Bootstrap a repository for agent-first development when there is no agent harness yet, or when the repo has only minimal ad hoc scaffolding. Use when the user asks to set up a new repo, scaffold an agent-ready project, add AGENTS.md, create harness scripts, validation gates, source-of-truth docs, CI, smoke or e2e loops, repo-local review skills, or automerge policy. For a repo that already has a working agent harness and needs modernization or repair, prefer update-harness.
How this skill is triggered — by the user, by Claude, or both
Slash command
/HarnessEngineeringSkills:setup-harnessThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Set up the repository so future agents can learn the project from committed
Set up the repository so future agents can learn the project from committed artifacts, run the same commands humans run, validate their own work, and leave auditable evidence. The rule of thumb: when an agent struggles, improve the environment before adding more prompt text.
This skill is language and framework agnostic. Discover the target repo's toolchain first, then express the harness through that repo's existing scripts, package manager, test runner, CI provider, and documentation style.
AGENTS.md short. It is a router to deeper docs, not the encyclopedia.Build a harness inventory before creating files:
Ask the user only for facts that are not discoverable and would materially change the scaffold.
Create the smallest complete harness that fits the repo. For a new repository, that usually means these surfaces.
Create or update root AGENTS.md with:
AGENTS.md files for large modules, packages, services, or
ownership boundariesUse scoped AGENTS.md files only where they reduce ambiguity. A small repo does
not need per-directory instructions.
Add a docs/ map that routes agents to durable knowledge:
docs/README.md: documentation mapdocs/ARCHITECTURE.md: boundaries, dependency direction, invariantsdocs/HARNESS_ENGINEERING.md or docs/HARNESS.md: harness strategy,
required commands, validation contract, and merge policydocs/PLANS.md: execution-plan workflow and required sectionsdocs/QUALITY_SCORE.md: current quality baseline, ratchets, and next targetsdocs/SECURITY.md and docs/RELIABILITY.md when the repo has security,
persistence, runtime, or production reliability concernsdocs/behaviours/: canonical scenarios, current validation state, and e2e or
manual checklistdocs/design-docs/, docs/product-specs/, or docs/references/ when deeper
design decisions, product behavior, or external references need a stable homedocs/generated/: generated inventory, public-surface reference, quality
snapshot, CLI help, API schema, load baseline, or whatever generated
references are valuable for the repoUse last_reviewed: YYYY-MM-DD frontmatter on source-of-truth docs if the repo
needs freshness checks.
Create docs/exec-plans/active/ and docs/exec-plans/completed/ for complex
work. Every non-readme plan should include:
## Goal## Scope## Tasks## Decision Log## VerificationPlans are for coupled or multi-step work. Small edits should not be buried in process.
Add a scripts/README.md that catalogs all important scripts. Prefer these
entrypoints:
scripts/fast-feedback.sh: local pre-PR gate for cheap deterministic checksscripts/harness-check.sh: full CI gate; includes slower tests and stricter
drift checksscripts/validate-harness-docs.sh: required docs, links between router docs,
plan headings, and doc structurescripts/check-doc-links.*: markdown links and source-of-truth referencesscripts/check-agents-drift.*: AGENTS.md still points at the real docs and
repo surfacesscripts/check-behaviour-docs.*: canonical scenarios appear in current-state
and e2e checklist docsscripts/check-doc-freshness.*: source-of-truth docs are recently reviewedscripts/check-generated-docs.*: generated references are currentImplementation language is a repo choice. Shell is useful for orchestration, but checks can be Python, JavaScript, Go, Rust, Ruby, Make, Just, or any tool the repo already standardizes on.
If repo-local skills are supported, add narrow pre-PR skills:
.agents/skills/review/SKILL.md: confirmed-issue-only correctness and
reliability review.agents/skills/security-review/SKILL.md: confirmed high-impact security
reviewWire a mechanical companion such as scripts/pre-pr-review.sh into
fast-feedback and harness-check. It should verify the review artifacts are
present and catch changed-file hazards across unstaged, staged, and committed
branch diffs.
Use the target repo's CI provider. A good baseline has:
scripts/harness-check.shStart automerge conservatively. Critical paths should require a human until the repo has enough green history to widen automation. Critical paths are repo-specific, but commonly include migrations, auth, billing, credentials, secrets, sandboxing, workflow files, root agent instructions, harness policy, and shared public contracts.
Work in reviewable slices, continuing unless the user asks to pause:
For each slice, adapt the templates in references/ to the target repo. Treat
those files as examples, not mandatory stack choices.
Order checks so cheap, structural failures surface first:
fast-feedback should be fast enough for every normal PR. harness-check
should match CI and can be slower. Environment-gated checks should either run
when prerequisites are present or skip with a clear reason.
If the repo already has violations, baseline them deliberately and fail only on regressions. Tell the user what was baselined and where the burn-down target lives.
A setup is complete when:
AGENTS.md and find the right docs, scripts, and
validation pathscripts/fast-feedback.sh and the full CI-equivalent gate both run or have
documented blockersProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
npx claudepluginhub swiftyos/harnessengineeringskills --plugin setup-harness