Repository navigation
Rebuild mod-builder for Claude Code 2.1.287 and later - #15
Merged
Merged
Conversation
added 2 commits
October 3, 2026 16:50
Replace the early-access skill text with a proof-first pipeline: a gate that generates the running build's types and reports drift, a shape check against those types, a footprint diff that also covers env names and state keys, a test seen failing, an isolated prove harness with evidence files and a fixed status vocabulary, and a handoff whose words come from the scripts. Scripts: lib.mjs, gate.mjs, api-check.mjs, prove.mjs; footprint.mjs rewritten with a JSON rule table and an ungraded exit. Data: api-map.json baseline (2.1.287), api-assertions.json, reach-rules.json. References rewritten per the 2.1.287 docs; gotchas, official-sources, reading and templates removed. Tests: node --test suite with a stub claude plus a live section. Repo: fable-pin tsconfig extends the generated one, .gitignore and image-peek ignore the .claude-plugin/types folder, README, marketplace and site card updated, CI job for the script tests.
Scripts: the gate marks lines that need attention with a leading !, prints the types folder, the uncovered names and the real login hint; prove reads unverified rather than not applicable for a drawing mod with no interactive script; api-check's migrate scan flags an untyped register in hooks files and early-access wording in plugin.json; list-mods no longer cuts piped JSON. Prose: 45 confirmed errors fixed (login needs, exit codes, plan block unified with plan.md, routing of references per step, kit nuances, state reload after /clear, guard precedence, validator message details); worked example refreshed from a new run. Tests: 74.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mod-builderskill (plugin version 1.0.0) for Claude Code 2.1.287 and later: SKILL.md (159 lines) runs a gate, a plan, a shape check against the generated types, a footprint diff, a test seen failing, an isolated proof, a threat model and a fixed handoff; every early-access instruction (theCLAUDE_CODE_ENABLE_FUNCTION_HOOKSflag,/plugin-types,.claude/types) is gone.skills/mod-builder/scripts/:lib.mjs(findclaude, harness home, run, parsevalidate --json, extract the API map from the types, locate or generate the types with a headless load),gate.mjs(step 0 block; lines that need attention start with!;--jsonlists them),api-check.mjs(diff the references' fencedapi-*blocks and backticked names against the running build's types;--modlists early-access spellings under eightM.*ids;--write-baseline),prove.mjs(copies the mod, drives a childclaudeunder its ownCLAUDE_CONFIG_DIR, stages validate, load, typecheck, test, command, opt-in interactive and install-smoke, isolation; one evidence file per stage,status.txt,run.json, three strikes).footprint.mjsis rewritten: rules move todata/reach-rules.json, env and state lines are parsed and diffed, an unknown method printsungraded:and exits 1.list-mods.mjsusesprocess.exitCodeso piped JSON is not cut short.data/api-map.json(baseline extracted from the 2.1.287 declarations),data/api-assertions.json(13 value-level regexes),data/reach-rules.json, andassets/probe-mod/(the mod the gate loads to make the engine write the types).gotchas.md,official-sources.md,reading.md,templates.md. The star invitation moves from SKILL.md toreferences/invitation.md;scripts/star-invitation.mjsis unchanged.tests/scripts.test.mjsandtests/helpers.mjs(a config-driven stubclaude): 74 tests, offline plus a live section that skips with a printed line when noclaudeat or above 2.1.287 is on PATH; new.github/workflows/mod-builder.ymlruns them.plugins/fable-pin/tsconfig.jsonbecomes{ "extends": "./.claude-plugin/types/tsconfig.json" }; root.gitignoreandplugins/image-peek/.gitignoreignore.claude-plugin/types/; rootREADME.md,.claude-plugin/marketplace.jsonand thesite/index.htmlmod-builder card describe the new pipeline.Details
Why the rewrite. An audit against the 2.1.287 docs found 19 verified errors in the previous skill text, all from the early-access build it was written on (the flag,
/plugin-types, "nothing draws on Desktop", stale result shapes). The new text restates only decision facts, process facts and limits, each with[src | checked <build> | recheck: <trigger>]; shapes are never restated, the references give the grep into<types>/claude-code/index.d.ts.Staying correct across releases. No patch version is pinned in prose (the floor
2.1.287appears inlib.mjsand once in SKILL.md).api-check.mjsextracts events, methods, nouns, components, surfaces, elements, invalidatable events, tiers, budget and tools from the live types, diffs them againstdata/api-map.json, and reportsSTALEnames in the references,SHAPE DRIFTon the assertions, and+/-names since the baseline. On the installed 2.1.288 it reports+ ui.selection (op event),+ $.ui.selection (method), 0 stale, 2 uncovered, 0 shape drift.Proof.
prove.mjswrites the status block (ran and passed,ran and FAILED (...),not applicable (...),unverified (...)); the skill pastes it and may add nothing. The load stage passes only on the documentedhooks module <name>@inline loadedline; the observed lines (settled in,$.<noun>.<verb> (<name>),[<name>] $.ui.log,type root of) are extra evidence and sit in one table with the build they were seen on. The isolation stage checks the loaded lines' provenance, the real~/.claude.jsonandsettings.json, the~/.claude/projectslisting and the source hashes.references/proof.mdends with the block from a real run onassets/probe-mod.Review before this PR was finalised. Three fact-checkers read 486 claims against the 2.1.288 types and the docs; 45 confirmed errors (none high after a skeptic pass) are fixed in the second commit. Three fresh agents built
branch-guard,turn-meterandread-logfrom the skill text alone; each passed validate, load, typecheck and test with tests seen failing, and their friction notes drove the routing and wording changes (one plan block, references per step, the!markers on the gate, the login hint naming only the interactive stage).Measured on this machine (2.1.288).
claude -ploads a--plugin-dirmod, firessession.start, writes the types and answers a registered/commandbefore the login check, so only the interactive stage needs a login. The debug log records loads and most$calls, but not$.stateor$.env.getcalls.claude plugin initscaffolds a classic-hook plugin, not a mod. Barenpx tscinstalls an unrelated package. A/** @jsx h */pragma is harmless; a foreign factory silently retargets JSX and hides<Client>modules from validate.Listing surfaces touched:
README.md,.claude-plugin/marketplace.json,site/index.html(mod-builder card and nothing else),plugins/mod-builder/README.md.Test plan
node --test 'plugins/mod-builder/skills/mod-builder/tests/*.test.mjs'from the repo root: 74 pass (71 pass, 3 skipped withoutMOD_BUILDER_SNAPSHOT=<path to the 2.1.287 d.ts>).node plugins/mod-builder/skills/mod-builder/scripts/gate.mjsprintsverdict: proceed(exit 0),references: usable (0 stale, 2 uncovered: ui.selection, $.ui.selection)on 2.1.288, and a!only on the harness line when not logged in.node plugins/mod-builder/skills/mod-builder/scripts/prove.mjs plugins/mod-builder/skills/mod-builder/assets/probe-mod --plan '$.command.register,$.env.get,$.state.get,$.state.set,$.ui.log' --env MOD_BUILDER_PROBE --state probe-mod.runs: validate, load, typecheck, test, command and isolation readran and passed; the source tree is unchanged after the run.node .../scripts/prove.mjs plugins/fable-pin: typecheck passes against the new extends tsconfig.claude plugin validate --strict plugins/mod-builderpasses.mod-builder scriptsjob passes on the PR;Invitation testsstill passes.site/index.html; check the mod-builder card on https://claude-code-mods.karanbansal.in/ reads "proves the result in an isolated run".