.claude/skills/workflow/error-recovery/SKILL.md
Structured recovery templates for common agent failure modes. Use when an agent fails mid-task due to context exhaustion, build failure, or unclear requirements.
npx skillsauth add brdohman/agile-maestro error-recoveryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When an agent fails, the coordinator spawns a NEW agent with a recovery prompt. The recovery prompt must be under 500 words and include only what the new agent needs.
Agent ran out of context before completing the task.
Recovery prompt template:
Task ID: [task-id]
Story: [story-id]
What was attempted: [1-2 sentences from the last implementation comment, or STARTING comment if no impl comment exists]
What remains: [list unchecked items from task checklist]
Files already created/modified: [list from git diff or last comment]
Error: Agent exhausted context before completing.
Pick up where the previous agent left off. Read the task via TaskGet, check what files exist, and complete the remaining checklist items. Do NOT redo work that's already done.
Key rule: Never paste the failed agent's full output. Summarize in 2-3 sentences.
Agent's code doesn't compile.
Recovery prompt template:
Task ID: [task-id]
Build error: [paste ONLY the error message, not full build log — typically 3-10 lines]
File with error: [path]
What the task is doing: [1 sentence from task description]
Fix the build error. Read the file, fix the issue, rebuild. If the fix requires understanding other files, read only what's needed.
Key rule: Paste the error message, not the full xcodebuild output. The error is usually 3-10 lines. The full log can be 500+ lines.
Tests fail after implementation.
Recovery prompt template:
Task ID: [task-id]
Failing test: [TestClassName/testMethodName]
Test error: [assertion failure message — 1-3 lines]
Test file: [path]
Implementation file: [path]
Read the failing test, understand what it expects, read the implementation, and fix the mismatch. Run the test again to verify.
Agent couldn't determine what to build from the task description.
Recovery approach: Don't spawn a recovery agent. Instead:
type: "note", content: "BLOCKED: [what's unclear]"metadata.blocked: trueAgent's changes conflict with another agent's concurrent work.
Recovery prompt template:
Task ID: [task-id]
Conflicting files: [list from git status]
This task's intent: [1 sentence]
Resolve the merge conflicts in the listed files. Keep both sides' changes where possible. If the conflict is semantic (both sides changed the same logic), read both versions and pick the correct one based on the task description. Rebuild after resolving.
testing
XCTest patterns for macOS Swift apps. Unit tests, async tests, Core Data tests, mock patterns, and assertion reference. Use when writing or reviewing tests.
tools
How to transition workflow state between review stages. Rules for setting review_stage and review_result fields on Stories and Epics.
documentation
Comment structure and rules for task workflow updates. Use when adding any comment to a task during implementation, review, or fix cycles.
testing
Validate task/story/epic/bug/techdebt metadata against schema v2.0. Run after TaskCreate or TaskUpdate to verify compliance. Returns pass/fail with actionable details.