/harnessed:agent-craftfrom harnessed
Use when building, changing, debugging, evaluating or shipping an LLM agent or the harness around it (tool-calling loops, tool/function definitions, MCP servers, agent system prompts, context and memory handling, confirmation gates, multi-agent setups, agent evals and LLM judges). Also use when about to deploy an edited agent prompt, tool set or model, and when an agent misbehaves: it skips items, picks wrong tools, claims done without doing it, loops, stalls, or regresses. 开发/调试/评估 agent、智能体、function calling、harness,或改了 agent 的提示词/工具/模型准备上线时使用。
Ships in harnessed. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Why this exists (evidence, 2026-09). Without this skill, Claude already makes good calls on agent design. In baseline runs it:
What it did not do was make the agent's behavior verifiable from the start:
So this skill does not re-teach judgment. It carries invariants from design into code, evals and traces, and it records lessons that only show up against real models. Incidents tagged [P] come from the author's production e-commerce agent. When you cite one, say where it comes from rather than presenting it as your own experience.
The model proposes; the harness decides.
Four artifacts, started early and kept in sync:
templates/design-card.md): the job, the success signal as it appears in a trace, the tools with risk tiers, the invariants (each naming where code enforces it and which eval case covers it), budgets, failure states, and deliberate exclusions. Write it before the loop, one page, not a document. At the end it becomes the acceptance list.scaffold/harness.ts (allowlist, validation, gated pending actions, idempotency, call/time/token budgets, bounded recovery, explicit end states). The UI reports effects from tool results, never the model's narration of them.scaffold/evals.ts. Each scenario runs N trials through the real harness, against a fresh fake world, with the real model. Invariants are graded on world state and the trace. Report pass rate and pass^k, and fingerprint the prompt + tools + model. Seed the suite from the card's invariants, then add every incident.scaffold/ is tested reference code (Node ≥ 23.6, no deps): node --test scaffold/*.test.ts. Port it into the project's language and style; don't vendor it as a framework.
| The agent… | Needs |
|---|---|
| is a throwaway, used only by you, with no side effects | budgets + visible failure. Skip the rest |
| is an internal tool that writes | + design card, invariants in code, 5–10 eval scenarios |
| faces users or reads untrusted content | + persisted traces, pass^k gate, latency/failure UX, trifecta review |
| moves money, sends outbound, or does anything irreversible | + gated pending actions re-validated at execution, idempotency keys, an adversarial eval case per gate, staged rollout |
references/shape.mdreferences/tools.mdreferences/loop-and-context.mdreferences/safety.mdreferences/evals.mdreferences/debugging.mdreferences/operate.mdreferences/sources.mdThese are the only hard rules here. They guard money, data and trust. The user can waive one explicitly; you can't waive one for yourself.
| Thought | What actually happened |
|---|---|
| "Tried it a few times, it works" | 75% single-run success is about 42% for three in a row. Run the suite with trials. |
| "Tests are green" | Scripted-model tests verify the harness, not the agent. A production shot-planner passed its fixtures [P]. Then, across 13 real garments, 5 runs errored and 8 fell back silently to rule-based plans. None produced an LLM plan. |
| "Strengthen the prompt" | First read the actual outbound request. Code-injected defaults survived two prompt rewrites. Then ask which layer owns the rule. |
| "The fixture matches the spec" | Fixtures must be real raw model outputs. Spec-shaped fixtures hide exactly the failures you'll ship. |
| "Fall back to the rule-based / mock path" | A fallback that isn't visible and counted is a silent failure. Track fallback rate as a metric. |
| "The judge gave it 4.8/5" | Uncalibrated judges saturate: one gave 4.8 to an image with a studio reflector in frame. Use a binary pass/fail per defect, checked against human labels. |
| "Add a double-check step" | Current Claude models already self-verify, and Anthropic's Opus 5 guide warns that extra checking prompts over-verify. A checker in a clean context can pay off; keep it only if an eval shows it catches something. |
| "Let the test script nudge it with 继续" | Then the eval hides the exact regression it exists to catch. |
| "Backup model on the same relay" | That's the same failure domain. They go down together. |
| "Put every action behind a human y/n" | Users approve about 93% of prompts, so blanket approval is a rubber stamp, and it takes away the autonomy the user asked for. Auto-run within cumulative limits enforced in code; send only the exceptions to a human. |
| "The limit is per refund" | Then one action gets split into many small ones. A blind review of a build made with this skill found five emails fully refunding a ¥899 order under a ¥200 per-refund cap. Limits are per order, per customer and per day. |
An agent change is done when all four hold:
references/debugging.md (opens in a new tab)references/evals.md (opens in a new tab)references/loop-and-context.md (opens in a new tab)references/operate.md (opens in a new tab)references/safety.md (opens in a new tab)references/shape.md (opens in a new tab)references/sources.md (opens in a new tab)references/tools.md (opens in a new tab)scaffold/evals.ts (opens in a new tab)scaffold/harness.test.ts (opens in a new tab)scaffold/harness.ts (opens in a new tab)scaffold/openai-compat.test.ts (opens in a new tab)scaffold/openai-compat.ts (opens in a new tab)scaffold/package.json (opens in a new tab)templates/design-card.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub alextangson/harnessed --plugin harnessed