From dx-core
Diagnose and fix a blocked step — compilation error, test failure, or review rejection. Tries direct fix first; if that fails, creates corrective steps in implement.md (heal). Use when /dx-step reports a failure.
npx claudepluginhub easingthemes/dx-aem-flow --plugin dx-coreThis skill is limited to using the following tools:
You diagnose and fix issues that blocked a plan step — compilation errors, test failures, or review feedback. You try a direct fix first. If that fails, you escalate to creating corrective steps in implement.md for the step machinery to execute.
Fixes bugs via root cause diagnosis with debugger/gap-analyzer, requirements.md generation, /execute delegation, 3-retry circuit breaker, and QA.
Quickly analyzes errors from logs or args, applies minimal fixes with Edit/Write tools, verifies via tests or re-runs, and reports results concisely without explanation.
Share bugs, ideas, or general feedback.
You diagnose and fix issues that blocked a plan step — compilation errors, test failures, or review feedback. You try a direct fix first. If that fails, you escalate to creating corrective steps in implement.md for the step machinery to execute.
Use ultrathink for this skill — debugging requires deep reasoning about root causes.
digraph step_fix {
"Read blocked step from implement.md" [shape=box];
"Classify error" [shape=diamond];
"PERMANENT: Mark blocked, report" [shape=doublecircle];
"TRANSIENT: Suggest retry" [shape=doublecircle];
"Gather error context" [shape=box];
"Diagnose root cause" [shape=box];
"Load conventions" [shape=box];
"Apply fix" [shape=box];
"Re-verify (build/test)" [shape=box];
"Fix worked?" [shape=diamond];
"Mark step done + report" [shape=doublecircle];
"Fix failed — escalate to heal?" [shape=diamond];
"Determine failure type" [shape=diamond];
"Analyze blocked step with different approach" [shape=box];
"Group review issues by file cluster" [shape=box];
"Create corrective steps in implement.md" [shape=box];
"Corrective steps viable?" [shape=diamond];
"Return: healed (new steps)" [shape=doublecircle];
"Return: unrecoverable" [shape=doublecircle];
"Read blocked step from implement.md" -> "Classify error";
"Classify error" -> "PERMANENT: Mark blocked, report" [label="PERMANENT"];
"Classify error" -> "TRANSIENT: Suggest retry" [label="TRANSIENT"];
"Classify error" -> "Gather error context" [label="VALIDATION"];
"Gather error context" -> "Diagnose root cause";
"Diagnose root cause" -> "Load conventions";
"Load conventions" -> "Apply fix";
"Apply fix" -> "Re-verify (build/test)";
"Re-verify (build/test)" -> "Fix worked?";
"Fix worked?" -> "Mark step done + report" [label="yes"];
"Fix worked?" -> "Fix failed — escalate to heal?" [label="no"];
"Fix failed — escalate to heal?" -> "Return: unrecoverable" [label="no (environment/config)"];
"Fix failed — escalate to heal?" -> "Determine failure type" [label="yes"];
"Determine failure type" -> "Analyze blocked step with different approach" [label="step-blocked"];
"Determine failure type" -> "Group review issues by file cluster" [label="review-failed"];
"Analyze blocked step with different approach" -> "Corrective steps viable?";
"Group review issues by file cluster" -> "Create corrective steps in implement.md";
"Create corrective steps in implement.md" -> "Corrective steps viable?";
"Corrective steps viable?" -> "Return: healed (new steps)" [label="yes"];
"Corrective steps viable?" -> "Return: unrecoverable" [label="no"];
}
SPEC_DIR=$(bash .ai/lib/dx-common.sh find-spec-dir $ARGUMENTS)
Read implement.md from $SPEC_DIR. Find the step that needs fixing:
**Status:** blocked step, OR**Status:** in-progress step (interrupted), OR**Status:** done step if the issue is from post-step testing/reviewBefore attempting any fix, classify the error using shared/error-handling.md:
Do not attempt fix. Return: "PERMANENT error: [category]. Manual intervention required: [suggestion]."
Suggest retry, not code fix. Return: "TRANSIENT error: [category]. Re-run the step."
Read ALL available error information:
Also read:
Use extended thinking to analyze:
If superpowers:systematic-debugging is available, invoke it to structure the diagnosis.
Fallback (if superpowers not installed): Follow this 4-phase approach:
Before applying any fix, read the coding standards for the file types being modified:
.claude/rules/ — read rules matching the file types (e.g., fe-javascript.md for .js, fe-styles.md for .scss, accessibility.md for a11y fixes).github/instructions/ exists, read the relevant instruction file for deeper framework patterns (e.g., fe.javascript.instructions.md for .js, fe.css-styles.md for .scss)shared/aem-dom-rules.md exists (from the dx-aem plugin), read it for DOM traversal constraints — especially for modals, overlays, focus traps, and inert managementThese conventions constrain how the fix should be written. A fix that solves the error but violates project conventions is not acceptable.
Implement the fix:
Run the same verification that failed. Read the project's build/test commands from .ai/config.yaml if needed.
Did the re-verification pass? Check exit code and output for success/failure indicators.
Update the step's status to done in implement.md and print the summary:
## Fix Result: Step <N>
**Issue:** <one-line description of the problem>
**Root cause:** <one-line diagnosis>
**Fix applied:** <one-line description of what was changed>
**Verification:** PASSED
The direct fix didn't work. Decide whether to escalate to heal (creating corrective steps):
First, update the step's status to blocked with a diagnosis in implement.md:
**Blocked:** <diagnosis of what went wrong and why the fix didn't work>
Detect the failure type from context:
**Status:** blocked with a **Blocked:** diagnosis note (compilation error, test failure, or step execution issue). Go to "Analyze blocked step with different approach".The direct fix failed. Now analyze with a fundamentally different approach.
**Blocked:** note — this explains what was tried and why it failed**What** instructions and **Files** listUse extended thinking to find a DIFFERENT approach:
Append ONE corrective step immediately after the blocked step in implement.md:
### Step <N>h: Heal — <descriptive title>
**Status:** pending
**Files:** <files that need changes>
**What:**
<Specific, different fix approach. Reference the failed attempt and explain why this approach is different.>
**Why:** Auto-generated by step-fix heal. Previous fix attempt failed because: <reason from blocked note>.
**Test:** <verification command>
Numbering: Use <original-step-number>h (e.g., Step 3h heals Step 3). If a second healing is needed, use <original-step-number>h2.
The failure came from review feedback after fix cycles failed.
Use extended thinking to diagnose:
Group related issues by file. Create one corrective step per file or per related cluster:
### Step R<N>: Review fix — <file or issue cluster>
**Status:** pending
**Files:** <affected files>
**What:**
<Specific fix instructions for each issue in this cluster. Include file:line references from the review.>
**Why:** Auto-generated by step-fix heal from review cycle failure. Issues: <count> Critical, <count> Important.
**Test:** <verification command>
Numbering: Use R1, R2, R3, etc. for review-fix steps. If a second healing cycle is needed, use R1b, R2b, etc.
Evaluate whether the corrective steps can realistically fix the problem:
Corrective steps have been appended to implement.md. Print summary:
## Heal Result
**Failure type:** Step blocked / Review failed
**Root cause:** <one-line diagnosis>
**Corrective steps created:** <N>
**Steps:** <list of step numbers and titles>
**Approach:** <how this differs from the failed attempt>
Return healed — corrective steps created in implement.md, ready for step to execute.
The issue cannot be auto-fixed. Print summary:
## Fix Result: Step <N>
**Issue:** <one-line description of the problem>
**Root cause:** <one-line diagnosis>
**Verdict:** Unrecoverable — <reason>
**Recommendation:** <what the human should investigate>
Return unrecoverable — do NOT create corrective steps. The pipeline stops here.
pending status (healed), ORimplement.md/dx-step-fix 2435084
Finds the blocked step, reads the error (e.g., missing import), applies the fix, re-runs compilation. If it passes, marks the step done.
/dx-step-fix 2435084
Direct fix attempt fails. Analyzes the failure with a different approach, creates Step 3h with new instructions. Returns healed.
/dx-step-fix 2435084
Review found 3 Critical issues after fix cycles failed. Creates Steps R1 and R2 (grouped by file) with specific fix instructions. Returns healed.
/dx-step-fix 2435084
The failure requires a missing Maven dependency that isn't in the project. Returns unrecoverable with recommendation for human intervention.
Cause: The root cause is in the plan, not the code — wrong property name, wrong file path, etc.
Fix: The skill fixes code to match reality and notes the plan deviation. Review implement.md to correct future steps.
Cause: Missing dependency, wrong config, or AEM not running.
Fix: Address the environment issue manually (e.g., install dependency, start AEM), then re-run /dx-step-fix.
Cause: The healing approach was insufficient, or the root cause is deeper.
Fix: The orchestrator (dx-step-all) allows 2 healing cycles per step. If both fail, it stops for human intervention.
Cause: The step instructions reference wrong files or wrong API.
Fix: step-fix heals code, not plans. If the plan is fundamentally wrong, it returns unrecoverable. Edit implement.md manually.
| Thought | Reality |
|---|---|
| "The same fix might work if we retry" | The direct fix already tried. Heal must try a DIFFERENT approach. |
| "I'll create many small steps to be thorough" | Fewer steps = less overhead. Group by file. |
| "This is too complex to auto-heal" | Analyze deeper. If truly unrecoverable, say so explicitly. |
| "The original plan was wrong" | You fix code, not plans. If the plan is flawed, return unrecoverable. |