Resources
9Install
npx skillscat add ancienttwo/repo-harness Install via the SkillsCat registry.
repo-harness
repo-harness is the repo-local agentic development harness skill, formerly repo-harness-skill.
It is a thin router over a versioned workflow engine.
Compatibility boundary:
- internal engine: tasks-first harness
- contract ID: tasks-first-harness-v1
- compatibility alias:
repo-harness-skill - retired install aliases:
project-initializerunder~/.codex/skillsand~/.claude/skills
The skill should not carry the whole workflow contract in prose. It should:
- inspect the repository
- classify the workflow state
- choose the correct path
- rely on the repo contract, migration scripts, and tests for enforcement
When to use
- initialize a new repo with Codex/Codex-compatible workflow scaffolding
- migrate an older repo to the current tasks-first harness
- audit drift between prompts, hooks, scripts, and repo-local contract files
- repair broken task-sync, workflow-contract, or handoff surfaces
When not to use
- runtime bug debugging inside an already healthy AI workflow
- generic project scaffolding unrelated to AI routing or repo-local workflow contracts
- ordinary product feature work
Router Protocol
Always start with structured inspection, not prompt guessing.
Step 1. Inspect first
Run:
bun scripts/inspect-project-state.ts --repo <path> --format text- fallback:
node --experimental-strip-types scripts/inspect-project-state.ts --repo <path> --format text
- fallback:
Read the result fields:
modelegacy_contract_versiondrift_signalsrequired_decisionssafe_defaults
Step 2. Choose one path
- Initialize
- use when the repo has no meaningful tasks-first workflow yet
- Migrate
- use when the repo has legacy workflow docs, missing contract manifest, or stale harness artifacts
- Audit
- use when the repo mostly works but the user wants drift analysis and enforcement review
- Repair
- use when the repo has a current contract surface but broken task-sync, hooks, or handoff behavior
Step 3. Prefer engine actions over prompt-only fixes
Default order:
- migrate legacy docs if needed
- install or refresh workflow contract artifacts
- sync hooks, helpers, and templates
- merge the guidance-only
external_toolingprofile into.ai/harness/policy.json - verify the repo-local contract
Do not treat hooks as the primary source of truth. The repo contract lives in repo files.
Core Engine Surfaces
The single machine-readable contract source is:
assets/workflow-contract.v1.json
The installed runtime copy inside a repo is:
.ai/harness/workflow-contract.json
The main engine entrypoints are:
scripts/inspect-project-state.tsscripts/migrate-workflow-docs.tsscripts/migrate-project-template.shscripts/check-agent-tooling.shscripts/check-task-workflow.shscripts/create-project-dirs.sh
Action Command Surface
The public command skills live in assets/skill-commands/ as thin facades over
the same engine. Use action-style names for discoverability:
repo-harness-plan: interactive planning; no repo mutation by defaultrepo-harness-review: plan review across product, engineering, design, and DevExrepo-harness-autoplan: automatic plan -> review -> decision summary pipelinerepo-harness-init: install or refresh the harness in an existing reporepo-harness-scaffold: create a new project or module scaffold, then attach the harnessrepo-harness-migrate: migrate legacy workflow docs and stale harness artifactsrepo-harness-upgrade: refresh an installed harness through manifest-owned upgrade actionsrepo-harness-capability: add selected capability boundaries without running full init/migrate/upgraderepo-harness-architecture: resolve architecture drift requests and update docs or diagrams without harness refreshrepo-harness-handoff: prepare or resume Codex handoff packets for long-task rolloverrepo-harness-deploy: check deploy and private operations configuration without publishing or deployingrepo-harness-repair: repair broken task sync, hook routing, handoff, context, policy, or helpersrepo-harness-check: run verification gates and report release or pre-merge readiness
Internal steps such as hooks-init, docs-init, and create-project-dirs are
not public commands. They stay behind init, scaffold, migrate, andupgrade so users choose intent instead of implementation details.
Plan Index
The router should still respect the canonical plan catalog in assets/plan-map.json:
Core Plans (A-F):
- Plan A: Remix
- Plan B: UmiJS + Ant Design Pro
- Plan C: Vite + TanStack Router
- Plan D: Bun + Turborepo
- Plan E: Astro landing page
- Plan F: Expo + NativeWind
Custom Presets (G-K):
- Plan G: AI quantitative trading
- Plan H: Financial trading / FIX / RFQ
- Plan I: Web3 DApp
- Plan J: AI coding agent / TUI
- Plan K: Fully custom configuration
AI-native scaffold overlay
repo-harness-scaffold keeps A-K as the project-type catalog and usesai_native_profile as a separate overlay axis. The default profile is none,
so existing generated output stays on the selected A-K plan. Use an overlay only
when the generated app needs agent runtime, UI protocol, tool, sidecar, state,
or observability boundaries.
Supported profile IDs live in assets/initializer-question-pack.v4.json.
Generated structure overlays currently exist for:
runtime-console: Vite 8 + assistant-ui, AG-UI event transport, Bun/Hono
agent gateway, run store, contracts, approvals, artifacts, and telemetryproduct-copilot: in-product copilot panel, AG-UI app-domain events, product
context loaders, business action tools, authorization and approval policiessidecar-kernel: Bun/Hono app gateway with Python, Go, or Rust kernels behind
MCP tools or narrow HTTP jobs
Do not turn the AI-native overlay into another lettered plan. Do not make A2UI,
Python, Go, Rust, Redis, ClickHouse, Temporal, object storage, vector DBs, model
providers, or tracing vendors mandatory defaults.
Migration Rules
For legacy repos, migrate old document surfaces before refreshing templates.
Legacy paths include:
docs/plan.mddocs/TODO.mddocs/PROGRESS.mddocs/contract.mddocs/review.mddocs/handoff.mdHANDOFF.md
Use:
bun scripts/migrate-workflow-docs.ts --repo <path> --dry-runbun scripts/migrate-workflow-docs.ts --repo <path> --apply
Migration defaults:
- preserve user-authored content
- archive uncertain legacy content instead of guessing
- remove repo-local Skill Factory and auto-memory surfaces when present
- archive legacy
docs/PROGRESS.mdcontent; do not regenerate it as a default workflow surface - keep
tasks/todo.mdlimited to deferred medium/long-term goals, including the tradeoff and revisit trigger - move hidden contracts and deep findings into
tasks/research.md - distill repeated corrections into
tasks/lessons.md - merge missing
external_toolingdefaults into.ai/harness/policy.jsonwithout overwriting explicit user values - keep gstack/gbrain/CodeGraph detection advisory-only; do not auto-install, auto-upgrade, auto-sync, or auto-enable MCP
- let
repo-harness initbootstrap required Codex/Claude runtime skills in one pass: Waza (check,design,health,hunt,learn,read,think,write) plusdiagram-designwhen a source copy exists - treat Waza as Codex-first:
~/.codex/skillsis the Codex runtime source,~/.agents/skillsis only skills CLI staging/cache, and updates require stage -> copy to Codex ->cmpverification
Repo-Local Contract
Preserve these semantics:
plans/is the timestamped plan catalog;.ai/harness/active-planselects the active plan, with.claude/.active-planas a legacy fallback during transitionplans/plan-*.mdmust carry a workflow inventory before implementation: active plan, owning worktree, contract, review, notes, deferred ledger, checks, run snapshots, scope owner, switching rule, and worktree isolation pathtasks/todo.mdis the deferred-goal ledger; active execution stays in the plan's## Task Breakdowntasks/lessons.mdstores correction-derived rulestasks/research.mdstores deep repo findings and hidden contractstasks/contracts/andtasks/reviews/are completion gatestasks/contracts/*.contract.mdmust repeat the workflow inventory and makeallowed_pathsthe edit-scope authoritytasks/workstreams/stores durable capability progressdocs/CHANGELOG.mdstores release history.ai/hooks/is the shared hook source of truth.claude/settings.jsonis the Claude adapter surface;.codex/hooks.jsonis the Codex adapter surface; repo-local.claude/hooks/is not generated by default
Hook Workflow Protocol
When the task mentions hooks, hook workflow, Codex hook detection, or hook-based
automation, treat it as a runtime-harness slice, not a generic config edit.
Map the route first:
assets/hooks/is the installable source..ai/hooks/is the repo-local implementation..claude/settings.jsonand.codex/hooks.jsonare adapters that dispatch to.ai/hooks/run-hook.sh.- Codex also requires the repo hook to be trusted in Codex Settings before it
executes. - Generated
.claude/hooks/shims are legacy cleanup targets; preserve only
user-authoredcustom-*.shhooks.
Trace one real event before changing behavior, for example:
UserPromptSubmit -> adapter -> .ai/hooks/run-hook.sh -> prompt-guard.sh -> plan or advisory output
or:
PostToolUse(Edit|Write) -> adapter -> .ai/hooks/run-hook.sh -> post-edit-guard.sh -> architecture drift, brain sync, contract verification, task handoff
For Codex hook failures, debug in this order: .codex/hooks.json, Codex Settings
trust, .ai/hooks/run-hook.sh, the target hook script, then .ai/harness/events.jsonl
or .claude/.trace.jsonl evidence.
Hooks are accelerators and guards. They do not replace plans/, tasks/,
contracts, reviews, policy, checks, or handoff artifacts. Heavy workflows such as
autoresearch must not silently run as background hook mutations. A hook may detect
optimization intent, point to an existing autoresearch-*/session.json, or remind
the agent to record an experiment; the agent still owns baseline measurement,
candidate staging, scoring, and winner promotion.
Keep local autoresearch run products under ignored autoresearch/ when they
must remain in the workspace.autoresearch-advisory.sh is a self-host maintainer hook for this repo, not a
default installable user hook.
Verify hook workflow changes with hook-specific evidence:
- default hook asset parity between
assets/hooks/and.ai/hooks/, with
explicit exclusions only for self-host maintainer hooks bun test tests/hook-runtime.test.ts tests/workflow-contract.test.tsbash scripts/check-task-sync.shbash scripts/check-task-workflow.sh --strictbun scripts/inspect-project-state.ts --repo . --format text.ai/harness/checks/latest.json,.ai/harness/events.jsonl, or handoff readback
Output Ownership
This skill may create or update:
AGENTS.mdAGENTS.md.ai/hooks/*.claude/settings.json.codex/hooks.json.claude/templates/*docs/spec.mddocs/reference-configs/*.mdtasks/todo.mdtasks/lessons.mdtasks/research.mdtasks/contracts/*tasks/reviews/*tasks/workstreams/*deploy/README.mddeploy/sql/*for ordered deployment SQL files.ai/harness/*- helper scripts under
scripts/
Verification
When changing the engine, migration path, contract manifest, or self-hosted workflow, run:
bun test
bash scripts/check-deploy-sql-order.sh
bash scripts/check-task-sync.sh
bash scripts/check-task-workflow.sh --strict
bash scripts/migrate-project-template.sh --repo . --dry-runFor migration-focused work, also inspect and dry-run legacy doc migration explicitly:
bun scripts/inspect-project-state.ts --repo . --format text
bun scripts/migrate-workflow-docs.ts --repo . --dry-runIteration Notes
- Keep this file short; detailed policy belongs in
docs/reference-configs/ - Keep stack-specific detail in assets and references, not in this skill body
- If the router changes, update
evals/evals.json - If the contract changes, update templates, migration, checks, and tests together