一键导入
repo-harness
routes repo-harness requests through the CLI and hook automation plugin for init, update, scaffold, migrate, audit, repair, and ship workflows
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
routes repo-harness requests through the CLI and hook automation plugin for init, update, scaffold, migrate, audit, repair, and ship workflows
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Resolves repo-harness architecture drift requests and updates architecture docs or diagrams without running full init, migrate, or upgrade.
Adds or syncs explicit repo-local capability boundaries without running full repo-harness init, migrate, or upgrade.
Verification entrypoint for repo-harness workflow readiness. Runs workflow gates, task sync, contract checks, inspector, and migration dry-run before merge or release.
Installs or refreshes the repo-harness workflow in an existing repository. Adds hooks, docs/spec.md, tasks, plans, .ai/context, .ai/harness, helpers, and policy without creating an application stack.
Migrates older Claude/Codex workflow repos to the current tasks-first harness while preserving or archiving user-authored docs and hooks.
Generates an AI-implementation-friendly PRD from a product idea into plans/prds/, with tiered sections, evidence rules, and sprint-consumable structure.
| name | repo-harness |
| description | routes repo-harness requests through the CLI and hook automation plugin for init, update, scaffold, migrate, audit, repair, and ship workflows |
| when_to_use | repo-harness, initialize repo-local agentic development harness, scaffold new project with repo-harness, migrate repo-local agentic development harness, audit repo-local agentic development harness, repair repo-local agentic development harness |
repo-harness is the CLI and hook automation plugin for repo-local agentic
development. The skill entrypoint is a compatibility router over the versioned
workflow engine and CLI command facades.
Compatibility boundary:
repo-harnessrepo-harness-scaffold (secondary generator)The former repo-harness-skill and project-initializer aliases have been
fully removed. They are no longer recognized, synced, or cleaned up by any
tooling. Historical markers left behind in long-migrated repos are inert
evidence and are not handled.
The skill should not carry the whole workflow contract in prose. It should:
repo-harness-init,
repo-harness-migrate, repo-harness-upgrade, or repo-harness-repairAlways start with structured inspection, not prompt guessing.
Run:
bun scripts/inspect-project-state.ts --repo <path> --format text
node --experimental-strip-types scripts/inspect-project-state.ts --repo <path> --format textRead the result fields:
modelegacy_contract_versiondrift_signalsrequired_decisionssafe_defaultsIf the request maps to a public command facade, name that route before running
checks or edits, then read the matching
assets/skill-commands/<repo-harness-command>/SKILL.md and follow that
facade's protocol. For example, pre-merge or release readiness requests route
to repo-harness-check, while broken task sync, hook routing, handoff, context,
policy, or helper surfaces route to repo-harness-repair.
repo-harness-scaffoldai_native_profileDefault order:
external_tooling profile into .ai/harness/policy.jsonDo not treat hooks as the primary source of truth. The repo contract lives in repo files.
The single machine-readable contract source is:
assets/workflow-contract.v1.jsonThe installed runtime copy inside a repo is:
.ai/harness/workflow-contract.jsonThe main engine entrypoints are:
scripts/inspect-project-state.tssrc/core/adoption/standard-plan.tssrc/effects/fs-transaction.tsscripts/check-agent-tooling.shscripts/check-task-workflow.shscripts/create-project-dirs.shThe command facades live in assets/skill-commands/ as compatibility wrappers
over the same CLI and hook engine. Use them for routing when the host discovers
skills; the implementation authority stays in the CLI, scripts, hooks, and
contract files:
repo-harness-plan: interactive planning; no repo mutation by defaultrepo-harness-review: plan review across product, engineering, design, and DevExrepo-harness-autoplan: automatic plan -> self-review twice -> implementation -> check -> ship pipelinerepo-harness-ship: validate finished worktrees, push branches, and create PRs by defaultrepo-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 readinessrepo-harness-prd: generate an upper-layer PRD in plans/prds/repo-harness-sprint: plan a sprint backlog in plans/sprints/ from a PRD or source spec, then expand each row with $think before the task-contract flowrepo-harness-goal / repo-harness:goal: prepare a Codex/Claude /goal prompt from detailed PRD or Sprint artifacts; request those documents before starting when missingrepo-harness-gptpro-setup / repo-harness:gptpro_setup: guide gptpro_browser ChatGPT Web browser/session setup and gptpro_mcp ChatGPT Connector MCP setup without treating GPT Pro as API quotarepo-harness-gptpro / repo-harness:gptpro: consult or continue GPT Pro through the local ChatGPT Web browser/session bridge while presenting gptpro consult/read/continue/open wording over the underlying browser-* engine commandsInternal steps such as hooks-init, docs-init, and create-project-dirs are
not public commands. They stay behind init, scaffold, migrate, and
upgrade so users choose intent instead of implementation details.
Keep A-K as stable scaffold codes, but route them as stack-family handles, not product prescriptions. Choose by frontend shell, backend/runtime boundary, deployment target, data authority, and sidecar needs first. Product domains such as finance, CRM, Web3, healthcare, and commerce are overlays.
Core Plans (A-F), routed as stack families:
/
and authenticated or browser-heavy workspace routes under /app. Use
route-level ssr: false for /app; Next.js is not a default recommendation.Custom Presets (G-K), routed as sidecar/runtime families:
uv, FastAPI or Pydantic AI,
DuckDB/Polars, evals, and artifact storage behind the app gateway.Agent runtimes that need stable Node APIs, long-lived processes, local tools, or heavier sidecars should default to VPS deployment behind the Hono gateway, not Cloudflare Workers. Cloudflare remains the preferred web/edge delivery surface, not the mandatory agent execution environment.
repo-harness-scaffold keeps A-K as the stack-family catalog and uses
ai_native_profile as a separate overlay axis. The default profile is none,
so generated output stays on the selected family unless the user asks for agentic
runtime behavior. Use an overlay only when the generated app needs agent UI,
streaming protocol, tool boundary, sidecar, shared state, approvals, artifacts,
or observability.
Supported profile IDs live in assets/initializer-question-pack.v4.json.
Current stack guidance:
/ SSR/prerender-capable and /app client-only.apps/marketing plus apps/web as the default answer to
SEO/SSR. Treat a static marketing app as explicit legacy/rollback or content
scope, not as the normal SaaS webapp split.Generated structure overlays currently exist for:
runtime-console: assistant-ui/AG-UI run console, Bun/Hono agent gateway,
run store, contracts, approvals, artifacts, replay, 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 jobscollaborative-editor: editor surface with document contracts, CRDT/sync
ownership, and user-visible agent action boundariesDo not turn AI-native overlays into more lettered plans. Do not make A2UI, specific model providers, vector DBs, workflow engines, tracing vendors, or sidecar languages mandatory defaults.
Scaffold is not an existing-repo adoption path. If the target already has a
product tree, use repo-harness-init, repo-harness-migrate,
repo-harness-upgrade, or repo-harness-repair and preserve the existing app
shape. create-project-dirs, hooks-init, and docs-init remain internal
steps behind public commands, not standalone user-facing scaffold aliases.
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.mdUse repo-harness adopt --repo <path> --dry-run to inspect the complete transaction, then repo-harness adopt --repo <path> to apply it.
Migration defaults:
docs/PROGRESS.md content; do not regenerate it as a default workflow surfacetasks/todos.md limited to deferred medium/long-term goals, including the tradeoff and revisit triggerdocs/researches/*.mdtasks/lessons.mdexternal_tooling defaults into .ai/harness/policy.json without overwriting explicit user valuesrepo-harness init bootstrap the required global runtime in one pass:
CLI install, repo-harness runtime alias sync, user-level hook adapters, Waza
(think, hunt, check, health), Mermaid, brain root persistence, and
CodeGraph CLI/MCP configuration~/.codex/skills is the Codex runtime source, ~/.agents/skills is only skills CLI staging/cache, and updates require stage -> copy to Codex -> cmp verificationPreserve these semantics:
plans/ is the timestamped plan catalog; .ai/harness/active-plan selects the active plan, with .claude/.active-plan as a legacy fallback during transitionplans/plan-*.md must 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/todos.md is the deferred-goal ledger; active execution stays in the plan's ## Task Breakdowntasks/lessons.md stores correction-derived rulesdocs/researches/*.md stores deep repo findings and hidden contracts by topictasks/contracts/ and tasks/reviews/ are completion gatestasks/contracts/*.contract.md must repeat the workflow inventory and make allowed_paths the edit-scope authoritytasks/workstreams/ stores durable capability progressdocs/CHANGELOG.md stores release historyassets/hooks/ is the installable hook product source; .ai/hooks/ is a full live runtime only in repos that pin "hook_source": "repo"~/.claude/settings.json and ~/.codex/hooks.json are the host adapter surfaces; repo-local .claude/hooks/, .claude/settings.json, and .codex/hooks.json are legacy cleanup targetsWhen 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.repo-harness-hook; .ai/hooks/
is a full repo-local implementation only when "hook_source": "repo" is pinned.~/.claude/settings.json and ~/.codex/hooks.json are adapters
that dispatch to repo-harness-hook or the compatibility repo-harness hook
route..claude/hooks/, repo-local .claude/settings.json, and repo-local
.codex/hooks.json are legacy cleanup targets; preserve only user-authored
custom-*.sh hooks.Trace one real event before changing behavior, for example:
UserPromptSubmit -> adapter -> repo-harness-hook -> prompt-guard.sh -> plan or advisory output
or:
PostToolUse(Edit|Write) -> adapter -> repo-harness-hook -> post-edit-guard.sh -> architecture drift, brain sync, contract verification, task handoff
For Codex hook failures, debug in this order: user-level ~/.codex/hooks.json,
Codex Settings trust, repo-harness-hook resolution, the active 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. The retired
autoresearch-advisory.sh hook is not part of .ai/hooks, user-level adapters,
or installable hook templates. If autoresearch evidence is needed, the agent
runs it explicitly and keeps local run products under ignored autoresearch/
when they must remain in the workspace.
Verify hook workflow changes with hook-specific evidence:
assets/hooks/ and .ai/hooks/, with
no self-host-only hook exclusionsbun 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 readbackThis skill may create or update:
AGENTS.mdAGENTS.md.ai/hooks/*.claude/settings.json.codex/hooks.json.claude/templates/*docs/spec.mddocs/reference-configs/*.mdtasks/todos.mdtasks/lessons.mddocs/researches/*tasks/contracts/*tasks/reviews/*tasks/workstreams/*deploy/README.mddeploy/sql/* for ordered deployment SQL files.ai/harness/*scripts/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
bun src/cli/index.ts adopt --repo . --dry-run
For migration-focused work, inspect state and the canonical dry-run explicitly:
bun scripts/inspect-project-state.ts --repo . --format text
bun src/cli/index.ts adopt --repo . --dry-run
docs/reference-configs/evals/evals.json