From workflow-kit
Rescue a stuck implementation phase by spawning a single stronger-model sub-agent to diagnose and fix a 3x verification failure. Use this skill whenever the user says "deep dive", "rescue this phase", "try again with a stronger model", "send in opus", invokes `/deep-dive`, or whenever the `implement-plan` skill hits its hard-stop path after three consecutive `/verify` failures on the same phase. Also trigger when the user is stuck on a specific failing phase and wants one focused, higher-capability attempt before giving up — even if they don't say "deep dive" explicitly.
How this skill is triggered — by the user, by Claude, or both
Slash command
/workflow-kit:deep-diveThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A focused rescue pass for an `implement-plan` phase that has exhausted its retry budget.
A focused rescue pass for an implement-plan phase that has exhausted its retry budget.
Spawn one sub-agent with a stronger model, hand it everything it needs to understand the
failure, and let it attempt a fix in the same worktree. Hard-cap the attempts so a stuck
phase cannot quietly burn the user's token budget.
Two entry points:
/deep-dive after watching a phase fail repeatedly, or wants
to throw a stronger model at a tricky problem.implement-plan hits its 3x /verify failure hard-stop on a phase
and routes here before falling back to the user-wait path.In both cases the skill operates as the escalation step before the human is paged.
Collect these before doing anything. If implement-plan delegated, it should pass them
through; otherwise prompt the user.
/verify error output — raw error/log from the most recent failed runIf the failed phase or error output is missing, ask once. Don't proceed blind — the whole point of deep-dive is targeted reasoning over the actual failure signal.
implement-plan writes a > ⚠️ **BLOCKED**: ... callout under the failed phase heading
before handing off. This skill owns that marker for the duration of the rescue loop:
implement-plan checks off the phase.Always write the plan back to disk after touching the marker. The point of the marker is durability across sessions; transient updates defeat that.
Hard cap: 3 deep-dive attempts. This skill's job is not to grind indefinitely on a hard problem — it is to give one focused, higher-capability rescue effort. After 3 failed attempts, halt and notify the user. The cost of a runaway deep-dive (token burn, wall clock, no convergence signal) is higher than the cost of asking the user to look at it.
Track attempt count in working memory across the loop below.
/verify error output verbatim — preserve quoted text, stack traces, file:line/clean-architecture to load the project's architecture rules into contextThe sub-agent gets briefed with this material, so the parent must collect it cleanly. Don't paraphrase the error — the exact message often contains the fix.
Use the Agent tool with the stronger model (default Opus, or the user's override). Brief it with everything from Step 1. The sub-agent's job is to diagnose, fix, and re-verify in one pass.
Sub-agent prompt template:
You are rescuing a stuck implementation phase. The primary agent ran /verify three times
on this phase and failed each time. Your job: diagnose the root cause, apply a fix in
the worktree, then run /verify and report whether it passed.
Plan: <plan file path>
Failed phase: <phase name / heading>
Worktree: <worktree path>
The phase tasks:
<copy of phase tasks from plan>
Last /verify error output:
<raw error output, fenced>
Architecture rules (from /clean-architecture):
<rules summary or pointer>
Constraints:
- Work only inside the worktree path above
- Honor the architecture rules — don't bypass layers or add abstractions the rules forbid
- Don't restructure unrelated code; stay focused on the phase's scope and the failure signal
- After you apply your fix, run /verify and report the exact pass/fail result back to me
- If you can't determine a fix from the error signal alone, say so explicitly rather than
guessing — a clear "I don't know why" is more useful than a speculative patch
Report back with:
1. Root cause diagnosis (one or two sentences)
2. What you changed (file paths + summary)
3. /verify result (pass | fail + raw output if fail)
Spawn the sub-agent with subagent_type: general-purpose (or a more specific type if
appropriate) and the model override.
When the sub-agent returns:
implement-plan so it can check off the phase and
continue. Report to the user: which attempt succeeded, root cause, files changed.Each retry's brief should include the previous attempt's diagnosis and what it tried. This avoids the rescue agent repeating a failed approach and gives it a chance to course-correct.
Three rescue attempts have failed. Stop.
Replace the BLOCKED callout in the plan with a HALTED callout under the failed phase heading, then write the plan back to disk:
### Phase <N>: <name>
> 🛑 **HALTED**: deep-dive exhausted 3 rescue attempts.
> **Last error:** <one-line summary>
> **Worktree:** <worktree path>
> **Recovery:** investigate manually, then re-run `/implement-plan` from this phase.
- [ ] Task ...
The HALTED marker is the durable signal that this phase needs human attention. Leave it in place — the user (or a later session) clears it when they resume.
Invoke /notify-me with a summary:
/notify-me "deep-dive halt: Phase <name> failed 3x rescue attempts. Last error: <one-line summary>"
Print a halt report to the user:
# Deep Dive Halted
**Plan:** <plan name>
**Phase:** <phase name>
**Attempts:** 3 (all failed)
**Worktree:** <path>
## Attempt History
1. Attempt 1 — <one-line diagnosis> → fail
2. Attempt 2 — <one-line diagnosis> → fail
3. Attempt 3 — <one-line diagnosis> → fail
## Last Error
<raw /verify output from attempt 3>
## Recovery
- The worktree is intact at <path>
- Review the attempt history above for partial progress to keep or discard
- Investigate manually, then resume `implement-plan` from this phase or revise the plan
A rescue loop without a cap can chew through tokens on a problem that is genuinely ambiguous, blocked on missing information (e.g., an external API change), or outside the model's reach with the available context. Three attempts is enough to try meaningfully different angles; beyond that, returning control to the human is almost always cheaper than another attempt.
The parent agent has been running the plan and may have accumulated context that's pulling it toward the same failed approach. A fresh sub-agent with a focused brief — plan tasks, error output, architecture rules — gets a clean reasoning slate and a stronger model. That combination is what makes deep-dive meaningfully different from the parent's own retry loop, not just "try again with more determination".
/verify will run/verify and architecture
rules to /clean-architecture, just like its sibling skills in workflow-kit./clean-architecture or /verify is missing in the project, surface that to the
user and proceed with whatever guidance the project does provide. Don't fabricate rules.npx claudepluginhub alton09/q-skills --plugin workflow-kitCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.