From ralph-dev
Systematically investigates code errors via root cause analysis, reproduction with tests, git diffs, pattern matching, hypothesis testing with web search, before fixes.
npx claudepluginhub mylukin/ralph-dev --plugin ralph-devThis skill is limited to using the following tools:
Systematically investigate and fix implementation errors using root cause analysis. **NO FIXES WITHOUT INVESTIGATION FIRST.**
Guides root cause investigation for bugs, test failures, unexpected behavior, and errors using four phases: investigation, pattern analysis, hypothesis testing before fixes.
Enforces four-phase debugging (root cause investigation, pattern analysis, hypothesis testing, implementation) for bugs, test failures, performance issues, and unexpected behavior before any fixes.
Enforces root cause investigation for bugs, test failures, unexpected behavior, and performance issues through four phases before proposing fixes.
Share bugs, ideas, or general feedback.
Systematically investigate and fix implementation errors using root cause analysis. NO FIXES WITHOUT INVESTIGATION FIRST.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
If you haven't completed Phase 1 (Root Cause Investigation), you CANNOT propose fixes.
{task_id}{error_msg}IMPORTANT: This skill requires the Ralph-dev CLI. It will build automatically on first use.
# Bootstrap CLI - runs automatically, builds if needed
source ${CLAUDE_PLUGIN_ROOT}/shared/bootstrap-cli.sh
# Verify CLI is ready
ralph-dev --version
# Context-compression resilience: Verify current phase
CURRENT_PHASE=$(ralph-dev state get --json 2>/dev/null | jq -r '.phase // "none"')
echo "Current phase: $CURRENT_PHASE"
# Expected: implement or heal (invoked by phase-3)
# Get task details (context-compression safe)
TASK_JSON=$(ralph-dev tasks get "$TASK_ID" --json)
TASK_DESC=$(echo "$TASK_JSON" | jq -r '.data.description // "No description"')
# Get test command from language config
TEST_CMD=$(ralph-dev detect --json | jq -r '.verifyCommands[] | select(contains("test"))' | head -1)
echo "Task: $TASK_ID"
echo "Description: $TASK_DESC"
echo "Test command: $TEST_CMD"
MANDATORY: Complete each phase before proceeding to the next.
CI=true {test_command} to confirmgit log -5, git diff HEAD~1Error Classification:
| Error Type | Indicators | Fix Type |
|---|---|---|
| Missing dependency | "Module not found", "Cannot find module" | npm install |
| Type error | "TypeError", type mismatch | Code fix |
| Undefined reference | "is not defined", "ReferenceError" | Import/declaration |
| Test failure | "Expected X but got Y" | Implementation logic |
| Build error | "compilation error", "build failed" | Config fix |
Max 3 attempts. After 3 failures → mark task as failed.
MAX_ATTEMPTS=3
ATTEMPT=1
while [ $ATTEMPT -le $MAX_ATTEMPTS ]; do
# Apply single fix based on hypothesis
# Run tests: CI=true {test_command}
if [ $? -eq 0 ]; then
# SUCCESS - return result
break
fi
ATTEMPT=$((ATTEMPT + 1))
# If still failing, refine hypothesis and retry
done
CRITICAL: Always show full test output as verification evidence.
REQUIRED Output Format:
---HEALING RESULT---
task_id: {task_id}
status: success | failed
verification_passed: true | false
attempts: {N}
fix_type: dependency | code | implementation | config
hypothesis: {what was wrong}
notes: {brief summary}
---END HEALING RESULT---
| Limit | Value | Purpose |
|---|---|---|
| Max attempts | 3 | Prevent infinite retry loops |
| Timeout | 1 hour | Prevent stuck healing |
| Single fix per attempt | 1 | Isolate variables |
CI=true when running tests| Error | Action |
|---|---|
| Cannot reproduce | Gather more data, check environment |
| No working examples | Use WebSearch for reference implementations |
| All 3 attempts fail | Mark task failed, require manual intervention |
| Hypothesis unclear | Return to Phase 1 with more investigation |