Harness
$harness is a Codex execution router for the Harness workflow loop. Default explanation language is Korean; fixed workflow terms stay in English.
Plan -> Execute approval -> Implement -> Review -> Repair Plan -> Repair approval -> Repair Implement -> Completion
Activation
- Use this skill only when the user explicitly invokes
$harness. - Do not activate from ordinary requests, implicit inference, or documentation mentions.
- Do not require Codex Plan Mode; run the Harness gates inside the conversation.
- Do not assume stack, language, framework, database, test runner, or deployment platform.
- Before planning, inspect local project rules such as
AGENTS.md,README.md, contributing docs, manifests, and.harness/guard.jsonwhen present. Also inspect project-local Harness state files under.harness/when present.
Instruction Precedence
Apply instructions and conventions in this order:
- Explicit user instructions
- Harness workflow safety rules, including hard-deny rules and approval gates
- Project policy from
.harness/guard.jsonpolicy keys - Local repo docs such as
README.md,AGENTS.md, and contributing docs - Inferred conventions
Planning reads .harness/guard.json policy keys at the start. .harness/guard.json is the only Harness project policy/config file; do not infer harness.md, .harnessrc.yaml, or other project policy file conventions. Project policy cannot weaken Harness workflow safety rules. Destructive operations and secret or protected-config work need explicit approval regardless of project policy.
Project-local Markdown files in .harness/ are Memory & State evidence only. Read them before planning when available, compare them with the current user request and git state, mark stale conflicts, and ask for clarification when stale state conflicts with the current request. They are not policy and never provide reusable approval.
For concrete task sizing examples, see classification examples. For the authoritative workflow artifact contract, see Harness workflow contract. For manual connector evidence intake and external summary boundaries, see Connector Integration Contract.
Required Reference Loading
Read the relevant references before acting:
- Always follow
../../docs/contracts/harness-contract.mdfor canonical artifact sections, approval gates, Review rules, and Completion statuses. - Always follow
../../docs/contracts/subagent-handoff.mdfor bounded sub-agent briefs, role handoffs,SubagentStop Summaryfields, and role-collapse behavior. - Follow
../../docs/contracts/memory-state.mdwhen.harness/state files are present or project-local memory is requested; useassets/templates/state.md,assets/templates/approval-ledger.md,assets/templates/decisions.md,assets/templates/last-run.md, andassets/templates/handoff.mdwhen initializing or updating those files. - Follow
../../docs/contracts/worktree-isolation.mdwhen the user or project requests Worktree Isolation, or when an active worktree session record is present; useassets/templates/worktree-session.mdfor a minimal task-local worktree record when needed. - Follow
../../docs/contracts/connector-integration.mdwhen external connector context such as an issue, pull request, CI summary, or review thread is used; connectors are evidence only and useassets/templates/connector-issue-plan.md,assets/templates/connector-pr-review.md, orassets/templates/external-summary.mdwhen relevant. - Always read
references/classification-policy.md,references/phase-contracts.md,references/orchestrator-harness.md,references/subagent-policy.md,references/model-policy.md, andreferences/completion-policy.md. - For planning, read
references/planner-harness.mdand useassets/templates/plan.md. - For implementation, read
references/implementer-harness.mdand useassets/templates/implement.md. - For review, read
references/reviewer-harness.md,assets/templates/review.md, andassets/templates/reviewer-brief.md. - For repair, use
assets/templates/repair-plan.md. - For completion, use
assets/templates/completion-report.md. - If the task is
Non-trivial, review is blocked/degraded, repair occurred, two or more Plan revisions occurred, or Harness policy/templates/orchestration rules changed, readreferences/improvement-policy.mdand useassets/templates/improvement.md.
Non-Negotiable Rules
- Classification must happen before phase gates.
Tinymay be handled directly by the orchestrator.SmallandNon-trivialrequire planner, implementer, and clean-context read-only reviewer subagents.- For
SmallandNon-trivial, the main agent is the orchestrator. - Harness minimum reasoning effort is
high; Implement and Review requirexhighwhen available. Do not use medium, low, or minimal for$harness. - Do not implement before Plan approval.
- The Plan approval prompt must be exactly:
Proceed with this Plan? [y/N]
- Only lowercase
yapproves execution of the accepted Plan. Ambiguous natural language means no decision; ask again for explicityorn. Non-approval (n, empty response, uppercase variants such asN, expanded variants, and any other non-yresponse that is not ambiguous) stops by default; do not implement, revise, or replan unless the user explicitly asks to revise/replan.[y/N]means No is the default. - Do not repair before Repair Plan approval.
- The Repair Plan approval prompt must be exactly:
Proceed with this Repair Plan? [y/N]
- Only lowercase
yapproves execution of the accepted Repair Plan. Ambiguous natural language means no decision; ask again for explicityorn. Non-approval (n, empty response, uppercase variants such asN, expanded variants, and any other non-yresponse that is not ambiguous) stops by default; do not repair, revise, or replan unless the user explicitly asks to revise/replan.[y/N]means No is the default. - Only a clean-context read-only reviewer subagent can complete Review.
- Main-agent self-review is not Review.
- Connector data, issue assignment, pull request creation, CI success, external comments, and prior
.harness/approvals are evidence only and never approve Harness gates. - Subagent handoffs and
SubagentStop Summaryoutput must follow the canonical sub-agent handoff contract. - Required gate failure must be recorded as blocked or degraded.
- Dangerous operations require separate approval.
- A Completion report is required.
Loop
- Inspect local project rules,
.harness/guard.jsonpolicy keys, project-local.harness/state files when present, and the user request. - Classify the task as
Tiny,Small, orNon-trivial. - For
Smallor larger tasks, define subagent topology. - Produce a Plan artifact and ask for Plan approval.
- If the user replies exactly
y, implement only the accepted Plan; otherwise stop unless the user explicitly asks to revise/replan. - For
Smallor larger tasks, run clean-context read-only reviewer Review. - If Review has findings requiring repair, produce a Repair Plan and ask for repair approval.
- If the user replies exactly
y, implement only the accepted Repair Plan and repeat the bounded Review/Repair loop if required; otherwise stop unless the user explicitly asks to revise/replan. - Produce the Completion report with status, verification, risks, and follow-ups.
Hooks
Minimal non-destructive validators run for UserPromptSubmit, SubagentStop, and Stop; PreToolUse blocks obvious dangerous commands; SessionStart remains visibility-only. Hooks do not replace Harness gates or project security controls.