plugin-forge
An eval-first builder of Claude Code plugins. You describe the plugin you want; forge interviews you, writes a design contract, generates a runnable evaluation suite, freezes it, and then builds the plugin in an isolated worktree until the suite goes green. The eval suite is the contract. Green is the definition of done. Nothing is scaffolded until a suite exists whose reference solutions pass and which bare Claude demonstrably fails.
Built for scientific and business plugins where "it seems to work" is not an acceptable ship criterion.
Why this exists
Every prior plugin builder — including the three generations that preceded this one — shares the same gaps:
- They scaffold without testing. Existing builders (the official
plugin-dev pipeline, this repo's own builder agents, skill-creator) end at "validated scaffold + manual test instructions to the user." None runs the generated plugin headlessly, none has graders, none has a score. Validation means "the YAML parses," not "the plugin does the job."
- They select primitives checkbox-style. Component selection is a checklist ("do you want hooks? agents? MCP?"), not consequence-first reasoning about how a primitive behaves under trigger pressure, in headless mode, after compaction, or under org policy. Nobody asks "which grader could ever observe this choice?" before committing to it.
- They stop at ship. Iteration is "use it and notice struggles." No regression suite, no trace capture, no way to turn a production failure into a test.
plugin-forge inverts this. The build cannot start until an eval suite exists, is proven meaningful (reference solutions pass it, bare Claude fails it, LLM judges agree with human labels), and is cryptographically frozen. The builder loop's only exit is that frozen suite printing RESULT=PASS — and guard hooks make the suite un-editable during the build, even under --dangerously-skip-permissions.
The pipeline
One conductor skill (/plugin-forge:forge) drives a file-based state machine. State lives in .forge/state.json in your project, so the pipeline is resumable across sessions with zero memory. Each phase skill reads the state file before doing anything and refuses to run out of order.
interview → contract → evals → armed → building → smoke → verify → ship
| Transition | What unlocks it |
|---|
interview → contract | design/INTENT.md written. The interview asks runtime-environment questions first (cloud/scheduled vs local, headless CI, org policies, external systems live-vs-mock, side-effect and consent inventory) because those answers constrain every later primitive choice. |
contract → evals | design/CONTRACT.md — a Primitive Decision Record with a six-column consequence chain per capability (trigger, context economics, enforcement, failure modes, testability, distribution), a full 14-slot USED/NOT-USED ledger, and at least one rejected alternative per capability. The read-only spec-critic agent must write APPROVED into .forge/critic-report.md (it audits through three lenses: context economics, headless/enforcement, distribution/maintenance). The approved contract is sha256-pinned; editing it later regresses the phase back to contract. |
evals → armed | arm-evals passes four gates: (1) reference-green — every task's reference solution passes its own graders; (2) RED baseline — the full suite runs against bare Claude with no plugin, and any task that passes is "no signal" and must be hardened or cut; (3) judge calibration — every LLM judge reaches ≥0.85 agreement with 10–20 human-labeled transcripts; (4) freeze — sha256 of the evals/ tree written to .forge/freeze.json. |
armed → building | build-loop launches bin/forge-build: an isolated git worktree plus a headless claude -p "/goal …" loop whose termination condition is the FORGE_EVAL: … RESULT=PASS scoreboard line in the transcript. Setting phase to building arms the guard hooks. |
building → smoke | The frozen suite goes green inside the build loop. Smoke is the cheap sanity matrix run before expensive trials: plugin loads with empty plugin_errors, one probe per user-invocable skill, hook fixture pipes produce the contracted exit codes, and a 3-phrasing trigger sanity check. |
smoke → verify | Smoke matrix green. Verify then runs the expensive checks: fresh N-trial runs scored as pass^k (all trials must pass — the reliability headline for business/scientific use), a holdout tranche of tasks the builder never saw, trigger precision/recall, and a token-budget check. The triage agent samples failures and classifies each as agent-error, grader-error, or task-ambiguity. |
verify → ship | pass^k acceptable, holdout green, triage findings resolved (grader errors trigger a suite re-arm and version bump, not silent edits). |