[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6H47CWKYXK14XDP0EQ8B4RR":3,"skill-same:01M6H47CWKYXK14XDP0EQ8B4RR":71},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":51,"repositoryHtmlUrl":52,"repositoryHomepageUrl":6,"ownerHtmlUrl":53,"ownerBlogUrl":54,"ownerDescription":55,"updatedAt":56,"install":57,"resources":70},"01M6H47CWKYXK14XDP0EQ8B4RR","dx-step-all",null,"Run every plan step hands-free (implement, test, review, commit), with step-fix on failures; stops after 2 failed fixes on one step. Use for 'execute plan', 'run all steps'.","easingthemes\u002Fdx-aem-flow","easingthemes","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2750284?v=4","01M6H3XYGJY8QCX9ES36P2WF4H","Dragan Filipović","01M6H3XYMN1XVSGKN7N79SW3RH",7,"MIT","https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-core\u002Fskills\u002Fdx-step-all\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"dx","dx step all","id","with","implement","use","for","fixes","execute plan","edit","write","read","run","plan","work","review","commit","free","fix","search","2026-11-10 10:12:30",false,"---\nname: dx-step-all\ndescription: \"Run every plan step hands-free (implement, test, review, commit), with step-fix on failures; stops after 2 failed fixes on one step. Use for 'execute plan', 'run all steps'.\"\nargument-hint: \"[Work Item ID or slug (optional — uses most recent if omitted)]\"\ncontext: fork\nallowed-tools: [\"read\", \"edit\", \"search\", \"write\", \"agent\"]\n---\n\n**Isolation check.** This skill is meant to run in its own context (`context: fork`). If you can see the user's messages from before this skill was invoked, you are running inline (Copilot CLI ignores `context: fork`): do not run the steps below yourself. Start one subagent with your task\u002Fsubagent tool, give it only this instruction — \"Invoke the dx-core:dx-step-all skill with these arguments: \u003Cthe arguments you were given, or none>. Run it fully and reply with its final report only.\" — then show the user that report and stop. If you cannot see earlier user messages, or your only earlier message is that instruction to invoke dx-core:dx-step-all (you are a fork or that subagent), continue below.\n\nYou are a coordinator. You run the step pipeline for each step in implement.md, delegating to skills via the Skill tool.\n\n## Progress visibility\n\nYou run in a forked context. Before emitting any chat output, determine whether you were invoked by the orchestrator (`dx-agent-all`) or standalone — see `plugins\u002Fdx-core\u002Fshared\u002Forchestration-check.md`:\n\n```bash\nORCHESTRATED=0\nFLAG=\".ai\u002Frun-context\u002Forchestrating.flag\"\nif [ -f \"$FLAG\" ]; then\n  AGE=$(( $(date +%s) - $(date -r \"$FLAG\" +%s) ))\n  [ \"$AGE\" -lt 7200 ] && ORCHESTRATED=1\nfi\n```\n\n- **If `$ORCHESTRATED == 1`** (orchestrator path): write all canonical artifacts to `$SPEC_DIR\u002F\u003Cfile>.md` (already documented below) and emit ONLY the `## Return` block to chat.\n- **If `$ORCHESTRATED == 0`** (standalone path): write the same canonical artifacts AND emit the human-friendly summary marked `\u003C!-- standalone-only -->` below, followed by the `## Return` block at the very end.\n\nPer-phase \u002F per-step progress lines during the run are allowed in both paths.\n\nYou run forked, so nothing inside this skill is visible to the orchestrator (`dx-agent-all`) — the progress file is the only channel. You MUST update `$SPEC_DIR\u002Fdev-all-progress.md` after each step transition:\n\n- Mark step in_progress at the start of execution\n- Mark step done | failed | healing immediately on transition\n- Update within the same logical action — never batch updates\n\nThe orchestrator reads this file after this skill returns and prints a one-line status summary to the user. Skill invocations are blocking — the orchestrator does not poll mid-execution. If you skip an update, the user sees stale progress when they ask for a recap.\n\n**Write it with the shared script** — it creates the file on first call and updates a row in place on later calls:\n\n```bash\nDX_PROGRESS_FILE=\"dev-all-progress.md\" DX_PROGRESS_TITLE=\"Pipeline Progress\" \\\n  bash \"${CLAUDE_PLUGIN_ROOT}\u002Fshared\u002Fupdate-progress.sh\" \"$SPEC_DIR\" \"1: \u003Ctitle>\" \"in_progress\"\n```\n\n**Format** — one row per step:\n\n| Step | Status | Note |\n|---|---|---|\n| 1: \u003Ctitle> | done | committed 4bf6fe5 |\n| 2: \u003Ctitle> | in_progress | — |\n| 3: \u003Ctitle> | — | — |\n\n## Progress Tracking\n\nFollow `.ai\u002Frules\u002Ftask-progress.md` (plugin default: `rules\u002Ftask-progress.md`). After loading `implement.md`, write one `pending` row per plan step into `dev-all-progress.md` (see above), then move each to `in_progress` when executing and `done` when committed. Fix attempts and heal cycles go in the **note** column (`fix 1`, `healing: \u003Ccorrective action>`) — never as a new row, or the step is duplicated.\n\nThis skill runs forked (`context: fork`), so per `.ai\u002Frules\u002Ftask-progress.md` it does **not** create its own task tree — a forked skill's task list is invisible to its parent. The file is the channel.\n\n## Loop invariant\n\nThis skill has exactly two exits: **\"Completion summary + log run + promote fixes\"** and **\"STOP: Human intervention needed\"**. No other point in the flow may end your turn.\n\n- A worker's summary (`## Step N complete`, `## Fix Result`, `## Heal Result`) and its `## Return` block are **input to you, not your output**. Read the verdict, then take the next edge in the graph.\n- Before you write any final message, run `bash .ai\u002Flib\u002Fplan-metadata.sh $SPEC_DIR`. If a step is still `pending` or `in-progress` and neither STOP condition holds, you are not done — go to \"Get next pending step\".\n- Both exits write `.ai\u002Flearning\u002Fraw\u002Fruns.jsonl` (STOP included). A run that ends without that line ended in the wrong place.\n- **No-progress cap:** if \"Get next pending step\" picks the same step twice with its status unchanged in between, stop looping and go to \"STOP: Human intervention needed\". Don't spin.\n\n## Flow\n\n```dot\ndigraph step_all {\n    \"Locate spec dir + check run-state\" [shape=box];\n    \"Ensure feature branch\" [shape=box];\n    \"Load fix memory\" [shape=box];\n    \"Get next pending step\" [shape=box];\n    \"All steps done?\" [shape=diamond];\n    \"Execute step\" [shape=box];\n    \"Step passed?\" [shape=diamond];\n    \"Fix attempt\" [shape=box];\n    \"Fix succeeded?\" [shape=diamond];\n    \"Consecutive failures \u003C 2?\" [shape=diamond];\n    \"Invoke step-fix (heal)\" [shape=box];\n    \"Heal result?\" [shape=diamond];\n    \"Execute corrective steps\" [shape=box];\n    \"Corrective step failed after 2 fixes?\" [shape=diamond];\n    \"Healing cycle \u003C 2?\" [shape=diamond];\n    \"Log progress + track fix patterns\" [shape=box];\n    \"Completion summary + log run + promote fixes\" [shape=doublecircle];\n    \"STOP: Human intervention needed\" [shape=doublecircle];\n\n    \"Locate spec dir + check run-state\" -> \"Ensure feature branch\";\n    \"Ensure feature branch\" -> \"Load fix memory\";\n    \"Load fix memory\" -> \"Get next pending step\";\n    \"Get next pending step\" -> \"All steps done?\";\n    \"All steps done?\" -> \"Completion summary + log run + promote fixes\" [label=\"yes\"];\n    \"All steps done?\" -> \"Execute step\" [label=\"no\"];\n    \"Execute step\" -> \"Step passed?\";\n    \"Step passed?\" -> \"Log progress + track fix patterns\" [label=\"yes\"];\n    \"Step passed?\" -> \"Fix attempt\" [label=\"no (blocked)\"];\n    \"Fix attempt\" -> \"Fix succeeded?\";\n    \"Fix succeeded?\" -> \"Log progress + track fix patterns\" [label=\"yes\"];\n    \"Fix succeeded?\" -> \"Consecutive failures \u003C 2?\" [label=\"no\"];\n    \"Consecutive failures \u003C 2?\" -> \"Fix attempt\" [label=\"yes, retry\"];\n    \"Consecutive failures \u003C 2?\" -> \"Invoke step-fix (heal)\" [label=\"no, 2 strikes\"];\n    \"Invoke step-fix (heal)\" -> \"Heal result?\";\n    \"Heal result?\" -> \"Execute corrective steps\" [label=\"healed\"];\n    \"Heal result?\" -> \"STOP: Human intervention needed\" [label=\"unrecoverable\"];\n    \"Execute corrective steps\" -> \"Corrective step failed after 2 fixes?\";\n    \"Corrective step failed after 2 fixes?\" -> \"Log progress + track fix patterns\" [label=\"no, passed\"];\n    \"Corrective step failed after 2 fixes?\" -> \"Healing cycle \u003C 2?\" [label=\"yes, failed\"];\n    \"Healing cycle \u003C 2?\" -> \"Invoke step-fix (heal)\" [label=\"yes, try again\"];\n    \"Healing cycle \u003C 2?\" -> \"STOP: Human intervention needed\" [label=\"no, 2 cycles exhausted\"];\n    \"Log progress + track fix patterns\" -> \"Get next pending step\";\n}\n```\n\n## Node Details\n\n### Locate spec dir + check run-state\n\n```bash\nSPEC_DIR=$(bash .ai\u002Flib\u002Fdx-common.sh find-spec-dir $ARGUMENTS)\n```\n\nMark the step loop active, so the step workers drop their \"run X next\" hints addressed to a human (see `plugins\u002Fdx-core\u002Fshared\u002Forchestration-check.md` § Step-loop marker):\n\n```bash\nmkdir -p .ai\u002Frun-context && echo \"$SPEC_DIR\" > .ai\u002Frun-context\u002Fstep-loop.flag\n```\n\nMaintain run state in `$SPEC_DIR\u002Frun-state.json`:\n\n```json\n{\n  \"skill\": \"dx-step-all\",\n  \"ticket\": \"\u003Cid>\",\n  \"started\": \"\u003CISO-8601>\",\n  \"phase\": 0,\n  \"step\": 0,\n  \"completed_phases\": [],\n  \"last_action\": \"\",\n  \"files_modified\": []\n}\n```\n\n**On invocation:**\n1. Check for existing `$SPEC_DIR\u002Frun-state.json`\n2. If exists and `started` \u003C 2 hours ago → ask user: \"Previous run found at phase {phase}, step {step}. Resume or start fresh?\"\n3. If exists and `started` ≥ 2 hours ago → warn: \"Stale run state found (started {time}). Starting fresh.\" Delete run-state.json.\n4. If not exists → create new run-state.json\n\n**During execution:** Update run-state.json after each phase\u002Fstep completion.\n**On completion:** Delete run-state.json (clean exit).\n\nGet the plan metadata (step count and status) — do NOT read full implement.md here:\n\n```bash\nbash .ai\u002Flib\u002Fplan-metadata.sh $SPEC_DIR\n```\n\nThis outputs a compact summary (~10 tokens\u002Fstep vs ~200 for full file). Workers (step, step-fix) will read the full implement.md when they need it.\n\nPrint: `Starting execution: \u003CN> steps total, \u003CM> pending.`\n\n### Ensure feature branch\n\nBefore executing any steps, run the shared branch guard:\n\n```bash\nbash .ai\u002Flib\u002Fensure-feature-branch.sh $SPEC_DIR\n```\n\nThis no-ops if already on `feature\u002F*` or `bugfix\u002F*`. Creates a feature branch if on any other branch. The branch name is saved to `$SPEC_DIR\u002F.branch`.\n\nPrint: `Branch: \u003CBRANCH> (\u003CBRANCH_ACTION>)`\n\n**This is a hard gate** — never execute steps on a protected branch.\n\n### Load fix memory\n\nBefore entering the execution loop, check if the project has accumulated fix knowledge from previous runs.\n\nIf `.ai\u002Flearning\u002Ffixes.md` exists:\n- Read it\n- Include a note when dispatching skills: append to the prompt: `Known fix patterns for this project: \u003Csummary of fixes.md content>`\n- Print: `Learning: Loaded \u003CN> known fix patterns from previous runs.`\n\nIf it does not exist, skip silently.\n\n### Get next pending step\n\nRe-read plan metadata to get the latest status (skills update implement.md). Especially important after step-fix creates new steps. Never read full implement.md in the orchestrator — workers handle that.\n\n```bash\ntouch .ai\u002Frun-context\u002Fstep-loop.flag\nbash .ai\u002Flib\u002Fplan-metadata.sh $SPEC_DIR\n```\n\nIdentify the next step with status `pending`, then print the loop assertion — every iteration, verbatim shape:\n\n```\nLoop: \u003CP> pending, \u003CD> done of \u003CN> — continuing with Step \u003Cn>\nLoop: 0 pending, \u003CD> done of \u003CN> — exiting\n```\n\n`\u003CP>` counts `pending` + `in-progress` from the metadata output, not from memory.\n\n### All steps done?\n\nUse `\u003CP>` from the loop assertion — the count of `pending` + `in-progress` steps.\n\n- **yes** (`\u003CP>` = 0) → proceed to \"Completion summary + log run + promote fixes\"\n- **no** (`\u003CP>` > 0) → proceed to \"Execute step\" with the next pending step\n\n### Execute step\n\nInvoke `Skill(\u002Fdx-step)` for the current step. dx-step handles implement + test + review + commit as internal phases — no separate dispatches needed.\n\ndx-step runs forked and ends with a `## Return` block. That block is a checkpoint, not your exit (see **Loop invariant**) — continue to \"Step passed?\".\n\n### Step passed?\n\nRead the `verdict` of dx-step's `## Return` block, and confirm it against the step's status in `plan-metadata.sh` (the file wins if they disagree):\n- **`pass`** (step `done`) → proceed to \"Log progress + track fix patterns\"\n- **`fail`** (step `blocked`) → classify the error (see **Error Classification** below), then proceed to \"Fix attempt\"\n\n**Error Classification:** Before triggering healing, classify the failure using `..\u002F..\u002Fshared\u002Ferror-handling.md`:\n- **TRANSIENT** → Retry the step (counts toward consecutive failure limit)\n- **VALIDATION** → Let dx-step-fix attempt repair (counts as healing cycle)\n- **PERMANENT** → Skip healing entirely. Mark step blocked. Report to user immediately. Proceed to \"STOP: Human intervention needed\".\n\n### Fix attempt\n\nInvoke `Skill(\u002Fdx-step-fix)` for the current step.\n\nTrack fix attempts per step.\n\n### Fix succeeded?\n\nRead the `verdict` of dx-step-fix's `## Return` block:\n- **yes** (`verdict: pass`) → proceed to \"Log progress + track fix patterns\"\n- **no** (`verdict: fail` or `warn`) → proceed to \"Consecutive failures \u003C 2?\". A `warn` means dx-step-fix escalated to heal on its own: the direct fix failed, and the corrective steps it appended are already `pending` in implement.md. \"Get next pending step\" will pick them up. Don't re-create them.\n\n### Consecutive failures \u003C 2?\n\nCheck consecutive fix failure count for this step:\n- **yes, retry** → proceed to \"Fix attempt\" for another attempt\n- **no, 2 strikes** → proceed to \"Invoke step-fix (heal)\"\n\n### Invoke step-fix (heal)\n\nTrack healing cycles per step. Max 2 healing cycles per original step.\n\nInvoke `Skill(\u002Fdx-step-fix)` with healing context:\n```\n\u002Fdx-step-fix \u003CSPEC_DIR> --heal --failure-type step-blocked --blocked-step \u003CN>\n```\n\ndx-step-fix now handles both fix and heal modes internally.\n\n### Heal result?\n\nRead the `verdict` of dx-step-fix's `## Return` block:\n- **healed** (`verdict: warn`, `next_action: run corrective steps …`) → re-read implement.md to find the new corrective step(s). Print a clear plan-mutation notice:\n  ```\n  ⚠ Plan modified by heal: \u003CN> corrective step(s) added after Step \u003Cblocked-step>.\n  New steps: \u003Clist of step numbers and titles>\n  Total steps now: \u003Cupdated total>\n  ```\n  Add the corrective steps to `dev-all-progress.md` (and mirror into tasks if they exist). Proceed to \"Execute corrective steps\".\n- **unrecoverable** (`verdict: fail`) → print: `Step \u003CN> unrecoverable after 2 fixes + healing. Human intervention needed.` Proceed to \"STOP: Human intervention needed\".\n\n### Execute corrective steps\n\nRun the normal Execute step → Fix attempt cycle on each new corrective step created by step-fix.\n\n### Corrective step failed after 2 fixes?\n\nAfter running the corrective step through the full cycle (including up to 2 fix attempts):\n- **no, passed** → proceed to \"Log progress + track fix patterns\"\n- **yes, failed** → proceed to \"Healing cycle \u003C 2?\"\n\n### Healing cycle \u003C 2?\n\nCheck the healing cycle count for the original step:\n- **yes, try again** → proceed to \"Invoke step-fix (heal)\" for another healing cycle\n- **no, 2 cycles exhausted** → print: `Step \u003CN> blocked after 2 healing cycles. Human intervention needed.` Proceed to \"STOP: Human intervention needed\".\n\n### Log progress + track fix patterns\n\nAfter each step cycle, print:\n```\nStep \u003CN>\u002F\u003Ctotal> done — \u003Cstep title>\n```\n\n**Track and persist learning signals** for each step that completes (or fails):\n- `step_number`: which step\n- `step_title`: the step's title from implement.md\n- `fix_attempts`: number of fix attempts (0 if none needed)\n- `fix_succeeded`: how many fix attempts succeeded\n- `fix_failed`: how many fix attempts failed\n- `heal_cycles`: number of healing cycles invoked (0 if none)\n- `heal_succeeded`: how many heal cycles succeeded\n- `heal_failed`: how many heal cycles failed\n- `fix_types`: list of error types encountered (e.g., \"compilation\", \"test-failure\", \"review-rejection\")\n\n**Persist immediately after each step** (not deferred to end-of-run):\n\n```bash\nmkdir -p .ai\u002Flearning\u002Fraw\n```\n\nIf fix attempts occurred for this step, append one JSONL line per attempt to `.ai\u002Flearning\u002Fraw\u002Ffixes.jsonl`:\n```json\n{\"timestamp\":\"\u003CISO-8601>\",\"ticket\":\"\u003Cid>\",\"step\":\u003CN>,\"error_type\":\"\u003Ctype>\",\"fix_description\":\"\u003Cwhat was done>\",\"result\":\"\u003Csuccess|failed>\"}\n```\n\n**Incremental pattern promotion:** After appending, check if any pattern in `fixes.jsonl` now has 3+ successes and 0 failures. If so, promote it immediately (see \"Completion summary + log run + promote fixes\" for format). This ensures learning survives even if the run is interrupted.\n\n### Completion summary + log run + promote fixes\n\nAfter all steps are done:\n\n\u003C!-- standalone-only — emit only when $ORCHESTRATED == 0 -->\n\nWhen running standalone (`$ORCHESTRATED == 0`), emit:\n\n```markdown\n## Execution Complete\n\n**\u003Ccount> steps** executed — \u003Ccount> succeeded, \u003Ccount> failed, \u003Ccount> self-healed.\n\n| Step | Status | Note |\n|------|--------|------|\n| 1: \u003Ctitle> | done | committed \u003Csha> |\n| 2: \u003Ctitle> | done | committed \u003Csha> |\n\u003C... one row per step ...>\n\n\u003CIf any steps failed:>\n### Blocked Steps\n- Step \u003CN>: \u003Ctitle> — \u003Cerror summary>\n\n\u003CIf cross-repo note from implement.md:>\n### Other repos required\n\u003Crepo list from implement.md>\n\n### Next step:\n- `\u002Fdx-step-build` — build and verify\n```\n\nWhen orchestrated (`$ORCHESTRATED == 1`), skip the above block entirely. The orchestrator (`dx-agent-all`) reads `$SPEC_DIR\u002Fdev-all-progress.md` directly to summarize step counts and present next-steps. The Cross-Repo Note (when `implement.md` has \"Other repos required\") still belongs in the orchestrator's Final Summary — pass it through via the `## Return` block's `summary` (truncated) and `next_action` fields.\n\n**Log run record:**\n\n```bash\nmkdir -p .ai\u002Flearning\u002Fraw\n```\n\nAppend one JSONL line to `.ai\u002Flearning\u002Fraw\u002Fruns.jsonl`:\n```json\n{\"timestamp\":\"\u003CISO-8601>\",\"ticket\":\"\u003Cid>\",\"flow\":\"step-all\",\"total_steps\":\u003CN>,\"steps_completed\":\u003CN>,\"fix_attempts\":{\"succeeded\":\u003CN>,\"failed\":\u003CN>},\"heal_cycles\":{\"succeeded\":\u003CN>,\"failed\":\u003CN>},\"step_titles\":[\"\u003Ctitle1>\",\"\u003Ctitle2>\"]}\n```\n\nUse Bash to append — `echo '\u003Cjson>' >> .ai\u002Flearning\u002Fraw\u002Fruns.jsonl`\n\nClear the step-loop marker:\n\n```bash\nrm -f .ai\u002Frun-context\u002Fstep-loop.flag\n```\n\n**Final promotion sweep:**\n\nRun one final pattern promotion check (same logic as incremental promotion in \"Log progress + track fix patterns\") to catch any patterns that crossed the 3-success threshold during the last step. This is a safety net — most promotions happen incrementally.\n\nRead `.ai\u002Flearning\u002Fraw\u002Ffixes.jsonl`. Group entries by `error_type` + `fix_description`. For each combination with **3+ successes AND 0 failures**:\n- Generate slug from error type (e.g., `compilation-missing-import`)\n- Skip if `.claude\u002Frules\u002Flearned-fix-\u003Cslug>.md` already exists (promoted earlier)\n- Otherwise create:\n  ```markdown\n  # Learned Fix: \u003Cerror_type>\n\n  When encountering: \u003Cerror_type>\n  Apply this fix: \u003Cfix_description>\n\n  Evidence: \u003CN> successful applications across \u003Cticket list>.\n  ```\n- Print: `Learning: Promoted fix pattern to .claude\u002Frules\u002Flearned-fix-\u003Cslug>.md — \u003Cfix_description>`\n\n**Summary message:**\n\nIf fix patterns were logged:\n- Print: `Learning: \u003CN> fix patterns logged, \u003CM> promoted to rules.`\n\nIf no fix patterns at all:\n- Print: `Learning: Clean run — no fixes needed.`\n\n### STOP: Human intervention needed\n\nThe execution loop has been halted. Either:\n- A step was marked **unrecoverable** after 2 fix attempts + healing\n- **2 healing cycles** were exhausted on the same original step\n\nPrint the blocked step number, the error type, and a summary of what was tried. The user must manually intervene (edit `implement.md`, fix the environment, or re-plan).\n\nLog the run anyway — append the same `runs.jsonl` record as the completion node, with `\"stopped\":\"\u003Cstep N: reason>\"` added and `steps_completed` \u003C `total_steps`. Then clear the marker (`rm -f .ai\u002Frun-context\u002Fstep-loop.flag`) and end with the `## Return` block (`verdict: fail`).\n\n## Examples\n\n### Execute full plan\n```\n\u002Fdx-step-all 2416553\n```\nReads `implement.md` from `.ai\u002Fspecs\u002F2416553-add-layout-switcher\u002F`, finds 6 pending steps, and runs each through dx-step (which handles implement + test + review + commit internally). Prints progress after each step.\n\n### Resume after partial completion\n```\n\u002Fdx-step-all 2416553\n```\nIf steps 1-3 are already `done`, picks up at step 4 and continues. Only pending steps are executed.\n\n### Self-healing on failure\nWhen step 3 fails twice, triggers `dx-step-fix` in heal mode which analyzes the error, creates a corrective step 3a, executes it, then retries step 3. If healing also fails after 2 cycles, stops and reports.\n\n## Troubleshooting\n\n### \"No pending steps\" but plan isn't done\n**Cause:** Steps are marked `blocked` or `in-progress` from a previous interrupted run.\n**Fix:** Open `implement.md` and reset the stuck step's status to `pending`, then re-run.\n\n### Build fails repeatedly on the same step\n**Cause:** The plan step has incorrect instructions or missing context.\n**Fix:** Let self-healing run (2 fix attempts + 2 heal cycles). If still failing, run `\u002Fdx-step-fix` manually to diagnose, or edit `implement.md` to fix the step instructions.\n\n### \"Cannot execute on protected branch\"\n**Cause:** You're on `development`, `main`, or `master` instead of a feature branch.\n**Fix:** The branch guard should auto-create a feature branch. If it fails, manually create one: `git checkout -b feature\u002F\u003Cid>-\u003Cslug>`.\n\n## Decision Examples\n\n### Heal: Flaky Test\n**Failure:** Test passes locally but fails in step execution (timing-dependent assertion)\n**Consecutive failures:** 2\n**Decision:** HEAL — test is flaky. Fix: add wait\u002Fretry in test assertion.\n\n### Escalate: Architecture Mismatch\n**Failure:** Step creates a new utility, but existing utility covers the need\n**Consecutive failures:** 2\n**Decision:** ESCALATE — plan problem, not code problem. Report: \"Step 4 violates reuse rule. Existing `forms.js:validateField()` covers this need.\"\n\n## Success Criteria\n\n- [ ] All steps in implement.md have status: done, blocked, or skipped\n- [ ] No steps remain in pending or in-progress\n- [ ] Build command exits 0 after final step\n- [ ] run-state.json deleted (clean completion)\n\n## Rules\n\n- **Coordinator only** — never implement code yourself. Always delegate via Skill tool.\n- **Sequential execution** — steps must run in order. Never parallelize steps.\n- **2-strike then heal** — after 2 consecutive fix failures, invoke step-fix in heal mode before giving up.\n- **2 healing cycles max** — after 2 healing cycles on the same original step, stop for real.\n- **Progress reporting** — print status after each step so the user can follow along.\n- **Re-read metadata between steps** — run `plan-metadata.sh` between steps to get the latest status (skills update implement.md). Especially important after step-fix creates new steps. Never read full implement.md in the orchestrator — workers handle that.\n- **Don't skip blocked steps** — if a step is blocked and healing failed, stop. Steps have dependencies.\n\n## Platform Compatibility\n\nThis skill uses `Skill()` tool calls which work on both Claude Code and Copilot CLI.\n\n**Copilot CLI \u002F VS Code Chat fallback:** If subagent skill invocation fails, run the skills manually in sequence for each plan step:\n1. `\u002Fdx-step \u003Cstep-number>` — execute a single step (implement + test + review + commit)\n2. On failure: `\u002Fdx-step-fix \u003Cspec-dir>` — attempt repair (up to 2 tries)\n3. On persistent failure: `\u002Fdx-step-fix \u003Cspec-dir> --heal` — diagnose and create corrective steps\n4. Repeat from step 1 for each pending step in `implement.md`\n\n## Return\n\nThis skill runs in a forked context. It MUST end with a `## Return` block per `plugins\u002Fdx-core\u002Fshared\u002Fskill-return-contract.md`.\n\nExamples:\n\n```markdown\n## Return\nverdict: pass\nsummary: Executed 4 steps; 3 commits; 1 self-heal cycle on Step 3 (lint no-shadow).\nartifacts:\n  - .ai\u002Fspecs\u002F2490722-microsite\u002Fdev-all-progress.md\n  - .ai\u002Fspecs\u002F2490722-microsite\u002Frun-state.json\nnext_action: continue to Phase 4 (build)\n```\n\n```markdown\n## Return\nverdict: fail\nsummary: Step 2 blocked after 2 fix attempts — JS test pollution; manual intervention needed.\nartifacts:\n  - .ai\u002Fspecs\u002F2490722-microsite\u002Fdev-all-progress.md\n  - .ai\u002Fspecs\u002F2490722-microsite\u002Frun-state.json\nnext_action: human fix Step 2; re-run \u002Fdx-step-all\n```\n","**Isolation check.** This skill is meant to run in its own context (`context: fork`). If you can see the user's messages from before this skill was invoked, you are running inline (Copilot CLI ignores `context: fork`): do not run the steps below yourself. Start one subagent with your task\u002Fsubagent tool, give it only this instruction — \"Invoke the dx-core:dx-step-all skill with these arguments: \u003Cthe arguments you were given, or none>. Run it fully and reply with its final report only.\" — then show the user that report and stop. If you cannot see earlier user messages, or your only earlier message is that instruction to invoke dx-core:dx-step-all (you are a fork or that subagent), continue below.\n\nYou are a coordinator. You run the step pipeline for each step in implement.md, delegating to skills via the Skill tool.\n\n## Progress visibility\n\nYou run in a forked context. Before emitting any chat output, determine whether you were invoked by the orchestrator (`dx-agent-all`) or standalone — see `plugins\u002Fdx-core\u002Fshared\u002Forchestration-check.md`:\n\n```bash\nORCHESTRATED=0\nFLAG=\".ai\u002Frun-context\u002Forchestrating.flag\"\nif [ -f \"$FLAG\" ]; then\n  AGE=$(( $(date +%s) - $(date -r \"$FLAG\" +%s) ))\n  [ \"$AGE\" -lt 7200 ] && ORCHESTRATED=1\nfi\n```\n\n- **If `$ORCHESTRATED == 1`** (orchestrator path): write all canonical artifacts to `$SPEC_DIR\u002F\u003Cfile>.md` (already documented below) and emit ONLY the `## Return` block to chat.\n- **If `$ORCHESTRATED == 0`** (standalone path): write the same canonical artifacts AND emit the human-friendly summary marked `\u003C!-- standalone-only -->` below, followed by the `## Return` block at the very end.\n\nPer-phase \u002F per-step progress lines during the run are allowed in both paths.\n\nYou run forked, so nothing inside this skill is visible to the orchestrator (`dx-agent-all`) — the progress file is the only channel. You MUST update `$SPEC_DIR\u002Fdev-all-progress.md` after each step transition:\n\n- Mark step in_progress at the start of execution\n- Mark step done | failed | healing immediately on transition\n- Update within the same logical action — never batch updates\n\nThe orchestrator reads this file after this skill returns and prints a one-line status summary to the user. Skill invocations are blocking — the orchestrator does not poll mid-execution. If you skip an update, the user sees stale progress when they ask for a recap.\n\n**Write it with the shared script** — it creates the file on first call and updates a row in place on later calls:\n\n```bash\nDX_PROGRESS_FILE=\"dev-all-progress.md\" DX_PROGRESS_TITLE=\"Pipeline Progress\" \\\n  bash \"${CLAUDE_PLUGIN_ROOT}\u002Fshared\u002Fupdate-progress.sh\" \"$SPEC_DIR\" \"1: \u003Ctitle>\" \"in_progress\"\n```\n\n**Format** — one row per step:\n\n| Step | Status | Note |\n|---|---|---|\n| 1: \u003Ctitle> | done | committed 4bf6fe5 |\n| 2: \u003Ctitle> | in_progress | — |\n| 3: \u003Ctitle> | — | — |\n\n## Progress Tracking\n\nFollow `.ai\u002Frules\u002Ftask-progress.md` (plugin default: `rules\u002Ftask-progress.md`). After loading `implement.md`, write one `pending` row per plan step into `dev-all-progress.md` (see above), then move each to `in_progress` when executing and `done` when committed. Fix attempts and heal cycles go in the **note** column (`fix 1`, `healing: \u003Ccorrective action>`) — never as a new row, or the step is duplicated.\n\nThis skill runs forked (`context: fork`), so per `.ai\u002Frules\u002Ftask-progress.md` it does **not** create its own task tree — a forked skill's task list is invisible to its parent. The file is the channel.\n\n## Loop invariant\n\nThis skill has exactly two exits: **\"Completion summary + log run + promote fixes\"** and **\"STOP: Human intervention needed\"**. No other point in the flow may end your turn.\n\n- A worker's summary (`## Step N complete`, `## Fix Result`, `## Heal Result`) and its `## Return` block are **input to you, not your output**. Read the verdict, then take the next edge in the graph.\n- Before you write any final message, run `bash .ai\u002Flib\u002Fplan-metadata.sh $SPEC_DIR`. If a step is still `pending` or `in-progress` and neither STOP condition holds, you are not done — go to \"Get next pending step\".\n- Both exits write `.ai\u002Flearning\u002Fraw\u002Fruns.jsonl` (STOP included). A run that ends without that line ended in the wrong place.\n- **No-progress cap:** if \"Get next pending step\" picks the same step twice with its status unchanged in between, stop looping and go to \"STOP: Human intervention needed\". Don't spin.\n\n## Flow\n\n```dot\ndigraph step_all {\n    \"Locate spec dir + check run-state\" [shape=box];\n    \"Ensure feature branch\" [shape=box];\n    \"Load fix memory\" [shape=box];\n    \"Get next pending step\" [shape=box];\n    \"All steps done?\" [shape=diamond];\n    \"Execute step\" [shape=box];\n    \"Step passed?\" [shape=diamond];\n    \"Fix attempt\" [shape=box];\n    \"Fix succeeded?\" [shape=diamond];\n    \"Consecutive failures \u003C 2?\" [shape=diamond];\n    \"Invoke step-fix (heal)\" [shape=box];\n    \"Heal result?\" [shape=diamond];\n    \"Execute corrective steps\" [shape=box];\n    \"Corrective step failed after 2 fixes?\" [shape=diamond];\n    \"Healing cycle \u003C 2?\" [shape=diamond];\n    \"Log progress + track fix patterns\" [shape=box];\n    \"Completion summary + log run + promote fixes\" [shape=doublecircle];\n    \"STOP: Human intervention needed\" [shape=doublecircle];\n\n    \"Locate spec dir + check run-state\" -> \"Ensure feature branch\";\n    \"Ensure feature branch\" -> \"Load fix memory\";\n    \"Load fix memory\" -> \"Get next pending step\";\n    \"Get next pending step\" -> \"All steps done?\";\n    \"All steps done?\" -> \"Completion summary + log run + promote fixes\" [label=\"yes\"];\n    \"All steps done?\" -> \"Execute step\" [label=\"no\"];\n    \"Execute step\" -> \"Step passed?\";\n    \"Step passed?\" -> \"Log progress + track fix patterns\" [label=\"yes\"];\n    \"Step passed?\" -> \"Fix attempt\" [label=\"no (blocked)\"];\n    \"Fix attempt\" -> \"Fix succeeded?\";\n    \"Fix succeeded?\" -> \"Log progress + track fix patterns\" [label=\"yes\"];\n    \"Fix succeeded?\" -> \"Consecutive failures \u003C 2?\" [label=\"no\"];\n    \"Consecutive failures \u003C 2?\" -> \"Fix attempt\" [label=\"yes, retry\"];\n    \"Consecutive failures \u003C 2?\" -> \"Invoke step-fix (heal)\" [label=\"no, 2 strikes\"];\n    \"Invoke step-fix (heal)\" -> \"Heal result?\";\n    \"Heal result?\" -> \"Execute corrective steps\" [label=\"healed\"];\n    \"Heal result?\" -> \"STOP: Human intervention needed\" [label=\"unrecoverable\"];\n    \"Execute corrective steps\" -> \"Corrective step failed after 2 fixes?\";\n    \"Corrective step failed after 2 fixes?\" -> \"Log progress + track fix patterns\" [label=\"no, passed\"];\n    \"Corrective step failed after 2 fixes?\" -> \"Healing cycle \u003C 2?\" [label=\"yes, failed\"];\n    \"Healing cycle \u003C 2?\" -> \"Invoke step-fix (heal)\" [label=\"yes, try again\"];\n    \"Healing cycle \u003C 2?\" -> \"STOP: Human intervention needed\" [label=\"no, 2 cycles exhausted\"];\n    \"Log progress + track fix patterns\" -> \"Get next pending step\";\n}\n```\n\n## Node Details\n\n### Locate spec dir + check run-state\n\n```bash\nSPEC_DIR=$(bash .ai\u002Flib\u002Fdx-common.sh find-spec-dir $ARGUMENTS)\n```\n\nMark the step loop active, so the step workers drop their \"run X next\" hints addressed to a human (see `plugins\u002Fdx-core\u002Fshared\u002Forchestration-check.md` § Step-loop marker):\n\n```bash\nmkdir -p .ai\u002Frun-context && echo \"$SPEC_DIR\" > .ai\u002Frun-context\u002Fstep-loop.flag\n```\n\nMaintain run state in `$SPEC_DIR\u002Frun-state.json`:\n\n```json\n{\n  \"skill\": \"dx-step-all\",\n  \"ticket\": \"\u003Cid>\",\n  \"started\": \"\u003CISO-8601>\",\n  \"phase\": 0,\n  \"step\": 0,\n  \"completed_phases\": [],\n  \"last_action\": \"\",\n  \"files_modified\": []\n}\n```\n\n**On invocation:**\n1. Check for existing `$SPEC_DIR\u002Frun-state.json`\n2. If exists and `started` \u003C 2 hours ago → ask user: \"Previous run found at phase {phase}, step {step}. Resume or start fresh?\"\n3. If exists and `started` ≥ 2 hours ago → warn: \"Stale run state found (started {time}). Starting fresh.\" Delete run-state.json.\n4. If not exists → create new run-state.json\n\n**During execution:** Update run-state.json after each phase\u002Fstep completion.\n**On completion:** Delete run-state.json (clean exit).\n\nGet the plan metadata (step count and status) — do NOT read full implement.md here:\n\n```bash\nbash .ai\u002Flib\u002Fplan-metadata.sh $SPEC_DIR\n```\n\nThis outputs a compact summary (~10 tokens\u002Fstep vs ~200 for full file). Workers (step, step-fix) will read the full implement.md when they need it.\n\nPrint: `Starting execution: \u003CN> steps total, \u003CM> pending.`\n\n### Ensure feature branch\n\nBefore executing any steps, run the shared branch guard:\n\n```bash\nbash .ai\u002Flib\u002Fensure-feature-branch.sh $SPEC_DIR\n```\n\nThis no-ops if already on `feature\u002F*` or `bugfix\u002F*`. Creates a feature branch if on any other branch. The branch name is saved to `$SPEC_DIR\u002F.branch`.\n\nPrint: `Branch: \u003CBRANCH> (\u003CBRANCH_ACTION>)`\n\n**This is a hard gate** — never execute steps on a protected branch.\n\n### Load fix memory\n\nBefore entering the execution loop, check if the project has accumulated fix knowledge from previous runs.\n\nIf `.ai\u002Flearning\u002Ffixes.md` exists:\n- Read it\n- Include a note when dispatching skills: append to the prompt: `Known fix patterns for this project: \u003Csummary of fixes.md content>`\n- Print: `Learning: Loaded \u003CN> known fix patterns from previous runs.`\n\nIf it does not exist, skip silently.\n\n### Get next pending step\n\nRe-read plan metadata to get the latest status (skills update implement.md). Especially important after step-fix creates new steps. Never read full implement.md in the orchestrator — workers handle that.\n\n```bash\ntouch .ai\u002Frun-context\u002Fstep-loop.flag\nbash .ai\u002Flib\u002Fplan-metadata.sh $SPEC_DIR\n```\n\nIdentify the next step with status `pending`, then print the loop assertion — every iteration, verbatim shape:\n\n```\nLoop: \u003CP> pending, \u003CD> done of \u003CN> — continuing with Step \u003Cn>\nLoop: 0 pending, \u003CD> done of \u003CN> — exiting\n```\n\n`\u003CP>` counts `pending` + `in-progress` from the metadata output, not from memory.\n\n### All steps done?\n\nUse `\u003CP>` from the loop assertion — the count of `pending` + `in-progress` steps.\n\n- **yes** (`\u003CP>` = 0) → proceed to \"Completion summary + log run + promote fixes\"\n- **no** (`\u003CP>` > 0) → proceed to \"Execute step\" with the next pending step\n\n### Execute step\n\nInvoke `Skill(\u002Fdx-step)` for the current step. dx-step handles implement + test + review + commit as internal phases — no separate dispatches needed.\n\ndx-step runs forked and ends with a `## Return` block. That block is a checkpoint, not your exit (see **Loop invariant**) — continue to \"Step passed?\".\n\n### Step passed?\n\nRead the `verdict` of dx-step's `## Return` block, and confirm it against the step's status in `plan-metadata.sh` (the file wins if they disagree):\n- **`pass`** (step `done`) → proceed to \"Log progress + track fix patterns\"\n- **`fail`** (step `blocked`) → classify the error (see **Error Classification** below), then proceed to \"Fix attempt\"\n\n**Error Classification:** Before triggering healing, classify the failure using `..\u002F..\u002Fshared\u002Ferror-handling.md`:\n- **TRANSIENT** → Retry the step (counts toward consecutive failure limit)\n- **VALIDATION** → Let dx-step-fix attempt repair (counts as healing cycle)\n- **PERMANENT** → Skip healing entirely. Mark step blocked. Report to user immediately. Proceed to \"STOP: Human intervention needed\".\n\n### Fix attempt\n\nInvoke `Skill(\u002Fdx-step-fix)` for the current step.\n\nTrack fix attempts per step.\n\n### Fix succeeded?\n\nRead the `verdict` of dx-step-fix's `## Return` block:\n- **yes** (`verdict: pass`) → proceed to \"Log progress + track fix patterns\"\n- **no** (`verdict: fail` or `warn`) → proceed to \"Consecutive failures \u003C 2?\". A `warn` means dx-step-fix escalated to heal on its own: the direct fix failed, and the corrective steps it appended are already `pending` in implement.md. \"Get next pending step\" will pick them up. Don't re-create them.\n\n### Consecutive failures \u003C 2?\n\nCheck consecutive fix failure count for this step:\n- **yes, retry** → proceed to \"Fix attempt\" for another attempt\n- **no, 2 strikes** → proceed to \"Invoke step-fix (heal)\"\n\n### Invoke step-fix (heal)\n\nTrack healing cycles per step. Max 2 healing cycles per original step.\n\nInvoke `Skill(\u002Fdx-step-fix)` with healing context:\n```\n\u002Fdx-step-fix \u003CSPEC_DIR> --heal --failure-type step-blocked --blocked-step \u003CN>\n```\n\ndx-step-fix now handles both fix and heal modes internally.\n\n### Heal result?\n\nRead the `verdict` of dx-step-fix's `## Return` block:\n- **healed** (`verdict: warn`, `next_action: run corrective steps …`) → re-read implement.md to find the new corrective step(s). Print a clear plan-mutation notice:\n  ```\n  ⚠ Plan modified by heal: \u003CN> corrective step(s) added after Step \u003Cblocked-step>.\n  New steps: \u003Clist of step numbers and titles>\n  Total steps now: \u003Cupdated total>\n  ```\n  Add the corrective steps to `dev-all-progress.md` (and mirror into tasks if they exist). Proceed to \"Execute corrective steps\".\n- **unrecoverable** (`verdict: fail`) → print: `Step \u003CN> unrecoverable after 2 fixes + healing. Human intervention needed.` Proceed to \"STOP: Human intervention needed\".\n\n### Execute corrective steps\n\nRun the normal Execute step → Fix attempt cycle on each new corrective step created by step-fix.\n\n### Corrective step failed after 2 fixes?\n\nAfter running the corrective step through the full cycle (including up to 2 fix attempts):\n- **no, passed** → proceed to \"Log progress + track fix patterns\"\n- **yes, failed** → proceed to \"Healing cycle \u003C 2?\"\n\n### Healing cycle \u003C 2?\n\nCheck the healing cycle count for the original step:\n- **yes, try again** → proceed to \"Invoke step-fix (heal)\" for another healing cycle\n- **no, 2 cycles exhausted** → print: `Step \u003CN> blocked after 2 healing cycles. Human intervention needed.` Proceed to \"STOP: Human intervention needed\".\n\n### Log progress + track fix patterns\n\nAfter each step cycle, print:\n```\nStep \u003CN>\u002F\u003Ctotal> done — \u003Cstep title>\n```\n\n**Track and persist learning signals** for each step that completes (or fails):\n- `step_number`: which step\n- `step_title`: the step's title from implement.md\n- `fix_attempts`: number of fix attempts (0 if none needed)\n- `fix_succeeded`: how many fix attempts succeeded\n- `fix_failed`: how many fix attempts failed\n- `heal_cycles`: number of healing cycles invoked (0 if none)\n- `heal_succeeded`: how many heal cycles succeeded\n- `heal_failed`: how many heal cycles failed\n- `fix_types`: list of error types encountered (e.g., \"compilation\", \"test-failure\", \"review-rejection\")\n\n**Persist immediately after each step** (not deferred to end-of-run):\n\n```bash\nmkdir -p .ai\u002Flearning\u002Fraw\n```\n\nIf fix attempts occurred for this step, append one JSONL line per attempt to `.ai\u002Flearning\u002Fraw\u002Ffixes.jsonl`:\n```json\n{\"timestamp\":\"\u003CISO-8601>\",\"ticket\":\"\u003Cid>\",\"step\":\u003CN>,\"error_type\":\"\u003Ctype>\",\"fix_description\":\"\u003Cwhat was done>\",\"result\":\"\u003Csuccess|failed>\"}\n```\n\n**Incremental pattern promotion:** After appending, check if any pattern in `fixes.jsonl` now has 3+ successes and 0 failures. If so, promote it immediately (see \"Completion summary + log run + promote fixes\" for format). This ensures learning survives even if the run is interrupted.\n\n### Completion summary + log run + promote fixes\n\nAfter all steps are done:\n\n\u003C!-- standalone-only — emit only when $ORCHESTRATED == 0 -->\n\nWhen running standalone (`$ORCHESTRATED == 0`), emit:\n\n```markdown\n## Execution Complete\n\n**\u003Ccount> steps** executed — \u003Ccount> succeeded, \u003Ccount> failed, \u003Ccount> self-healed.\n\n| Step | Status | Note |\n|------|--------|------|\n| 1: \u003Ctitle> | done | committed \u003Csha> |\n| 2: \u003Ctitle> | done | committed \u003Csha> |\n\u003C... one row per step ...>\n\n\u003CIf any steps failed:>\n### Blocked Steps\n- Step \u003CN>: \u003Ctitle> — \u003Cerror summary>\n\n\u003CIf cross-repo note from implement.md:>\n### Other repos required\n\u003Crepo list from implement.md>\n\n### Next step:\n- `\u002Fdx-step-build` — build and verify\n```\n\nWhen orchestrated (`$ORCHESTRATED == 1`), skip the above block entirely. The orchestrator (`dx-agent-all`) reads `$SPEC_DIR\u002Fdev-all-progress.md` directly to summarize step counts and present next-steps. The Cross-Repo Note (when `implement.md` has \"Other repos required\") still belongs in the orchestrator's Final Summary — pass it through via the `## Return` block's `summary` (truncated) and `next_action` fields.\n\n**Log run record:**\n\n```bash\nmkdir -p .ai\u002Flearning\u002Fraw\n```\n\nAppend one JSONL line to `.ai\u002Flearning\u002Fraw\u002Fruns.jsonl`:\n```json\n{\"timestamp\":\"\u003CISO-8601>\",\"ticket\":\"\u003Cid>\",\"flow\":\"step-all\",\"total_steps\":\u003CN>,\"steps_completed\":\u003CN>,\"fix_attempts\":{\"succeeded\":\u003CN>,\"failed\":\u003CN>},\"heal_cycles\":{\"succeeded\":\u003CN>,\"failed\":\u003CN>},\"step_titles\":[\"\u003Ctitle1>\",\"\u003Ctitle2>\"]}\n```\n\nUse Bash to append — `echo '\u003Cjson>' >> .ai\u002Flearning\u002Fraw\u002Fruns.jsonl`\n\nClear the step-loop marker:\n\n```bash\nrm -f .ai\u002Frun-context\u002Fstep-loop.flag\n```\n\n**Final promotion sweep:**\n\nRun one final pattern promotion check (same logic as incremental promotion in \"Log progress + track fix patterns\") to catch any patterns that crossed the 3-success threshold during the last step. This is a safety net — most promotions happen incrementally.\n\nRead `.ai\u002Flearning\u002Fraw\u002Ffixes.jsonl`. Group entries by `error_type` + `fix_description`. For each combination with **3+ successes AND 0 failures**:\n- Generate slug from error type (e.g., `compilation-missing-import`)\n- Skip if `.claude\u002Frules\u002Flearned-fix-\u003Cslug>.md` already exists (promoted earlier)\n- Otherwise create:\n  ```markdown\n  # Learned Fix: \u003Cerror_type>\n\n  When encountering: \u003Cerror_type>\n  Apply this fix: \u003Cfix_description>\n\n  Evidence: \u003CN> successful applications across \u003Cticket list>.\n  ```\n- Print: `Learning: Promoted fix pattern to .claude\u002Frules\u002Flearned-fix-\u003Cslug>.md — \u003Cfix_description>`\n\n**Summary message:**\n\nIf fix patterns were logged:\n- Print: `Learning: \u003CN> fix patterns logged, \u003CM> promoted to rules.`\n\nIf no fix patterns at all:\n- Print: `Learning: Clean run — no fixes needed.`\n\n### STOP: Human intervention needed\n\nThe execution loop has been halted. Either:\n- A step was marked **unrecoverable** after 2 fix attempts + healing\n- **2 healing cycles** were exhausted on the same original step\n\nPrint the blocked step number, the error type, and a summary of what was tried. The user must manually intervene (edit `implement.md`, fix the environment, or re-plan).\n\nLog the run anyway — append the same `runs.jsonl` record as the completion node, with `\"stopped\":\"\u003Cstep N: reason>\"` added and `steps_completed` \u003C `total_steps`. Then clear the marker (`rm -f .ai\u002Frun-context\u002Fstep-loop.flag`) and end with the `## Return` block (`verdict: fail`).\n\n## Examples\n\n### Execute full plan\n```\n\u002Fdx-step-all 2416553\n```\nReads `implement.md` from `.ai\u002Fspecs\u002F2416553-add-layout-switcher\u002F`, finds 6 pending steps, and runs each through dx-step (which handles implement + test + review + commit internally). Prints progress after each step.\n\n### Resume after partial completion\n```\n\u002Fdx-step-all 2416553\n```\nIf steps 1-3 are already `done`, picks up at step 4 and continues. Only pending steps are executed.\n\n### Self-healing on failure\nWhen step 3 fails twice, triggers `dx-step-fix` in heal mode which analyzes the error, creates a corrective step 3a, executes it, then retries step 3. If healing also fails after 2 cycles, stops and reports.\n\n## Troubleshooting\n\n### \"No pending steps\" but plan isn't done\n**Cause:** Steps are marked `blocked` or `in-progress` from a previous interrupted run.\n**Fix:** Open `implement.md` and reset the stuck step's status to `pending`, then re-run.\n\n### Build fails repeatedly on the same step\n**Cause:** The plan step has incorrect instructions or missing context.\n**Fix:** Let self-healing run (2 fix attempts + 2 heal cycles). If still failing, run `\u002Fdx-step-fix` manually to diagnose, or edit `implement.md` to fix the step instructions.\n\n### \"Cannot execute on protected branch\"\n**Cause:** You're on `development`, `main`, or `master` instead of a feature branch.\n**Fix:** The branch guard should auto-create a feature branch. If it fails, manually create one: `git checkout -b feature\u002F\u003Cid>-\u003Cslug>`.\n\n## Decision Examples\n\n### Heal: Flaky Test\n**Failure:** Test passes locally but fails in step execution (timing-dependent assertion)\n**Consecutive failures:** 2\n**Decision:** HEAL — test is flaky. Fix: add wait\u002Fretry in test assertion.\n\n### Escalate: Architecture Mismatch\n**Failure:** Step creates a new utility, but existing utility covers the need\n**Consecutive failures:** 2\n**Decision:** ESCALATE — plan problem, not code problem. Report: \"Step 4 violates reuse rule. Existing `forms.js:validateField()` covers this need.\"\n\n## Success Criteria\n\n- [ ] All steps in implement.md have status: done, blocked, or skipped\n- [ ] No steps remain in pending or in-progress\n- [ ] Build command exits 0 after final step\n- [ ] run-state.json deleted (clean completion)\n\n## Rules\n\n- **Coordinator only** — never implement code yourself. Always delegate via Skill tool.\n- **Sequential execution** — steps must run in order. Never parallelize steps.\n- **2-strike then heal** — after 2 consecutive fix failures, invoke step-fix in heal mode before giving up.\n- **2 healing cycles max** — after 2 healing cycles on the same original step, stop for real.\n- **Progress reporting** — print status after each step so the user can follow along.\n- **Re-read metadata between steps** — run `plan-metadata.sh` between steps to get the latest status (skills update implement.md). Especially important after step-fix creates new steps. Never read full implement.md in the orchestrator — workers handle that.\n- **Don't skip blocked steps** — if a step is blocked and healing failed, stop. Steps have dependencies.\n\n## Platform Compatibility\n\nThis skill uses `Skill()` tool calls which work on both Claude Code and Copilot CLI.\n\n**Copilot CLI \u002F VS Code Chat fallback:** If subagent skill invocation fails, run the skills manually in sequence for each plan step:\n1. `\u002Fdx-step \u003Cstep-number>` — execute a single step (implement + test + review + commit)\n2. On failure: `\u002Fdx-step-fix \u003Cspec-dir>` — attempt repair (up to 2 tries)\n3. On persistent failure: `\u002Fdx-step-fix \u003Cspec-dir> --heal` — diagnose and create corrective steps\n4. Repeat from step 1 for each pending step in `implement.md`\n\n## Return\n\nThis skill runs in a forked context. It MUST end with a `## Return` block per `plugins\u002Fdx-core\u002Fshared\u002Fskill-return-contract.md`.\n\nExamples:\n\n```markdown\n## Return\nverdict: pass\nsummary: Executed 4 steps; 3 commits; 1 self-heal cycle on Step 3 (lint no-shadow).\nartifacts:\n  - .ai\u002Fspecs\u002F2490722-microsite\u002Fdev-all-progress.md\n  - .ai\u002Fspecs\u002F2490722-microsite\u002Frun-state.json\nnext_action: continue to Phase 4 (build)\n```\n\n```markdown\n## Return\nverdict: fail\nsummary: Step 2 blocked after 2 fix attempts — JS test pollution; manual intervention needed.\nartifacts:\n  - .ai\u002Fspecs\u002F2490722-microsite\u002Fdev-all-progress.md\n  - .ai\u002Fspecs\u002F2490722-microsite\u002Frun-state.json\nnext_action: human fix Step 2; re-run \u002Fdx-step-all\n```\n",{"name":5,"context":44,"description":7,"allowed-tools":45,"argument-hint":47},"fork",[30,28,38,29,46],"agent","[Work Item ID or slug (optional — uses most recent if omitted)]","main","5c642842a92100dc7561ae0682a152a74846e186","plugins\u002Fdx-core\u002Fskills\u002Fdx-step-all",3,"https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow","https:\u002F\u002Fgithub.com\u002Feasingthemes","https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fdraganfilipovic\u002F","Agentic SDLC platform in production. I build agent-ready codebases. AEM MCP Server author.","2026-11-11 09:59:48",{"source":8,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add easingthemes\u002Fdx-aem-flow --skill dx-step-all",{"tool":63,"command":64},"bunx","bunx skills add easingthemes\u002Fdx-aem-flow --skill dx-step-all",{"tool":66,"command":67},"pnpm","pnpm dlx skills add easingthemes\u002Fdx-aem-flow --skill dx-step-all","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-core\u002Fskills\u002Fdx-step-all\u002FSKILL.md",true,[],[72,92,113,136,152,167],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":39},"01M6H48W19F46A7B7TSSQAMYRW","dx-hub-status","Show hub dispatch status — which repos are running, done, blocked or failed. Use for 'hub status', 'what's running'.","https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-hub\u002Fskills\u002Fdx-hub-status\u002FSKILL.md",[],[19,79,80,81,82,83,84,25,85,86,24,87,88,21,89,30,29,90,91],"dx hub status","hub","status","hub status","which","show","ticket","clean","done","Bash","dispatch","repos","grep",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":39},"01M6H48R6ZH7YMVPMVWMMWT3RA","dx-hub-init","Initialize a hub directory for multi-repo orchestration. Discovers sibling repos, merges configs, validates CLI compatibility. Use when setting up hub mode for the first time. Trigger on \"init hub\", \"set up hub\", \"multi-repo setup\".","https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-hub\u002Fskills\u002Fdx-hub-init\u002FSKILL.md",[],[99,100,19,101,80,102,103,104,105,106,107,108,109,110,88,111,112,30,29,28],"init","hub init","dx hub init","SET","time","mode","default","up","repo setup","orchestration","configure","multi-repo","cli","directory",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":124,"publishedAt":39},"01M6H48K267CWEF8YNN3Y49BVT","dx-hub-dispatch","Dispatch a ticket to several repos — open an independent Claude session per repo in VS Code terminals. Use for 'hub dispatch', 'work on ticket across repos'.","https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-hub\u002Fskills\u002Fdx-hub-dispatch\u002FSKILL.md",[119],{"categoryNo":120,"categoryName":121,"taxonomyType":122,"taxonomyTypeDesc":123},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[19,125,89,80,126,25,127,128,129,85,130,131,24,132,88,133,134,135,21,33],"dx hub dispatch","ado","repo","work on","session","open","MCP","URL","vscode","code","across",{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":39},"01M6H48FAWKTT6AAWT3H80ZKE0","dx-hub-config","View and edit hub configuration — add repos, adjust terminal delay. Use to manage hub settings. Trigger on \"hub config\", \"add repo to hub\", \"terminal delay\".","https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-hub\u002Fskills\u002Fdx-hub-config\u002FSKILL.md",[],[19,143,80,144,84,145,127,146,147,148,149,24,109,88,150,30,151,29,28,90],"dx hub config","config","view","manage","trigger","true","adjust","terminal","settings",{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":158,"publishedAt":39},"01M6H48BNMYEJY6CCWPYHNQDAT","dx-discover-repos","Resolve which repos a work item touches (explicit directive → simple block → cross-repo table → LLM). Used by the KAI-HUB router to fan an agent out across repos; 'which repos'.","https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-hub\u002Fskills\u002Fdx-discover-repos\u002FSKILL.md",[],[159,19,160,90,83,127,135,161,21,162,33,163,80,164,165,166],"discover","dx discover repos","router","directive","simple","block","sonnet","table",{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":174,"publishedAt":39},"01M6H487QA1FDSBT1HTZGW4HAQ","dx-upgrade","Upgrade a consumer project to the installed plugin versions — run dx-doctor, fix stale and missing files, list manual actions. Use after upgrading plugins.","https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-core\u002Fskills\u002Fdx-upgrade\u002FSKILL.md",[173],{"categoryNo":120,"categoryName":121,"taxonomyType":122,"taxonomyTypeDesc":123},[175,19,176,177,178,38,37,179,180,31,30,29,28,181,182,183,184,24,185,186],"upgrade","dx upgrade","project","actions","files","auto","list","doctor","manual","missing","plugin","plugins"]