Plan Implementation (Gait)
Execute this workflow for: "implement the plan", "execute PLAN_NEXT", "ship plan stories", or "run backlog implementation end-to-end."
Scope
- Repository:
/Users/tr/gait
- Default input plan:
/Users/tr/gait/product/PLAN_NEXT.md
- Optional input plan: user-specified file under
/Users/tr/gait/product/
- This skill executes code/docs/tests for planned stories.
- Out of scope by default:
- GitHub issue creation
- PR creation
- Automated comments/discussions
- Auto-commit/auto-push
Preconditions
- Plan file exists and is readable.
- Plan includes:
Global Decisions (Locked)
Exit Criteria
Test Matrix Wiring
- Story-level
Tasks, Repo paths, Run commands, Test requirements, Matrix wiring, Acceptance criteria
- If required sections are missing, stop and report blockers.
Git Bootstrap Contract (Mandatory)
Before implementation starts, run in order:
git fetch origin main
git checkout main
git pull --ff-only origin main
git checkout -b codex/<plan-scope>
Rules:
- If working tree is dirty before step 1, stop and report blocker for user decision.
- If unexpected changes appear during implementation, stop immediately and ask how to proceed.
- Do not switch to other branches unless user explicitly requests it.
Workflow
- Parse plan and build execution queue:
- Follow
Minimum-Now Sequence first.
- Respect dependencies and
P0 -> P1 -> P2.
- Respect any explicit
Wave 1 before Wave 2 sequencing in the plan.
- Run baseline before first code change:
make lint-fast
make test-fast
- Record failures as
pre-existing vs introduced.
- Execute one story at a time:
- Implement only scoped story changes.
- Keep orchestration thin when story scope touches architecture; 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.
- Update tests required by story type.
- Update docs surgically only if user-facing behavior changed.
- Do not start next story until current story is validated.
- Validate story completion:
- Run story
Run commands.
- Run story
Test requirements.
- Run story
Matrix wiring lanes.
- If anything required is skipped, mark story incomplete.
- Run epic-level validation after each epic:
- Execute relevant integration/acceptance suites for impacted surfaces.
- Run final plan-level validation:
make prepush-full (preferred, includes CodeQL), or
make prepush and make codeql explicitly.
- Never finish without CodeQL unless user explicitly waives it.
- Revalidate implementation against plan contracts:
- Re-check every implemented story against acceptance criteria.
- Re-check plan
Definition of Done.
- Re-check plan
Exit Criteria.
- Produce a
met/not met checklist with command evidence for each item.
Command Anchors
gait doctor --json to verify local environment and dependency readiness before implementation.
gait gate eval --policy <policy.yaml> --intent <intent.json> --json for policy-story contract checks.
gait pack verify <artifact.zip> --json for artifact-story integrity checks.
Contract Discipline Rules
- If a story changes public CLI/SDK/schema surfaces, update the 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
- Golden fixtures
- Compatibility/migration tests
make test-contracts
- CLI behavior changes (flags/JSON/exits):
- Command tests in
cmd/gait/*_test.go
- JSON output stability tests
- Exit-code contract tests
- Gate/policy/fail-closed changes:
- Deterministic allow/block/require_approval fixture tests
- Fail-closed undecidable-path tests
- Stable reason-code tests
- Determinism/hash/sign/packaging changes:
- Repeat-run byte-stability tests
- Canonicalization/digest stability tests
- Verify/diff determinism checks
make test-packspec-tck when relevant
- Job runtime/state/concurrency changes:
- Lifecycle tests (submit/checkpoint/pause/resume/cancel)
- Atomic-write/crash-safety tests
- Contention/concurrency tests
- Chaos tests when scoped
- SDK/adapter boundary changes:
- Wrapper behavior/error-mapping tests
- Adapter parity/conformance tests
make test-adapter-parity when relevant
- Voice/context evidence 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 operator flow changes
Test Matrix Wiring (Enforcement)
Each 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: ensure Linux/macOS/Windows-safe behavior for touched surfaces
- Risk lane: determinism/safety/security/perf suites as required by story
No story is complete without passing its mapped lanes.
Surgical Docs Sync Rule
If a story introduces user-visible behavior changes, 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 story is internal-only and behavior is unchanged, do not force doc churn.
Safety Rules
- Preserve non-negotiables: determinism, offline-first, fail-closed, schema stability, stable exit codes.
- Never weaken non-allow => non-execute paths.
- No destructive git operations unless explicitly requested.
- No auto-commit or auto-push.
- Keep changes story-scoped; no unrelated refactors.
Quality Rules
- Facts must be backed by command/test evidence.
- Do not claim tests ran if they did not.
- No silent skips of required checks.
- Tests must use temp output paths (no artifact leakage into source tree).
- If code/docs drift is introduced by user-facing change, 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 the blocked story.
- Report exact blocker and impacted 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.
- Story acceptance criteria are satisfied with evidence.
- Plan
Definition of Done is satisfied.
- Plan
Exit Criteria is satisfied.
- Required matrix lanes and CodeQL are passing.
Expected Output
Execution summary: completed/deferred/blocked stories
Change log: files modified per story
Validation log: commands and pass/fail results
Revalidation report: story acceptance + DoD + exit criteria (met/not met with evidence)
Residual risk: remaining gaps and next required stories
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: plan-implement3description: Implement a Gait backlog plan end-to-end from product/PLAN_NEXT.md (or a specified plan), with strict branch bootstrap, per-story test wiring, CodeQL validation, and final DoD/acceptance revalidation. No issue/PR automation. Use when this capability is needed.4---56# Plan Implementation (Gait)78Execute this workflow for: "implement the plan", "execute PLAN_NEXT", "ship plan stories", or "run backlog implementation end-to-end."910## Scope1112- Repository: `/Users/tr/gait`13- Default input plan: `/Users/tr/gait/product/PLAN_NEXT.md`14- Optional input plan: user-specified file under `/Users/tr/gait/product/`15- This skill executes code/docs/tests for planned stories.16- Out of scope by default:17- GitHub issue creation18- PR creation19- Automated comments/discussions20- Auto-commit/auto-push2122## Preconditions2324- Plan file exists and is readable.25- Plan includes:26- `Global Decisions (Locked)`27- `Exit Criteria`28- `Test Matrix Wiring`29- Story-level `Tasks`, `Repo paths`, `Run commands`, `Test requirements`, `Matrix wiring`, `Acceptance criteria`30- If required sections are missing, stop and report blockers.3132## Git Bootstrap Contract (Mandatory)3334Before implementation starts, run in order:35361. `git fetch origin main`372. `git checkout main`383. `git pull --ff-only origin main`394. `git checkout -b codex/<plan-scope>`4041Rules:42- If working tree is dirty before step 1, stop and report blocker for user decision.43- If unexpected changes appear during implementation, stop immediately and ask how to proceed.44- Do not switch to other branches unless user explicitly requests it.4546## Workflow47481. Parse plan and build execution queue:49- Follow `Minimum-Now Sequence` first.50- Respect dependencies and `P0 -> P1 -> P2`.51- Respect any explicit `Wave 1` before `Wave 2` sequencing in the plan.52532. Run baseline before first code change:54- `make lint-fast`55- `make test-fast`56- Record failures as `pre-existing` vs `introduced`.57583. Execute one story at a time:59- Implement only scoped story changes.60- Keep orchestration thin when story scope touches architecture; move parsing, persistence, reporting, or policy logic into focused packages instead of coordinator layers.61- Make side effects explicit in API names/signatures and preserve symmetric semantics unless the distinction is intentionally named.62- Update tests required by story type.63- Update docs surgically only if user-facing behavior changed.64- Do not start next story until current story is validated.65664. Validate story completion:67- Run story `Run commands`.68- Run story `Test requirements`.69- Run story `Matrix wiring` lanes.70- If anything required is skipped, mark story incomplete.71725. Run epic-level validation after each epic:73- Execute relevant integration/acceptance suites for impacted surfaces.74756. Run final plan-level validation:76- `make prepush-full` (preferred, includes CodeQL), or77- `make prepush` and `make codeql` explicitly.78- Never finish without CodeQL unless user explicitly waives it.79807. Revalidate implementation against plan contracts:81- Re-check every implemented story against acceptance criteria.82- Re-check plan `Definition of Done`.83- Re-check plan `Exit Criteria`.84- Produce a `met/not met` checklist with command evidence for each item.8586## Command Anchors8788- `gait doctor --json` to verify local environment and dependency readiness before implementation.89- `gait gate eval --policy <policy.yaml> --intent <intent.json> --json` for policy-story contract checks.90- `gait pack verify <artifact.zip> --json` for artifact-story integrity checks.9192## Contract Discipline Rules9394- If a story changes public CLI/SDK/schema surfaces, update the stable/internal/deprecated surface notes in the same change.95- If versioning or schema compatibility behavior changes, document what is breaking vs additive and the migration expectation in the same story.96- If errors cross CLI or SDK boundaries, preserve structured machine-readable errors and stable mappings.97- If a story touches long-running workflows, verify cancellation and timeout propagation end-to-end.98- If enterprise customization pressure appears in scope, prefer explicit extension points over fork-only designs when feasible.99- For user-facing docs, explain integration hooks before internals and keep `README.md`, repo docs, and generated/public docs in sync.100101## Test Requirements by Work Type (Mandatory)1021031. Schema/artifact contract changes:104- Schema validation tests105- Golden fixtures106- Compatibility/migration tests107- `make test-contracts`1081092. CLI behavior changes (flags/JSON/exits):110- Command tests in `cmd/gait/*_test.go`111- JSON output stability tests112- Exit-code contract tests1131143. Gate/policy/fail-closed changes:115- Deterministic allow/block/require_approval fixture tests116- Fail-closed undecidable-path tests117- Stable reason-code tests1181194. Determinism/hash/sign/packaging changes:120- Repeat-run byte-stability tests121- Canonicalization/digest stability tests122- Verify/diff determinism checks123- `make test-packspec-tck` when relevant1241255. Job runtime/state/concurrency changes:126- Lifecycle tests (submit/checkpoint/pause/resume/cancel)127- Atomic-write/crash-safety tests128- Contention/concurrency tests129- Chaos tests when scoped1301316. SDK/adapter boundary changes:132- Wrapper behavior/error-mapping tests133- Adapter parity/conformance tests134- `make test-adapter-parity` when relevant1351367. Voice/context evidence changes:137- `make test-voice-acceptance` and/or `make test-context-conformance` as applicable1381398. Docs/examples changes:140- `make test-docs-consistency`141- `make test-docs-storyline` when operator flow changes142143## Test Matrix Wiring (Enforcement)144145Each story must map to and run required lanes:146147- Fast lane: `make lint-fast`, `make test-fast`148- Core lane: targeted unit/integration suites149- Acceptance lane: relevant `make test-*-acceptance` targets150- Cross-platform lane: ensure Linux/macOS/Windows-safe behavior for touched surfaces151- Risk lane: determinism/safety/security/perf suites as required by story152153No story is complete without passing its mapped lanes.154155## Surgical Docs Sync Rule156157If a story introduces user-visible behavior changes, update only impacted docs in the same story:158159- `/Users/tr/gait/README.md`160- `/Users/tr/gait/docs/`161- `/Users/tr/gait/docs-site/public/llms.txt`162- `/Users/tr/gait/docs-site/public/llm/*.md`163- `/Users/tr/gait/CONTRIBUTING.md`164- `/Users/tr/gait/CHANGELOG.md`165- `/Users/tr/gait/CODE_OF_CONDUCT.md`166- `/Users/tr/gait/SECURITY.md`167- `/Users/tr/gait/.github/ISSUE_TEMPLATE/`168- `/Users/tr/gait/.github/pull_request_template.md`169170If story is internal-only and behavior is unchanged, do not force doc churn.171172## Safety Rules173174- Preserve non-negotiables: determinism, offline-first, fail-closed, schema stability, stable exit codes.175- Never weaken non-allow => non-execute paths.176- No destructive git operations unless explicitly requested.177- No auto-commit or auto-push.178- Keep changes story-scoped; no unrelated refactors.179180## Quality Rules181182- Facts must be backed by command/test evidence.183- Do not claim tests ran if they did not.184- No silent skips of required checks.185- Tests must use temp output paths (no artifact leakage into source tree).186- If code/docs drift is introduced by user-facing change, patch docs in same story.187- Keep README first-screen coverage crisp: what it is, who it is for, how it integrates, and how to get value quickly.188- Keep one docs source of truth and update generated/public derivatives in the same story.189190## Blocker Handling191192If blocked:1931941. Stop the blocked story.1952. Report exact blocker and impacted acceptance criteria.1963. Continue only independent unblocked stories.1974. End with minimum unblock actions.198199## Completion Criteria200201Implementation is complete only when all are true:202203- All non-blocked in-scope stories are implemented.204- Story acceptance criteria are satisfied with evidence.205- Plan `Definition of Done` is satisfied.206- Plan `Exit Criteria` is satisfied.207- Required matrix lanes and CodeQL are passing.208209## Expected Output210211- `Execution summary`: completed/deferred/blocked stories212- `Change log`: files modified per story213- `Validation log`: commands and pass/fail results214- `Revalidation report`: story acceptance + DoD + exit criteria (`met/not met` with evidence)215- `Residual risk`: remaining gaps and next required stories216217---218> Converted and distributed by [TomeVault](https://tomevault.io/claim/clyra-ai) — claim your Tome and manage your conversions.219<!-- tomevault:4.0:skill_md:2026-04-13 -->