From harness-engineering
Bootstrap an agent-first knowledge base in any repository. This skill should be used when initializing a new project or adding structured knowledge scaffolding to an existing repo. Supports configurable base directory, new/existing repos, Claude settings with plan directory, and bundled agent capabilities. Invoke via /harness-init.
How this skill is triggered — by the user, by Claude, or both
Slash command
/harness-engineering:harness-engineeringThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Bootstrap a universal, stack-agnostic knowledge base optimized for agent-first development. Creates AGENTS.md as a table of contents (not an encyclopedia), with deep knowledge in structured docs, mechanically discoverable, progressively disclosed.
assets/commands/harness-eslint.mdassets/commands/harness-init.mdassets/commands/harness-onboard.mdassets/commands/harness-shape.mdassets/commands/harness-standards.mdassets/eslint-plugin-harness/index.jsassets/eslint-plugin-harness/package.jsonassets/eslint-plugin-harness/rules/filename-match-export.jsassets/eslint-plugin-harness/rules/filename-match-export/README.mdassets/eslint-plugin-harness/rules/max-file-lines.jsassets/eslint-plugin-harness/rules/max-file-lines/README.mdassets/eslint-plugin-harness/rules/no-console-log.jsassets/eslint-plugin-harness/rules/no-console-log/README.mdassets/eslint-plugin-harness/rules/no-default-export.jsassets/eslint-plugin-harness/rules/no-default-export/README.mdassets/eslint-plugin-harness/rules/no-eval.jsassets/eslint-plugin-harness/rules/no-eval/README.mdassets/eslint-plugin-harness/rules/structured-logging.jsassets/eslint-plugin-harness/rules/structured-logging/README.mdassets/hooks/lint-on-save.shBootstrap a universal, stack-agnostic knowledge base optimized for agent-first development. Creates AGENTS.md as a table of contents (not an encyclopedia), with deep knowledge in structured docs, mechanically discoverable, progressively disclosed.
Based on the system that produced ~1M LOC across 1,500 PRs with zero manually-written code. See references/harness-engineering-article.md for the full source material.
/harness-init┌─────────────────────────────────────────────────────────────┐
│ HARNESS ENGINEERING FLOW │
├─────────────────────────────────────────────────────────────┤
│ │
│ /harness-init Bootstrap scaffolding │
│ ↓ (AGENTS.md, docs/, commands, hooks) │
│ │
│ /harness-shape Fill with real project context │
│ ↓ (analyze repo → confirm → fill) │
│ │
│ /harness-onboard Existing repo gap-fill │
│ ↓ (audit → onboarding plan) │
│ │
│ /harness-eslint Optional: mechanical enforcement │
│ (ESLint rules for JS/TS repos) │
│ │
└─────────────────────────────────────────────────────────────┘
Typical sequence:
New repo: /harness-init → /harness-shape
Existing repo: /harness-init → /harness-onboard → /harness-shape
JS/TS repo: ... → /harness-eslint (optional add-on)
Determine whether the target is a new or existing repository:
Check:
1. Does .git/ exist? → existing repo
2. Does AGENTS.md exist? → likely already bootstrapped (prefer audit + gap-fill)
3. Does the default docs/ directory have existing content? → potential conflict
Notes:
The knowledge base defaults to docs/ but is configurable.
If docs/ already has significant content (>5 non-generated files), surface to user:
"
docs/already contains files. Options:"
- Use
docs/anyway (merge alongside existing content)- Use
knowledge/instead- Use a custom path
- Cancel
All generated files, templates, and path references adapt to the chosen base directory.
Ask the user (skip if already provided via args):
If the user declines, use placeholders.
Execute the bootstrap shell script which handles all file creation:
bash .claude/skills/harness-engineering/scripts/bootstrap.sh \
--target "$(pwd)" \
--name "Project Name" \
--description "One-liner" \
--base-dir "docs" \
--stack "TypeScript" \
--domains "| Auth | src/auth/ | — | Authentication |"
The script is idempotent — it skips existing files and reports what was created vs skipped.
What the script creates (knowledge base — skips existing files):
Root files:
AGENTS.md — table of contents (~70 lines, all paths reference chosen base dir)CLAUDE.md — repo-level Claude instructionsARCHITECTURE.md — domain map templateKnowledge base (under <base-dir>/):
design-docs/index.md + design-docs/core-beliefs.mdproduct-specs/index.mdgolden-principles.md — mechanical rulesquality-score.md — grading rubric (A-F)tech-debt-tracker.md — debt registerDESIGN.md, PLANS.md, PRODUCT_SENSE.md, RELIABILITY.md, SECURITY.md.gitkeep in: plans/, plans/in-progress/, plans/complete/, plan-details/, product-specs/, references/, generated/Repo checks (root):
scripts/harness/knowledge-check.sh — minimal mechanical checks to keep the knowledge base legible to agents (wire into CI when ready)What the script deploys (agent tooling — always overwrites for updates):
Slash commands:
.claude/commands/harness-init.md — bootstrap entry point.claude/commands/harness-shape.md — fill knowledge base with real project context.claude/commands/harness-onboard.md — existing repo audit + gap-fill plan.claude/commands/harness-standards.md — alias for harness-shape (original name).claude/commands/harness-eslint.md — optional ESLint enforcementHooks:
.claude/hooks/lint-on-save.sh — immediate lint feedback on Edit/Write (ESLint, ruff, shellcheck).claude/hooks/shaping-ripple.sh — PostToolUse on Edit/Write. Detects edits to shaping: true files and reminds agent to check cross-level consistencydocs/plans/ with proper <slug>-YYYY-MM-DD.md nameCompanion skills:
.claude/skills/git-worktree/ — isolated parallel development with env file managementClaude config:
.claude/settings.json — planDirectory + lint-on-save hook configNew repo:
git init + rename branch to mainchore: bootstrap agent-first knowledge baseExisting repo:
chore/add-knowledge-basechore: add agent-first knowledge base scaffoldFor existing repositories, the hard part isn’t creating empty scaffolding. It’s filling the Phase 0: Standards gaps using the repo’s real context (code, README, CI, existing conventions), and producing a short execution plan so agents don’t drift.
Run the audit script to generate a concrete onboarding plan:
bash .claude/skills/harness-engineering/scripts/audit.sh --target "$(pwd)" --write-plan
The audit will:
.claude/settings.json when possiblesrc/, apps/, packages/, etc.)<base-dir>/plans/harness-onboard-existing-YYYY-MM-DD.mdThe source article emphasizes enforcing invariants via custom linters and structural tests with agent-readable remediation.
This skill ships a minimal, stack-agnostic enforcement loop:
bash scripts/harness/knowledge-check.sh
When the repo is JS/TS-heavy and ESLint is already in play, consider:
@factory/eslint-plugin) and adapting itThe right outcome is not “more rules.” It’s “rules that eliminate whole classes of agent mistakes.”
This template includes a small, repo-local ESLint plugin skeleton you can copy into a JS/TS repo:
bash .claude/skills/harness-engineering/scripts/add-eslint-agent-lints.sh --target "$(pwd)" --install
It creates:
tools/eslint-plugin-harness/ (tiny plugin with agent-readable messages)eslint.config.cjspackage.json lint script (if missing)If the repo already has a stack and package manager, ask the user one tight question:
scripts/harness/knowledge-check.sh)scripts/harness/knowledge-check.sh into CI)Print summary:
The generated templates encode these agent-first principles:
After bootstrapping, install these tools to unlock the full agent-first development loop. The audit script (audit.sh) checks for their presence on PATH.
| Tool | Purpose | Install |
|---|---|---|
gh | GitHub CLI — PRs, issues, CI checks | brew install gh |
| Tool | Purpose | Install |
|---|---|---|
agent-browser | Headless browser automation — screenshot validation, DOM inspection, user flow testing | npm i -g agent-browser && agent-browser install |
playwriter | Control user's Chrome via extension — authenticated flows, debugging | Load skill: /playwriter |
peekaboo | macOS screenshot/click automation — visual QA | brew install steipete/tap/peekaboo |
| Skill | Purpose |
|---|---|
harness-engineering | This skill — bootstrap + onboard + standards |
git-worktree | Isolated parallel development — one worktree per task |
compound-engineering:agent-browser | Browser automation skill (load with /compound-engineering:agent-browser) |
These patterns are enabled by the tools above:
Browser Validation: Drive the app with Chrome DevTools for visual QA. Use agent-browser (headless) or playwriter (user's Chrome). Enables: screenshot validation, DOM inspection, user flow testing.
Doc Gardening: Recurring scan for stale docs that don't match code behavior. Pattern: agent reads code → compares to docs → opens fix-up PRs for drift.
Quality Sweeps: Background task scanning for golden principle violations. Updates quality scores in <base-dir>/quality-score.md. Opens targeted refactoring PRs.
Plan Lifecycle: Manage plans as first-class artifacts:
<base-dir>/plans/<base-dir>/PLANS.md<base-dir>/plans/complete/ when doneThe bundled eslint-plugin-harness ships these rules, mapped to the article's lint categories:
| Rule | Category | Severity | Description |
|---|---|---|---|
no-console-log | Observability | error | No committed console.log |
no-default-export | Grep-ability | warn | Named exports only — highest leverage for agents |
no-eval | Security | error | Block eval() and new Function() |
filename-match-export | Grep-ability | warn | Filename matches single named export |
structured-logging | Observability | error | Static message + metadata object |
max-file-lines | Glob-ability | warn | Keep files < 500 LOC |
See assets/eslint-plugin-harness/rules/<rule>/README.md for per-rule docs with rationale and examples.
This skill is fully self-contained. Everything needed to bootstrap a repo lives inside this directory.
bootstrap.sh — creates knowledge base + deploys all tooling. Accepts --target, --name, --description, --base-dir, --stack, --domains flags. Idempotent for knowledge base; always updates tooling.audit.sh — analyzes existing repo for stack, CI, domains, agent tooling, placeholders. Generates onboarding plans.add-eslint-agent-lints.sh — scaffolds local ESLint plugin with agent-readable rules into JS/TS repos.15 template files with {{PLACEHOLDER}} markers: {{PROJECT_NAME}}, {{DESCRIPTION}}, {{BASE_DIR}}, {{STACK}}, {{DOMAINS}}, {{DATE}}. The bootstrap script handles substitution.
5 slash command files deployed to .claude/commands/ during bootstrap:
harness-init.md — bootstrap entry pointharness-shape.md — fill knowledge base with real project context (primary post-bootstrap command)harness-standards.md — alias for harness-shape (original name)harness-onboard.md — existing repo audit + gap-fill planharness-eslint.md — optional ESLint enforcementlint-on-save.sh — PostToolUse hook deployed to .claude/hooks/. Runs ESLint (JS/TS), ruff (Python), or shellcheck (Shell) after every Edit/Write. Exit 2 blocks with feedback.hooks/hooks.json, no deployed asset)plan-capture.sh — PostToolUse on ExitPlanMode. Reminds agent to symlink approved plan into docs/plans/ with proper <slug>-YYYY-MM-DD.md naming.git-worktree/ — companion skill deployed to .claude/skills/git-worktree/. Manages worktree create/list/switch/cleanup with env file copying and .worktree-config for agent use.6-rule ESLint plugin with agent-readable error messages. Deployed to tools/eslint-plugin-harness/ via /harness-eslint.
harness-engineering-article.md — key insights from the OpenAI harness engineering article (includes lint categories, enforcement patterns, and development cycle)npx claudepluginhub lattice-technologies-inc/harness-engineering --plugin harness-engineeringBootstraps repositories with harness engineering scaffolding: AGENTS.md orientation map, docs/ system of record, boundary tests, linter rules, CI pipeline, GC scripts. Use for new projects, agent-readiness, or architecture boundaries.
Assesses codebase for AI agent readiness by detecting stacks, monorepos, git setup, and evaluating style, testing, code quality, secrets, and file sizes.
Creates or audits ECL Agent Harness infrastructure for AI collaboration: AGENTS.md, change tracking, CI gates, lint checks, and agent handoff docs.