| name | repo-harness-repair |
| description | Repairs a broken current harness, including task sync, hook routing, handoff, context-map, policy, helper, and generated/runtime drift. |
| when_to_use | repo-harness-repair, repair broken agentic workflow, fix task sync, fix hook routing, fix handoff, repair .ai harness, repair context-map |
repo-harness-repair
Use this command when the repo has a harness but a specific workflow surface is broken.
Protocol
- Reproduce the failure and name the failing surface.
- Run
bun scripts/inspect-project-state.ts --repo <repo> --format text.
- Trace the failing path, such as
settings.json -> .ai/hooks/run-hook.sh -> .ai/hooks/* or plans/ -> tasks/todos.md -> tasks/contracts/.
- Apply the smallest targeted fix.
- Re-run the failing check and the relevant workflow gate.
Failure Modes
- If the repo lacks a current harness, route to
repo-harness-init or repo-harness-migrate.
- If the broken path is release readiness, route to
repo-harness-check.
- If the failure cannot be reproduced, report the missing evidence and stop before editing.
Boundaries
- Do not use repair to migrate a legacy repo; route legacy contract drift to
repo-harness-migrate.
- Do not use repair to scaffold product code.
- Preserve unrelated dirty worktree changes.