agent-harness-design
Skill6 starsChanged 4 months agoApache-2.0View on GitHub
Use when designing tool definitions for a new agent or subagent, an agent shows high retry rates, ambiguous tool invocations, or silent failures, or an existing agent harness needs a quality review.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- AnastasiyaW/codex-claude-code-configtheir own version, first seen Oct 30, 2026
- quokkify/skillstheir own version, first seen Oct 13, 2026
- AnastasiyaW/claude-code-configtheir own version, first seen Oct 8, 2026
- 2867203296/hermes-agenttheir own version, first seen Aug 19, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- AnastasiyaW/claude-code-config★ 214same name
- AnastasiyaW/codex-claude-code-config★ 214same name
- quokkify/skills★ 2same name
- 2867203296/hermes-agent★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository116 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/graphify/references/CLAUDE.mdCLAUDE.md
- agent-config-security-auditSkill
- agent-readable-docsSkill
- agent-runtime-patternsSkill
- agent-session-forensicsSkill
- ai-regression-testingSkill
- ai-slop-cleanerSkill
- api-doc-reviewSkill
- architecture-decision-recordsSkill
- architecture-simplificationSkill
- ask-claudeSkill
- ask-codexSkill
- ask-geminiSkill
- autonomous-delivery-pipelineSkill
- baseline-comparison-reviewSkill
- bigquery-cost-auditSkill
- brainstormingSkill
- browser-automation-safetySkill
- bug-huntSkill
- build-fix-minimal-diffSkill
- canonical-advisor-routingSkill
- change-impact-checkSkill
- changelog-generatorSkill
- ci-failure-readoutSkill
- codebase-migration-batchesSkill
- context-compressionSkill
- context-docsSkill
- context-minimizationSkill
- context-retrieval-loopSkill
- data-qualitySkill
- dataset-split-reviewSkill
- dbt-incremental-strategy-auditSkill
- dbt-preflightSkill
- dbt-strategySkill
- dead-code-removalSkill
- defuddleSkill
- dependency-cleanupSkill
- deploy-pipeline-runbookSkill
- dispatching-parallel-agentsSkill
- doc-consistency-checkSkill
- environment-doctorSkill
- experiment-tracking-reviewSkill
- failure-triageSkill
- filesystem-mcp-guardrailsSkill
- finishing-a-development-branchSkill
- flaky-test-investigationSkill
- gh-address-commentsSkill
- github-ci-failure-triageSkill
- graphifySkill
- handoff-disciplineSkill
- hard-won-skill-extractorSkill
- hook-safety-reviewSkill
- incident-readoutSkill
- incremental-migrationSkill
- json-canvasSkill
- local-rag-mcpSkill
- log-driven-diagnosisSkill
- managed-codebase-contextSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 12 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use when designing or improving how an agent invokes tools, handles errors, and decides when to stop.
- Very specific: line 21
Use explicit, stable names: read_file, run_tests, apply_patch
- Very specific: line 22
No generic names: do_action, execute, handle
- Distinctive: line 27
Keep tool inputs narrow:
- Distinctive: line 29
Use enums for mode/type values — never free-text strings that require parsing
- Distinctive: line 44
Every tool response must include:
- Very specific: line 52
Avoid run_bash / shell_exec style catch-all tools unless:
- Distinctive: line 56
If you must use a catch-all, add a PreToolUse validation hook for dangerous patterns.
- Distinctive: line 60
Every tool must define what happens on failure:
- Distinctive: line 68
Do not return partial success with no indication that something failed.
- Distinctive: line 82
Never retry indefinitely. Declare a hard ceiling.
- Distinctive: line 86
Keep system prompt fixed and minimal — it is loaded on every turn
- Distinctive: line 87
Put large reference material (schemas, docs) in skills loaded on demand
- Distinctive: line 89
Do not pass growing tool-call history to subagents.
- Distinctive: line 110
No explicit stop condition — agent loops indefinitely
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Harness Design
Use when designing or improving how an agent invokes tools, handles errors, and decides when to stop.
When to Use
- Designing tool definitions for a new agent or subagent
- Observing high retry rates or ambiguous tool invocations
- Agent is failing silently or completing without verifying outcomes
- Reviewing an existing agent harness for quality issues
Tool Design Rules
Naming
- Use explicit, stable names:
read_file,run_tests,apply_patch - No generic names:
do_action,execute,handle - One tool per distinct operation; do not overload parameters to compensate
Schema
Keep tool inputs narrow:
- Required fields only; no optional fields that change behavior
- Use enums for mode/type values — never free-text strings that require parsing
- Validate at the boundary; reject malformed input with a clear error, not a fallback
{
"name": "run_tests",
"parameters": {
"path": { "type": "string", "description": "Path to test file or directory" },
"filter": { "type": "string", "description": "Optional test name filter" }
}
}Output Shape
Every tool response must include:
status:"success" | "warning" | "error"summary: one-line result (human-readable)next_actions: list of follow-up steps the agent should considerartifacts: file paths or IDs produced (empty list if none)
Catch-All Tools
Avoid run_bash / shell_exec style catch-all tools unless:
- The task is genuinely open-ended and the toolset cannot be pre-defined
- You explicitly document the risk and add an allowlist or preflight check
If you must use a catch-all, add a PreToolUse validation hook for dangerous patterns.
Error Path Rules
Every tool must define what happens on failure:
| Case | Required response |
| Invalid input | Reject immediately with status: "error" and exact field name |
| Transient failure | Include retry_after hint and idempotency note |
| Non-recoverable | State stop: true and describe the manual resolution step |
Do not return partial success with no indication that something failed.
Retry and Stop Conditions
Define retry limits in the harness, not inside tool implementations:
max_retries: 2
stop_conditions:
- tool returns status: "error" with stop: true
- same tool called with identical inputs twice in a row
- completion signal receivedNever retry indefinitely. Declare a hard ceiling.
Context Budget
- Keep system prompt fixed and minimal — it is loaded on every turn
- Put large reference material (schemas, docs) in skills loaded on demand
- Compact at phase boundaries (after research, after planning, after debugging)
- Do not pass growing tool-call history to subagents; summarize into a context bundle
Granularity Guide
| Risk level | Tool granularity |
| High (deploy, migrate, permissions) | Micro — one action, one confirmation |
| Medium (edit, read, search) | Standard — composite is fine |
| Low (format, report, list) | Macro — batch operations acceptable |
Benchmarks to Track
- Completion rate (task finished without escalation)
- Retries per task
- Pass@1 rate (completed on first attempt)
- Cost per successful task
Anti-Patterns
- Overlapping tool semantics (agent cannot choose between them)
- Tool returns only on error — no output on success
- No explicit stop condition — agent loops indefinitely
- Context overload — every tool call inlines full file contents
Verification
- Every tool has an explicit, stable name and exactly one distinct operation
- Schemas use required fields and enums — no free-text mode strings, no behavior-changing optionals
- Every tool response carries
status,summary,next_actions, andartifacts - Every tool defines its invalid-input, transient-failure, and non-recoverable paths
- Retry ceiling and stop conditions are declared in the harness, not inside tools
- Any catch-all tool is documented with its risk and guarded by an allowlist or preflight check
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

