Adhoc Plan Implementation (Gait)
Execute this workflow for: "implement this plan file", "run plan from ", or "execute backlog from a custom plan doc."
Scope
- Repository:
/Users/tr/gait
- Mandatory input argument:
plan_path
plan_path must point to a specific plan document provided by the user
- No default fallback to
product/PLAN_NEXT.md
- Planning input only; this skill performs implementation work in repo
Input Contract (Mandatory)
- Required:
plan_path
- Accepted forms:
- absolute path
- repo-relative path
- Input must resolve to an existing readable file
- If
plan_path is missing or invalid, stop with blocker report
Preconditions
- Plan file includes required structure:
Global Decisions (Locked)
Exit Criteria
Test Matrix Wiring
- Story sections with
Tasks, Repo paths, Run commands, Test requirements, Matrix wiring, Acceptance criteria
- If structure is incomplete, stop and report missing sections
Git Bootstrap Contract (Mandatory)
Run in order before implementation:
git fetch origin main
git checkout main
git pull --ff-only origin main
git checkout -b codex/adhoc-<plan-scope>
Rules:
- If worktree is dirty before step 1, stop and report blocker
- If unexpected unrelated changes appear during execution, stop immediately and ask how to proceed
- Do not auto-commit or auto-push unless explicitly requested by the user
Workflow
- Parse plan and build execution queue by dependency and priority (
P0 -> P1 -> P2).
- Respect any explicit
Wave 1 before Wave 2 sequencing in the plan.
- Run baseline before first edit:
make lint-fast
make test-fast
- Record failures as pre-existing vs introduced.
- Implement one story at a time (no parallel story execution).
- For each story:
- implement scoped code/docs/tests only
- keep orchestration thin when architecture is touched; move parsing, persistence, reporting, or policy logic into focused packages instead of coordinator layers
- make side effects explicit in API names/signatures and preserve symmetric semantics unless the distinction is intentionally named
- run story
Run commands
- run story
Test requirements
- run story
Matrix wiring lanes
- mark complete only when acceptance criteria pass
- Run epic-level validation after epic completion.
- Run plan-level validation:
make prepush-full (preferred), or
make prepush plus make codeql
- Never finish without CodeQL unless explicitly waived by the user.
- Revalidate all implemented work against:
- story acceptance criteria
- plan Definition of Done
- plan Exit Criteria
- Output
met/not met with command evidence for each item.
Command Contract (JSON Required)
When collecting evidence or emitting machine-readable status, use gait commands with --json, for example:
gait doctor --json
gait gate eval --policy examples/policy/strict.yaml --intent examples/policy/intents/file_delete.json --json
Contract Discipline Rules
- If a story changes public CLI/SDK/schema surfaces, update stable/internal/deprecated surface notes in the same change.
- If versioning or schema compatibility behavior changes, document what is breaking vs additive and the migration expectation in the same story.
- If errors cross CLI or SDK boundaries, preserve structured machine-readable errors and stable mappings.
- If a story touches long-running workflows, verify cancellation and timeout propagation end-to-end.
- If enterprise customization pressure appears in scope, prefer explicit extension points over fork-only designs when feasible.
- For user-facing docs, explain integration hooks before internals and keep
README.md, repo docs, and generated/public docs in sync.
Test Requirements by Work Type (Mandatory)
- Schema/artifact contract changes:
- schema validation tests
- fixture/golden updates
- compatibility or migration tests
make test-contracts
- CLI behavior changes (flags/JSON/exits):
cmd/gait/*_test.go command coverage
--json stability checks
- exit-code contract checks
- Gate/policy/fail-closed changes:
- deterministic allow/block/require_approval fixtures
- fail-closed undecidable-path tests
- reason-code stability checks
- Determinism/hash/sign/pack changes:
- byte-stability repeat-run tests
- canonicalization/digest stability checks
- verify/diff determinism tests
make test-packspec-tck when applicable
- Job runtime/state/concurrency changes:
- lifecycle tests (submit/checkpoint/pause/resume/cancel)
- atomic write/crash safety tests
- contention/concurrency tests
- chaos lanes when scoped
- SDK/adapter boundary changes:
- wrapper behavior/error-mapping tests
- adapter conformance/parity tests
make test-adapter-parity when applicable
- Voice/context changes:
make test-voice-acceptance and/or make test-context-conformance as applicable
- Docs/examples changes:
make test-docs-consistency
make test-docs-storyline when flow changes
Test Matrix Wiring (Enforcement)
Every story must map to and run required lanes:
- Fast lane:
make lint-fast, make test-fast
- Core lane: targeted unit/integration suites
- Acceptance lane: relevant
make test-*-acceptance targets
- Cross-platform lane: preserve Linux/macOS/Windows behavior on touched surfaces
- Risk lane: determinism/safety/security/perf suites as required
No story is complete if any required lane is skipped or failing.
Surgical Docs Sync Rule
If a story changes user-visible behavior, update only impacted docs in the same story:
/Users/tr/gait/README.md
/Users/tr/gait/docs/
/Users/tr/gait/docs-site/public/llms.txt
/Users/tr/gait/docs-site/public/llm/*.md
/Users/tr/gait/CONTRIBUTING.md
/Users/tr/gait/CHANGELOG.md
/Users/tr/gait/CODE_OF_CONDUCT.md
/Users/tr/gait/SECURITY.md
/Users/tr/gait/.github/ISSUE_TEMPLATE/
/Users/tr/gait/.github/pull_request_template.md
If internal-only behavior with no user-visible impact, avoid unnecessary doc churn.
Safety Rules
- Preserve determinism, offline-first defaults, fail-closed enforcement, schema stability, and exit-code stability.
- Never weaken non-allow => non-execute behavior.
- No destructive git operations unless explicitly requested.
- No silent skips of required tests/checks.
- Keep changes tightly scoped to active story.
Quality Rules
- Claims must be evidence-backed by executed commands/tests.
- Do not claim tests ran if they were not run.
- Tests must use temp dirs for generated artifacts; do not leak test outputs into tracked source paths.
- If docs/CLI drift occurs due to user-visible changes, patch docs in same story.
- Keep README first-screen coverage crisp: what it is, who it is for, how it integrates, and how to get value quickly.
- Keep one docs source of truth and update generated/public derivatives in the same story.
Blocker Handling
If blocked:
- Stop blocked story immediately.
- Report exact blocker and affected acceptance criteria.
- Continue only independent unblocked stories.
- End with minimum unblock actions.
Completion Criteria
Implementation is complete only when all are true:
- All non-blocked in-scope stories are implemented.
- Required story tests and matrix lanes pass.
- Plan Definition of Done is satisfied.
- Plan Exit Criteria is satisfied.
- CodeQL validation is green.
Expected Output
- Execution summary: completed/deferred/blocked stories
- Change log: key files per story
- Validation log: commands and pass/fail
- Revalidation report: acceptance criteria + DoD + exit criteria (
met/not met with evidence)
- Residual risk: remaining gaps and next required actions
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: adhoc-implement3description: Implement a user-specified Gait backlog plan end-to-end with strict branch bootstrap, story-by-story execution, required test-matrix wiring, CodeQL validation, and final DoD/acceptance revalidation. Use when this capability is needed.4---56# Adhoc Plan Implementation (Gait)78Execute this workflow for: "implement this plan file", "run plan from <path>", or "execute backlog from a custom plan doc."910## Scope1112- Repository: `/Users/tr/gait`13- Mandatory input argument: `plan_path`14- `plan_path` must point to a specific plan document provided by the user15- No default fallback to `product/PLAN_NEXT.md`16- Planning input only; this skill performs implementation work in repo1718## Input Contract (Mandatory)1920- Required: `plan_path`21- Accepted forms:22- absolute path23- repo-relative path24- Input must resolve to an existing readable file25- If `plan_path` is missing or invalid, stop with blocker report2627## Preconditions2829- Plan file includes required structure:30- `Global Decisions (Locked)`31- `Exit Criteria`32- `Test Matrix Wiring`33- Story sections with `Tasks`, `Repo paths`, `Run commands`, `Test requirements`, `Matrix wiring`, `Acceptance criteria`34- If structure is incomplete, stop and report missing sections3536## Git Bootstrap Contract (Mandatory)3738Run in order before implementation:39401. `git fetch origin main`412. `git checkout main`423. `git pull --ff-only origin main`434. `git checkout -b codex/adhoc-<plan-scope>`4445Rules:46- If worktree is dirty before step 1, stop and report blocker47- If unexpected unrelated changes appear during execution, stop immediately and ask how to proceed48- Do not auto-commit or auto-push unless explicitly requested by the user4950## Workflow51521. Parse plan and build execution queue by dependency and priority (`P0 -> P1 -> P2`).53 - Respect any explicit `Wave 1` before `Wave 2` sequencing in the plan.542. Run baseline before first edit:55- `make lint-fast`56- `make test-fast`57- Record failures as pre-existing vs introduced.583. Implement one story at a time (no parallel story execution).594. For each story:60- implement scoped code/docs/tests only61- keep orchestration thin when architecture is touched; move parsing, persistence, reporting, or policy logic into focused packages instead of coordinator layers62- make side effects explicit in API names/signatures and preserve symmetric semantics unless the distinction is intentionally named63- run story `Run commands`64- run story `Test requirements`65- run story `Matrix wiring` lanes66- mark complete only when acceptance criteria pass675. Run epic-level validation after epic completion.686. Run plan-level validation:69- `make prepush-full` (preferred), or70- `make prepush` plus `make codeql`71- Never finish without CodeQL unless explicitly waived by the user.727. Revalidate all implemented work against:73- story acceptance criteria74- plan Definition of Done75- plan Exit Criteria76- Output `met/not met` with command evidence for each item.7778## Command Contract (JSON Required)7980When collecting evidence or emitting machine-readable status, use `gait` commands with `--json`, for example:8182- `gait doctor --json`83- `gait gate eval --policy examples/policy/strict.yaml --intent examples/policy/intents/file_delete.json --json`8485## Contract Discipline Rules8687- If a story changes public CLI/SDK/schema surfaces, update stable/internal/deprecated surface notes in the same change.88- If versioning or schema compatibility behavior changes, document what is breaking vs additive and the migration expectation in the same story.89- If errors cross CLI or SDK boundaries, preserve structured machine-readable errors and stable mappings.90- If a story touches long-running workflows, verify cancellation and timeout propagation end-to-end.91- If enterprise customization pressure appears in scope, prefer explicit extension points over fork-only designs when feasible.92- For user-facing docs, explain integration hooks before internals and keep `README.md`, repo docs, and generated/public docs in sync.9394## Test Requirements by Work Type (Mandatory)95961. Schema/artifact contract changes:97- schema validation tests98- fixture/golden updates99- compatibility or migration tests100- `make test-contracts`1011022. CLI behavior changes (flags/JSON/exits):103- `cmd/gait/*_test.go` command coverage104- `--json` stability checks105- exit-code contract checks1061073. Gate/policy/fail-closed changes:108- deterministic allow/block/require_approval fixtures109- fail-closed undecidable-path tests110- reason-code stability checks1111124. Determinism/hash/sign/pack changes:113- byte-stability repeat-run tests114- canonicalization/digest stability checks115- verify/diff determinism tests116- `make test-packspec-tck` when applicable1171185. Job runtime/state/concurrency changes:119- lifecycle tests (submit/checkpoint/pause/resume/cancel)120- atomic write/crash safety tests121- contention/concurrency tests122- chaos lanes when scoped1231246. SDK/adapter boundary changes:125- wrapper behavior/error-mapping tests126- adapter conformance/parity tests127- `make test-adapter-parity` when applicable1281297. Voice/context changes:130- `make test-voice-acceptance` and/or `make test-context-conformance` as applicable1311328. Docs/examples changes:133- `make test-docs-consistency`134- `make test-docs-storyline` when flow changes135136## Test Matrix Wiring (Enforcement)137138Every story must map to and run required lanes:139140- Fast lane: `make lint-fast`, `make test-fast`141- Core lane: targeted unit/integration suites142- Acceptance lane: relevant `make test-*-acceptance` targets143- Cross-platform lane: preserve Linux/macOS/Windows behavior on touched surfaces144- Risk lane: determinism/safety/security/perf suites as required145146No story is complete if any required lane is skipped or failing.147148## Surgical Docs Sync Rule149150If a story changes user-visible behavior, update only impacted docs in the same story:151- `/Users/tr/gait/README.md`152- `/Users/tr/gait/docs/`153- `/Users/tr/gait/docs-site/public/llms.txt`154- `/Users/tr/gait/docs-site/public/llm/*.md`155- `/Users/tr/gait/CONTRIBUTING.md`156- `/Users/tr/gait/CHANGELOG.md`157- `/Users/tr/gait/CODE_OF_CONDUCT.md`158- `/Users/tr/gait/SECURITY.md`159- `/Users/tr/gait/.github/ISSUE_TEMPLATE/`160- `/Users/tr/gait/.github/pull_request_template.md`161162If internal-only behavior with no user-visible impact, avoid unnecessary doc churn.163164## Safety Rules165166- Preserve determinism, offline-first defaults, fail-closed enforcement, schema stability, and exit-code stability.167- Never weaken non-allow => non-execute behavior.168- No destructive git operations unless explicitly requested.169- No silent skips of required tests/checks.170- Keep changes tightly scoped to active story.171172## Quality Rules173174- Claims must be evidence-backed by executed commands/tests.175- Do not claim tests ran if they were not run.176- Tests must use temp dirs for generated artifacts; do not leak test outputs into tracked source paths.177- If docs/CLI drift occurs due to user-visible changes, patch docs in same story.178- Keep README first-screen coverage crisp: what it is, who it is for, how it integrates, and how to get value quickly.179- Keep one docs source of truth and update generated/public derivatives in the same story.180181## Blocker Handling182183If blocked:1841. Stop blocked story immediately.1852. Report exact blocker and affected acceptance criteria.1863. Continue only independent unblocked stories.1874. End with minimum unblock actions.188189## Completion Criteria190191Implementation is complete only when all are true:192193- All non-blocked in-scope stories are implemented.194- Required story tests and matrix lanes pass.195- Plan Definition of Done is satisfied.196- Plan Exit Criteria is satisfied.197- CodeQL validation is green.198199## Expected Output200201- Execution summary: completed/deferred/blocked stories202- Change log: key files per story203- Validation log: commands and pass/fail204- Revalidation report: acceptance criteria + DoD + exit criteria (`met/not met` with evidence)205- Residual risk: remaining gaps and next required actions206207---208> Converted and distributed by [TomeVault](https://tomevault.io/claim/clyra-ai) — claim your Tome and manage your conversions.209<!-- tomevault:4.0:skill_md:2026-04-11 -->