craft-harness
Purpose
Build and maintain the agent harness around a real repo.
A harness is the set of files and installed capabilities that help coding agents work well in a project: root context, local context/rules, skills, commands, scripts, hooks, subagents, MCP/integrations, plugins, and external assets worth adopting.
This skill is not only for first setup. Use it across the harness lifecycle: bootstrap, task-fit, repair, sync, adopt, prune, and maintain.
Non-goals
- Not a global config manager.
- Not an installer or plugin publisher.
- Not a runtime framework.
- Not a replacement for the user's agent settings UI or marketplace flow.
- Default output is a repo-local plan, small repo-local markdown/skill edits, or reviewable asset recipes.
How it differs from related skills
craft-skill-spec designs one reusable artifact: a skill, skill suite, subagent, or plugin.
craft-harness decides what a repo's agent harness needs, where each piece belongs, and what to create, adopt, update, defer, or remove.
craft-survey studies prior art. craft-harness uses prior-art search as one step when buy-vs-build matters.
craft-critique reviews a prompt or skill without editing. craft-harness may use critique-style checks on the harness plan before applying changes.
Inputs
- the repo or task being supported
- current primary target, if any: Codex, Claude Code, or both
- observed agent failures or desired workflows
- existing harness files and commands
- constraints around edits, installs, hooks, MCP, plugins, or global config
If the user does not state a primary target, default to dual-target output with Codex as the current primary. Claude Code remains a first-class target, not a fallback.
Required reads
Before making recommendations:
- Inspect existing repo harness files first:
- shared root and local context files
- provider-specific skill, command, hook, subagent, MCP, plugin, and rules locations
- repo workflow files:
package.json, Makefile, CI config, scripts, docs
- Read
references/platform-surfaces.md when a recommendation touches provider-specific paths, hooks, subagents, MCP, plugins, or install locations.
- Read
references/dual-target-layout.md when the harness targets both Codex and Claude Code, uses .agents/ as shared source, or needs symlink/copy decisions.
- Read
references/hook-patterns.md when recommending, reviewing, pruning, or generating hooks.
- Read
references/eval-cases.md when drafting or validating craft-harness changes.
- Read adjacent CraftKit skills only when the recommendation would create or modify a prompt/skill artifact.
Do not inspect user/global config unless the user explicitly asks for personal or global harness work.
Lifecycle modes
Choose one primary mode and mention secondary modes when useful:
bootstrap - create the smallest useful harness for a repo with little setup.
task-fit - add harness support for a specific task, PR, workflow, or team convention.
repair - fix repeated agent failures by moving guidance to the right surface.
sync - align Codex and Claude Code surfaces when they drift.
adopt - evaluate external skills, plugins, MCPs, or integrations before building locally.
prune - remove stale, bloated, duplicated, or conflicting harness guidance.
maintain - reassess after model, tool, repo, or workflow changes.
Workflow
- State the harness mode and primary target. If tradeoffs conflict, prefer the user's current primary agent; otherwise prefer Codex while keeping Claude Code support explicit.
- Inventory the existing harness. Mark each relevant file or installed surface as
keep, update, missing, risky, or prune.
- Name the repeated agent jobs: navigation, implementation, review, verification, release, incident work, research, handoff, backlog work, external-tool work, or project onboarding.
- Choose placement for each need:
- root context for stable rules every task needs
- local context or path-scoped rules for directory-specific facts
- skill for reusable judgment workflow
- command for explicit manual shortcut
- script for deterministic checks that should be run on demand
- hook for deterministic lifecycle automation: either a community-proven guardrail candidate or a project-specific repeated miss where timing matters
- MCP/integration for structured access to an external system
- subagent for isolated exploration, review, or role separation
- plugin for installable multi-surface packaging
- external adoption when a maintained asset fits better than local invention
- no change when the existing harness is enough
- Run buy-vs-build when a new skill, plugin, MCP server, hook, or integration is plausible. Search or explicitly say why search was skipped. Use
adopt, fork/adapt, build local, or defer.
- Produce a patch plan before high-risk edits. Low-risk repo-local markdown and skill drafts may be edited when the user asked to make the change.
- Verify the harness with prompts or commands that exercise the intended behavior, not just static file syntax.
Risk gates
Low-risk repo-local edits may be made when the user asks for implementation:
- repo-local markdown guidance
AGENTS.md / CLAUDE.md bridge updates
- repo-local skill drafts
- repo-local docs and verification prompts
Require explicit approval before:
- adding or enabling hooks or hook scripts
- adding MCP servers or external integrations
- installing plugins or adding marketplaces
- editing user/global config
- creating write-capable subagents or custom agents
- adding commands that affect secrets, auth, deployment, or CI behavior
Defer by default:
- organization-managed policy
- plugin packaging and publishing
- broad agent-team factories
This skill may propose high-risk surfaces, but it does not install or enable them unless the user explicitly asks for that after seeing the plan. When proposing a hook, name the hook class, dry-run command, false-positive notes, and rollback steps. When proposing third-party adoption, inspect the files that execute or steer tools before recommending install.
Output format
Harness mode
- mode
- primary target
- why this mode fits
Existing harness
Short inventory grouped as keep, update, missing, risky, and prune.
Pain / need map
Table with:
- need
- repeated agent job
- evidence
- placement
- promotion trigger
Buy vs build
Include when a new skill, plugin, MCP server, hook, or integration is plausible.
For each candidate, name source, decision (adopt, fork/adapt, build local, or defer), trust notes, why it fits or fails, and rollback path. Trust notes cover provenance, execution, permissions, freshness, and portability.
Proposed edits
Table with path/target, action, risk gate (none, approval required, or defer), and rationale.
For hook rows, also include:
- hook class:
community-proven guardrail or project-specific
- dry-run command
- rollback note
Codex target
List Codex-specific files, commands, trust/reload steps, and caveats.
Claude target
List Claude-Code-specific files, commands, trust/reload steps, and caveats.
Verification
List prompts or commands with expected evidence and failure signals.
Deferred / prune
List work intentionally skipped, why now is too early, and the reassessment trigger.
Placement rules
- Keep root context small. Move procedures into skills, commands, scripts, or hooks.
- Prefer
AGENTS.md plus a CLAUDE.md import or symlink only when both agents should read the same stable core. Do not assume identical load behavior.
- Prefer a skill over a long root instruction when the guidance is a reusable workflow.
- Prefer a script over prose when the rule is deterministic and easy to run.
- Prefer a community-proven guardrail hook candidate during
bootstrap or maintain only when it is deterministic, fast, read-only by default, no-network by default, low-noise, and easy to roll back.
- Prefer a project-specific hook over a script only when timing matters and repeated repo-specific misses justify lifecycle automation.
- Prefer a subagent only when isolated context, parallel work, or a constrained role improves output quality.
- Prefer a plugin only when installation, versioning, bundled integrations, or marketplace distribution are part of the value.
- Prefer no change when the existing harness already supports the job.
Verification prompts
Use one or two starter evals before shipping changes to this skill. The full case set and expected checks live in references/eval-cases.md.
- "Set up this repo so Codex and Claude both know the test, lint, and release workflow without bloating root instructions."
- "Agents keep missing migration safety checks in this repo. Decide whether to use context, skill, script, hook, or subagent."
Pass signal: the output inventories existing harness files first, separates provider-neutral decisions from Codex/Claude targets, risk-gates high-risk surfaces, and verifies behavior rather than only file syntax.
Failure modes
- over-generating every possible harness surface instead of solving the repeated job
- treating Codex and Claude paths as a mechanical one-to-one migration
- putting long workflow procedures into
AGENTS.md or CLAUDE.md
- skipping external search and rebuilding a maintained asset
- recommending third-party install without trust and maintenance checks
- avoiding hooks even when the guardrail is deterministic, common, low-noise, and timing-sensitive
- installing hooks automatically instead of proposing reviewable scripts and target adapters
- adding hooks or MCP config without rollback or approval notes
Example
Input
"Agents keep missing our migration safety process. We use Codex more lately, but some teammates use Claude Code too."
Output sketch
Harness mode
- mode:
repair
- primary target: Codex current-primary, Claude Code first-class target
- why: the issue is a repeated agent miss in an operating repo
Pain / need map
| need |
repeated agent job |
evidence |
placement |
promotion trigger |
| migration safety checklist |
verification/review |
repeated misses during DB work |
repo-local skill plus short root pointer |
promote to hook only if agents still skip deterministic checks |
Verification
- Prompt: "Review this migration change and tell me what safety checks apply."
- Expected evidence: agent finds the migration skill and names rollback, idempotency, data-size, and test checks.
- Failure signal: agent only says "run tests" or misses rollback/data safety.
Deferred / prune
- plugin packaging: defer until the skill proves useful across more than one repo.
Source: sungjunlee/craftkit — distributed by TomeVault.
1---2name: craft-harness3description: Build, repair, sync, prune, and evolve a project-specific agent harness for Codex and Claude Code. Use when repo guidance, AGENTS.md/CLAUDE.md, local skills, commands, hooks, subagents, MCP/integration notes, plugins, or adoption choices need a repo-local plan or small edits. Use when this capability is needed.4---56# craft-harness78## Purpose910Build and maintain the agent harness around a real repo.1112A harness is the set of files and installed capabilities that help coding agents work well in a project: root context, local context/rules, skills, commands, scripts, hooks, subagents, MCP/integrations, plugins, and external assets worth adopting.1314This skill is not only for first setup. Use it across the harness lifecycle: bootstrap, task-fit, repair, sync, adopt, prune, and maintain.1516## Non-goals1718- Not a global config manager.19- Not an installer or plugin publisher.20- Not a runtime framework.21- Not a replacement for the user's agent settings UI or marketplace flow.22- Default output is a repo-local plan, small repo-local markdown/skill edits, or reviewable asset recipes.2324## How it differs from related skills2526- `craft-skill-spec` designs one reusable artifact: a skill, skill suite, subagent, or plugin.27- `craft-harness` decides what a repo's agent harness needs, where each piece belongs, and what to create, adopt, update, defer, or remove.28- `craft-survey` studies prior art. `craft-harness` uses prior-art search as one step when buy-vs-build matters.29- `craft-critique` reviews a prompt or skill without editing. `craft-harness` may use critique-style checks on the harness plan before applying changes.3031## Inputs3233- the repo or task being supported34- current primary target, if any: Codex, Claude Code, or both35- observed agent failures or desired workflows36- existing harness files and commands37- constraints around edits, installs, hooks, MCP, plugins, or global config3839If the user does not state a primary target, default to dual-target output with Codex as the current primary. Claude Code remains a first-class target, not a fallback.4041## Required reads4243Before making recommendations:44451. Inspect existing repo harness files first:46 - shared root and local context files47 - provider-specific skill, command, hook, subagent, MCP, plugin, and rules locations48 - repo workflow files: `package.json`, `Makefile`, CI config, scripts, docs492. Read `references/platform-surfaces.md` when a recommendation touches provider-specific paths, hooks, subagents, MCP, plugins, or install locations.503. Read `references/dual-target-layout.md` when the harness targets both Codex and Claude Code, uses `.agents/` as shared source, or needs symlink/copy decisions.514. Read `references/hook-patterns.md` when recommending, reviewing, pruning, or generating hooks.525. Read `references/eval-cases.md` when drafting or validating `craft-harness` changes.536. Read adjacent CraftKit skills only when the recommendation would create or modify a prompt/skill artifact.5455Do not inspect user/global config unless the user explicitly asks for personal or global harness work.5657## Lifecycle modes5859Choose one primary mode and mention secondary modes when useful:6061- `bootstrap` - create the smallest useful harness for a repo with little setup.62- `task-fit` - add harness support for a specific task, PR, workflow, or team convention.63- `repair` - fix repeated agent failures by moving guidance to the right surface.64- `sync` - align Codex and Claude Code surfaces when they drift.65- `adopt` - evaluate external skills, plugins, MCPs, or integrations before building locally.66- `prune` - remove stale, bloated, duplicated, or conflicting harness guidance.67- `maintain` - reassess after model, tool, repo, or workflow changes.6869## Workflow70711. State the harness mode and primary target. If tradeoffs conflict, prefer the user's current primary agent; otherwise prefer Codex while keeping Claude Code support explicit.722. Inventory the existing harness. Mark each relevant file or installed surface as `keep`, `update`, `missing`, `risky`, or `prune`.733. Name the repeated agent jobs: navigation, implementation, review, verification, release, incident work, research, handoff, backlog work, external-tool work, or project onboarding.744. Choose placement for each need:75 - root context for stable rules every task needs76 - local context or path-scoped rules for directory-specific facts77 - skill for reusable judgment workflow78 - command for explicit manual shortcut79 - script for deterministic checks that should be run on demand80 - hook for deterministic lifecycle automation: either a community-proven guardrail candidate or a project-specific repeated miss where timing matters81 - MCP/integration for structured access to an external system82 - subagent for isolated exploration, review, or role separation83 - plugin for installable multi-surface packaging84 - external adoption when a maintained asset fits better than local invention85 - no change when the existing harness is enough865. Run buy-vs-build when a new skill, plugin, MCP server, hook, or integration is plausible. Search or explicitly say why search was skipped. Use `adopt`, `fork/adapt`, `build local`, or `defer`.876. Produce a patch plan before high-risk edits. Low-risk repo-local markdown and skill drafts may be edited when the user asked to make the change.887. Verify the harness with prompts or commands that exercise the intended behavior, not just static file syntax.8990## Risk gates9192Low-risk repo-local edits may be made when the user asks for implementation:9394- repo-local markdown guidance95- `AGENTS.md` / `CLAUDE.md` bridge updates96- repo-local skill drafts97- repo-local docs and verification prompts9899Require explicit approval before:100101- adding or enabling hooks or hook scripts102- adding MCP servers or external integrations103- installing plugins or adding marketplaces104- editing user/global config105- creating write-capable subagents or custom agents106- adding commands that affect secrets, auth, deployment, or CI behavior107108Defer by default:109110- organization-managed policy111- plugin packaging and publishing112- broad agent-team factories113114This skill may propose high-risk surfaces, but it does not install or enable them unless the user explicitly asks for that after seeing the plan. When proposing a hook, name the hook class, dry-run command, false-positive notes, and rollback steps. When proposing third-party adoption, inspect the files that execute or steer tools before recommending install.115116## Output format117118### Harness mode119- mode120- primary target121- why this mode fits122123### Existing harness124Short inventory grouped as `keep`, `update`, `missing`, `risky`, and `prune`.125126### Pain / need map127Table with:128129- need130- repeated agent job131- evidence132- placement133- promotion trigger134135### Buy vs build136Include when a new skill, plugin, MCP server, hook, or integration is plausible.137138For each candidate, name source, decision (`adopt`, `fork/adapt`, `build local`, or `defer`), trust notes, why it fits or fails, and rollback path. Trust notes cover provenance, execution, permissions, freshness, and portability.139140### Proposed edits141Table with path/target, action, risk gate (`none`, `approval required`, or `defer`), and rationale.142143For hook rows, also include:144145- hook class: `community-proven guardrail` or `project-specific`146- dry-run command147- rollback note148149### Codex target150List Codex-specific files, commands, trust/reload steps, and caveats.151152### Claude target153List Claude-Code-specific files, commands, trust/reload steps, and caveats.154155### Verification156List prompts or commands with expected evidence and failure signals.157158### Deferred / prune159List work intentionally skipped, why now is too early, and the reassessment trigger.160161## Placement rules162163- Keep root context small. Move procedures into skills, commands, scripts, or hooks.164- Prefer `AGENTS.md` plus a `CLAUDE.md` import or symlink only when both agents should read the same stable core. Do not assume identical load behavior.165- Prefer a skill over a long root instruction when the guidance is a reusable workflow.166- Prefer a script over prose when the rule is deterministic and easy to run.167- Prefer a community-proven guardrail hook candidate during `bootstrap` or `maintain` only when it is deterministic, fast, read-only by default, no-network by default, low-noise, and easy to roll back.168- Prefer a project-specific hook over a script only when timing matters and repeated repo-specific misses justify lifecycle automation.169- Prefer a subagent only when isolated context, parallel work, or a constrained role improves output quality.170- Prefer a plugin only when installation, versioning, bundled integrations, or marketplace distribution are part of the value.171- Prefer no change when the existing harness already supports the job.172173## Verification prompts174175Use one or two starter evals before shipping changes to this skill. The full case set and expected checks live in `references/eval-cases.md`.176177- "Set up this repo so Codex and Claude both know the test, lint, and release workflow without bloating root instructions."178- "Agents keep missing migration safety checks in this repo. Decide whether to use context, skill, script, hook, or subagent."179180Pass signal: the output inventories existing harness files first, separates provider-neutral decisions from Codex/Claude targets, risk-gates high-risk surfaces, and verifies behavior rather than only file syntax.181182## Failure modes183184- over-generating every possible harness surface instead of solving the repeated job185- treating Codex and Claude paths as a mechanical one-to-one migration186- putting long workflow procedures into `AGENTS.md` or `CLAUDE.md`187- skipping external search and rebuilding a maintained asset188- recommending third-party install without trust and maintenance checks189- avoiding hooks even when the guardrail is deterministic, common, low-noise, and timing-sensitive190- installing hooks automatically instead of proposing reviewable scripts and target adapters191- adding hooks or MCP config without rollback or approval notes192193## Example194195### Input196197"Agents keep missing our migration safety process. We use Codex more lately, but some teammates use Claude Code too."198199### Output sketch200201**Harness mode**202- mode: `repair`203- primary target: Codex current-primary, Claude Code first-class target204- why: the issue is a repeated agent miss in an operating repo205206**Pain / need map**207| need | repeated agent job | evidence | placement | promotion trigger |208|---|---|---|---|---|209| migration safety checklist | verification/review | repeated misses during DB work | repo-local skill plus short root pointer | promote to hook only if agents still skip deterministic checks |210211**Verification**212- Prompt: "Review this migration change and tell me what safety checks apply."213- Expected evidence: agent finds the migration skill and names rollback, idempotency, data-size, and test checks.214- Failure signal: agent only says "run tests" or misses rollback/data safety.215216**Deferred / prune**217- plugin packaging: defer until the skill proves useful across more than one repo.218219---220> Source: [sungjunlee/craftkit](https://github.com/sungjunlee/craftkit) — distributed by [TomeVault](https://tomevault.io).221<!-- tomevault:4.0:skill_md:2026-06-16 -->