Skip to content

pixel: craft and motion checks on sprites, pixel look, and a workflow in rounds - #177

Closed
SandroMaglione wants to merge 10 commits into
mainfrom
claude/project-thread-yfy9g7
Closed

SandroMaglione wants to merge 10 commits into
mainfrom
claude/project-thread-yfy9g7

Conversation

@SandroMaglione

Copy link
Copy Markdown
Member

Requested by Sandro · project thread

Brings the loop ritmo-tools fx already runs on effects to sprites, tiles, and animation sheets. The patterns come from a study of agent skills that draw machines and animations (Anatomy, claude-animation, rossark-motion): plan before drawing, checks that name the pixels, look before the owner does, and read motion as numbers.

Tools (@typeonce/ritmo-tools)

  • Shared craft checks. craft.ts moves from fx/core to pixel/core. pixel lint, check, fix, render, and sheet now warn on jaggies, doubles, and holes, each with its pixels. Doubles are read on the silhouette and on the outline's own color, and a box corner is no longer counted as a double (this applies to fx too).
  • Animation checks. Sheets also get flicker on lone pixels only, so a limb moving between poses doesn't count, and the turn-around frames of a pingpong are skipped. They also get three motion checks: area (the body changing size), skate (the planted foot moving by uneven steps), and seam (the loop jumping back to its start). The report's motion gives the area per frame, the foot's steps, and ground.pixelsPerSecond, the speed the game must move the sprite at to keep the foot planted.
  • pixel lint reads a written sprite sheet's .json.
  • pixel look <files...> writes one PNG. The top row shows every piece at display size on the game's backdrop (a color, or a tile repeated), beside the stand-in player, all standing on one ground line. Below that, each frame is shown up close, with each warning's pixels ringed in magenta.
  • New pixel.config.json fields. scale, backdrops, and standIn for look. accept takes warnings judged deliberate, per file, each with a reason. Errors cannot be accepted, and reports list accepted warnings under accepted.

Skill (@typeonce/ritmo)

  • ritmo-pixel-art now works in Rounds: write a brief in the design notes before the first pixel, then check (fix, or accept with a reason), look, read motion as numbers, and act on the person's notes. It also gets a "what you see, and the usual fix" table.
  • PIXEL-ART.md traces every new rule to its principle and its sources. It adds Rickett's "Walk Cycles" on slippage, and notes that the rounds are the skill's one procedure, asked for by the maintainer.

Samples (last commit, for review)

packages/tools/examples/pixel/ holds one round of the workflow:

  • a brief;
  • four code-drawn pieces: player, slime, chest and floor;
  • an image generator's run cycle fixed with pixel sheet;
  • look.png and look.report.json.

The fire spirit deliberately still fails the size check, since that was the round's finding. Drop or rework this commit after review.

Not in this PR

  • fx banks keep their own backdrops and standIn. Moving them into pixel.config.json would change the bank format, so it is left for a follow-up.
  • A review page with pinned comments for sprites, like fx's.

Checks

  • pnpm run check passes.
  • pnpm pack:check passes.
  • pnpm --dir website build passes.
  • New tests are in packages/tools/test/craft.test.ts.

Generated by Claude Code

Agents drawing pixel art could not see what fx already measured on effects:
broken steps, thickened lines, pinholes. Nor could they watch a sheet play.
The craft rules move to pixel/core/craft.ts, shared by `fx check` and
`pixel lint`/`check`/`fix`/`render`/`sheet`. Sheets also get flicker on
lone pixels and motion checks (area, a foot that skates, a loop seam),
with the numbers in the report, including the ground speed that keeps the
planted foot still.

`pixel look` draws the pieces at display size on the game's backdrop
beside its player, then up close with each warning's pixels ringed, so
an agent judges the read before a person does. pixel.config.json gains
scale, backdrops, standIn, and accept (warnings judged deliberate, with
why; errors cannot be accepted).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HendNacJCbqZbVLaQUvuyd
A brief written before the first pixel, then check (fix or accept with
why), `pixel look`, motion read as numbers, and the person's notes, the
same shape as the ritmo-fx loop. Adds a table of what a person sees and
the usual fix, each row traced in PIXEL-ART.md to the principle and
sources behind it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HendNacJCbqZbVLaQUvuyd
Pictures of one frame share a row and each animation gets its own, in
cells the size of their own art; up close a tile backdrop becomes its
main color so it does not hide the art; the stand-in is not drawn twice
when it is one of the pieces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HendNacJCbqZbVLaQUvuyd
A brief, four code-drawn pieces (player, slime, chest, floor tile), and an
image generator's run cycle fixed with pixel sheet, each checked and
looked at together. Samples for review: the spirit still fails the size
check on purpose, as the round's finding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HendNacJCbqZbVLaQUvuyd
@SandroMaglione SandroMaglione self-assigned this Nov 2, 2026

Copy link
Copy Markdown
Member Author

Performance regressions failed on one case: runtime query/iterate-write-10k took 0.264 ms against 0.199 ms on base (+32.8%).

This PR changes no runtime code. Its diff touches only packages/tools and the Markdown skill files under packages/core. The bench probably ran because packages/core changed. In the same run, the other critical cases moved the other way (frame/50-systems-5k −12%, checkpoint/rollback −7%), allocations are flat, and the type suite is unchanged. That pattern looks like runner noise on a single case.

I'll re-run the failed job once when the rest of the workflow finishes; GitHub refuses a re-run while the workflow is still running. If it fails a second time, I'll treat it as real.


Generated by Claude Code

Shrinking a detailed reference copies its pixels, and at a game's sizes
that is noise. A parts plan ranks the subject's parts and measures each as a
simple shape on the reference; the tool draws each size from it with pixel
rules, keeping only what that size can hold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HendNacJCbqZbVLaQUvuyd
The maintainer rejected resampling a reference and asked for the main parts
to be decided first, asking the person when unsure. The skill gets that
procedure, with its sources.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HendNacJCbqZbVLaQUvuyd
Both references are free to ship (CC0 and public domain).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HendNacJCbqZbVLaQUvuyd
…for dropped parts

Two agents used the skill with no other pointer and tripped on the same
things: a given orange turned dark brown under matte, two given colors
shared one ramp, a bust got an outline where the reference crops it,
sprites failed the project's square sizes, and nothing said why a part
was left out. Polygons and lines attached to an enlarged ring now follow it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HendNacJCbqZbVLaQUvuyd
…zes, hand edits

From the skill's first test with fresh agents: rank the parts yourself and
write it down when no one can be asked, give the smallest size its own plan,
keep hand edits in a copy, and the render command's real file names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HendNacJCbqZbVLaQUvuyd
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HendNacJCbqZbVLaQUvuyd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants