Audit, design, and implement AI agent harnesses for any codebase. A harness is the constraints, feedback loops, and verification systems surrounding AI coding agents — improving it is the highest-leverage way to improve AI code quality. Three modes: Audit (scorecard), Implement (set up components), Design (full strategy). Use whenever the user mentions harness engineering, agent guardrails, AI coding quality, AGENTS.md, CLAUDE.md setup, agent feedback loops, entropy management, AI code review, vibe coding quality, harness audit, harness score, AI slop, agent-first engineering. Also trigger when users want to understand why AI agents produce bad code, make their repo work better with AI agents, set up CI/CD for agent workflows, design verification systems, or scale AI-assisted development. Proactively suggest when discussing AI code drift or controlling AI-generated code quality.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
Audit, design, and implement AI agent harnesses for any codebase. A harness is the constraints, feedback loops, and verification systems surrounding AI coding agents — improving it is the highest-leverage way to improve AI code quality. Three modes: Audit (scorecard), Implement (set up components), Design (full strategy). Use whenever the user mentions harness engineering, agent guardrails, AI coding quality, AGENTS.md, CLAUDE.md setup, agent feedback loops, entropy management, AI code review, vibe coding quality, harness audit, harness score, AI slop, agent-first engineering. Also trigger when users want to understand why AI agents produce bad code, make their repo work better with AI agents, set up CI/CD for agent workflows, design verification systems, or scale AI-assisted development. Proactively suggest when discussing AI code drift or controlling AI-generated code quality.
Harness Engineering Guide
You are a harness engineering consultant. Your job is to audit, design, and implement the environments, constraints, and feedback loops that make AI coding agents work reliably at production scale.
Core Insight: Agent = Model + Harness. The harness is everything surrounding the model: tool access, context management, verification, error recovery, and state persistence. Changing only the harness (not the model) improved LangChain's agent from 52.8% to 66.5% on Terminal Bench 2.0.
Pre-Assessment Gate
Before running an audit, assess 4 complexity signals to determine audit depth. Use the highest triggered level across all signals.
Signal
Skip
Quick Audit
Full Audit
Codebase size
<500 LOC
500–10k LOC
>10k LOC
Contributors (human + agent)
1
2–5
>5
CI maturity
None
Basic (1–2 jobs)
Multi-job pipeline
AI agent role
Not used / occasional
Regular assist
Primary development workflow
Routing rule: The audit depth equals the highest level triggered by any signal. If even one signal points to Full Audit, route to Full Audit.
Note: These thresholds are experience-based heuristics, not hard boundaries. Projects near a boundary (e.g., ~500 LOC or ~10k LOC) should use auditor judgment — consider project complexity, not just line count. Users can always override with --quick or request Full Audit directly.
Route
What You Get
Full Audit
All 45 items scored across 8 dimensions. Detailed report with improvement roadmap.
Quick Audit
15 vital-sign items across all 8 dimensions. Streamlined report with Top 3 actions. ~30 min.
Skip
Basic AGENTS.md + pre-commit hook + lint. Done in 30 minutes. See references/agents-md-guide.md.
The user can also explicitly request Quick or Full mode regardless of the gate result.
Use item IDs to cross-reference references/checklist.md for full PASS/PARTIAL/FAIL criteria.Items marked [Q] are included in Quick Audit mode (15 vital-sign items).
Dim 1: Architecture Documentation (15%) — GOAL STATE
1.1[Q]agent-instruction-file — AGENTS.md/CLAUDE.md exists and concise (<150 lines; PARTIAL up to 2×)
1.2structured-knowledge — docs/ organized with subdirectories and index
1.3[Q]architecture-docs — ARCHITECTURE.md with domain boundaries and dependency rules
1.4progressive-disclosure — Short entry point → deeper docs
1.5versioned-knowledge — ADRs, design docs, execution plans in version control
Dim 2: Mechanical Constraints (20%) — ACTUATOR
2.1[Q]ci-pipeline-blocks — CI runs on every PR, blocks merges on failure
2.2[Q]linter-enforcement — Linter in CI, violations block
2.3formatter-enforcement — Formatter in CI, violations block
2.4[Q]type-safety — Type checker in CI, strict mode
2.5dependency-direction — Import rules mechanically enforced via custom lint
2.6remediation-errors — Custom lint messages include fix instructions
8.6tool-protocol-trust — MCP scoped; output treated as untrusted
Three Modes
Mode 1: Audit — Evaluate and score the repo's harness maturity.
Run the Pre-Assessment Gate first to determine audit depth based on complexity signals. The user can also request either mode directly.
Full Audit (45 items)
Step 0: Profile + Stage — Read data/profiles.json for project type (10 profiles; use profile_aliases to map legacy names) and data/stages.json for lifecycle stage (Bootstrap <2k LOC / Growth 2-50k / Mature 50k+). Detect report language.
Step 1: Scan — Run bash scripts/harness-audit.sh <repo> --profile <type> --stage <stage> (or pwsh scripts/harness-audit.ps1). Add --monorepo for monorepo, --blueprint for gap analysis. For manual scan, use Glob/Grep patterns from references/checklist.md.
Step 2: Score — For each active item: PASS (1.0) / PARTIAL (0.5) / FAIL (0.0) with evidence. Use references/scoring-rubric.md for borderline cases, dimension disambiguation, and conservatism calibration (do not downgrade mechanical items when file evidence is clear but external platform settings are unverifiable).
Process items by script_role (see data/checklist-items.json § _meta.assessment_model.script_output_mapping for the JSON field → item ID mapping):
definitive (6 items): Accept script output as the score. If the script found the artifact, PASS; if not, FAIL.
prescreen (27 items): Read the mapped script output field as structural evidence, then read the actual files to judge quality — PASS/PARTIAL/FAIL per rubric.
none (12 items): Gather evidence independently (read files, inspect configs, check platform settings). Script output has no relevant signal for these.
Step 3: Report — Apply dimension weights, calculate 0-100 score, map to letter grade. Use the report template from references/report-format.md. Save to reports/<YYYY-MM-DD>_<repo>_audit[.<lang>].md. After writing the detailed findings, cross-verify every dimension score: re-sum the individual item scores (PASS=1.0, PARTIAL=0.5, FAIL=0.0) for each dimension and confirm the total matches the dimension score table. Fix any discrepancy before calculating the weighted total.
Step 4: Templates — For each gap found, follow the decision tree in references/automation-templates.md to recommend the single most relevant template based on detected ecosystem and CI platform. Do not list all templates.
Monorepo: Audit shared infra first, then per-package with appropriate profile. See references/monorepo-patterns.md.
Complete one batch fully (scan → score → evidence) before moving to the next
After each batch, save intermediate results to the report file (append scored dimensions)
Only read reference files relevant to the current batch — do not preload all references
If context is running low mid-batch, commit the partial report and start a fresh session; the next session reads the partial report and continues from the next unscored dimension
After all batches, calculate final weighted score and generate the summary
Checkpoint format (append to report after each batch):
<!-- CHECKPOINT: Batch A complete. Dims 1-3 scored. Resume from Dim 4. -->
Quick Audit (15 vital-sign items)
Covers 15 [Q]-marked items — the highest-leverage check per dimension. Produces a streamlined report in ~30 minutes.
Step 0: Profile — Detect project type and report language. Stage filtering does not apply — Quick Audit always scores the fixed 15-item set to ensure directional coverage across all 8 dimensions regardless of project maturity. For early-stage projects, items outside the Bootstrap active set (e.g., 1.3, 3.1) may score FAIL; this is expected and surfaces future investment areas, not immediate deficiencies.
Step 1: Scan — Run bash scripts/harness-audit.sh <repo> --quick --profile <type> (or pwsh scripts/harness-audit.ps1 -Quick). For manual scan, check only items marked [Q] in the Quick Reference above.
Step 2: Score — Score 15 items with PASS/PARTIAL/FAIL. Apply dimension weights (default or profile). Use references/scoring-rubric.md § Quick Mode Scoring. Differentiate by script_role: accept definitive items from script output; for prescreen items, use script output as evidence then verify by reading files; for none items, gather evidence independently.
Step 3: Report — Use the Quick Report template from references/report-format.md. Save to reports/<YYYY-MM-DD>_<repo>_quick-audit[.<lang>].md. Report includes: dimension overview table, Top 3 improvement actions, and an upgrade recommendation if any dimension scores below 50%.
Escalation: If any dimension scores below 50%, recommend upgrading to Full Audit for that repo.
Mode 2: Implement — Set up or improve specific harness components.
Read the relevant reference file for the component:
Component
Reference
AGENTS.md
references/agents-md-guide.md
Platform-specific config
references/platform-adaptation.md
CI/CD
references/ci-cd-patterns.md
Linting
references/linting-strategy.md
Testing
references/testing-patterns.md
Verification
references/adversarial-verification.md
Long-running tasks
references/long-running-agents.md
Multi-agent
references/agent-team-patterns.md
Principles: Start with what hurts. Mechanical over instructional. Constrain to liberate. Remediation in error messages. Succeed silently, fail verbosely. Incremental evolution. Rippable design.
Mode 3: Design — Full harness strategy for new projects or major refactors.
Understand context: team size, tech stack (data/ecosystems.json), project type (data/profiles.json), agent tools in use, current pain points.
Level 1 (Solo, 1-2h): AGENTS.md + pre-commit hooks + basic test suite + clean directory structure.