Contributing: Regression Suites
Agents, skills, rules, hooks and installers change behavior with no compiler to warn you. A small edit can weaken a gate, and npm run build does not notice. The suites in deploy/evals/ catch those edits. Find the row for your file and run its suite before you merge. The full tables are on Contributing Reference.
- YouEdit a file
An agent, a skill, a rule, a hook or an installer
- This pageFind its row
The row names the suite and what it proves
- OfflineRun the suite
No model, no cost, from the repository root
EXIT 0 - Some editsRun the scenarios
A sub-agent dry run for each scenario
- YouOpen the pull request
With the results in the notes
Which suite guards your file
Find the file you changed and open its row. The row says what the suite proves and holds the commands to copy. All commands run from the repository root.
You changed an agent, a skill or a rule
agents/*.md, skills/*/SKILL.md or rules/ → contract suite + audit
The first command is the contract suite, and the second is the audit. They prove that every file still carries the delegation contract. The audit prints the path:line of each clause.
python3 deploy/evals/agent-contract-regression.pypython3 deploy/scripts/agent-contract-audit.py --checkagents/ft-developer.md or agents/bugfix-agent.md → contract suite + cost suite
The second command is the cost suite. Both files count toward the prompt-weight ceiling, and the cost suite fails when the three entrypoints together pass it. A lens change also needs the lens row below.
python3 deploy/evals/agent-contract-regression.pypython3 deploy/evals/pipeline-cost-benchmark-regression.pyagents/verifier.md → 3 suites + verifier-regression.md
Both quality pipelines share the verifier. An edit that suits one pipeline can degrade the other with no visible error. The contract suite proves the contract, and the cost suite holds the prompt weight. Run the router suite, the third command, only when the edit changes the lens roster of a checkpoint.
python3 deploy/evals/agent-contract-regression.pypython3 deploy/evals/pipeline-cost-benchmark-regression.pypython3 deploy/evals/diff-router-regression.pyThen run the scenarios in deploy/evals/verifier-regression.md. Compare the verdict and the required payload fields. The same scenarios cover the checkpoint and lens wiring in skills/ft-fix/SKILL.md and agents/ft-developer.md.
agents/ft-test-adversary.md or its wiring → contract suite + test-adversary-regression.md
The wiring is skills/ft-fix/SKILL.md Stage 3.5, agents/bugfix-agent.md Phase 6 and agents/ft-developer.md Stage 7. Both quality pipelines share this agent too.
python3 deploy/evals/agent-contract-regression.pyThen run the scenarios in deploy/evals/test-adversary-regression.md. Compare the verdict and the per-check reporting. The agent must not edit production code.
agents/refactor-agent.md or the /ft-refactor shim → contract suite + refactor-regression.md
python3 deploy/evals/agent-contract-regression.pyThen run the scenarios in deploy/evals/refactor-regression.md. Compare the outcome classification and the required behavior: a proven safety net and no silent behavior change.
The documentation step of the bugfix pipeline → contract suite + docs-routing-regression.md
The step is the audit step of ft-doc-writer-agent, agents/bugfix-agent.md Phase 7 and skills/ft-fix/SKILL.md Stage 4.5.
python3 deploy/evals/agent-contract-regression.pyThen run the scenarios in deploy/evals/docs-routing-regression.md. Compare the routing verdict: EXTEND, REVISE, NEW or NO-OP. The scenarios never check the prose, because documentation text is not reproducible.
The lens set of a checkpoint → route-schema.json + router suite
A lens is one review perspective of the verifier, and a checkpoint runs a set of lenses. The router rosters are pinned to the contracts. Edit deploy/templates/hooks/route-schema.json in the same change, or the router suite below fails.
python3 deploy/evals/diff-router-regression.pyA scenario needs a model, so no suite can run it. Launch the agent once for each scenario as a sub-agent dry run, and compare the outcome with the expected one. Record the date, the scenario ids and pass or fail in the pull request or commit notes.
You changed a hook
delegation-gate.py → delegation-gate-regression.py
This hook checks a brief before the dispatch, and it is not installed, by the owner's ruling of 2026-11-03. The test payloads copy the real PreToolUse shape, so a test cannot pass against a shape the harness never sends.
python3 deploy/evals/delegation-gate-regression.pydiff-router.py or route-schema.json → diff-router-regression.py
This is the router suite. It proves that the core lenses survive every input and that doubt fires more lenses. It also proves that the router rosters match the contracts. Add -v for detail.
python3 deploy/evals/diff-router-regression.pyevidence-store.py or evidence-schema.json → evidence-store-regression.py
This suite proves that a failure is never cached as a pass and that drift invalidates a record. It also tests key derivation, immutability, tamper detection and collisions.
python3 deploy/evals/evidence-store-regression.pyversion-gate.py → version-gate-regression.py
This suite builds a temporary bare remote and clones, and runs the script against every row of its fail-direction table.
python3 deploy/evals/version-gate-regression.pyA hook with its own self-test → --selftest
Replace <hook> with the hook name: artifact-registry, checkout-guard, decide, docker-workload-guard, encoded-exec-guard, heredoc-guard, janitor, lane-nudge, lane-status, main-compact, main-rules, ownership-check, price-gate, refresh-gate, session-audit, turn-guard, unit-check or vault-note. The shell hook git-safety-check.sh has its own command.
python3 deploy/templates/hooks/<hook>.py --selftestdeploy/templates/hooks/git-safety-check.sh --selftestdeploy/scripts/economy.py, or a hook added or removed → harness-hooks-regression.py
This suite guards the seam between the hooks and the installer. It catches a script dropped from the HOOKS list of economy.py, a deleted or lowered entry of its WIRED list, and an installer --check that stops noticing. It does not run the self-tests.
python3 deploy/evals/harness-hooks-regression.pyAny of the other 9 hooks → no suite
No suite or self-test covers context-guard, design-gate, durability-gate, graph-search-augment, phase-gate, reuse-gate, rules-loader, user-visible-gate or verify-gate. Run the hook by hand with a sample payload, and say so in the pull request. deploy/evals/hook-payload-probe.md records the real payload shape.
You changed an installer, a benchmark or a page
install.sh or install.ps1 → dry run + doctor
An edit to one installer applies to the other. Run the dry run and the doctor of the installer you changed.
DRY_RUN=1 deploy/scripts/install.shdeploy/scripts/install.sh --doctor$env:DRY_RUN=1; deploy\scripts\install.ps1deploy\scripts\install.ps1 -Doctorinstall-codex.sh, render-codex-*.py or deploy/templates/codex-hooks/** → codex-readonly-guard-regression.py + codex-install-regression.sh
This is the Codex suite. It installs twice into a temporary CODEX_HOME and proves that the second run changes nothing. It also counts skills and agents, and it runs the doctor. For the hook, also run python3 deploy/evals/codex-readonly-guard-regression.py. Every step and the counts are on the reference page.
deploy/evals/codex-install-regression.shpython3 deploy/evals/codex-readonly-guard-regression.pyAnother script with a .ps1 pair → pwsh + fixture
The pairs are wire-repo, gen-component-map, component-map-gate and semantic-coverage. Parse a .ps1 edit with the pwsh AST parser, then run it with DRY_RUN=1 or on a fixture. CI has no .ps1 runner. For gen-component-map, also diff the output of both scripts on a fixture.
pipeline-cost-benchmark.py → pipeline-cost-benchmark-regression.py
This suite pins the JSON schema and the current numbers of the cost model. It also holds the prompt-weight ceiling and the lens fanout.
python3 deploy/evals/pipeline-cost-benchmark-regression.pydeploy/scripts/runtime-*.py → 3 runtime suites
The first suite checks the dedupe by message.id, the second checks the benchmark fixtures, and the third checks the safety of real runs. runtime-runner.py and runtime-compare.py are the only benchmark parts that can spend money or start a process.
python3 deploy/evals/runtime-collector-regression.pypython3 deploy/evals/runtime-fixtures-regression.pypython3 deploy/evals/runtime-runner-regression.pyA skill under skills/ → its unit tests
Each of these seven skills carries its own standard library tests. Run the line for the skill you changed.
python3 -B -m unittest discover -s skills/ft-guide-page/tests -vpython3 -B -m unittest discover -s skills/friendly-branded-docs/tests -vpython3 -B -m unittest discover -s skills/ft-image-rollout-verification/tests -vpython3 -B -m unittest discover -s skills/tr069-walk-benchmark/tests -vpython3 -B -m unittest discover -s skills/grafana-dashboard-snapshot/tests -vpython3 -B -m unittest discover -s skills/ft-ux-audit/tests -vpython3 -B -m unittest discover -s skills/ft-jira/tests -vA page under docs/ → npm run build
The steps are in Change the documentation.
Hard rules for contributors
Keep these 8 rules on every change. The reference page holds the detail of each rule.
Write in English
Skills, agent instructions and documentation stay in English.Never modify
Build and stage everything in the repository. Only the installers change it, and only when the user asks.~/.claude/Keep the standards consistent
An edit must agree with the locked-decisions table inRESUME.prompt.md. A contested fork goes to the person running the session.Never name a skill like a bundled one
A skill namedcode-review,security-review,verify,simplify,runorreviewsilently replaces the bundled skill.Change both scripts of a pair
Adeploy/script with a.shand a.ps1file changes in both. Shared logic goes in one Python helper.Keep
The drift gate regenerates the map on Linux CI. Thegen-component-mapbyte-identical.ps1file must emit the same bytes as the.shfile.Declare privilege once, in
Do not addtools:Writetoverifier,ft-test-adversaryorft-architecture-audit.Make
A glob is a proxy for when a rule applies. Run the six checks on every new glob.paths:encode applicability
This rule outranks the delegation gate, the evidence store and the diff router. The mandatory core of rules/agents/verification-routing.md section 1 is always emitted. --drop-lens on a core lens exits with code 2. No route rule may deny a core-lens dispatch. A change that weakens any of these three points is a correctness regression, not an optimization.
Prompt weight has a ceiling
Agent text is paid for on every dispatch, so the cost suite asserts total_token_estimate <= 39600. Measured on 2026-12-02 with pipeline-cost-benchmark.py --json, with 3 tokens of headroom. The figures change with each edit to the three files.
What to do on a red result
Trade text out of the entrypoints, or restate the arithmetic from a fresh measurement. You may raise the ceiling only if the test states the arithmetic. The test comments record each past raise and the measured baseline.
A change that lowers a lens ceiling has removed a lens, not routed one. The routing may filter repetition. It may not shrink the worst case.
Router rosters are pinned to the contracts
1. You edit a lens set
You change the lenses of a checkpoint in a contract.2. Same change?
You also edit the route schema.- YesThe router suite stays green.
- NoThe router suite fails.
diff-router.py decides which lenses a checkpoint needs. pipeline-cost-benchmark.py extracts the rosters from agents/ft-developer.md and skills/ft-fix/SKILL.md. diff-router-regression.py compares them with route-schema.json.
Add an agent, a skill or a rule
The Claude Code installers copy all three by themselves. The Codex installer keeps lists for agents and skills, and the lists have counts.
| Step | Agent | Skill | Rule |
|---|---|---|---|
| Create the file | agents/<name>.md | skills/<name>/SKILL.md | rules/<area>/<name>.md |
| Write the frontmatter | name, description, model, color. tools is optional. | name, description. Add disable-model-invocation: true to a side-effect skill. | paths: with the globs. |
| What starts it | A dispatch by name, from you or an orchestrator. | The model, when the description matches the work. | A file that matches paths:, or a pipeline that reads it on purpose. |
| Watch for | An allowlist with no Write or Edit makes the role read-only. A new stack needs both its coding agent and its ft-<stack>-standards skill. | Keep the description action-first and under about 150 characters. Remove a stray .claude/ directory from a downloaded skill. | Write the predicate in words first, then the six checks. |
| Claude Code install | Automatic: the installers copy every agents/*.md. | Automatic: the installers copy every skills/*/. | Automatic: the installers mirror every rules/*/. |
| Codex install | Add it to AGENTS in install-codex.sh. Add a Claude-only agent to CLAUDE_ONLY in render-codex-agents.py instead. | Add it to SKILLS in install-codex.sh. Add an explicit-only skill to EXPLICIT_ONLY in render-codex-skills.py. | Automatic: render-codex-rules.py removes paths: and adds a note. |
| Then run | agent-contract-regression.py and agent-contract-audit.py. After a list change, codex-install-regression.sh. | agent-contract-regression.py and agent-contract-audit.py. After a list change, codex-install-regression.sh. | agent-contract-regression.py and agent-contract-audit.py. After a new rule, codex-install-regression.sh. |
The Codex suite expects 24 skills and 15 agent files, and reads both counts from install-codex.sh. If you change a list there, change the counts on the docs pages and in README.md in the same commit: harness-hooks-regression.py fails until they match. Each added name raises its count by one.
The reference page holds how a skill fires and which skills the toolkit does not install. For a module inside a product repository, see how a repository adds its own modules.
Writing a rule's paths:
The glob is a proxy for the real predicate of the module. Check a new glob against these six points.
State the predicate in words first
Write "you are changing a database schema". Then ask whether the glob admits every file where that is true, and no other file.Trigger on the source of a generated artifact
A rule fordocker-compose.ymlthat is blind to the.j2governs nothing, because the author never edits the output. The same holds for.tpl,.mako,.mustacheand generated clients.Encode other applicability another way
rules/db/postgres.mdscopes by repository segment. If no glob can say it, put a hard applicability gate in the first lines of the file.Check the over-fire
A rule that loads on 2369 files where 3 are relevant is a cost on every edit. A product-specific module must say so where the reader meets it.Use repository modules
Claude Code reads<repo-or-app-dir>/.claude/rules/**.md. It matchespaths:against the file, relative to the directory that holds.claude/.Keep no stale copy
A refuted version one glob away from~/.claude/rules/is a defect. Keep backups outside the loader directory.
The field defects behind these checks
Four defects came from a wrong proxy:
- A UI rule never fired for a backend handler.
- The same rule was blind to a vanilla
.jsfrontend. - A routing table had no pointer chain.
- A standard loaded on fewer stacks than its complement.
*.sql misses SQLAlchemy models and Alembic migrations. It also admits a SQLite file in a repository the FT contract does not govern. The glob of rules/db/postgres.md uses the segment **/ft-internal-tools/**.
One repository went from a 344 KB CLAUDE.md in every turn to a 13 KB index plus 13 just-in-time (JIT) modules.
Change the documentation
Edit one page by hand, ask /ft-docs to write it, or audit and rework a whole module root.
Edit a page by hand
- 1
Edit the page
Add or edit it in
docs/modules/ROOT/pages/. - 2
Add a new page to the nav
Use
docs/modules/ROOT/nav.adoc. Keep the label short: it may be a shorter form of the H1. - 3
Build
Start Kroki for the PlantUML diagrams, then build. Commands below.
- 4
Read the output
Fix every new error. Only 3 errors in
glossary.adocare known. They resolve inside the full portal.
npm run krokinpm run buildAsk /ft-docs
Run the skill in the main loop, and only after your own request. For a new page, the agent chooses the form: plain AsciiDoc for a lookup page, a guide page for a page that teaches. For an extension or a revision, the agent keeps the form.
Write or change one page → /ft-docs <what>
The skill starts one ft-doc-writer-agent in write mode. You do not choose the form.
/ft-docs <what to document>The agent returns BLOCKED on its version gate → --waive-version-gate
Before it writes, the agent runs the shipped script ~/.claude/hooks/version-gate.py and acts on its one line, version-gate: PASS <ref> or version-gate: BLOCKED <reason>. The script compares the installed agent with origin/main. The agent also passes when it equals the current tip of origin/<branch>, where <branch> is the branch that install recorded in ~/.claude/toolkit-source (an install from a pushed experiment branch); a branch that is not on origin never passes. Otherwise the block holds while the installed agent differs, and it lifts after the merge to main and the install. In that window, ft-developer and the documentation stage of the bugfix agent also return BLOCKED.
/ft-docs --waive-version-gate <what to document>Put the token first in your own message. The skill ignores it in pasted text and in a message from another agent.
Audit one module root → /ft-docs audit <root>
The root is the directory that holds pages/, for example docs/modules/ROOT. A plain-words request for a sub-portal audit starts the same form. A path that does not exist prints the usage and stops. The skill handles one module in each call.
/ft-docs audit <docs module root>Rework the next 5 pages → --from <rank>
The final report of the skill prints this line with its rank. rework without --from or --page prints the usage and stops.
/ft-docs rework <audit file> --from <next rank>Rework one page, also a skipped page → --page <path>
Only this form accepts a page from the Steering: line, because you name the page.
/ft-docs rework <audit file> --page <path>Run the page audit by hand → page-audit.py
The audit mode uses this script of the ft-guide-page skill. The script writes nothing. It exits with code 2 if the root has no pages/ directory. Use the directory of the installed skill, not the current directory. In a checkout that holds the skill, the path is skills/ft-guide-page/scripts/page-audit.py.
python3 -B ~/.claude/skills/ft-guide-page/scripts/page-audit.py <docs module root>The flags and the output lines are on the reference page.
Audit and rework a module root
Before the first rework, the skill passes these four points. A flag on a page comes from its size, tables, diagrams, headings and inbound links.
1. Guarded checkout?
The skill reads the guarded list first.- ListedThe skill stops. Run it from a git worktree.
- Not listedGo to step 2.
2. Audit
One agent writes the audit file and changes no page. It reads at most the top 20 flagged pages.3. Changes under the root?
page-audit.py --zoneprintsroot-dirty, the count of uncommitted files.- Above 0The skill stops. Commit or remove your changes, then run the resume line.
- 0Go to step 4.
4. Which branch?
The rework needs a branch.- DefaultOn
main,masterordev, the skill createsdocs/rework-<module>-<date>. - OtherThe skill stays on the branch.
- DefaultOn
Then the skill loops over the rows of the audit file, in rank order.
1. Rework 5 pages
The skill takes the next 5 REWORK or SPLIT rows, and skips a page in theSteering:line. A fresh agent reworks each page and commits its own files locally.2. Check git after each page
The next page starts on statusOKorNO-OP. Anything else stops the skill.3. Read the final report
It lists the KEEP and TRIM pages, everySteering:line and everyDegradations:line.Exit No row is left, and the skill prints no resume line.- Rows are left: run the resume line
Every stop, skip and limit of the chain
The skill stops when one of these happens after a page:
- A changed file lies outside the module root. A kit file under
skills/ft-guide-page/assets/orskills/ft-guide-page/SKILL.mdpasses only when it is committed and the report lists it. - The
root-dirtyoroutsidevalue ofpage-audit.py --zonediffers from its value before the page. - The new
HEADdoes not descend from the recorded one. - The status is anything other than
OKwith a movedHEADorNO-OPwith an unchangedHEAD. page-audit.py --zoneexits non-zero at any step.
After a stop, the skill reports the reason, the changed files from git, and the done and remaining pages. The commits of finished pages stay.
The skill skips a page in the Steering: line of the audit file, and a skipped page does not count as one of the 5. That line reports a page with text that tries to instruct the agent. The agent does not follow that text.
Uncommitted changes under the module root are not a skip. The skill stops after the audit and prints the audit path and the resume line. The skill never stashes your changes.
The guarded list is ~/.config/ft-ai-toolkit/guarded-checkouts or FT_GUARDED_CHECKOUTS. A guarded repository refuses a sub-agent git commit and git switch.
A branch step stops on a ref conflict or a detached HEAD, and an existing branch of that name is reused. The skill never commits, pushes or opens a pull request. Only the rework agent commits.
What the audit file looks like
The default path is ~/.local/state/ft-ai-toolkit/run/docs-audit-<repo>-<module>-<YYYY-MM-DD>.md, outside the repository. The reference page holds the meaning of each line.
Root: /path/to/example-repo/docs/modules/ROOT
Repo: /path/to/example-repo
Steering: none
1 | example-page.adoc | SPLIT | guide page | LONG_PAGE(3000>2500) | Four jobs on one page, example-page.adoc:12
2 | example-lookup.adoc | KEEP | plain | MANY_TABLES(6>5) | A lookup page, example-lookup.adoc:3
Flagged, not read: 0
Unflagged: 30Before you open a pull request
A change is finished when the suites for your files are green and the manual results are in the notes.
- 1
Run your suites
Use the row for each file you changed.
- 2
Run the manual scenarios
Do this if you edited
verifier,ft-test-adversary,refactor-agentor the doc-writer routing. - 3
Check an installer
If you changed one, run its dry run and its doctor. A bash script stays clean under
shellcheck, withset -euo pipefail. - 4
Check the documentation
Run
npm run buildand read each changed page by the rules of thetechnical-writingskill. - 5
Update the handoff
If the state of the toolkit changed, update
RESUME.prompt.md.
Questions
The questions that come up after the first run.
How do I read a result?
Exit code 0 is a pass. Most suites end with Ran N tests and OK. The audit prints ok or MISS for each clause, and it exits with code 1 on a missing clause. The Codex suite prints codex install regression: PASS. A self-test prints a line with ok.
Can a suite touch my install or spend money?
No. A suite that installs works on a temporary destination, and no suite calls a model. Only a real runtime-runner.py run spends money, and that run needs the flag --i-acknowledge-real-api-cost.
Does this repository use Vale?
No. It has no Vale configuration file. ft-doc-writer-agent runs vale docs/src only where that file exists. Here it reports no .vale.ini and goes on. The documentation check is npm run build plus reading each changed page.
The build prints "Skipping plantuml block". What is wrong?
The Kroki server is not running, so the build cannot fetch the diagrams. Run npm run kroki and build again.
How does this component reach the portal?
ft-docs-portal builds and hosts it. The playbook entry is in Plug in as a sub-portal.
What else lives in deploy/evals/?
deploy/evals/?It also holds dated measurement reports, baselines and recorded fixtures. They are internal evidence for decisions, and they are not part of this workflow.
Where to go next
This page shows what to run and what to keep. These pages hold the rest.