[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6H424ENRT0NF62J99SN0457":3,"skill-same:01M6H424ENRT0NF62J99SN0457":70},{"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":47,"commitSha":48,"skillDirectory":49,"forksCount":50,"repositoryHtmlUrl":51,"repositoryHomepageUrl":6,"ownerHtmlUrl":52,"ownerBlogUrl":53,"ownerDescription":54,"updatedAt":55,"install":56,"resources":69},"01M6H424ENRT0NF62J99SN0457","dx-bug-fix",null,"Plan, implement, test and open a PR for a bug fix from triage.md \u002F verification.md. Use after \u002Fdx-bug-triage or \u002Fdx-bug-verify. Not before triage exists, not for the whole workflow (dx-bug-all) or reproduction (dx-bug-verify).","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-bug-fix\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"fix","bug","dx","bug fix","dx bug fix","id","implement","use","for","pr","ado","edit","write","read","plan","work","verification","workflow","open","search","2026-11-10 10:12:30",false,"---\nname: dx-bug-fix\ndescription: \"Plan, implement, test and open a PR for a bug fix from triage.md \u002F verification.md. Use after \u002Fdx-bug-triage or \u002Fdx-bug-verify. Not before triage exists, not for the whole workflow (dx-bug-all) or reproduction (dx-bug-verify).\"\nargument-hint: \"\u003CADO Bug Work Item ID (optional — uses most recent if omitted)>\"\nallowed-tools: [\"read\", \"edit\", \"search\", \"write\", \"agent\"]\n---\n\nYou are a coordinator. You do NOT implement anything yourself. You delegate each workflow phase to the `subagent` agent via the Task tool, then report progress.\n\n## Flow\n\n```dot\ndigraph bug_fix {\n    \"Pre-flight validation\" [shape=box];\n    \"Locate spec dir + read triage\u002Fverification\" [shape=box];\n    \"Check verification status\" [shape=box];\n    \"Generate fix plan (opus, 2-5 steps)\" [shape=box];\n    \"Cross-repo gate: all steps in other repo?\" [shape=diamond];\n    \"Hub dispatch fix\" [shape=box];\n    \"STOP: Fix belongs in other repo\" [shape=doublecircle];\n    \"Execute step cycle (step - test - review - fix)\" [shape=box];\n    \"Step blocked (2-strike)?\" [shape=diamond];\n    \"STOP: Human intervention needed\" [shape=doublecircle];\n    \"All steps done?\" [shape=diamond];\n    \"Run build\" [shape=box];\n    \"Run bug-verify (after mode)\" [shape=box];\n    \"Fix verified?\" [shape=diamond];\n    \"Attempt \u003C 2?\" [shape=diamond];\n    \"Revise plan + re-execute steps\" [shape=box];\n    \"Commit + create PR\" [shape=box];\n    \"Final summary\" [shape=doublecircle];\n\n    \"Pre-flight validation\" -> \"Locate spec dir + read triage\u002Fverification\";\n    \"Locate spec dir + read triage\u002Fverification\" -> \"Check verification status\";\n    \"Check verification status\" -> \"Generate fix plan (opus, 2-5 steps)\";\n    \"Generate fix plan (opus, 2-5 steps)\" -> \"Cross-repo gate: all steps in other repo?\";\n    \"Cross-repo gate: all steps in other repo?\" -> \"Hub dispatch fix\" [label=\"yes + hub mode\"];\n    \"Cross-repo gate: all steps in other repo?\" -> \"STOP: Fix belongs in other repo\" [label=\"yes + no hub\"];\n    \"Cross-repo gate: all steps in other repo?\" -> \"Execute step cycle (step - test - review - fix)\" [label=\"no\"];\n    \"Hub dispatch fix\" -> \"Final summary\";\n    \"Execute step cycle (step - test - review - fix)\" -> \"Step blocked (2-strike)?\";\n    \"Step blocked (2-strike)?\" -> \"STOP: Human intervention needed\" [label=\"yes\"];\n    \"Step blocked (2-strike)?\" -> \"All steps done?\" [label=\"no\"];\n    \"All steps done?\" -> \"Execute step cycle (step - test - review - fix)\" [label=\"no, next step\"];\n    \"All steps done?\" -> \"Run build\" [label=\"yes\"];\n    \"Run build\" -> \"Run bug-verify (after mode)\";\n    \"Run bug-verify (after mode)\" -> \"Fix verified?\";\n    \"Fix verified?\" -> \"Commit + create PR\" [label=\"yes or blocked\"];\n    \"Fix verified?\" -> \"Attempt \u003C 2?\" [label=\"no (partial\u002Ffailed)\"];\n    \"Attempt \u003C 2?\" -> \"Revise plan + re-execute steps\" [label=\"yes\"];\n    \"Attempt \u003C 2?\" -> \"STOP: Human intervention needed\" [label=\"no, 2 attempts\"];\n    \"Revise plan + re-execute steps\" -> \"Run build\";\n    \"Commit + create PR\" -> \"Final summary\";\n}\n```\n\n## Node Details\n\n### Pre-flight validation\n\nBefore starting the bug fix workflow, validate prerequisites:\n\n1. **Spec directory exists** — run `bash .ai\u002Flib\u002Fdx-common.sh find-spec-dir $ARGUMENTS`. If not found, STOP with: \"No spec directory found. Run `\u002Fdx-bug-triage \u003Cid>` first.\"\n2. **Required files exist** — check for `triage.md` in the spec directory. If missing, STOP.\n3. **MCP health** — run `bash .ai\u002Flib\u002Fmcp-health-check.sh all`. Report any failures as warnings (non-blocking — fix may not need MCP).\n4. **Feature branch** — run `bash .ai\u002Flib\u002Fensure-feature-branch.sh \u003Cspec-dir>`.\n\nIf any blocking check fails, STOP with a clear message listing what's missing.\n\n### Locate spec dir + read triage\u002Fverification\n\n```bash\nSPEC_DIR=$(bash .ai\u002Flib\u002Fdx-common.sh find-spec-dir $ARGUMENTS)\n```\n\nRead from `$SPEC_DIR`:\n- `raw-bug.md` — **required**. If missing: \"Run `\u002Fdx-bug-triage` first.\"\n- `triage.md` — **required**. If missing: \"Run `\u002Fdx-bug-triage` first.\"\n- `verification.md` — **optional**. If missing or result is \"Blocked\", warn but continue.\n\nPrint: `Bug fix starting for ADO #\u003Cid> — \u003Ctitle>`\n\n### Check verification status\n\nIf `verification.md` exists, read the `**Result:**` line:\n- `Reproduced` → proceed normally\n- `Partially Reproduced` → proceed with caution note\n- `Could Not Reproduce` → warn: \"Bug was not reproduced — fix is based on code analysis only.\"\n- `Blocked` → warn: \"Verification was blocked — proceeding on triage analysis alone.\"\n\nIf `verification.md` doesn't exist → same warning as \"Blocked\".\n\n### Generate fix plan (opus, 2-5 steps)\n\nDelegate to a subagent with **model: opus** for deep reasoning:\n\n```\nGenerate implement.md for bug fix in spec directory \u003CSPEC_DIR>.\n\nRead raw-bug.md, triage.md, and verification.md (if exists).\nUse the root cause hypothesis from triage.md and the evidence from verification.md\nto generate a concrete fix plan.\n\nBefore writing implement.md, load coding standards for the affected file types\n(from triage.md's Affected Files table):\n- Check .claude\u002Frules\u002F for rules matching the file types being fixed\n- If .github\u002Finstructions\u002F exists, read the relevant instruction file:\n  - .js files → .github\u002Finstructions\u002Ffe.javascript.instructions.md (or fe.javascript.md)\n  - .scss\u002F.css files → .github\u002Finstructions\u002Ffe.css-styles.md (or fe.styles.instructions.md)\n  - .html (HTL) files → .github\u002Finstructions\u002Fbe.htl.md\n  - .java files → .github\u002Finstructions\u002Fbe.sling-models.md\n  - Dialog XML → .github\u002Finstructions\u002Fbe.dialog.md\n  - Accessibility-related bugs → .github\u002Finstructions\u002Faccessibility.instructions.md\n- If the bug involves AEM frontend modals, overlays, or focus management,\n  also read shared\u002Faem-dom-rules.md from the dx-aem plugin for DOM constraints.\nThese conventions MUST inform the fix approach — do not generate steps that violate them.\n\nWrite implement.md to \u003CSPEC_DIR>\u002Fimplement.md with:\n- Root Cause (1-2 sentences)\n- Approach (2-3 sentences)\n- If triage.md has a \"Cross-Repo Scope\" section, add: **Other repos required:** \u003Crepo name(s)> — run `\u002Fdx-bug-all \u003Cid>` there after this fix\n- Steps (2-5, each with Status: pending, Files, What, Why, Test)\n- Testing Plan (unit tests + manual verification)\n\nRules for plan generation:\n- 2-5 steps maximum (bugs are simpler than features)\n- Every file reference must come from triage.md's Affected Files table\n- Steps ordered by implementation dependency\n- Each step has **Status:** pending\n- Include regression test in at least one step\n- Root Cause must be grounded in actual code, not speculation\n```\n\nPrint: `Phase 1 done — implement.md created with \u003CN> steps`\n\n### Cross-repo gate: all steps in other repo?\n\nAfter implement.md is generated, check if the fix belongs in another repo:\n\n1. Read implement.md for the `**Other repos required:**` line\n2. Check if **any step modifies source code** (JS, CSS, Java, etc.) in the current repo — or if steps only touch spec\u002Fdoc files (triage.md, verification.md, etc.)\n\n**If all steps are doc-only \u002F dead-code cleanup** (no functional fix in this repo) → go to \"STOP: Fix belongs in other repo\".\n\n**If at least one step modifies functional source code** in this repo → go to \"Execute step cycle (step - test - review - fix)\". The cross-repo note will appear in the final summary.\n\n### Hub dispatch fix\n\n**Entered when:** Cross-repo gate detected all fix steps belong to another repo AND hub mode is active.\n\nPrint: `Hub mode detected. The fix belongs in another repo. Use \u002Fdx-hub-dispatch \u003Cticket-id> to dispatch this bug to the correct repo terminal.` STOP.\n\nHub dispatch is handled by the dedicated `\u002Fdx-hub-dispatch` skill, which opens independent VS Code terminals for each repo.\n\n> **Note:** If hub mode is NOT active, the existing \"STOP: Fix belongs in other repo\" behavior applies unchanged.\n\n### STOP: Fix belongs in other repo\n\nPrint a prominent warning and STOP:\n\n```markdown\n## Cross-Repo Bug: Fix belongs in \u003Cother repo(s)>\n\n**ADO #\u003Cid> — \u003Ctitle>**\n\nThe root cause is in **\u003Cother repo(s)>**, not in this repo. No functional fix can be applied here.\n\n**Root cause:** \u003C1-line from implement.md>\n\n**What's needed in \u003Cother repo>:**\n\u003CExtract the specific fix description from implement.md's \"Other repos required\" line or approach section>\n\n### Next steps:\n1. `cd \u003Cpath-to-other-repo>` (from `.ai\u002Fconfig.yaml` repos section)\n2. Run `\u002Fdx-bug-triage \u003Cid>` → `\u002Fdx-bug-fix \u003Cid>` there\n3. _(Optional)_ Come back here to clean up dead code after the upstream fix ships\n\n### Dead code in this repo (optional cleanup):\n\u003CList any dead-code steps from implement.md, e.g., \"Remove unused fix from brand.js\">\nRun `\u002Fdx-bug-fix \u003Cid>` again with `--cleanup` intent if you want to proceed with just the cleanup steps.\n```\n\nDo not proceed to any further sections. The user must fix the other repo first.\n\n> **Note:** If hub mode is active, the \"Hub dispatch fix\" node directs the user to `\u002Fdx-hub-dispatch` instead of reaching this node.\n\n### Execute step cycle (step - test - review - fix)\n\nFor each pending step in implement.md, run the step-test-review-fix cycle. Before the first step, mark the step loop active, so the workers drop their \"run X next\" hints addressed to a human (`..\u002F..\u002Fshared\u002Forchestration-check.md` § Step-loop marker). Remove it at \"All steps done?\" → yes and at \"STOP: Human intervention needed\":\n\n```bash\nmkdir -p .ai\u002Frun-context && echo \"$SPEC_DIR\" > .ai\u002Frun-context\u002Fstep-loop.flag   # rm -f on exit\n```\n\n**Execute Step:**\n\n```\nInvoke \u002Fdx-step for spec directory \u003CSPEC_DIR>\n```\n\n`\u002Fdx-step` handles implementation, testing, review, and commit in one pass. It runs forked and ends with a `## Return` block — a checkpoint, not the end of this skill. `verdict: fail` (step `blocked`) → go to fix sub-cycle; otherwise continue to \"All steps done?\".\n\n**Fix (if needed):**\n\n```\nInvoke \u002Fdx-step-fix for spec directory \u003CSPEC_DIR>\n```\n\nTrack fix attempts per step. If fix succeeds → re-run tests (loop back to Run Tests above).\n\n**Progress Report:** After each step cycle: `Step \u003CN>\u002F\u003Ctotal> done — \u003Cstep title>`\n\n### Step blocked (2-strike)?\n\nTrack consecutive fix failures per step. **2-strike rule:** If 2nd consecutive fix on the same step fails:\n\n- **yes** → go to \"STOP: Human intervention needed\"\n- **no** → go to \"All steps done?\"\n\n### STOP: Human intervention needed\n\nPrint error details and: \"Step \u003CN> blocked after 2 fix attempts. Human intervention needed.\"\n\nSTOP the entire workflow.\n\n### All steps done?\n\nCheck implement.md for remaining pending steps (`bash .ai\u002Flib\u002Fplan-metadata.sh $SPEC_DIR`), never from memory:\n\n- **no, next step** → go back to \"Execute step cycle (step - test - review - fix)\" with the next pending step\n- **yes** → go to \"Run build\"\n\n### Run build\n\nAfter all steps complete:\n\n```\nInvoke \u002Fdx-step-build for spec directory \u003CSPEC_DIR>\n```\n\nIf build fails, delegate to step-fix. 2-strike rule applies.\n\n### Run bug-verify (after mode)\n\nRun local verification to confirm the fix resolved the issue:\n\n```\nInvoke \u002Fdx-bug-verify \u003Cid> after\n```\n\nThis runs `dx-bug-verify` in `after` mode — swaps the repro URL to local AEM, re-runs the repro steps, and confirms the bug is no longer present. Output goes to `verification-local.md`.\n\nRead `verification-local.md` for the result.\n\nPrint: `Local verification: \u003Cresult>`\n\n### Fix verified?\n\nRead the result from `verification-local.md`:\n\n- **yes (Fix Verified)** → go to \"Commit + create PR\"\n- **blocked** → go to \"Commit + create PR\" (warn but proceed — local verification is best-effort, e.g., Playwright unavailable)\n- **no (partial\u002Ffailed)** → go to \"Attempt \u003C 2?\"\n\n### Attempt \u003C 2?\n\nCheck how many fix-verify iterations have been attempted:\n\n- **yes (first attempt)** → go to \"Revise plan + re-execute steps\"\n- **no, 2 attempts** → STOP. Write diagnostic to `\u003Cspec-dir>\u002Ffix-loop-report.md`:\n\n```\n## Bug Fix Loop — Blocked After 2 Attempts\n\n**Original issue:** \u003Cfrom triage.md>\n**Attempt 1 result:** \u003Cfrom verification-local.md>\n**Attempt 2 result:** \u003Cfrom verification-local.md>\n**Diagnosis:** \u003Cwhat changed between attempts, what's still failing>\n\nHuman intervention needed. The verification output suggests: \u003Cactionable next step>\n```\n\nGo to \"STOP: Human intervention needed\".\n\n**Cap:** 2 fix-verify iterations maximum. Never loop more than twice.\n\n### Revise plan + re-execute steps\n\n1. Read the verification failure details from `verification-local.md`\n2. Append failure context to `triage.md` under a new `## Fix Attempt 1 — Failure Analysis` heading\n3. Re-read the original triage + failure context\n4. Generate a revised fix plan — update `implement.md` with new steps (mark old steps as `done` or `superseded`)\n5. Execute the revised steps via `\u002Fdx-step` (same 2-strike rule per step)\n\nAfter revised steps complete → go to \"Run build\".\n\n### Commit + create PR\n\n```\nInvoke \u002Fdx-pr-commit for spec directory \u003CSPEC_DIR>.\nCommit message format: #\u003Cid> Fix \u003Cshort description from bug title>\n```\n\nPrint: `PR created: \u003CPR URL>`\n\n### Final summary\n\n```markdown\n## Bug Fix Complete: ADO #\u003Cid>\n\n**\u003CTitle>**\n**Root Cause:** \u003C1-line from implement.md>\n**Branch:** `bugfix\u002F\u003Cid>-\u003Cslug>`\n**PR:** \u003CPR URL>\n\n| Phase | Status | Details |\n|-------|--------|---------|\n| Triage | Done | \u003CN> files identified, layer: \u003Clayer> |\n| Verification | \u003Cresult> | \u003CN> screenshots |\n| Fix Plan | \u003CN> steps | All pending → done |\n| Execution | \u003CN>\u002F\u003CN> done | \u003CN> fix attempts |\n| Build | Passed | |\n| Local Verify | \u003Cresult> | \u003CN> post-fix screenshots |\n| PR | Created | \u003CPR URL> |\n\n### Files Changed:\n\u003Clist from git diff --name-only>\n\n### Cross-Repo Note:\n\u003CIf implement.md has \"Other repos required\", print:>\n> This fix covers **\u003Ccurrent repo>** only. Switch to **\u003Cother repo(s)>** and run `\u002Fdx-bug-all \u003Cid>` there.\n\u003COtherwise omit this section.>\n```\n\n## Error Handling\n\n| Scenario | Action |\n|----------|--------|\n| triage.md missing | STOP — \"Run `\u002Fdx-bug-triage` first.\" |\n| triage.md has no affected files | STOP — \"Cannot generate fix plan without affected files.\" |\n| implement.md generation fails | Retry once. If still fails, suggest: \"Run `\u002Fdx-plan` manually.\" |\n| All fix steps are in another repo | STOP — print cross-repo gate message (section \"STOP: Fix belongs in other repo\"). Advise user to `cd` to that repo and run `\u002Fdx-bug-triage` + `\u002Fdx-bug-fix` there. |\n| Step blocked (2-strike) | STOP loop. Report which step blocked. |\n| Build fails after all steps | Delegate to step-fix loop (max 6 attempts per build pattern). |\n| Local verification Fix Failed (attempt 1) | Revise fix plan, re-execute steps, retry once (attempt 2). |\n| Local verification Fix Failed (attempt 2) | STOP. Write `fix-loop-report.md`. Human intervention needed. |\n| Local verification Blocked | WARN and continue to commit. Playwright may be unavailable. |\n| commit fails | Report error. Suggest: \"Run `\u002Fdx-pr-commit` manually.\" |\n\n## Rules\n\n- **Coordinator only** — never implement code yourself. Always delegate via Task tool.\n- **Sequential phases** — plan → execute → build → commit. Never skip.\n- **2-strike rule** — stop after 2 consecutive fix failures. Don't brute-force.\n- **Re-read implement.md** — re-read between steps to get latest status.\n- **Bugfix branch required** — never execute on a protected branch. Check `.branch` file.\n- **Progress reporting** — print status after each phase and step.\n- **Commit message format** — `#\u003Cid> Fix \u003Cdescription>` (not `#\u003Cid> Add` or `#\u003Cid> Update`).\n","You are a coordinator. You do NOT implement anything yourself. You delegate each workflow phase to the `subagent` agent via the Task tool, then report progress.\n\n## Flow\n\n```dot\ndigraph bug_fix {\n    \"Pre-flight validation\" [shape=box];\n    \"Locate spec dir + read triage\u002Fverification\" [shape=box];\n    \"Check verification status\" [shape=box];\n    \"Generate fix plan (opus, 2-5 steps)\" [shape=box];\n    \"Cross-repo gate: all steps in other repo?\" [shape=diamond];\n    \"Hub dispatch fix\" [shape=box];\n    \"STOP: Fix belongs in other repo\" [shape=doublecircle];\n    \"Execute step cycle (step - test - review - fix)\" [shape=box];\n    \"Step blocked (2-strike)?\" [shape=diamond];\n    \"STOP: Human intervention needed\" [shape=doublecircle];\n    \"All steps done?\" [shape=diamond];\n    \"Run build\" [shape=box];\n    \"Run bug-verify (after mode)\" [shape=box];\n    \"Fix verified?\" [shape=diamond];\n    \"Attempt \u003C 2?\" [shape=diamond];\n    \"Revise plan + re-execute steps\" [shape=box];\n    \"Commit + create PR\" [shape=box];\n    \"Final summary\" [shape=doublecircle];\n\n    \"Pre-flight validation\" -> \"Locate spec dir + read triage\u002Fverification\";\n    \"Locate spec dir + read triage\u002Fverification\" -> \"Check verification status\";\n    \"Check verification status\" -> \"Generate fix plan (opus, 2-5 steps)\";\n    \"Generate fix plan (opus, 2-5 steps)\" -> \"Cross-repo gate: all steps in other repo?\";\n    \"Cross-repo gate: all steps in other repo?\" -> \"Hub dispatch fix\" [label=\"yes + hub mode\"];\n    \"Cross-repo gate: all steps in other repo?\" -> \"STOP: Fix belongs in other repo\" [label=\"yes + no hub\"];\n    \"Cross-repo gate: all steps in other repo?\" -> \"Execute step cycle (step - test - review - fix)\" [label=\"no\"];\n    \"Hub dispatch fix\" -> \"Final summary\";\n    \"Execute step cycle (step - test - review - fix)\" -> \"Step blocked (2-strike)?\";\n    \"Step blocked (2-strike)?\" -> \"STOP: Human intervention needed\" [label=\"yes\"];\n    \"Step blocked (2-strike)?\" -> \"All steps done?\" [label=\"no\"];\n    \"All steps done?\" -> \"Execute step cycle (step - test - review - fix)\" [label=\"no, next step\"];\n    \"All steps done?\" -> \"Run build\" [label=\"yes\"];\n    \"Run build\" -> \"Run bug-verify (after mode)\";\n    \"Run bug-verify (after mode)\" -> \"Fix verified?\";\n    \"Fix verified?\" -> \"Commit + create PR\" [label=\"yes or blocked\"];\n    \"Fix verified?\" -> \"Attempt \u003C 2?\" [label=\"no (partial\u002Ffailed)\"];\n    \"Attempt \u003C 2?\" -> \"Revise plan + re-execute steps\" [label=\"yes\"];\n    \"Attempt \u003C 2?\" -> \"STOP: Human intervention needed\" [label=\"no, 2 attempts\"];\n    \"Revise plan + re-execute steps\" -> \"Run build\";\n    \"Commit + create PR\" -> \"Final summary\";\n}\n```\n\n## Node Details\n\n### Pre-flight validation\n\nBefore starting the bug fix workflow, validate prerequisites:\n\n1. **Spec directory exists** — run `bash .ai\u002Flib\u002Fdx-common.sh find-spec-dir $ARGUMENTS`. If not found, STOP with: \"No spec directory found. Run `\u002Fdx-bug-triage \u003Cid>` first.\"\n2. **Required files exist** — check for `triage.md` in the spec directory. If missing, STOP.\n3. **MCP health** — run `bash .ai\u002Flib\u002Fmcp-health-check.sh all`. Report any failures as warnings (non-blocking — fix may not need MCP).\n4. **Feature branch** — run `bash .ai\u002Flib\u002Fensure-feature-branch.sh \u003Cspec-dir>`.\n\nIf any blocking check fails, STOP with a clear message listing what's missing.\n\n### Locate spec dir + read triage\u002Fverification\n\n```bash\nSPEC_DIR=$(bash .ai\u002Flib\u002Fdx-common.sh find-spec-dir $ARGUMENTS)\n```\n\nRead from `$SPEC_DIR`:\n- `raw-bug.md` — **required**. If missing: \"Run `\u002Fdx-bug-triage` first.\"\n- `triage.md` — **required**. If missing: \"Run `\u002Fdx-bug-triage` first.\"\n- `verification.md` — **optional**. If missing or result is \"Blocked\", warn but continue.\n\nPrint: `Bug fix starting for ADO #\u003Cid> — \u003Ctitle>`\n\n### Check verification status\n\nIf `verification.md` exists, read the `**Result:**` line:\n- `Reproduced` → proceed normally\n- `Partially Reproduced` → proceed with caution note\n- `Could Not Reproduce` → warn: \"Bug was not reproduced — fix is based on code analysis only.\"\n- `Blocked` → warn: \"Verification was blocked — proceeding on triage analysis alone.\"\n\nIf `verification.md` doesn't exist → same warning as \"Blocked\".\n\n### Generate fix plan (opus, 2-5 steps)\n\nDelegate to a subagent with **model: opus** for deep reasoning:\n\n```\nGenerate implement.md for bug fix in spec directory \u003CSPEC_DIR>.\n\nRead raw-bug.md, triage.md, and verification.md (if exists).\nUse the root cause hypothesis from triage.md and the evidence from verification.md\nto generate a concrete fix plan.\n\nBefore writing implement.md, load coding standards for the affected file types\n(from triage.md's Affected Files table):\n- Check .claude\u002Frules\u002F for rules matching the file types being fixed\n- If .github\u002Finstructions\u002F exists, read the relevant instruction file:\n  - .js files → .github\u002Finstructions\u002Ffe.javascript.instructions.md (or fe.javascript.md)\n  - .scss\u002F.css files → .github\u002Finstructions\u002Ffe.css-styles.md (or fe.styles.instructions.md)\n  - .html (HTL) files → .github\u002Finstructions\u002Fbe.htl.md\n  - .java files → .github\u002Finstructions\u002Fbe.sling-models.md\n  - Dialog XML → .github\u002Finstructions\u002Fbe.dialog.md\n  - Accessibility-related bugs → .github\u002Finstructions\u002Faccessibility.instructions.md\n- If the bug involves AEM frontend modals, overlays, or focus management,\n  also read shared\u002Faem-dom-rules.md from the dx-aem plugin for DOM constraints.\nThese conventions MUST inform the fix approach — do not generate steps that violate them.\n\nWrite implement.md to \u003CSPEC_DIR>\u002Fimplement.md with:\n- Root Cause (1-2 sentences)\n- Approach (2-3 sentences)\n- If triage.md has a \"Cross-Repo Scope\" section, add: **Other repos required:** \u003Crepo name(s)> — run `\u002Fdx-bug-all \u003Cid>` there after this fix\n- Steps (2-5, each with Status: pending, Files, What, Why, Test)\n- Testing Plan (unit tests + manual verification)\n\nRules for plan generation:\n- 2-5 steps maximum (bugs are simpler than features)\n- Every file reference must come from triage.md's Affected Files table\n- Steps ordered by implementation dependency\n- Each step has **Status:** pending\n- Include regression test in at least one step\n- Root Cause must be grounded in actual code, not speculation\n```\n\nPrint: `Phase 1 done — implement.md created with \u003CN> steps`\n\n### Cross-repo gate: all steps in other repo?\n\nAfter implement.md is generated, check if the fix belongs in another repo:\n\n1. Read implement.md for the `**Other repos required:**` line\n2. Check if **any step modifies source code** (JS, CSS, Java, etc.) in the current repo — or if steps only touch spec\u002Fdoc files (triage.md, verification.md, etc.)\n\n**If all steps are doc-only \u002F dead-code cleanup** (no functional fix in this repo) → go to \"STOP: Fix belongs in other repo\".\n\n**If at least one step modifies functional source code** in this repo → go to \"Execute step cycle (step - test - review - fix)\". The cross-repo note will appear in the final summary.\n\n### Hub dispatch fix\n\n**Entered when:** Cross-repo gate detected all fix steps belong to another repo AND hub mode is active.\n\nPrint: `Hub mode detected. The fix belongs in another repo. Use \u002Fdx-hub-dispatch \u003Cticket-id> to dispatch this bug to the correct repo terminal.` STOP.\n\nHub dispatch is handled by the dedicated `\u002Fdx-hub-dispatch` skill, which opens independent VS Code terminals for each repo.\n\n> **Note:** If hub mode is NOT active, the existing \"STOP: Fix belongs in other repo\" behavior applies unchanged.\n\n### STOP: Fix belongs in other repo\n\nPrint a prominent warning and STOP:\n\n```markdown\n## Cross-Repo Bug: Fix belongs in \u003Cother repo(s)>\n\n**ADO #\u003Cid> — \u003Ctitle>**\n\nThe root cause is in **\u003Cother repo(s)>**, not in this repo. No functional fix can be applied here.\n\n**Root cause:** \u003C1-line from implement.md>\n\n**What's needed in \u003Cother repo>:**\n\u003CExtract the specific fix description from implement.md's \"Other repos required\" line or approach section>\n\n### Next steps:\n1. `cd \u003Cpath-to-other-repo>` (from `.ai\u002Fconfig.yaml` repos section)\n2. Run `\u002Fdx-bug-triage \u003Cid>` → `\u002Fdx-bug-fix \u003Cid>` there\n3. _(Optional)_ Come back here to clean up dead code after the upstream fix ships\n\n### Dead code in this repo (optional cleanup):\n\u003CList any dead-code steps from implement.md, e.g., \"Remove unused fix from brand.js\">\nRun `\u002Fdx-bug-fix \u003Cid>` again with `--cleanup` intent if you want to proceed with just the cleanup steps.\n```\n\nDo not proceed to any further sections. The user must fix the other repo first.\n\n> **Note:** If hub mode is active, the \"Hub dispatch fix\" node directs the user to `\u002Fdx-hub-dispatch` instead of reaching this node.\n\n### Execute step cycle (step - test - review - fix)\n\nFor each pending step in implement.md, run the step-test-review-fix cycle. Before the first step, mark the step loop active, so the workers drop their \"run X next\" hints addressed to a human (`..\u002F..\u002Fshared\u002Forchestration-check.md` § Step-loop marker). Remove it at \"All steps done?\" → yes and at \"STOP: Human intervention needed\":\n\n```bash\nmkdir -p .ai\u002Frun-context && echo \"$SPEC_DIR\" > .ai\u002Frun-context\u002Fstep-loop.flag   # rm -f on exit\n```\n\n**Execute Step:**\n\n```\nInvoke \u002Fdx-step for spec directory \u003CSPEC_DIR>\n```\n\n`\u002Fdx-step` handles implementation, testing, review, and commit in one pass. It runs forked and ends with a `## Return` block — a checkpoint, not the end of this skill. `verdict: fail` (step `blocked`) → go to fix sub-cycle; otherwise continue to \"All steps done?\".\n\n**Fix (if needed):**\n\n```\nInvoke \u002Fdx-step-fix for spec directory \u003CSPEC_DIR>\n```\n\nTrack fix attempts per step. If fix succeeds → re-run tests (loop back to Run Tests above).\n\n**Progress Report:** After each step cycle: `Step \u003CN>\u002F\u003Ctotal> done — \u003Cstep title>`\n\n### Step blocked (2-strike)?\n\nTrack consecutive fix failures per step. **2-strike rule:** If 2nd consecutive fix on the same step fails:\n\n- **yes** → go to \"STOP: Human intervention needed\"\n- **no** → go to \"All steps done?\"\n\n### STOP: Human intervention needed\n\nPrint error details and: \"Step \u003CN> blocked after 2 fix attempts. Human intervention needed.\"\n\nSTOP the entire workflow.\n\n### All steps done?\n\nCheck implement.md for remaining pending steps (`bash .ai\u002Flib\u002Fplan-metadata.sh $SPEC_DIR`), never from memory:\n\n- **no, next step** → go back to \"Execute step cycle (step - test - review - fix)\" with the next pending step\n- **yes** → go to \"Run build\"\n\n### Run build\n\nAfter all steps complete:\n\n```\nInvoke \u002Fdx-step-build for spec directory \u003CSPEC_DIR>\n```\n\nIf build fails, delegate to step-fix. 2-strike rule applies.\n\n### Run bug-verify (after mode)\n\nRun local verification to confirm the fix resolved the issue:\n\n```\nInvoke \u002Fdx-bug-verify \u003Cid> after\n```\n\nThis runs `dx-bug-verify` in `after` mode — swaps the repro URL to local AEM, re-runs the repro steps, and confirms the bug is no longer present. Output goes to `verification-local.md`.\n\nRead `verification-local.md` for the result.\n\nPrint: `Local verification: \u003Cresult>`\n\n### Fix verified?\n\nRead the result from `verification-local.md`:\n\n- **yes (Fix Verified)** → go to \"Commit + create PR\"\n- **blocked** → go to \"Commit + create PR\" (warn but proceed — local verification is best-effort, e.g., Playwright unavailable)\n- **no (partial\u002Ffailed)** → go to \"Attempt \u003C 2?\"\n\n### Attempt \u003C 2?\n\nCheck how many fix-verify iterations have been attempted:\n\n- **yes (first attempt)** → go to \"Revise plan + re-execute steps\"\n- **no, 2 attempts** → STOP. Write diagnostic to `\u003Cspec-dir>\u002Ffix-loop-report.md`:\n\n```\n## Bug Fix Loop — Blocked After 2 Attempts\n\n**Original issue:** \u003Cfrom triage.md>\n**Attempt 1 result:** \u003Cfrom verification-local.md>\n**Attempt 2 result:** \u003Cfrom verification-local.md>\n**Diagnosis:** \u003Cwhat changed between attempts, what's still failing>\n\nHuman intervention needed. The verification output suggests: \u003Cactionable next step>\n```\n\nGo to \"STOP: Human intervention needed\".\n\n**Cap:** 2 fix-verify iterations maximum. Never loop more than twice.\n\n### Revise plan + re-execute steps\n\n1. Read the verification failure details from `verification-local.md`\n2. Append failure context to `triage.md` under a new `## Fix Attempt 1 — Failure Analysis` heading\n3. Re-read the original triage + failure context\n4. Generate a revised fix plan — update `implement.md` with new steps (mark old steps as `done` or `superseded`)\n5. Execute the revised steps via `\u002Fdx-step` (same 2-strike rule per step)\n\nAfter revised steps complete → go to \"Run build\".\n\n### Commit + create PR\n\n```\nInvoke \u002Fdx-pr-commit for spec directory \u003CSPEC_DIR>.\nCommit message format: #\u003Cid> Fix \u003Cshort description from bug title>\n```\n\nPrint: `PR created: \u003CPR URL>`\n\n### Final summary\n\n```markdown\n## Bug Fix Complete: ADO #\u003Cid>\n\n**\u003CTitle>**\n**Root Cause:** \u003C1-line from implement.md>\n**Branch:** `bugfix\u002F\u003Cid>-\u003Cslug>`\n**PR:** \u003CPR URL>\n\n| Phase | Status | Details |\n|-------|--------|---------|\n| Triage | Done | \u003CN> files identified, layer: \u003Clayer> |\n| Verification | \u003Cresult> | \u003CN> screenshots |\n| Fix Plan | \u003CN> steps | All pending → done |\n| Execution | \u003CN>\u002F\u003CN> done | \u003CN> fix attempts |\n| Build | Passed | |\n| Local Verify | \u003Cresult> | \u003CN> post-fix screenshots |\n| PR | Created | \u003CPR URL> |\n\n### Files Changed:\n\u003Clist from git diff --name-only>\n\n### Cross-Repo Note:\n\u003CIf implement.md has \"Other repos required\", print:>\n> This fix covers **\u003Ccurrent repo>** only. Switch to **\u003Cother repo(s)>** and run `\u002Fdx-bug-all \u003Cid>` there.\n\u003COtherwise omit this section.>\n```\n\n## Error Handling\n\n| Scenario | Action |\n|----------|--------|\n| triage.md missing | STOP — \"Run `\u002Fdx-bug-triage` first.\" |\n| triage.md has no affected files | STOP — \"Cannot generate fix plan without affected files.\" |\n| implement.md generation fails | Retry once. If still fails, suggest: \"Run `\u002Fdx-plan` manually.\" |\n| All fix steps are in another repo | STOP — print cross-repo gate message (section \"STOP: Fix belongs in other repo\"). Advise user to `cd` to that repo and run `\u002Fdx-bug-triage` + `\u002Fdx-bug-fix` there. |\n| Step blocked (2-strike) | STOP loop. Report which step blocked. |\n| Build fails after all steps | Delegate to step-fix loop (max 6 attempts per build pattern). |\n| Local verification Fix Failed (attempt 1) | Revise fix plan, re-execute steps, retry once (attempt 2). |\n| Local verification Fix Failed (attempt 2) | STOP. Write `fix-loop-report.md`. Human intervention needed. |\n| Local verification Blocked | WARN and continue to commit. Playwright may be unavailable. |\n| commit fails | Report error. Suggest: \"Run `\u002Fdx-pr-commit` manually.\" |\n\n## Rules\n\n- **Coordinator only** — never implement code yourself. Always delegate via Task tool.\n- **Sequential phases** — plan → execute → build → commit. Never skip.\n- **2-strike rule** — stop after 2 consecutive fix failures. Don't brute-force.\n- **Re-read implement.md** — re-read between steps to get latest status.\n- **Bugfix branch required** — never execute on a protected branch. Check `.branch` file.\n- **Progress reporting** — print status after each phase and step.\n- **Commit message format** — `#\u003Cid> Fix \u003Cdescription>` (not `#\u003Cid> Add` or `#\u003Cid> Update`).\n",{"name":5,"description":7,"allowed-tools":44,"argument-hint":46},[32,30,38,31,45],"agent","\u003CADO Bug Work Item ID (optional — uses most recent if omitted)>","main","5c642842a92100dc7561ae0682a152a74846e186","plugins\u002Fdx-core\u002Fskills\u002Fdx-bug-fix",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":57,"prompt":67,"zipAvailable":68},[58,61,64],{"tool":59,"command":60},"npx","npx skills add easingthemes\u002Fdx-aem-flow --skill dx-bug-fix",{"tool":62,"command":63},"bunx","bunx skills add easingthemes\u002Fdx-aem-flow --skill dx-bug-fix",{"tool":65,"command":66},"pnpm","pnpm dlx skills add easingthemes\u002Fdx-aem-flow --skill dx-bug-fix","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-core\u002Fskills\u002Fdx-bug-fix\u002FSKILL.md",true,[],[71,91,112,133,149,164],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"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",[],[21,78,79,80,81,82,83,27,84,85,26,86,87,24,88,32,31,89,90],"dx hub status","hub","status","hub status","which","show","ticket","clean","done","Bash","dispatch","repos","grep",{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"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",[],[98,99,21,100,79,101,102,103,104,105,106,107,108,109,87,110,111,32,31,30],"init","hub init","dx hub init","SET","time","mode","default","up","repo setup","orchestration","configure","multi-repo","cli","directory",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":123,"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",[118],{"categoryNo":119,"categoryName":120,"taxonomyType":121,"taxonomyTypeDesc":122},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[21,124,88,79,29,27,125,126,127,84,37,128,26,129,87,130,131,132,24,34],"dx hub dispatch","repo","work on","session","MCP","URL","vscode","code","across",{"skillNo":134,"name":135,"nameZh":6,"description":136,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":137,"categories":138,"keywords":139,"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",[],[21,140,79,141,83,142,125,143,144,145,146,26,108,87,147,32,148,31,30,89],"dx hub config","config","view","manage","trigger","true","adjust","terminal","settings",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"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",[],[156,21,157,89,82,125,132,158,24,159,34,160,79,161,162,163],"discover","dx discover repos","router","directive","simple","block","sonnet","table",{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":171,"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",[170],{"categoryNo":119,"categoryName":120,"taxonomyType":121,"taxonomyTypeDesc":122},[172,21,173,174,175,38,19,176,177,178,32,31,30,179,180,181,182,26,183,184],"upgrade","dx upgrade","project","actions","files","auto","run","list","doctor","manual","missing","plugin","plugins"]