Classify failures into structured categories and select recovery recipes. Use when: diagnosing errors, sprint failures, QA failures, build errors, test failures, MCP issues, branch conflicts, or any failure that needs classification before repair. Enables "recovery before escalation" pattern.
From cksnpx claudepluginhub cardinalconseils/claude-starter --plugin cksThis skill is limited to using the following tools:
recipes/branch_divergence.mdrecipes/compile.mdrecipes/mcp_startup.mdrecipes/test.mdDesigns and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Classify every failure into a structured category before attempting repair. This prevents blind retries and enables targeted recovery recipes.
Core principle: Recovery before escalation — attempt one automatic fix per failure type before asking the user.
| Category | Detection Pattern | Severity | Auto-Recoverable? |
|---|---|---|---|
compile | Build/type errors, syntax errors, missing imports | blocking | Yes — usually fixable from error output |
test | Test suite failures, assertion errors | blocking | Partial — depends on cause |
branch_divergence | Merge conflicts, stale branch, rebase needed | blocking | Yes — rebase or merge-forward |
trust_gate | Security scan failures, secret leaks, CONFIDENCE.md gate failures | blocking | No — requires human review |
mcp_startup | MCP server connection failures, handshake timeouts | degraded | Yes — retry once, then skip with warning |
plugin_startup | Plugin configuration errors, missing dependencies | degraded | Partial — depends on config |
infra | Deployment failures, environment issues, CI failures | blocking | No — usually requires manual intervention |
prompt_delivery | Agent dispatch failures, context overflow, tool errors | degraded | Yes — reduce scope and retry |
When encountering a failure:
blocking (stops progress) or degraded (can continue with reduced capability)recipes/{category}.mdSignals: "error TS", "SyntaxError", "Cannot find module", "does not exist",
"expected expression", "Build failed", exit code from tsc/esbuild/webpack,
"cargo build" failures, "rustc error", ImportError, ModuleNotFoundError
Signals: "FAIL", "AssertionError", "expected X but got Y", "test failed",
"Tests: N failed", exit code from jest/vitest/pytest/cargo test,
"0 passing" when tests expected
Signals: "CONFLICT", "merge conflict", "diverged", "behind origin/main",
"needs rebase", "cannot fast-forward", git status showing unmerged paths
Signals: "secret detected", "API key found", "CONFIDENCE.md gate FAIL" (after 2 attempts),
security scan findings, "vulnerability found", eslint-plugin-security warnings
Signals: "MCP server failed", "connection refused", "handshake timeout",
"tool not available", MCP-related errors in session start output
Signals: "plugin not found", "invalid plugin.json", "missing dependency",
"hook failed to load", plugin initialization errors
Signals: "deployment failed", "container exited", "health check failed",
"environment variable not set", CI pipeline red, "permission denied" on deploy
Signals: "context too long", "token limit exceeded", "agent failed to respond",
"tool call failed", timeout on agent dispatch, empty agent response
After classification, produce:
{
"failure_type": "compile",
"severity": "blocking",
"signal": "error TS2304: Cannot find name 'UserProfile'",
"source_file": "src/auth/middleware.ts",
"source_line": 42,
"auto_recoverable": true,
"recipe": "recipes/compile.md",
"recovery_attempted": false,
"recovery_result": null
}
failure_type to the diagnosis report.failure.classified events with the structured output.Each failure type gets ONE automatic recovery attempt. If recovery fails:
recovery.escalated event