Battle-Tested Agent
19 production-hardened patterns for AI agents. Every one earned from failure.
Use this skill when you are:
- hardening an agent that will run repeatedly or autonomously
- tightening memory, verification, or anti-hallucination behavior
- reducing compaction failures, weak handoffs, or orchestration drift
- reviewing an agent workspace for missing production patterns
- debugging why an agent keeps losing context, guessing, or dropping work
Do not use this skill for:
- persona writing or onboarding polish
- one-off prompt tweaks with no reusable pattern behind them
- adding new tools, servers, or runtime capabilities
- turning a simple workspace into process theater
Default workflow
Audit first
Run bash scripts/audit.sh <workspace> to see which patterns are present.
The script checks for all 16 patterns and tells you what to fix first.
Start with the smallest tier that fits
Implement starter patterns first, then intermediate, then advanced.
Do not cargo-cult every pattern into every agent.
Patch the actual failure mode
Change the mechanism, not just the wording. "ALWAYS check X" is not a fix —
a verification gate is a fix.
Keep patterns lightweight
Add only the pieces that materially reduce failures or operator burden.
Pattern tiers
- Starter (5): baseline reliability for almost every agent
- Intermediate (5): daily-driver patterns for briefs, heartbeats, and recurring work
- Advanced (6): multi-agent orchestration, handoffs, and self-improvement discipline
Pattern clusters
Some patterns reinforce each other naturally. Adopt them together when the failure
mode calls for it:
- Trust chain: WAL Protocol + Anti-Hallucination + Agent Verification — ensures
data is captured, sourced, and measured before reporting
- Handoff loop: Delegation Rules + Completion Contract + Acceptance Gate + Task State Tracking — prevents
work from disappearing between agents or being certified without proof
- Survival kit: Working Buffer + Compaction Injection Hardening + Silent Worker Recovery — keeps context
alive across long sessions and prevents silent delegated drift
- Quality gate: QA Gates + Verify Implementation + Decision Logs — ensures output
quality and traceable reasoning
- Delegation hardening: Brief Quality Gate + Scoped Verifier Gate — keeps delegation tight without turning the whole system into bureaucracy
When patterns conflict
If two patterns seem to give contradictory advice:
- Safety patterns win over speed patterns. Ambiguity Gate overrides Simple Path First
when the request is ambiguous. Verify before acting, even if the simple path is obvious.
- Evidence patterns win over action patterns. Anti-Hallucination overrides "just try it"
when reporting data. Never guess a number to move faster.
Assets — how to use them
The assets/ folder contains starter files you copy into your workspace and customize.
They are templates, not drop-in replacements.
# Merge delegation and decision log rules into your existing AGENTS.md
cp assets/AGENTS-additions.md ~/workspace/ # Review, then merge
# Add QA gates
cp assets/QA-gates.md ~/workspace/QA.md
# Set up self-improvement tracking
mkdir -p ~/workspace/.learnings
cp assets/learnings-template.md ~/workspace/.learnings/LEARNINGS.md
cp assets/errors-template.md ~/workspace/.learnings/ERRORS.md
cp assets/features-template.md ~/workspace/.learnings/FEATURE_REQUESTS.md
Read references/audit-usage.md for the full rollout order and bootstrap workflow.
References
references/starter-patterns.md — WAL, anti-hallucination, ambiguity, simple-path-first, unblock-before-shelve
references/intermediate-patterns.md — verification, working buffer, QA gates, decision logs, verify implementation
references/advanced-patterns.md — delegation, brief quality, proof-based handoffs, acceptance gates, orchestration, stale-worker recovery, compaction hardening, recurrence tracking
references/audit-usage.md — audit script usage, install/copy snippets, and expected outcomes
Included scripts
scripts/audit.sh — workspace audit for all 19 patterns (supports AGENTS.md, CLAUDE.md, SOUL.md, and system.md)
Rules of thumb
- Audit before expanding
- Prefer progressive disclosure over giant core files
- Silence is better than hallucination
- Ambiguity is a stop sign, not permission
- The orchestrator should preserve oversight, not sink into implementation
- Mechanism changes beat wording changes
- After acting, verify the new state before declaring success
- Partial progress is not success; recovery steps matter as much as first-attempt steps
Outcome
A leaner, more resilient agent that survives compaction, hands work off cleanly,
reports only what is verified, and improves without spiraling into bureaucracy.
1---2name: battle-tested-agent3description: 19 production-hardened patterns for AI agents — memory, verification, ambiguity handling, compaction survival, delegation, proof-based handoffs, stale-worker recovery, and self-improvement. Use when hardening an agent for production reliability, when an agent keeps hallucinating or losing context, when handoffs between agents drop details, when delegated work silently fails, or when someone says "my agent is unreliable" or "how do I make this more robust." Works with OpenClaw, Claude Code, Cowork, or any SKILL.md-based agent setup. Includes the Isolated Agent Fabrication Guard plus new delegation hardening patterns for brief quality, completion contracts, acceptance gates, silent-worker recovery, and scoped verifier use.4license: MIT5---67# Battle-Tested Agent89**19 production-hardened patterns for AI agents. Every one earned from failure.**1011Use this skill when you are:12- hardening an agent that will run repeatedly or autonomously13- tightening memory, verification, or anti-hallucination behavior14- reducing compaction failures, weak handoffs, or orchestration drift15- reviewing an agent workspace for missing production patterns16- debugging why an agent keeps losing context, guessing, or dropping work1718Do not use this skill for:19- persona writing or onboarding polish20- one-off prompt tweaks with no reusable pattern behind them21- adding new tools, servers, or runtime capabilities22- turning a simple workspace into process theater2324## Default workflow25261. **Audit first**27 Run `bash scripts/audit.sh <workspace>` to see which patterns are present.28 The script checks for all 16 patterns and tells you what to fix first.29302. **Start with the smallest tier that fits**31 Implement starter patterns first, then intermediate, then advanced.32 Do not cargo-cult every pattern into every agent.33343. **Patch the actual failure mode**35 Change the mechanism, not just the wording. "ALWAYS check X" is not a fix —36 a verification gate is a fix.37384. **Keep patterns lightweight**39 Add only the pieces that materially reduce failures or operator burden.4041## Pattern tiers4243- **Starter (5):** baseline reliability for almost every agent44- **Intermediate (5):** daily-driver patterns for briefs, heartbeats, and recurring work45- **Advanced (6):** multi-agent orchestration, handoffs, and self-improvement discipline4647### Pattern clusters4849Some patterns reinforce each other naturally. Adopt them together when the failure50mode calls for it:5152- **Trust chain:** WAL Protocol + Anti-Hallucination + Agent Verification — ensures53 data is captured, sourced, and measured before reporting54- **Handoff loop:** Delegation Rules + Completion Contract + Acceptance Gate + Task State Tracking — prevents55 work from disappearing between agents or being certified without proof56- **Survival kit:** Working Buffer + Compaction Injection Hardening + Silent Worker Recovery — keeps context57 alive across long sessions and prevents silent delegated drift58- **Quality gate:** QA Gates + Verify Implementation + Decision Logs — ensures output59 quality and traceable reasoning60- **Delegation hardening:** Brief Quality Gate + Scoped Verifier Gate — keeps delegation tight without turning the whole system into bureaucracy6162### When patterns conflict6364If two patterns seem to give contradictory advice:65- **Safety patterns win over speed patterns.** Ambiguity Gate overrides Simple Path First66 when the request is ambiguous. Verify before acting, even if the simple path is obvious.67- **Evidence patterns win over action patterns.** Anti-Hallucination overrides "just try it"68 when reporting data. Never guess a number to move faster.6970## Assets — how to use them7172The `assets/` folder contains starter files you copy into your workspace and customize.73They are templates, not drop-in replacements.7475```bash76# Merge delegation and decision log rules into your existing AGENTS.md77cp assets/AGENTS-additions.md ~/workspace/ # Review, then merge7879# Add QA gates80cp assets/QA-gates.md ~/workspace/QA.md8182# Set up self-improvement tracking83mkdir -p ~/workspace/.learnings84cp assets/learnings-template.md ~/workspace/.learnings/LEARNINGS.md85cp assets/errors-template.md ~/workspace/.learnings/ERRORS.md86cp assets/features-template.md ~/workspace/.learnings/FEATURE_REQUESTS.md87```8889Read `references/audit-usage.md` for the full rollout order and bootstrap workflow.9091## References9293- `references/starter-patterns.md` — WAL, anti-hallucination, ambiguity, simple-path-first, unblock-before-shelve94- `references/intermediate-patterns.md` — verification, working buffer, QA gates, decision logs, verify implementation95- `references/advanced-patterns.md` — delegation, brief quality, proof-based handoffs, acceptance gates, orchestration, stale-worker recovery, compaction hardening, recurrence tracking96- `references/audit-usage.md` — audit script usage, install/copy snippets, and expected outcomes9798## Included scripts99100- `scripts/audit.sh` — workspace audit for all 19 patterns (supports AGENTS.md, CLAUDE.md, SOUL.md, and system.md)101102## Rules of thumb103104- Audit before expanding105- Prefer progressive disclosure over giant core files106- Silence is better than hallucination107- Ambiguity is a stop sign, not permission108- The orchestrator should preserve oversight, not sink into implementation109- Mechanism changes beat wording changes110- After acting, verify the new state before declaring success111- Partial progress is not success; recovery steps matter as much as first-attempt steps112113## Outcome114115A leaner, more resilient agent that survives compaction, hands work off cleanly,116reports only what is verified, and improves without spiraling into bureaucracy.