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.

  1. YouEdit a file

    An agent, a skill, a rule, a hook or an installer

  2. This pageFind its row

    The row names the suite and what it proves

  3. OfflineRun the suite

    No model, no cost, from the repository root

    EXIT 0
  4. Some editsRun the scenarios

    A sub-agent dry run for each scenario

  5. 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.

bash
python3 deploy/evals/agent-contract-regression.pypython3 deploy/scripts/agent-contract-audit.py --check
agents/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.

bash
python3 deploy/evals/agent-contract-regression.pypython3 deploy/evals/pipeline-cost-benchmark-regression.py
agents/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.

bash
python3 deploy/evals/agent-contract-regression.pypython3 deploy/evals/pipeline-cost-benchmark-regression.pypython3 deploy/evals/diff-router-regression.py

Then 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.

bash
python3 deploy/evals/agent-contract-regression.py

Then 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
bash
python3 deploy/evals/agent-contract-regression.py

Then 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.

bash
python3 deploy/evals/agent-contract-regression.py

Then 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.

bash
python3 deploy/evals/diff-router-regression.py
Run a manual scenario

A 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.

bash
python3 deploy/evals/delegation-gate-regression.py
diff-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.

bash
python3 deploy/evals/diff-router-regression.py
evidence-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.

bash
python3 deploy/evals/evidence-store-regression.py
version-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.

bash
python3 deploy/evals/version-gate-regression.py
A 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.

bash
python3 deploy/templates/hooks/<hook>.py --selftestdeploy/templates/hooks/git-safety-check.sh --selftest
deploy/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.

bash
python3 deploy/evals/harness-hooks-regression.py
Any 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.

macOS, Linux
DRY_RUN=1 deploy/scripts/install.shdeploy/scripts/install.sh --doctor
Windows
$env:DRY_RUN=1; deploy\scripts\install.ps1deploy\scripts\install.ps1 -Doctor
install-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.

bash
deploy/evals/codex-install-regression.shpython3 deploy/evals/codex-readonly-guard-regression.py
Another 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.

bash
python3 deploy/evals/pipeline-cost-benchmark-regression.py
deploy/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.

bash
python3 deploy/evals/runtime-collector-regression.pypython3 deploy/evals/runtime-fixtures-regression.pypython3 deploy/evals/runtime-runner-regression.py
A 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.

bash
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 -v
A 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 ~/.claude/

    Build and stage everything in the repository. Only the installers change it, and only when the user asks.
  • Keep the standards consistent

    An edit must agree with the locked-decisions table in RESUME.prompt.md. A contested fork goes to the person running the session.
  • Never name a skill like a bundled one

    A skill named code-review, security-review, verify, simplify, run or review silently replaces the bundled skill.
  • Change both scripts of a pair

    A deploy/ script with a .sh and a .ps1 file changes in both. Shared logic goes in one Python helper.
  • Keep gen-component-map byte-identical

    The drift gate regenerates the map on Linux CI. The .ps1 file must emit the same bytes as the .sh file.
  • Declare privilege once, in tools:

    Do not add Write to verifier, ft-test-adversary or ft-architecture-audit.
  • Make paths: encode applicability

    A glob is a proxy for when a rule applies. Run the six checks on every new glob.
Economy may never remove the last independent reviewer

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

ft-developer.md19,108
bugfix-agent.md13,350
verifier.md7,139
All three39,597
The ceiling39,600

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. 1. You edit a lens set

    You change the lenses of a checkpoint in a contract.
  2. 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.

StepAgentSkillRule
Create the fileagents/<name>.mdskills/<name>/SKILL.mdrules/<area>/<name>.md
Write the frontmattername, description, model, color. tools is optional.name, description. Add disable-model-invocation: true to a side-effect skill.paths: with the globs.
What starts itA 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 forAn 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 installAutomatic: the installers copy every agents/*.md.Automatic: the installers copy every skills/*/.Automatic: the installers mirror every rules/*/.
Codex installAdd 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 runagent-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.
A list change has two counts to update

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 for docker-compose.yml that is blind to the .j2 governs nothing, because the author never edits the output. The same holds for .tpl, .mako, .mustache and generated clients.
  • Encode other applicability another way

    rules/db/postgres.md scopes 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 matches paths: 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 .js frontend.
  • 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. 1

    Edit the page

    Add or edit it in docs/modules/ROOT/pages/.

  2. 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. 3

    Build

    Start Kroki for the PlantUML diagrams, then build. Commands below.

  4. 4

    Read the output

    Fix every new error. Only 3 errors in glossary.adoc are known. They resolve inside the full portal.

bash
npm run krokinpm run build

Ask /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.

Claude Code
/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.

Claude Code
/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.

Claude Code
/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.

Claude Code
/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.

Claude Code
/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.

bash
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. 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. 2. Audit

    One agent writes the audit file and changes no page. It reads at most the top 20 flagged pages.
  3. 3. Changes under the root?

    page-audit.py --zone prints root-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. 4. Which branch?

    The rework needs a branch.
    • DefaultOn main, master or dev, the skill creates docs/rework-<module>-<date>.
    • OtherThe skill stays on the branch.

Then the skill loops over the rows of the audit file, in rank order.

  1. 1. Rework 5 pages

    The skill takes the next 5 REWORK or SPLIT rows, and skips a page in the Steering: line. A fresh agent reworks each page and commits its own files locally.
  2. 2. Check git after each page

    The next page starts on status OK or NO-OP. Anything else stops the skill.
  3. 3. Read the final report

    It lists the KEEP and TRIM pages, every Steering: line and every Degradations: line.Exit No row is left, and the skill prints no resume line.
  4. 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/ or skills/ft-guide-page/SKILL.md passes only when it is committed and the report lists it.
  • The root-dirty or outside value of page-audit.py --zone differs from its value before the page.
  • The new HEAD does not descend from the recorded one.
  • The status is anything other than OK with a moved HEAD or NO-OP with an unchanged HEAD.
  • page-audit.py --zone exits 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.

docs-audit-example-repo-ROOT-0000-00-00.md
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: 30
IllustrationThe shape is real. The values are invented.

Before 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. 1

    Run your suites

    Use the row for each file you changed.

  2. 2

    Run the manual scenarios

    Do this if you edited verifier, ft-test-adversary, refactor-agent or the doc-writer routing.

  3. 3

    Check an installer

    If you changed one, run its dry run and its doctor. A bash script stays clean under shellcheck, with set -euo pipefail.

  4. 4

    Check the documentation

    Run npm run build and read each changed page by the rules of the technical-writing skill.

  5. 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/?

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.

The pipelines the suites protectGrades and gates in Quality Pipelines.
How a rule reaches an agentLoading and modules in Rules.
The Codex installUser commands in Codex.
A term you do not knowLens, checkpoint and dispatch are in the Glossary.
Contributing Reference