Use after 2 consecutive failed attempts at solving a problem - STOP guessing and research documentation, codebase, and online resources before resuming
After 2 consecutive failures, this skill forces a research phase before more attempts. It uses grep, web search, and codebase analysis to understand the problem, then posts findings to the issue before resuming with a new approach.
/plugin marketplace add troykelly/claude-skills/plugin install issue-driven-development@troykelly-skillsThis skill is limited to using the following tools:
After 2 failed attempts, stop and research. Don't keep trying the same thing.
Core principle: Insanity is doing the same thing and expecting different results.
Trigger: Two consecutive failed attempts at solving a problem.
Announce at start: "I've failed twice. I'm stopping to research before trying again."
Attempt 1: Try solution
│
▼
Failed?
│
┌──────┴──────┐
│ │
Yes No → Done
│
▼
Attempt 2: Try different approach
│
▼
Failed?
│
┌──────┴──────┐
│ │
Yes No → Done
│
▼
STOP
│
▼
RESEARCH ← You are here
│
▼
Attempt 3: Try with new knowledge
| Failure | Not a Failure |
|---|---|
| Tests don't pass | Minor syntax error fixed |
| Build breaks | Typo corrected |
| Feature doesn't work | IDE autocomplete issue |
| Same error recurs | Different error (progress) |
| No progress made | Partial progress |
Before researching, document what was tried:
## Failed Attempts
### Attempt 1
**Approach:** [What was tried]
**Result:** [What happened]
**Error:** [Error message if any]
### Attempt 2
**Approach:** [What was tried]
**Result:** [What happened]
**Error:** [Error message if any]
### Pattern
[What do these failures have in common?]
# Check README
cat README.md
# Check docs directory
ls -la docs/
cat docs/[relevant-topic].md
# Check CONTRIBUTING
cat CONTRIBUTING.md
# Search for relevant docs
grep -r "[keyword]" docs/
Questions to answer:
# Find similar patterns
grep -r "[pattern]" src/
# Find how others solved similar problems
git log --all --oneline --grep="[keyword]"
# Look at test files for usage examples
grep -r "[function/class]" **/*.test.ts
Questions to answer:
Use web search for:
Search queries to try:
- "[exact error message]"
- "[library name] [problem description]"
- "[framework] [what you're trying to do]"
## Research Findings
### From Repository Docs
- [Finding 1]
- [Finding 2]
### From Codebase
- [Pattern found]
- [Example found]
### From Online
- [Solution found]
- [Workaround found]
### New Approach
Based on research, the new approach is:
1. [Step 1]
2. [Step 2]
3. [Step 3]
Post research findings to the issue:
gh issue comment [ISSUE_NUMBER] --body "## Research After Failed Attempts
### What Was Tried
1. [Attempt 1]
2. [Attempt 2]
### Research Findings
[Summary of findings]
### New Approach
[How this will be solved now]
"
Apply findings to the next attempt.
If third attempt also fails → Consider escalating to human.
After research + third attempt, if still failing:
## Escalation: Need Human Input
**Issue:** #[NUMBER]
**Attempted:**
1. [Approach 1] - [Result]
2. [Approach 2] - [Result]
3. [Approach 3 after research] - [Result]
**Researched:**
- [Sources checked]
- [Findings]
**Current Understanding:**
[What we know now]
**Blocking Question:**
[Specific question that needs human insight]
Mark issue as Blocked and await response.
| Anti-Pattern | Correct Approach |
|---|---|
| Keep trying same thing | Stop and research |
| Research indefinitely | Time-box to 15-30 min |
| Ignore error messages | Search exact error text |
| Skip local docs | Check README first |
| Guess at solutions | Understand problem first |
Priority order:
Research should be focused:
| Resource | Time Limit |
|---|---|
| Local docs | 5 minutes |
| Codebase search | 10 minutes |
| Online search | 15 minutes |
| Total research | 30 minutes max |
After 30 minutes without breakthrough → Escalate.
When triggered by 2 failures:
This skill is triggered by:
issue-driven-development - Step 8 (verification loop)This skill calls:
issue-lifecycle - Post research findingsmemory-integration - Store findings for future referenceThis skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.