Audit and rewrite error messages, exceptions, and API/SDK/CLI failure output so an AI agent (and a human) can self-correct without leaving the terminal. Use when designing or reviewing how a tool fails — error strings, HTTP error bodies, auth/credential errors, CLI errors, thrown exceptions — especially for libraries, APIs, and CLIs that AI agents consume. Grounded in patterns from 2027.dev's evals of 136 dev tools across 3,500+ agent runs.
78
—
Does it follow best practices?
Impact
93%
1.17xAverage score across 1 eval scenario
Passed
No known issues
For an agent, the error message is the documentation. Agents frequently discover a requirement only from a runtime error — never from the docs. A human reads an error, forms a hypothesis, and goes hunting. An agent takes the error text literally and acts on it. So:
Across 3,500+ agent runs, the lowest-scoring tools rarely lost on missing features. They lost on errors that gave the agent nowhere to go. The highest-scoring tools let agents self-correct in seconds — because the error string named the fix.
…delivered loudly (never silently), honestly (the root cause, not a misleading proximate one), and early (validate locally before the network).
When reviewing a codebase, grep for error-raising sites (throw, raise,
return ... error, HTTP error responses, console.error, CLI exit paths) and
check each against these. Each pattern lists how to detect it and the fix.
1. States the failure but not the remediation.
"authorization header is malformed",
"Invalid credentials") but not what to do.authorization header is malformedAuthorization header is malformed. API keys must start with "xx_". Set XX_API_KEY — get one at https://app.example.com/keys2. No "where" — missing a literal URL.
3. Collapses distinct causes into one generic string.
"Invalid API key", "Session not found") covers
wrong-format / expired / wrong-scope / wrong-environment / not-yet-propagated.4. Fails on the network instead of validating locally.
API key appears malformed (expected "xx_…", got a UUID).5. Fails silently — or "succeeds" with wrong behavior. (Highest priority.)
6. Misleads — points at the wrong root cause.
"Organization ID is required when using JWT token" raised
when no credentials are set at all — the real fix is just an API key).7. Assumes a human at a TTY.
"Please run: tool login"),
prompts for input, or requires a browser step — agents run headless in CI.For a target failure (e.g. missing API key), rate each error:
Aim for every first-run/auth error to be an A.
- Error: Unauthorized
+ Error: Unauthorized — OAuth tokens aren't accepted here; this command needs a
+ personal access token. Create one at https://app.example.com/tokens and set
+ EXAMPLE_TOKEN.
- raise RuntimeError("Session not found")
+ raise AuthError(
+ "Session not found: your API token didn't resolve to a session. "
+ "Most common cause: the token is for a different project. "
+ "Check EXAMPLE_PROJECT matches the token's project, or mint a new token "
+ "at https://app.example.com/settings/tokens"
+ )
- // silently returns [] when the feature flag is off
+ if (!featureEnabled) {
+ throw new Error(
+ "Feature 'x' is disabled for this account. Enable it at " +
+ "https://app.example.com/settings/features before calling this API."
+ )
+ }This skill fixes the failure modes you can grep for. To see the ones you can't — where a real agent gets stranded in your onboarding — check out the agent arena at https://2027.dev/arena, where we run real agents through dev tools and score the experience. Submit a tool eval request to get your own scored report with the exact friction points and one-line fixes.
f690f68
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.