[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75V695VX158KAVEV7987QQQ":3,"skill-same:01M75V695VX158KAVEV7987QQQ":150},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M75V695VX158KAVEV7987QQQ","rom-forge",null,"Authors and compiles Puck cartridges (puck.cartridge.v1, *.cgb.puck, *.dmg.puck, *.agb.puck, forge.play, forge.open, puck compile --validate), native compilers, cost. Emulator core is gaming-bricks.","ByteTerrace\u002FPuck","ByteTerrace","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F18753984?v=4","01M75V2WCB9PGGC3H7RZC7AXPS","01M75V2WD0NJPRNP5HJ75VZGD0",2,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: rom-forge\ndescription: \"Authors and compiles Puck cartridges (puck.cartridge.v1, *.cgb.puck, *.dmg.puck, *.agb.puck, forge.play, forge.open, puck compile --validate), native compilers, cost. Emulator core is gaming-bricks.\"\n---\n\n# ROM documents and native compilers\n\nA map of cartridge authoring: where it lives, the contracts that bite, and how\nto see a cartridge run. When this file and the code disagree, the code wins and\nthis file is corrected in the same change.\n\n## Where things live\n\n| Thing | Where |\n|---|---|\n| The `puck.cartridge.v1` model, validation, canonicalization, the `CartridgeDraft` editor, `ICartridgeCompiler`, the cost model | `src\u002FPuck.GamingBricks.Forge` (`CartridgeDocuments`, `CartridgeValidation`, `CartridgeCost`, `CartridgeLimits`); its README has the source contract |\n| The cartridge `.puck` vocabulary | `src\u002FPuck.GamingBricks.Transpiler` |\n| Native SM83 compiler for the cgb and dmg targets (code, 2bpp tiles, maps, palettes or shade registers) | `HgbCartridgeCompiler` in `src\u002FPuck.HumbleGamingBrick.Forge` |\n| Native AGB compiler (Thumb code, mode-0 4bpp graphics) | `AgbCartridgeCompiler` in `src\u002FPuck.AdvancedGamingBrick.Forge` |\n| Shared audio compilation | `AudioDocumentCompiler`, `ApuNotePeriod` in the shared forge package; `TuneRom.Build` for world audio |\n| Boot ROMs | `BootRomBuilder`, `BootDivPrediction`, `BootRomLayout` in `Puck.HumbleGamingBrick`; the native ARM7TDMI firmware in [`Puck.AdvancedGamingBrick\u002FFirmware`](..\u002F..\u002F..\u002Fsrc\u002FPuck.AdvancedGamingBrick\u002FFirmware\u002FREADME.md) |\n| The in-engine console | `src\u002FPuck.World\u002FForgeCommandModule.cs` (`forge.new\u002Fopen\u002Fshow\u002Fset\u002Fremove\u002Fundo\u002Fcheck\u002Fbuild\u002Fsave\u002Fexport\u002Fplay`) |\n| Shipped sources | `worlds\u002Fdebug\u002Fcartridges\u002F\u003Ctarget>\u002F*.\u003Ctarget>.puck` (one folder per target, `cgb\u002F`, `dmg\u002F` and `agb\u002F`, which a world lists in a machine's `contentFolders`), authored source only; `shared\u002F` holds the modules several targets import, each declaring `schema: \"puck.cartridge.v1\"` so a world-source walk of the package never takes it for a world module |\n\nBoth compilers consume the same rules, variables, sprites and input conditions.\nSource data determines behavior: never add a game-name switch or copy gameplay\ninto a C# template. `Puck.GamingBricks.Forge` depends on Abstractions, Assets and\n`Puck.State`, never on World.\n\n## From source to a running cartridge\n\n1. Edit the `.puck` source.\n2. `puck compile \u003Cname>.cgb.puck --output .claude\u002Fscratch\u002F\u003Clane>-cartridge.cartridge.json --validate`.\n   `--validate` runs `CartridgeDocuments.Validate` over the lowered JSON;\n   lowering alone proves only that the source was well formed.\n3. In a running `Puck.World`, `forge.open \u003Cfile>.cartridge.json` loads the\n   compiled JSON as the console's draft, then `forge.play \u003Cscreen-index>\n   \u003Cfile>.cartridge.json` hot-loads the draft into a screen. `forge.open` reads JSON only; machine content binding accepts authored `.puck`\n   sources directly.\n   `forge.play` needs a draft first (`forge: create or open a draft first`\n   otherwise), and its path is an output: it writes the draft's canonical source\n   there, then inserts it, and refuses a path not ending in `.cartridge.json`.\n   A world screen whose `source` is a machine may instead name the\n   `.puck` source as its `contentPath`; its content provider resolves imports\n   and compiles the source at bind.\n4. Look at it with `world.screenshot`. Cartridges are verified in a\n   world, never in a bespoke driver.\n\n`puck decompile \u003Cname>.cartridge.json --output \u003Cname>.cgb.puck` turns a document\nback into source; the source it writes compiles back to the same bytes.\n\nThe owner's ruling treats cartridge JSON twins as derived caches: never commit\nthem or compare a run against them. Commit the authored source, compile when\nneeded, and keep semantic compile\u002Fdecompile round trips over freshly compiled\ndocuments. The machine content provider accepts source directly; the forge\nconsole still opens a compiled JSON draft.\n\n`forge.play \u003Cscreen> \u003Cpath>` saves the source and inserts it through the\nscreen's named machine (`WorldMachineCommandModule.InsertContent`); a screen\nwith no declared machine refuses. The path must be a file in one of that\nmachine's `contentFolders`, as every mount must, and the play needs Control\nover the screen and the machine. Failed draft edits leave the draft intact; check, save, build,\nexport and play always validate.\n\n## Contracts that bite\n\n- **Cartridge rules admit what world rules refuse.** `repeat \u003Cn> as \u003Cname> { }`\n  with `break`, call-form gates (`key(\u003Cbutton>, held|pressed|released)`) and\n  every compound assignment are legal in a cartridge rule. World rules also\n  admit compound assignment; loops and cartridge call-form gates are\n  **PUCK037** and **PUCK038** there. `key(...)` is a gate only,\n  not an operand. A `repeat` index name must be a declared variable.\n- **Rule bodies are step trees** (`set`\u002F`if`\u002F`repeat`\u002F`break`\u002F`map`\u002F`blit`\u002F\n  `play`\u002F`stop`\u002F`save`\u002F`load`). An operand is a `Puck.State.ExpressionProgram`;\n  `CartridgeExpressions.Reads` is the admitted operation subset and anything\n  outside it is refused at its own spelling.\n- **Targets differ; validation says how.** cgb, dmg and agb; byte and two-byte\n  state; no ROM banking. Consult the validator before calling a feature\n  portable. The light sensor `$light` exists only on `cgb`.\n- **Colour is per-palette:** up to 8 palettes on cgb and 16 on agb,\n  `mapPalettes` per background cell, a sprite picks an object palette. The dmg\n  target validates like cgb but shades monochrome: every cell from the first\n  background palette whatever it selects, a sprite from the first or second\n  object palette by its palette's low bit, each colour reduced to one of four\n  shades by its luma (`CartridgeGraphics.MonochromePalette`); a fade is a\n  table of shade registers. A dmg image runs at single speed, so it sustains\n  half the cgb work per frame (`CartridgeCostProfile.Monochrome`).\n- **One game, several targets: a shared module.** A cartridge source may\n  `import` a `.puck` module; its templates and constants come in\n  (`CartridgeDocumentEmitter.LowerSource`, which `puck compile`, the language\n  server and the round-trip test use), never rows. The game lives once as a\n  template in `worlds\u002Fdebug\u002Fcartridges\u002Fshared\u002F` (`tetromino.puck`), and each target's source\n  imports it, declares `target` and `palettes`, and calls it. A module contributes no standalone document.\n- **A Color-only image cannot run on the DMG.** The cgb image arms the speed\n  switch and executes STOP, which parks a monochrome processor until a key is\n  pressed, and it writes palette memory and video bank one, which the DMG does\n  not have. Port the source to `target: \"dmg\"` instead.\n- **Map writes land a frame late on both targets:** they queue and drain in the\n  next vertical blank. Validation bounds a frame's map writes to the queue's 24\n  entries.\n- **A sound is a music track or a one-shot effect.** A track is one to four\n  voice parts, one to a channel, and validation refuses an effect on any voice\n  a track occupies, since the effect would cut that part off. An effect may sit\n  only on the pulse-1, noise or wave voice (never pulse 2), so with music on\n  pulse 1 and pulse 2 the choices are an effect on noise or wave, or moving the\n  music part off pulse 1 and the effect onto it.\n- **Keep the two sound drivers in register sync.** Stream step widths are\n  `duration` plus five register bytes for pulse one and wave, four for pulse two\n  and noise; `AgbSoundDriver` maps the same registers to the AGB's legacy sound\n  ports.\n- **Saves.** `AgbSaveModule` needs its identifier text in the image or nothing\n  persists; saves persist every byte.\n\n## Cost is measured, never estimated\n\n`CartridgeCost` prices a document in abstract work units against\n`CartridgeCostProfile`'s per-target weights; `CartridgeDocuments.Estimate`\nreports the frame bound and nothing refuses on it. Cost is advice, never a gate:\ndo not add a cost refusal, because the one hard refusal is capacity\n(`CartridgeCapacityException`, an image that outgrew its machine). Weights come from\n`puck cartridge-cost`, which boots `CartridgeCostMeasurement`'s probe documents\non both machines. Never hand-count an emitter's instructions into a weight or\nadjust a weight to make a document fit; a new primitive is measured by adding\nits shape to `CartridgeCostMeasurement.Shapes`. An unmeasured primitive prices\nas `CostBound.Unmodeled`, which poisons the whole estimate. Never compare unit\ntotals across targets. A blit repaints with the display off, so frames stop\nadvancing while it runs; `CartridgeLimits.BlitCellCount` bounds its size.\n\n## Boot ROMs\n\nThe Deck's original diagnostic programs use authored `.deck` selections, prepared by\n`DeckContentProvider` at boot. Their native `.nes` bytes live only in the derived cache;\n`puck cartridges deck --output \u003Cdir>` exports them. `DerivedBytes` uses the shared\n`CodeClosure` walker (also used by the mesh bake and `CompiledWorldChunks`) and `ContentAddressedStore`: generator code and explicit inputs key\neach product, corrupt or absent objects derive again, and stderr counts hits, misses and\nderivation milliseconds. Never restore a committed image comparison.\n\n`BootRomBuilder.Build(ConsoleModel)` emits each revision's boot program. The\nhandoff counter (`BootDivPrediction`'s tables) is the contract, pinned from\noutside by the `boot-rom-handoff` Post stage against the mooneye `boot_div-*`\ncartridges; never move a table value to make a boot agree with it. The builder\nsolves its straight-line tail against the emitted image; never hand-count\ninstruction timings into its constants. `HgbFirmware.GetImage` derives and calibrates\nimages in process on a cache miss, with generator code and revision as its key.\nThe generator and shared SM83 emitter live in the core package, so direct embedding\nneeds no Forge dependency. `puck firmware hgb --output \u003Cdir>` exports cached or\nfreshly derived images; there is no committed image or verify mode.\n\nThe AGB BIOS derives from C and ARM sources through `AgbFirmwareCompiler` and\n`DerivedBytes`, keyed by sources, deriving code and LLVM identity. A miss needs\nclang and ld.lld from [machine setup](..\u002F..\u002F..\u002Fdocs\u002Fdevelopment\u002Fcontributing.md#setting-up-a-machine);\n`puck firmware agb` exports through that same path. Player publishing and\n`world prepare` ship prewarmed caches, so players need neither tool. No binary\nor verify mode compares with repository bytes.\n\n## Seeing it work\n\n- Compile a cartridge and play it in a world (above). For World integration,\n  drive the real host over stdin (`puck-world`); a build alone is not a play\n  test.\n- The cartridge suites are `tests\u002FPuck.AdvancedGamingBrick.Forge.Tests`\n  (`CartridgeCompilerTests`, `CartridgeMemoryTests` and the per-feature\n  `Cartridge*Tests` run cartridges on both real emulators),\n  `tests\u002FPuck.GamingBricks.Transpiler.Tests` (the round trip) and\n  `tests\u002FPuck.HumbleGamingBrick.Forge.Tests` (boot ROM and bundle container).\n  Run them when they reach the change: `dotnet build \u003Cproject> -c Release -nodeReuse:false`, then `dotnet test \u003Cproject> -c Release --no-build`.\n- **Settle out of OAM DMA before reading the bus.** A fixed stepping boundary\n  can land inside OAM DMA, where WRAM reads 0xFF. Every SM83 verifier calls\n  `VerifyMachineSettle.SettleOutOfOamDma` after stepping frames; use\n  `Framework.VerifyMachineDriver`, which already does.\n- **Wait on the observable fact, not a duration.** `RunFramesUntil` advances\n  until a condition holds and fails at a frame cap. Reach a shared starting\n  position once and hand it out with `VerifyMachineDriver.Snapshot`\u002F`Restore`.\n\n[references\u002Fbackend-contracts.md](references\u002Fbackend-contracts.md) holds memory\naddresses, register bits and the native compilers' instruction-level behavior.\n\n## Route adjacent work\n\n| Skill | Route there for |\n|---|---|\n| `puck-dsl` | `.puck` grammar, the compile\u002Flint\u002Fformat verbs, PUCKnnn diagnostics. |\n| `gaming-bricks` | Emulator core behavior and the Post batteries. |\n| `puck-world` | Driving the World over stdin; screens and authority. |\n","# ROM documents and native compilers\n\nA map of cartridge authoring: where it lives, the contracts that bite, and how\nto see a cartridge run. When this file and the code disagree, the code wins and\nthis file is corrected in the same change.\n\n## Where things live\n\n| Thing | Where |\n|---|---|\n| The `puck.cartridge.v1` model, validation, canonicalization, the `CartridgeDraft` editor, `ICartridgeCompiler`, the cost model | `src\u002FPuck.GamingBricks.Forge` (`CartridgeDocuments`, `CartridgeValidation`, `CartridgeCost`, `CartridgeLimits`); its README has the source contract |\n| The cartridge `.puck` vocabulary | `src\u002FPuck.GamingBricks.Transpiler` |\n| Native SM83 compiler for the cgb and dmg targets (code, 2bpp tiles, maps, palettes or shade registers) | `HgbCartridgeCompiler` in `src\u002FPuck.HumbleGamingBrick.Forge` |\n| Native AGB compiler (Thumb code, mode-0 4bpp graphics) | `AgbCartridgeCompiler` in `src\u002FPuck.AdvancedGamingBrick.Forge` |\n| Shared audio compilation | `AudioDocumentCompiler`, `ApuNotePeriod` in the shared forge package; `TuneRom.Build` for world audio |\n| Boot ROMs | `BootRomBuilder`, `BootDivPrediction`, `BootRomLayout` in `Puck.HumbleGamingBrick`; the native ARM7TDMI firmware in [`Puck.AdvancedGamingBrick\u002FFirmware`](..\u002F..\u002F..\u002Fsrc\u002FPuck.AdvancedGamingBrick\u002FFirmware\u002FREADME.md) |\n| The in-engine console | `src\u002FPuck.World\u002FForgeCommandModule.cs` (`forge.new\u002Fopen\u002Fshow\u002Fset\u002Fremove\u002Fundo\u002Fcheck\u002Fbuild\u002Fsave\u002Fexport\u002Fplay`) |\n| Shipped sources | `worlds\u002Fdebug\u002Fcartridges\u002F\u003Ctarget>\u002F*.\u003Ctarget>.puck` (one folder per target, `cgb\u002F`, `dmg\u002F` and `agb\u002F`, which a world lists in a machine's `contentFolders`), authored source only; `shared\u002F` holds the modules several targets import, each declaring `schema: \"puck.cartridge.v1\"` so a world-source walk of the package never takes it for a world module |\n\nBoth compilers consume the same rules, variables, sprites and input conditions.\nSource data determines behavior: never add a game-name switch or copy gameplay\ninto a C# template. `Puck.GamingBricks.Forge` depends on Abstractions, Assets and\n`Puck.State`, never on World.\n\n## From source to a running cartridge\n\n1. Edit the `.puck` source.\n2. `puck compile \u003Cname>.cgb.puck --output .claude\u002Fscratch\u002F\u003Clane>-cartridge.cartridge.json --validate`.\n   `--validate` runs `CartridgeDocuments.Validate` over the lowered JSON;\n   lowering alone proves only that the source was well formed.\n3. In a running `Puck.World`, `forge.open \u003Cfile>.cartridge.json` loads the\n   compiled JSON as the console's draft, then `forge.play \u003Cscreen-index>\n   \u003Cfile>.cartridge.json` hot-loads the draft into a screen. `forge.open` reads JSON only; machine content binding accepts authored `.puck`\n   sources directly.\n   `forge.play` needs a draft first (`forge: create or open a draft first`\n   otherwise), and its path is an output: it writes the draft's canonical source\n   there, then inserts it, and refuses a path not ending in `.cartridge.json`.\n   A world screen whose `source` is a machine may instead name the\n   `.puck` source as its `contentPath`; its content provider resolves imports\n   and compiles the source at bind.\n4. Look at it with `world.screenshot`. Cartridges are verified in a\n   world, never in a bespoke driver.\n\n`puck decompile \u003Cname>.cartridge.json --output \u003Cname>.cgb.puck` turns a document\nback into source; the source it writes compiles back to the same bytes.\n\nThe owner's ruling treats cartridge JSON twins as derived caches: never commit\nthem or compare a run against them. Commit the authored source, compile when\nneeded, and keep semantic compile\u002Fdecompile round trips over freshly compiled\ndocuments. The machine content provider accepts source directly; the forge\nconsole still opens a compiled JSON draft.\n\n`forge.play \u003Cscreen> \u003Cpath>` saves the source and inserts it through the\nscreen's named machine (`WorldMachineCommandModule.InsertContent`); a screen\nwith no declared machine refuses. The path must be a file in one of that\nmachine's `contentFolders`, as every mount must, and the play needs Control\nover the screen and the machine. Failed draft edits leave the draft intact; check, save, build,\nexport and play always validate.\n\n## Contracts that bite\n\n- **Cartridge rules admit what world rules refuse.** `repeat \u003Cn> as \u003Cname> { }`\n  with `break`, call-form gates (`key(\u003Cbutton>, held|pressed|released)`) and\n  every compound assignment are legal in a cartridge rule. World rules also\n  admit compound assignment; loops and cartridge call-form gates are\n  **PUCK037** and **PUCK038** there. `key(...)` is a gate only,\n  not an operand. A `repeat` index name must be a declared variable.\n- **Rule bodies are step trees** (`set`\u002F`if`\u002F`repeat`\u002F`break`\u002F`map`\u002F`blit`\u002F\n  `play`\u002F`stop`\u002F`save`\u002F`load`). An operand is a `Puck.State.ExpressionProgram`;\n  `CartridgeExpressions.Reads` is the admitted operation subset and anything\n  outside it is refused at its own spelling.\n- **Targets differ; validation says how.** cgb, dmg and agb; byte and two-byte\n  state; no ROM banking. Consult the validator before calling a feature\n  portable. The light sensor `$light` exists only on `cgb`.\n- **Colour is per-palette:** up to 8 palettes on cgb and 16 on agb,\n  `mapPalettes` per background cell, a sprite picks an object palette. The dmg\n  target validates like cgb but shades monochrome: every cell from the first\n  background palette whatever it selects, a sprite from the first or second\n  object palette by its palette's low bit, each colour reduced to one of four\n  shades by its luma (`CartridgeGraphics.MonochromePalette`); a fade is a\n  table of shade registers. A dmg image runs at single speed, so it sustains\n  half the cgb work per frame (`CartridgeCostProfile.Monochrome`).\n- **One game, several targets: a shared module.** A cartridge source may\n  `import` a `.puck` module; its templates and constants come in\n  (`CartridgeDocumentEmitter.LowerSource`, which `puck compile`, the language\n  server and the round-trip test use), never rows. The game lives once as a\n  template in `worlds\u002Fdebug\u002Fcartridges\u002Fshared\u002F` (`tetromino.puck`), and each target's source\n  imports it, declares `target` and `palettes`, and calls it. A module contributes no standalone document.\n- **A Color-only image cannot run on the DMG.** The cgb image arms the speed\n  switch and executes STOP, which parks a monochrome processor until a key is\n  pressed, and it writes palette memory and video bank one, which the DMG does\n  not have. Port the source to `target: \"dmg\"` instead.\n- **Map writes land a frame late on both targets:** they queue and drain in the\n  next vertical blank. Validation bounds a frame's map writes to the queue's 24\n  entries.\n- **A sound is a music track or a one-shot effect.** A track is one to four\n  voice parts, one to a channel, and validation refuses an effect on any voice\n  a track occupies, since the effect would cut that part off. An effect may sit\n  only on the pulse-1, noise or wave voice (never pulse 2), so with music on\n  pulse 1 and pulse 2 the choices are an effect on noise or wave, or moving the\n  music part off pulse 1 and the effect onto it.\n- **Keep the two sound drivers in register sync.** Stream step widths are\n  `duration` plus five register bytes for pulse one and wave, four for pulse two\n  and noise; `AgbSoundDriver` maps the same registers to the AGB's legacy sound\n  ports.\n- **Saves.** `AgbSaveModule` needs its identifier text in the image or nothing\n  persists; saves persist every byte.\n\n## Cost is measured, never estimated\n\n`CartridgeCost` prices a document in abstract work units against\n`CartridgeCostProfile`'s per-target weights; `CartridgeDocuments.Estimate`\nreports the frame bound and nothing refuses on it. Cost is advice, never a gate:\ndo not add a cost refusal, because the one hard refusal is capacity\n(`CartridgeCapacityException`, an image that outgrew its machine). Weights come from\n`puck cartridge-cost`, which boots `CartridgeCostMeasurement`'s probe documents\non both machines. Never hand-count an emitter's instructions into a weight or\nadjust a weight to make a document fit; a new primitive is measured by adding\nits shape to `CartridgeCostMeasurement.Shapes`. An unmeasured primitive prices\nas `CostBound.Unmodeled`, which poisons the whole estimate. Never compare unit\ntotals across targets. A blit repaints with the display off, so frames stop\nadvancing while it runs; `CartridgeLimits.BlitCellCount` bounds its size.\n\n## Boot ROMs\n\nThe Deck's original diagnostic programs use authored `.deck` selections, prepared by\n`DeckContentProvider` at boot. Their native `.nes` bytes live only in the derived cache;\n`puck cartridges deck --output \u003Cdir>` exports them. `DerivedBytes` uses the shared\n`CodeClosure` walker (also used by the mesh bake and `CompiledWorldChunks`) and `ContentAddressedStore`: generator code and explicit inputs key\neach product, corrupt or absent objects derive again, and stderr counts hits, misses and\nderivation milliseconds. Never restore a committed image comparison.\n\n`BootRomBuilder.Build(ConsoleModel)` emits each revision's boot program. The\nhandoff counter (`BootDivPrediction`'s tables) is the contract, pinned from\noutside by the `boot-rom-handoff` Post stage against the mooneye `boot_div-*`\ncartridges; never move a table value to make a boot agree with it. The builder\nsolves its straight-line tail against the emitted image; never hand-count\ninstruction timings into its constants. `HgbFirmware.GetImage` derives and calibrates\nimages in process on a cache miss, with generator code and revision as its key.\nThe generator and shared SM83 emitter live in the core package, so direct embedding\nneeds no Forge dependency. `puck firmware hgb --output \u003Cdir>` exports cached or\nfreshly derived images; there is no committed image or verify mode.\n\nThe AGB BIOS derives from C and ARM sources through `AgbFirmwareCompiler` and\n`DerivedBytes`, keyed by sources, deriving code and LLVM identity. A miss needs\nclang and ld.lld from [machine setup](..\u002F..\u002F..\u002Fdocs\u002Fdevelopment\u002Fcontributing.md#setting-up-a-machine);\n`puck firmware agb` exports through that same path. Player publishing and\n`world prepare` ship prewarmed caches, so players need neither tool. No binary\nor verify mode compares with repository bytes.\n\n## Seeing it work\n\n- Compile a cartridge and play it in a world (above). For World integration,\n  drive the real host over stdin (`puck-world`); a build alone is not a play\n  test.\n- The cartridge suites are `tests\u002FPuck.AdvancedGamingBrick.Forge.Tests`\n  (`CartridgeCompilerTests`, `CartridgeMemoryTests` and the per-feature\n  `Cartridge*Tests` run cartridges on both real emulators),\n  `tests\u002FPuck.GamingBricks.Transpiler.Tests` (the round trip) and\n  `tests\u002FPuck.HumbleGamingBrick.Forge.Tests` (boot ROM and bundle container).\n  Run them when they reach the change: `dotnet build \u003Cproject> -c Release -nodeReuse:false`, then `dotnet test \u003Cproject> -c Release --no-build`.\n- **Settle out of OAM DMA before reading the bus.** A fixed stepping boundary\n  can land inside OAM DMA, where WRAM reads 0xFF. Every SM83 verifier calls\n  `VerifyMachineSettle.SettleOutOfOamDma` after stepping frames; use\n  `Framework.VerifyMachineDriver`, which already does.\n- **Wait on the observable fact, not a duration.** `RunFramesUntil` advances\n  until a condition holds and fails at a frame cap. Reach a shared starting\n  position once and hand it out with `VerifyMachineDriver.Snapshot`\u002F`Restore`.\n\n[references\u002Fbackend-contracts.md](references\u002Fbackend-contracts.md) holds memory\naddresses, register bits and the native compilers' instruction-level behavior.\n\n## Route adjacent work\n\n| Skill | Route there for |\n|---|---|\n| `puck-dsl` | `.puck` grammar, the compile\u002Flint\u002Fformat verbs, PUCKnnn diagnostics. |\n| `gaming-bricks` | Emulator core behavior and the Post batteries. |\n| `puck-world` | Driving the World over stdin; screens and authority. |\n",{"name":5,"description":7},"main","2ef814b84c9595144e052c6dcd300badb619ee2f",".claude\u002Fskills\u002From-forge",0,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck","https:\u002F\u002Fgithub.com\u002FByteTerrace","https:\u002F\u002Fbyteterrace.com","2026-11-12 13:59:16",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add ByteTerrace\u002FPuck --skill rom-forge",{"tool":37,"command":38},"bunx","bunx skills add ByteTerrace\u002FPuck --skill rom-forge",{"tool":40,"command":41},"pnpm","pnpm dlx skills add ByteTerrace\u002FPuck --skill rom-forge","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002FSKILL.md",true,[45,51,55,59,63,67,71,75,78,82,86,90,93,97,101,105,109,112,116,120,124,127,131,135,139,142,146],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"evals\u002Ff01-forge-play-a-puck-source\u002Fgraders\u002Fcompile-validate.md","REFERENCE","参考文档",85,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff01-forge-play-a-puck-source\u002Fgraders\u002Fcompile-validate.md",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"evals\u002Ff01-forge-play-a-puck-source\u002Fgraders\u002Fdraft-and-output-path.md",238,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff01-forge-play-a-puck-source\u002Fgraders\u002Fdraft-and-output-path.md",{"path":56,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":57,"sourceHtmlUrl":58},"evals\u002Ff01-forge-play-a-puck-source\u002Fgraders\u002Fjson-only.md",232,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff01-forge-play-a-puck-source\u002Fgraders\u002Fjson-only.md",{"path":60,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":61,"sourceHtmlUrl":62},"evals\u002Ff01-forge-play-a-puck-source\u002Fgraders\u002Fregenerate-not-hand-edit.md",174,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff01-forge-play-a-puck-source\u002Fgraders\u002Fregenerate-not-hand-edit.md",{"path":64,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":65,"sourceHtmlUrl":66},"evals\u002Ff01-forge-play-a-puck-source\u002Fgraders\u002Fskill-fired.md",36,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff01-forge-play-a-puck-source\u002Fgraders\u002Fskill-fired.md",{"path":68,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":69,"sourceHtmlUrl":70},"evals\u002Ff01-forge-play-a-puck-source\u002Fprompt.md",322,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff01-forge-play-a-puck-source\u002Fprompt.md",{"path":72,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":73,"sourceHtmlUrl":74},"evals\u002Ff02-effect-on-a-music-voice\u002Fgraders\u002Feffect-voices.md",137,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff02-effect-on-a-music-voice\u002Fgraders\u002Feffect-voices.md",{"path":76,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":65,"sourceHtmlUrl":77},"evals\u002Ff02-effect-on-a-music-voice\u002Fgraders\u002Fskill-fired.md","https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff02-effect-on-a-music-voice\u002Fgraders\u002Fskill-fired.md",{"path":79,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":80,"sourceHtmlUrl":81},"evals\u002Ff02-effect-on-a-music-voice\u002Fgraders\u002Fvoice-occupied.md",167,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff02-effect-on-a-music-voice\u002Fgraders\u002Fvoice-occupied.md",{"path":83,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":84,"sourceHtmlUrl":85},"evals\u002Ff02-effect-on-a-music-voice\u002Fprompt.md",284,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff02-effect-on-a-music-voice\u002Fprompt.md",{"path":87,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":88,"sourceHtmlUrl":89},"evals\u002Ff03-verifier-reads-ff-from-wram\u002Fgraders\u002Fsettle-helper.md",94,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff03-verifier-reads-ff-from-wram\u002Fgraders\u002Fsettle-helper.md",{"path":91,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":65,"sourceHtmlUrl":92},"evals\u002Ff03-verifier-reads-ff-from-wram\u002Fgraders\u002Fskill-fired.md","https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff03-verifier-reads-ff-from-wram\u002Fgraders\u002Fskill-fired.md",{"path":94,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":95,"sourceHtmlUrl":96},"evals\u002Ff03-verifier-reads-ff-from-wram\u002Fgraders\u002Fwait-on-the-fact.md",71,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff03-verifier-reads-ff-from-wram\u002Fgraders\u002Fwait-on-the-fact.md",{"path":98,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":99,"sourceHtmlUrl":100},"evals\u002Ff03-verifier-reads-ff-from-wram\u002Fprompt.md",315,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff03-verifier-reads-ff-from-wram\u002Fprompt.md",{"path":102,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":103,"sourceHtmlUrl":104},"evals\u002Ff04-cost-weight-tuned-to-fit\u002Fgraders\u002Fcost-is-advice.md",234,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff04-cost-weight-tuned-to-fit\u002Fgraders\u002Fcost-is-advice.md",{"path":106,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":107,"sourceHtmlUrl":108},"evals\u002Ff04-cost-weight-tuned-to-fit\u002Fgraders\u002Fmeasure-verb.md",76,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff04-cost-weight-tuned-to-fit\u002Fgraders\u002Fmeasure-verb.md",{"path":110,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":65,"sourceHtmlUrl":111},"evals\u002Ff04-cost-weight-tuned-to-fit\u002Fgraders\u002Fskill-fired.md","https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff04-cost-weight-tuned-to-fit\u002Fgraders\u002Fskill-fired.md",{"path":113,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":114,"sourceHtmlUrl":115},"evals\u002Ff04-cost-weight-tuned-to-fit\u002Fgraders\u002Fweights-are-measured.md",181,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff04-cost-weight-tuned-to-fit\u002Fgraders\u002Fweights-are-measured.md",{"path":117,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":118,"sourceHtmlUrl":119},"evals\u002Ff04-cost-weight-tuned-to-fit\u002Fprompt.md",378,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff04-cost-weight-tuned-to-fit\u002Fprompt.md",{"path":121,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":122,"sourceHtmlUrl":123},"evals\u002Ff05-world-rule-refuses-cartridge-forms\u002Fgraders\u002Fcartridge-admits-more.md",263,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff05-world-rule-refuses-cartridge-forms\u002Fgraders\u002Fcartridge-admits-more.md",{"path":125,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":65,"sourceHtmlUrl":126},"evals\u002Ff05-world-rule-refuses-cartridge-forms\u002Fgraders\u002Fskill-fired.md","https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff05-world-rule-refuses-cartridge-forms\u002Fgraders\u002Fskill-fired.md",{"path":128,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":129,"sourceHtmlUrl":130},"evals\u002Ff05-world-rule-refuses-cartridge-forms\u002Fprompt.md",356,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff05-world-rule-refuses-cartridge-forms\u002Fprompt.md",{"path":132,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":133,"sourceHtmlUrl":134},"evals\u002Ff06-agb-display-control-second-writer\u002Fgraders\u002Faccumulate-the-bit.md",194,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff06-agb-display-control-second-writer\u002Fgraders\u002Faccumulate-the-bit.md",{"path":136,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":137,"sourceHtmlUrl":138},"evals\u002Ff06-agb-display-control-second-writer\u002Fgraders\u002Fone-writer.md",245,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff06-agb-display-control-second-writer\u002Fgraders\u002Fone-writer.md",{"path":140,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":65,"sourceHtmlUrl":141},"evals\u002Ff06-agb-display-control-second-writer\u002Fgraders\u002Fskill-fired.md","https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff06-agb-display-control-second-writer\u002Fgraders\u002Fskill-fired.md",{"path":143,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":144,"sourceHtmlUrl":145},"evals\u002Ff06-agb-display-control-second-writer\u002Fprompt.md",281,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Fevals\u002Ff06-agb-display-control-second-writer\u002Fprompt.md",{"path":147,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":148,"sourceHtmlUrl":149},"references\u002Fbackend-contracts.md",11429,"https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002From-forge\u002Freferences\u002Fbackend-contracts.md",[151,158,165,172,179,186],{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":157,"publishedAt":18},"01M75V6X1GBYDMSMJC8VXXPFAP","verification","Verifies Puck changes: landing bar, builds, stale DLLs, flaky tests, GPU\u002Fheavy leases, coverage, source-scan or regex laws versus type\u002Fcompiler enforcement, and writing tests.","https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fverification\u002FSKILL.md",[],[],{"skillNo":159,"name":160,"nameZh":6,"description":161,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":162,"categories":163,"keywords":164,"publishedAt":18},"01M75V6TM3F9A7ZMA0Q43RVJSF","tooling","Maps shared build\u002FCLI architecture, compiler assembly identity, candidate installation, generated sections, and host admission.","https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftooling\u002FSKILL.md",[],[],{"skillNo":166,"name":167,"nameZh":6,"description":168,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":169,"categories":170,"keywords":171,"publishedAt":18},"01M75V6R4E6AY73X27MC6EE5X5","tooling-files","Maps shared repository tooling for files, paths, Git queries, project ownership and Markdown fences. Load before adding or changing a helper in these areas.","https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftooling-files\u002FSKILL.md",[],[],{"skillNo":173,"name":174,"nameZh":6,"description":175,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":176,"categories":177,"keywords":178,"publishedAt":18},"01M75V6N2P9XWWPH7EHRKMBTEC","symbol-analysis","Answers C# structure questions with puck references and declarations: which types derive from, implement or override a symbol, who references it, safe to delete or rename. Text: content-search.","https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsymbol-analysis\u002FSKILL.md",[],[],{"skillNo":180,"name":181,"nameZh":6,"description":182,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":183,"categories":184,"keywords":185,"publishedAt":18},"01M75V6HRKM57BD8Q7A4N8QN0C","state","Maps Puck's state and rule engine (Puck.State, .Rules, .Search, .Topology, .Vectors, .Generators): arena, journal scopes, undo, hashing, rule compiler, faults, transforms, search, draws.","https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fstate\u002FSKILL.md",[],[],{"skillNo":187,"name":188,"nameZh":6,"description":189,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":190,"categories":191,"keywords":192,"publishedAt":18},"01M75V6CE3X73KNZYFRT9A5W8F","sdf-authoring","Authors creations: shape rows, primitives, blends, folds, palettes, paints, render lanes, rigs, bake work and bytes, creation stats. Use to sculpt or fix a part. Grammar: puck-dsl; GPU: rendering.","https:\u002F\u002Fgithub.com\u002FByteTerrace\u002FPuck\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsdf-authoring\u002FSKILL.md",[],[]]