[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6H44JZQ64RH4C02B6NADSEG":3,"skill-same:01M6H44JZQ64RH4C02B6NADSEG":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},"01M6H44JZQ64RH4C02B6NADSEG","dx-plan",null,"Generate implement.md, a plan with status-tracked steps, from explain.md and research.md. Use after requirements are ready ('plan this story').","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-plan\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"dx plan","dx","plan","high","research","id","with","implement","explain","requirements","use","opus","status","edit","write","read","generate","work","search","ready","2026-11-10 10:12:30",false,"---\nname: dx-plan\ndescription: \"Generate implement.md, a plan with status-tracked steps, from explain.md and research.md. Use after requirements are ready ('plan this story').\"\nargument-hint: \"[Work Item ID or slug (optional — uses most recent if omitted)]\"\nmodel: opus\neffort: high\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-plan 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-plan (you are a fork or that subagent), continue below.\n\nYou read the spec documents and use extended thinking to generate `implement.md` — a concrete, step-by-step development plan with status tracking for automated execution.\n\nUse ultrathink for this skill — implementation planning benefits from deep reasoning about dependencies, ordering, and edge cases.\n\n## Output discipline\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\nTwo outputs are always required regardless of path:\n\n1. **`$SPEC_DIR\u002Fimplement.md`** — the canonical plan, format defined in `.ai\u002Ftemplates\u002Fspec\u002Fimplement.md.template`. This is what the executor reads.\n2. **`$SPEC_DIR\u002Fplan-thinking.md`** — a design-rationale summary: the alternative approaches evaluated, dependencies and ordering constraints identified, and risks assessed for this plan. This is a finished analysis artifact, not a transcript of internal deliberation. Write it BEFORE writing `implement.md`. Maximum 1000 words.\n\n## 1. Locate the Spec Directory\n\n```bash\nSPEC_DIR=$(bash .ai\u002Flib\u002Fdx-common.sh find-spec-dir $ARGUMENTS)\n```\n\nIf the script exits with error, ask the user for the work item ID or slug.\n\nRead these files from `$SPEC_DIR` (in order of importance):\n- `research.md` — codebase findings (required for a good plan)\n- `explain.md` — distilled requirements\n- `raw-story.md` — original story for reference (may not exist for non-ADO flows)\n\nIf `research.md` doesn't exist, warn the user: \"No research.md found — run `\u002Fdx-req` first for a better plan. Proceeding with explain.md only.\"\n\n### Provenance Check on Inputs\n\nRead `..\u002F..\u002Fshared\u002Fprovenance-schema.md` for the schema definition.\n\nAfter reading each input file, parse its YAML frontmatter `provenance:` block (if present). Evaluate input quality:\n\n1. **research.md provenance:**\n   - If `confidence: low` → warn: \"⚠ research.md has low confidence (degraded mode or incomplete data). Plan quality may be affected — consider re-running `\u002Fdx-req` with better search hints.\"\n   - If `confidence: medium` or `high` → no warning needed\n   - If no provenance block → informational: \"ℹ research.md has no provenance metadata (pre-migration file). Confidence unknown.\"\n   - If `model: haiku` → note: \"ℹ research.md was produced at Haiku tier. For complex features, consider re-running `\u002Fdx-req` at higher tier.\"\n\n2. **explain.md provenance:**\n   - If `confidence: low` → warn: \"⚠ explain.md has low confidence. Requirements may be incomplete — verify with the original ticket.\"\n   - If no provenance block → skip (informational only, don't block)\n\n**Confidence propagation:** Use the *lowest* confidence from input files as the ceiling for `implement.md` provenance. If research.md is `low`, implement.md cannot be higher than `low` — regardless of planning quality, the plan is only as reliable as its inputs.\n\nAlso check for Figma prototype files (from `\u002Fdx-figma-prototype`):\n- `figma-conventions.md` — discovered project conventions (design tokens, naming, patterns)\n- `prototype\u002Findex.html` — standalone HTML prototype\n- `prototype\u002Fstyles.css` — CSS with project token mappings\n- `figma-extract.md` — raw Figma extraction data\n\nIf prototype files exist, the plan MUST reference them. Implementation steps should adapt the prototype into project-native code rather than building from scratch.\n\n**Component Reuse Map:** If `figma-conventions.md` contains a `### Component Reuse Map` section, the plan MUST respect it:\n- Components marked **Reuse as-is** → plan step says \"Use existing `\u003Ccomponent>` at `\u003Cpath>`\" — NO new file creation\n- Components marked **Extend** → plan step modifies the existing component file, adding the identified variant\n- Components marked **Compose** → plan step assembles from listed existing components — NO new wrapper when composition suffices\n- Components marked **Create new** → plan step creates a new component following the nearest existing pattern\n- **Atomic components (button, image, icon, link, input, badge) should ALWAYS be reused.** A plan step that recreates an existing atomic component is a plan defect.\n\n## Hub Mode Check\n\nRead `..\u002F..\u002Fshared\u002Fhub-dispatch.md` for hub detection logic.\n\nIf hub mode is active (`hub.enabled: true` AND cwd is `.hub\u002F`):\n1. Read `research.md` → `## Cross-Repo Scope` for per-repo scope\n2. If cross-repo scope detected:\n   a. Resolve target repos from config\n   b. For each repo, dispatch planning: `cd \u003Crepo.path> && claude -p \"\u002Fdx-plan \u003Cticket-id>\" --output-format json --allowedTools \"Bash,Read,Edit,Write,Glob,Grep\" --permission-mode bypassPermissions`\n   c. Each repo generates its own `implement.md` locally\n   d. Collect and summarize: \"Plans generated in \u003CN> repos\"\n3. Write state files\n4. STOP — do not continue with local planning\n\nIf hub mode is not active: continue with normal flow below.\n\n## 2. Check Existing Output\n\n1. Check if `implement.md` exists in the spec directory\n2. If it exists, read its content\n3. Check staleness indicators:\n   - Does the title in `implement.md` match the current spec?\n   - Does the step count and files referenced align with current `research.md`?\n   - Have `research.md` or `explain.md` changed since `implement.md` was generated?\n4. If `implement.md` is current → print `implement.md already up to date — skipping` and STOP\n5. If inputs changed or plan looks stale → print `implement.md exists but is outdated — regenerating` and continue\n6. If not found → continue normally (first run)\n\n## 3. Plan Format Rules\n\nIf `.ai\u002Frules\u002Fplan-format.md` exists (project override), read and follow it. Otherwise read the plugin's `rules\u002Fplan-format.md`.\n\nIf `.github\u002Finstructions\u002F` (or `.ai\u002Finstructions\u002F`) exists, read instruction files relevant to the file types in this spec — these provide detailed code examples and framework patterns for generating concrete implementation steps.\n\n### Design Exploration & Decision Capture\n\nIf this is a complex feature with multiple valid approaches, check if `superpowers:brainstorming` is available and invoke it to explore the design space before planning.\n\n**Fallback (if superpowers not installed):** Before generating the plan, briefly consider:\n- Are there 2-3 valid approaches? Document the chosen one and why.\n- What are the key tradeoffs (performance vs simplicity, reuse vs custom)?\n- Are there unknowns that need spiking first?\n\nIf a brainstorming spec already exists in `docs\u002Fsuperpowers\u002Fspecs\u002F`, read it for design context.\n\n**Decision capture:** Any non-obvious design decision surfaced during exploration MUST be recorded in the `## Key Decisions` section of `implement.md`. This includes:\n- Architecture choices (extend existing component vs create new)\n- Pattern selection (which existing pattern to follow when multiple exist)\n- Scope tradeoffs (what was deliberately excluded and why)\n- Technology choices (when research.md shows multiple viable approaches)\n\nIf the change is trivial (single-file edit, config-only, straightforward bug fix) or every decision is obvious from requirements, omit the Key Decisions section.\n\n### Cross-Ticket Pattern Lookup\n\nCheck if `.ai\u002Fgraph\u002Fnodes\u002Fpatterns\u002F` exists and contains YAML files:\n\n```bash\nfind .ai\u002Fgraph\u002Fnodes\u002Fpatterns\u002F -name \"*.yaml\" -type f 2>\u002Fdev\u002Fnull\n```\n\nIf pattern files exist, read `..\u002F..\u002Fshared\u002Fpattern-schema.md` for the schema, then read each pattern file. Match patterns against the current ticket by:\n\n1. **Tag matching** — compare pattern `tags` against component names, file types, and architectural concepts from `research.md`\n2. **File matching** — compare pattern `files` against files listed in `research.md`'s `## Files Inventory` or `## Key Findings`\n3. **Decision matching** — compare pattern `description` against the current ticket's requirements in `explain.md`\n\n**If relevant patterns found:**\n- Print: \"Found \u003CN> relevant patterns from previous tickets\"\n- Factor them into design decisions — if a pattern covers this ticket's approach, reference it rather than re-deriving the approach\n- Include a `## Relevant Patterns` section in `implement.md` (before `## Steps`):\n\n```markdown\n## Relevant Patterns\n\n| Pattern | Confidence | Tickets | Relevance |\n|---------|-----------|---------|-----------|\n| \u003Ctitle> | \u003Cconfidence> | \u003Ccount> | \u003Cwhy it matches> |\n\n> **\u003Cpattern-id>:** \u003Capproach summary from pattern>. (from \u003Cticket list>)\n```\n\n- When a plan step relates to a known pattern, reference it in the step's `**What:**` section: \"Follow established pattern `\u003Cpattern-id>` — \u003Cbrief approach>.\"\n\n**If no patterns found** (directory empty or doesn't exist): continue without the section. This is normal for new projects or early tickets.\n\n## AEM Component Intelligence Rules\n\nIf `research.md` contains an `## AEM Component Intelligence` section, apply these three rules during step generation:\n\n### Rule 1: Variant Completeness\nWhen a step modifies a component, check AEM Component Intelligence for variants:\n- **Variants in this repo** → include in the SAME step as additional files to modify (same change, different file path)\n- **Variants in other repos** → add a NOTE at the bottom of the step: \"⚠ Variant `\u003Cname>` in `\u003Crepo>` may need the same change. Verify in a separate session.\"\n\nEvery step that touches a component MUST account for all known variants. Missing a variant is a plan defect.\n\n### Rule 2: Field Semantic Awareness\nWhen a step references an AEM dialog field (e.g., for aria-label, display text, image alt), verify the field's semantic meaning from AEM Component Intelligence:\n- Check the field's `Label` and `Sample Authored Values`\n- If the plan's intended use doesn't match the field's actual semantic meaning → flag in the step with the correct field and explanation\n- Example: plan says \"use `heading` for product name\" but AEM shows heading Label=\"Product Price\", Value=\"$29.99\" → step must note: \"Use `text` (Product Name), NOT `heading` (Product Price)\"\n\n### Rule 3: Null Content Guard\nWhen a step renders a dialog field value in the UI (link text, label, display content):\n- Check AEM Component Intelligence for that field's authored values across pages\n- If ANY page shows the field as empty (\"(empty)\" or blank) → add a sub-task to the step: \"Guard: AEM shows `\u003Cfield>` is empty on `\u003Cpage>`. Wrap rendering in conditional to prevent empty elements (empty `\u003Ca>`, `\u003Cspan>`, etc.).\"\n\nThese rules are technology-agnostic — they specify WHAT to guard, not HOW. The project's `.claude\u002Frules\u002F` files provide syntax-specific patterns (HTL conditionals, HBS `{{#if}}`, etc.).\n\n### Cross-Repo Step Markers\n\nIf `research.md` contains a `## Cross-Repo Scope` section with **Scope: Multi-repo**:\n\n1. Read repo names from the Cross-Repo Scope section\n2. Prefix each step title with a repo tag: `[This repo]`, `[{Repo-Name}]`\n3. Group steps by repo: all backend-repo steps first, then this-repo steps\n4. Between repo groups, add a separator note:\n\n> Steps tagged [{Backend-Repo}] must be implemented in that repo. Deploy before starting [This repo] steps.\n\n5. The `**Other repos required:**` line at plan completion lists all non-current repos from the scope section\n\nExample:\n\n### Step 1: Add dialog field [{Backend-Repo}]\n**Files:** `ui.apps\u002F...\u002Fcomponent\u002F_cq_dialog\u002F.content.xml`\n**What:** Add `newField` to dialog\n**Verification:** Field appears in dialog XML\n\n> Steps tagged [{Backend-Repo}] must be implemented in that repo. Deploy before starting [This repo] steps.\n\n### Step 2: Consume new field [This repo]\n**Files:** `ui.frontend\u002Fsrc\u002F...\u002Fcomponent.js`\n**What:** Read `newField` from data model\n**Verification:** Field renders on page\n\nIf research.md has no Cross-Repo Scope section or scope is \"This repo only\", do not add repo tags.\n\n## 4. Generate implement.md\n\nAnalyze all inputs and write `implement.md` in the same spec directory.\n\nInclude the provenance frontmatter block at the top of `implement.md`, before the `# Implementation Plan:` heading. Use `agent: dx-plan`. Set confidence using the propagation rule from the Provenance Check step: the *lowest* input confidence is the ceiling, then apply the standard downgrade rule (no `research.md` → `low`). Default is `medium` when all inputs have `medium` or `high` confidence.\n\nRead `.ai\u002Ftemplates\u002Fspec\u002Fimplement.md.template` and follow that structure exactly. Key rules:\n\n- Every step MUST have `**Status:** pending` (initial state)\n- Steps are ordered by implementation dependency\n- Be specific about property names, types, default values, file paths with line numbers\n- Include code snippets when helpful\n- Key Decisions section: record non-obvious choices with alternatives and rationale. OMIT for trivial changes.\n- Risks section: only REAL technical risks. OMIT if none.\n\n## 5. Write Decision Nodes\n\nIf `implement.md` contains a `## Key Decisions` section (i.e., non-trivial decisions were made), externalize each decision as a structured YAML file.\n\nRead `..\u002F..\u002Fshared\u002Fdecision-schema.md` for the schema definition.\n\n### When to write\n\n- If the Key Decisions section was **omitted** (trivial change) → skip this step entirely\n- If Key Decisions section **exists** → write one YAML file per decision\n\n### How to write\n\n1. Create the directory if needed:\n```bash\nmkdir -p .ai\u002Fgraph\u002Fnodes\u002Fdecisions\n```\n\n2. For each decision in the `## Key Decisions` section, write a YAML file to `.ai\u002Fgraph\u002Fnodes\u002Fdecisions\u002F\u003Cticket>-\u003Cslug>.yaml`:\n   - `\u003Cticket>` is the work item ID (from spec directory name)\n   - `\u003Cslug>` is a kebab-case summary of the decision title (e.g., `extend-layout-dropdown`)\n   - Map the markdown fields to YAML: `**Chosen:**` → `chosen:`, `**Why:**` → `why:`, `**Alternatives considered:**` → `alternatives:`, `**Affects steps:**` → `affects_steps:`\n   - Set `confidence` from the same propagation logic used for `implement.md` provenance\n   - Set `trust_tier: shared`, `status: active`\n   - Populate `tags` from technology names, component types, and architectural concepts mentioned in the decision\n   - Populate `lineage` with references to the input spec files that informed this decision (e.g., `requirement-\u003Cticket>-raw`, `research-\u003Cticket>`)\n   - Populate `files` from files mentioned in the decision or the affected steps\n\n3. If decision YAML files already exist for this ticket (re-planning), overwrite them. Set `status: superseded` on any old decision files that are no longer in the new plan's Key Decisions section.\n\n### Content parity\n\nThe YAML files contain the **same information** as the markdown Key Decisions section — they are the structured counterpart for machine consumption. Do not add or remove decisions between the two formats.\n\n### Write edges\n\nAfter writing decision nodes, write (or update) the per-ticket edge file. Read `..\u002F..\u002Fshared\u002Fedge-schema.md` for the schema.\n\n```bash\nmkdir -p .ai\u002Fgraph\u002Fedges\n```\n\nWrite `.ai\u002Fgraph\u002Fedges\u002F\u003Cticket>.yaml` with edges derived from the planning context:\n\n1. **informed** edges — for each decision node, add edges from `requirement-\u003Cticket>-raw` and `research-\u003Cticket>` to the decision ID (these come from the decision's `lineage` field)\n2. **implemented-as** edges — for each decision node, add edges from the decision ID to `step-\u003Cticket>-\u003CN>` for each step in `affects_steps`\n3. **reuses** edges — if a plan step references a pattern from `## Relevant Patterns`, add an edge from `step-\u003Cticket>-\u003CN>` to the pattern ID\n\nIf the edge file already exists (re-planning), replace all edges where `agent: dx-plan` but preserve edges from other agents (e.g., `dx-step-verify`).\n\n## 6. Status Tracking\n\nEvery step MUST have a `**Status:**` line with one of:\n- `pending` — not yet started (initial state)\n- `in-progress` — currently being worked on\n- `done` — completed and verified\n- `blocked` — cannot proceed, with reason\n\nThe step-* skills update these statuses as they execute.\n\n## 7. Planning Principles\n\n- **Reuse before create** — if research.md's \"Existing Implementation Check\" shows existing code covers a requirement (✅ or ⚡), the step MUST reuse\u002Fextend that code. Never create a new utility, helper, service, or component when an existing one can be extended. If research.md doesn't have this section, search the codebase yourself before planning a \"Create new\" step.\n- **Every step references specific files and line numbers** from research.md\n- **Steps are ordered by dependency** — what must be done first for the next step to work\n- **Pattern references are concrete** — \"follow the pattern in ModelName.java:45\"\n- **Each step has a Test line** — specific test command or compile check\n- **Prototype-first** — if `prototype\u002F` exists, implementation steps adapt it into the project's build system. The step should reference specific prototype files:\n  - \"Adapt HTML structure from `prototype\u002Findex.html` into the HBS template\"\n  - \"Migrate CSS from `prototype\u002Fstyles.css` into component SCSS, replacing flat values with project variables\u002Fmixins\"\n  - \"Compare rendered output against `prototype\u002Ffigma-reference.png`\"\n  - The prototype uses the project's naming conventions, so class names and structure should carry over with minimal changes.\n- **Conventions as reference** — if `figma-conventions.md` exists, implementation steps should cite it for specific variable names, mixin usage, and naming patterns. E.g., \"Use `@include media-breakpoint-up(lg)` for desktop breakpoint (see figma-conventions.md).\"\n- **No time estimates**\n- **Scale to complexity** — simple change = 3-4 steps, complex feature = 10+\n\n## 8. Present Summary (standalone path only)\n\n\u003C!-- standalone-only — emit only when $ORCHESTRATED == 0 -->\n\nAfter all phases complete and only when running standalone, emit:\n\n```markdown\n## implement.md created\n\n**\u003CTitle>** (ADO #\u003Cid>)\n**Directory:** `.ai\u002Fspecs\u002F\u003Cid>-\u003Cslug>\u002F`\n\n### Plan:\n- `implement.md` — \u003Ccount> steps, \u003Ccount> files referenced\n- `plan-thinking.md` — design-rationale summary written\n\n### Key Decisions:\n\u003Cif Key Decisions section exists: list each decision title in one line>\n\u003Cif no Key Decisions: \"(none — straightforward implementation)\">\n\n### Risks:\n\u003Cif Risks section exists: list each risk in one line>\n\u003Cif no Risks: \"(none identified)\">\n\n### Next step:\n- `\u002Fdx-plan-validate` — cross-check plan against requirements\n```\n\nWhen orchestrated (`$ORCHESTRATED == 1`), skip this section entirely and emit only the `## Return` block.\n\n## Examples\n\n### Standard planning flow\n```\n\u002Fdx-plan 2416553\n```\nReads `.ai\u002Fspecs\u002F2416553-add-layout-switcher\u002Fexplain.md` and `research.md`, generates `implement.md` with 6 steps covering model changes, dialog updates, HTL template, JS logic, SCSS, and tests. All steps start as `pending`.\n\n### Re-run after research update\n```\n\u002Fdx-plan 2416553\n```\nDetects that `research.md` has changed since `implement.md` was generated. Prints \"implement.md exists but is outdated — regenerating\" and creates a fresh plan.\n\n### Without research (degraded mode)\n```\n\u002Fdx-plan 2416553\n```\nIf `research.md` doesn't exist, warns \"No research.md found — run `\u002Fdx-req` first for a better plan\" and generates from `explain.md` only. Plan will lack specific file paths and line numbers.\n\n## Troubleshooting\n\n### \"No spec directory found\"\n**Cause:** No `.ai\u002Fspecs\u002F` directory matches the given ID or slug.\n**Fix:** Run `\u002Fdx-req \u003Cid>` first to create the spec directory, or check the ID is correct.\n\n### Plan has vague steps without file paths\n**Cause:** `research.md` is missing or has thin results.\n**Fix:** Run `\u002Fdx-req \u003Cid>` with search hints to get better codebase findings, then re-run `\u002Fdx-plan`.\n\n### Plan creates new utilities instead of reusing existing ones\n**Cause:** `research.md` didn't find existing utilities, or the \"Existing Implementation Check\" section is missing.\n**Fix:** Run `\u002Fdx-req \u003Cid>` again — it may find more with different search terms. Or manually add findings to `research.md` before re-planning.\n\n## Decision Tree: Step Granularity\n\n```\nChange set identified →\n├── All files share one concern (same component) → 1 step (up to ~8 files)\n├── Files split across concerns (FE + BE + test) → split by concern\n├── >8 files in one concern → split by component boundary\n└── Test files →\n    ├── Unit tests for single component → include in component step\n    └── Integration tests spanning components → separate step\n```\n\n## Decision Examples\n\n### Reuse vs Create New\n**Scenario:** Plan step says \"add form validation for phone numbers\"\n**Discovery:** `src\u002Fcore\u002Fscripts\u002Flibs\u002Fforms.js` has `validateField()` with email, text, number patterns\n**Decision:** EXTEND — add phone regex to existing `validateField()`. Don't create new util.\n**Why:** Existing utility covers >70% of need. Only a new regex pattern is needed.\n\n**Key Decision entry:**\n```markdown\n### Form validation approach\n**Chosen:** Extend existing `validateField()` in `forms.js`\n**Why:** Covers >70% of need — only a new regex pattern is required\n**Alternatives considered:**\n- New `phoneValidator.js` utility — rejected because existing utility handles all other field types; a separate file fragments validation logic\n**Affects steps:** 2\n```\n\n### When to Create New\n**Scenario:** Need color-coded severity badge component for QA dashboard\n**Discovery:** Closest match is `HighlightBox` (callout alert) — wrong abstraction (alert vs badge)\n**Decision:** CREATE — no existing component serves this purpose\n**Why:** Repurposing HighlightBox would fight its design. Clean creation is simpler.\n\n### Step Granularity\n**Scenario:** Change touches hero.js (FE), HeroModel.java (BE), hero.html (template), hero-test.js (test)\n**Decision:** 2 steps — Step 1: BE (HeroModel.java), Step 2: FE (hero.js + hero.html + hero-test.js)\n**Why:** BE and FE are independent concerns. FE files change together (same concern).\n\n## Pre-Presentation Validation\n\nBefore presenting the generated plan:\n1. Re-read `explain.md` — list every requirement\n2. For each requirement, verify ≥1 plan step addresses it\n3. For each plan step, verify it traces to a requirement\n4. Flag gaps: \"Requirement #{N} has no corresponding plan step\"\n5. Flag extras: \"Step #{N} does not trace to any requirement\"\n\n## Success Criteria\n\n- [ ] `implement.md` exists in spec directory\n- [ ] Every step has `**Status:** pending`\n- [ ] Every step lists ≥1 file in `**Files:**`\n- [ ] No duplicate step numbers\n- [ ] Steps ordered by dependency (no forward references)\n\n## Anti-Rationalization\n\nCommon excuses for weak planning — and why they're wrong:\n\n| False Logic | Reality Check |\n|---|---|\n| \"I'll figure it out as I code\" | Coding without a plan produces twice the rework. Plan first, code once. |\n| \"The requirements are obvious\" | \"Obvious\" requirements produce the most bugs. Write them down explicitly. |\n| \"We don't need tests in the plan\" | Every step needs a verification command. Untested steps are unverified steps. |\n| \"I'll create a new utility for this\" | Search first. 80% of the time an existing utility covers the need. |\n| \"This is too simple for a plan\" | If it touches >2 files, it needs a plan. \"Simple\" changes cause unexpected ripple effects. |\n| \"I'll plan all the edge cases later\" | Edge cases discovered during coding cause scope creep and rework. Surface them now. |\n\n## Risk-First Slicing\n\nWhen ordering steps, tackle highest-uncertainty pieces first:\n\n- **Unknown APIs or integrations** → spike early, fail fast\n- **Core data model changes** → establish early, everything depends on them\n- **Complex algorithms** → prove feasibility before building UI around them\n- **Simple UI wiring** → leave for last, lowest risk\n\n**Change sizing:** Aim for steps that produce ~100 lines of diff each. Smaller is reviewable; larger hides problems.\n\n## Rules\n\n- **Grounded in research** — every file reference must come from research.md findings\n- **No duplication** — never plan to create something that already exists in the codebase. If research.md identifies existing utilities, helpers, services, or patterns, the plan MUST reuse them. A step that creates a new helper when an existing one covers the need is a plan defect.\n- **Concrete over abstract** — property names, types, default values, paths\n- **Dependency-ordered** — steps in the order they should be implemented\n- **No invented requirements** — only implements what explain.md says\n- **Domain-aware** — use correct terminology for the project's technology stack\n- **Status on every step** — `**Status:** pending` is mandatory\n- **Current repo only** — only plan steps for files that exist in this repo. If research.md has a \"Cross-Repo Scope\" section, add the `**Other repos required:**` header line but do NOT create steps for those repos. The developer runs the workflow in each repo separately.\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: Generated 4-step plan covering 9 requirements; 3 key decisions documented; 2 risks flagged.\nartifacts:\n  - .ai\u002Fspecs\u002F2490722-microsite\u002Fimplement.md\n  - .ai\u002Fspecs\u002F2490722-microsite\u002Fplan-thinking.md\nnext_action: run \u002Fdx-plan-validate\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-plan 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-plan (you are a fork or that subagent), continue below.\n\nYou read the spec documents and use extended thinking to generate `implement.md` — a concrete, step-by-step development plan with status tracking for automated execution.\n\nUse ultrathink for this skill — implementation planning benefits from deep reasoning about dependencies, ordering, and edge cases.\n\n## Output discipline\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\nTwo outputs are always required regardless of path:\n\n1. **`$SPEC_DIR\u002Fimplement.md`** — the canonical plan, format defined in `.ai\u002Ftemplates\u002Fspec\u002Fimplement.md.template`. This is what the executor reads.\n2. **`$SPEC_DIR\u002Fplan-thinking.md`** — a design-rationale summary: the alternative approaches evaluated, dependencies and ordering constraints identified, and risks assessed for this plan. This is a finished analysis artifact, not a transcript of internal deliberation. Write it BEFORE writing `implement.md`. Maximum 1000 words.\n\n## 1. Locate the Spec Directory\n\n```bash\nSPEC_DIR=$(bash .ai\u002Flib\u002Fdx-common.sh find-spec-dir $ARGUMENTS)\n```\n\nIf the script exits with error, ask the user for the work item ID or slug.\n\nRead these files from `$SPEC_DIR` (in order of importance):\n- `research.md` — codebase findings (required for a good plan)\n- `explain.md` — distilled requirements\n- `raw-story.md` — original story for reference (may not exist for non-ADO flows)\n\nIf `research.md` doesn't exist, warn the user: \"No research.md found — run `\u002Fdx-req` first for a better plan. Proceeding with explain.md only.\"\n\n### Provenance Check on Inputs\n\nRead `..\u002F..\u002Fshared\u002Fprovenance-schema.md` for the schema definition.\n\nAfter reading each input file, parse its YAML frontmatter `provenance:` block (if present). Evaluate input quality:\n\n1. **research.md provenance:**\n   - If `confidence: low` → warn: \"⚠ research.md has low confidence (degraded mode or incomplete data). Plan quality may be affected — consider re-running `\u002Fdx-req` with better search hints.\"\n   - If `confidence: medium` or `high` → no warning needed\n   - If no provenance block → informational: \"ℹ research.md has no provenance metadata (pre-migration file). Confidence unknown.\"\n   - If `model: haiku` → note: \"ℹ research.md was produced at Haiku tier. For complex features, consider re-running `\u002Fdx-req` at higher tier.\"\n\n2. **explain.md provenance:**\n   - If `confidence: low` → warn: \"⚠ explain.md has low confidence. Requirements may be incomplete — verify with the original ticket.\"\n   - If no provenance block → skip (informational only, don't block)\n\n**Confidence propagation:** Use the *lowest* confidence from input files as the ceiling for `implement.md` provenance. If research.md is `low`, implement.md cannot be higher than `low` — regardless of planning quality, the plan is only as reliable as its inputs.\n\nAlso check for Figma prototype files (from `\u002Fdx-figma-prototype`):\n- `figma-conventions.md` — discovered project conventions (design tokens, naming, patterns)\n- `prototype\u002Findex.html` — standalone HTML prototype\n- `prototype\u002Fstyles.css` — CSS with project token mappings\n- `figma-extract.md` — raw Figma extraction data\n\nIf prototype files exist, the plan MUST reference them. Implementation steps should adapt the prototype into project-native code rather than building from scratch.\n\n**Component Reuse Map:** If `figma-conventions.md` contains a `### Component Reuse Map` section, the plan MUST respect it:\n- Components marked **Reuse as-is** → plan step says \"Use existing `\u003Ccomponent>` at `\u003Cpath>`\" — NO new file creation\n- Components marked **Extend** → plan step modifies the existing component file, adding the identified variant\n- Components marked **Compose** → plan step assembles from listed existing components — NO new wrapper when composition suffices\n- Components marked **Create new** → plan step creates a new component following the nearest existing pattern\n- **Atomic components (button, image, icon, link, input, badge) should ALWAYS be reused.** A plan step that recreates an existing atomic component is a plan defect.\n\n## Hub Mode Check\n\nRead `..\u002F..\u002Fshared\u002Fhub-dispatch.md` for hub detection logic.\n\nIf hub mode is active (`hub.enabled: true` AND cwd is `.hub\u002F`):\n1. Read `research.md` → `## Cross-Repo Scope` for per-repo scope\n2. If cross-repo scope detected:\n   a. Resolve target repos from config\n   b. For each repo, dispatch planning: `cd \u003Crepo.path> && claude -p \"\u002Fdx-plan \u003Cticket-id>\" --output-format json --allowedTools \"Bash,Read,Edit,Write,Glob,Grep\" --permission-mode bypassPermissions`\n   c. Each repo generates its own `implement.md` locally\n   d. Collect and summarize: \"Plans generated in \u003CN> repos\"\n3. Write state files\n4. STOP — do not continue with local planning\n\nIf hub mode is not active: continue with normal flow below.\n\n## 2. Check Existing Output\n\n1. Check if `implement.md` exists in the spec directory\n2. If it exists, read its content\n3. Check staleness indicators:\n   - Does the title in `implement.md` match the current spec?\n   - Does the step count and files referenced align with current `research.md`?\n   - Have `research.md` or `explain.md` changed since `implement.md` was generated?\n4. If `implement.md` is current → print `implement.md already up to date — skipping` and STOP\n5. If inputs changed or plan looks stale → print `implement.md exists but is outdated — regenerating` and continue\n6. If not found → continue normally (first run)\n\n## 3. Plan Format Rules\n\nIf `.ai\u002Frules\u002Fplan-format.md` exists (project override), read and follow it. Otherwise read the plugin's `rules\u002Fplan-format.md`.\n\nIf `.github\u002Finstructions\u002F` (or `.ai\u002Finstructions\u002F`) exists, read instruction files relevant to the file types in this spec — these provide detailed code examples and framework patterns for generating concrete implementation steps.\n\n### Design Exploration & Decision Capture\n\nIf this is a complex feature with multiple valid approaches, check if `superpowers:brainstorming` is available and invoke it to explore the design space before planning.\n\n**Fallback (if superpowers not installed):** Before generating the plan, briefly consider:\n- Are there 2-3 valid approaches? Document the chosen one and why.\n- What are the key tradeoffs (performance vs simplicity, reuse vs custom)?\n- Are there unknowns that need spiking first?\n\nIf a brainstorming spec already exists in `docs\u002Fsuperpowers\u002Fspecs\u002F`, read it for design context.\n\n**Decision capture:** Any non-obvious design decision surfaced during exploration MUST be recorded in the `## Key Decisions` section of `implement.md`. This includes:\n- Architecture choices (extend existing component vs create new)\n- Pattern selection (which existing pattern to follow when multiple exist)\n- Scope tradeoffs (what was deliberately excluded and why)\n- Technology choices (when research.md shows multiple viable approaches)\n\nIf the change is trivial (single-file edit, config-only, straightforward bug fix) or every decision is obvious from requirements, omit the Key Decisions section.\n\n### Cross-Ticket Pattern Lookup\n\nCheck if `.ai\u002Fgraph\u002Fnodes\u002Fpatterns\u002F` exists and contains YAML files:\n\n```bash\nfind .ai\u002Fgraph\u002Fnodes\u002Fpatterns\u002F -name \"*.yaml\" -type f 2>\u002Fdev\u002Fnull\n```\n\nIf pattern files exist, read `..\u002F..\u002Fshared\u002Fpattern-schema.md` for the schema, then read each pattern file. Match patterns against the current ticket by:\n\n1. **Tag matching** — compare pattern `tags` against component names, file types, and architectural concepts from `research.md`\n2. **File matching** — compare pattern `files` against files listed in `research.md`'s `## Files Inventory` or `## Key Findings`\n3. **Decision matching** — compare pattern `description` against the current ticket's requirements in `explain.md`\n\n**If relevant patterns found:**\n- Print: \"Found \u003CN> relevant patterns from previous tickets\"\n- Factor them into design decisions — if a pattern covers this ticket's approach, reference it rather than re-deriving the approach\n- Include a `## Relevant Patterns` section in `implement.md` (before `## Steps`):\n\n```markdown\n## Relevant Patterns\n\n| Pattern | Confidence | Tickets | Relevance |\n|---------|-----------|---------|-----------|\n| \u003Ctitle> | \u003Cconfidence> | \u003Ccount> | \u003Cwhy it matches> |\n\n> **\u003Cpattern-id>:** \u003Capproach summary from pattern>. (from \u003Cticket list>)\n```\n\n- When a plan step relates to a known pattern, reference it in the step's `**What:**` section: \"Follow established pattern `\u003Cpattern-id>` — \u003Cbrief approach>.\"\n\n**If no patterns found** (directory empty or doesn't exist): continue without the section. This is normal for new projects or early tickets.\n\n## AEM Component Intelligence Rules\n\nIf `research.md` contains an `## AEM Component Intelligence` section, apply these three rules during step generation:\n\n### Rule 1: Variant Completeness\nWhen a step modifies a component, check AEM Component Intelligence for variants:\n- **Variants in this repo** → include in the SAME step as additional files to modify (same change, different file path)\n- **Variants in other repos** → add a NOTE at the bottom of the step: \"⚠ Variant `\u003Cname>` in `\u003Crepo>` may need the same change. Verify in a separate session.\"\n\nEvery step that touches a component MUST account for all known variants. Missing a variant is a plan defect.\n\n### Rule 2: Field Semantic Awareness\nWhen a step references an AEM dialog field (e.g., for aria-label, display text, image alt), verify the field's semantic meaning from AEM Component Intelligence:\n- Check the field's `Label` and `Sample Authored Values`\n- If the plan's intended use doesn't match the field's actual semantic meaning → flag in the step with the correct field and explanation\n- Example: plan says \"use `heading` for product name\" but AEM shows heading Label=\"Product Price\", Value=\"$29.99\" → step must note: \"Use `text` (Product Name), NOT `heading` (Product Price)\"\n\n### Rule 3: Null Content Guard\nWhen a step renders a dialog field value in the UI (link text, label, display content):\n- Check AEM Component Intelligence for that field's authored values across pages\n- If ANY page shows the field as empty (\"(empty)\" or blank) → add a sub-task to the step: \"Guard: AEM shows `\u003Cfield>` is empty on `\u003Cpage>`. Wrap rendering in conditional to prevent empty elements (empty `\u003Ca>`, `\u003Cspan>`, etc.).\"\n\nThese rules are technology-agnostic — they specify WHAT to guard, not HOW. The project's `.claude\u002Frules\u002F` files provide syntax-specific patterns (HTL conditionals, HBS `{{#if}}`, etc.).\n\n### Cross-Repo Step Markers\n\nIf `research.md` contains a `## Cross-Repo Scope` section with **Scope: Multi-repo**:\n\n1. Read repo names from the Cross-Repo Scope section\n2. Prefix each step title with a repo tag: `[This repo]`, `[{Repo-Name}]`\n3. Group steps by repo: all backend-repo steps first, then this-repo steps\n4. Between repo groups, add a separator note:\n\n> Steps tagged [{Backend-Repo}] must be implemented in that repo. Deploy before starting [This repo] steps.\n\n5. The `**Other repos required:**` line at plan completion lists all non-current repos from the scope section\n\nExample:\n\n### Step 1: Add dialog field [{Backend-Repo}]\n**Files:** `ui.apps\u002F...\u002Fcomponent\u002F_cq_dialog\u002F.content.xml`\n**What:** Add `newField` to dialog\n**Verification:** Field appears in dialog XML\n\n> Steps tagged [{Backend-Repo}] must be implemented in that repo. Deploy before starting [This repo] steps.\n\n### Step 2: Consume new field [This repo]\n**Files:** `ui.frontend\u002Fsrc\u002F...\u002Fcomponent.js`\n**What:** Read `newField` from data model\n**Verification:** Field renders on page\n\nIf research.md has no Cross-Repo Scope section or scope is \"This repo only\", do not add repo tags.\n\n## 4. Generate implement.md\n\nAnalyze all inputs and write `implement.md` in the same spec directory.\n\nInclude the provenance frontmatter block at the top of `implement.md`, before the `# Implementation Plan:` heading. Use `agent: dx-plan`. Set confidence using the propagation rule from the Provenance Check step: the *lowest* input confidence is the ceiling, then apply the standard downgrade rule (no `research.md` → `low`). Default is `medium` when all inputs have `medium` or `high` confidence.\n\nRead `.ai\u002Ftemplates\u002Fspec\u002Fimplement.md.template` and follow that structure exactly. Key rules:\n\n- Every step MUST have `**Status:** pending` (initial state)\n- Steps are ordered by implementation dependency\n- Be specific about property names, types, default values, file paths with line numbers\n- Include code snippets when helpful\n- Key Decisions section: record non-obvious choices with alternatives and rationale. OMIT for trivial changes.\n- Risks section: only REAL technical risks. OMIT if none.\n\n## 5. Write Decision Nodes\n\nIf `implement.md` contains a `## Key Decisions` section (i.e., non-trivial decisions were made), externalize each decision as a structured YAML file.\n\nRead `..\u002F..\u002Fshared\u002Fdecision-schema.md` for the schema definition.\n\n### When to write\n\n- If the Key Decisions section was **omitted** (trivial change) → skip this step entirely\n- If Key Decisions section **exists** → write one YAML file per decision\n\n### How to write\n\n1. Create the directory if needed:\n```bash\nmkdir -p .ai\u002Fgraph\u002Fnodes\u002Fdecisions\n```\n\n2. For each decision in the `## Key Decisions` section, write a YAML file to `.ai\u002Fgraph\u002Fnodes\u002Fdecisions\u002F\u003Cticket>-\u003Cslug>.yaml`:\n   - `\u003Cticket>` is the work item ID (from spec directory name)\n   - `\u003Cslug>` is a kebab-case summary of the decision title (e.g., `extend-layout-dropdown`)\n   - Map the markdown fields to YAML: `**Chosen:**` → `chosen:`, `**Why:**` → `why:`, `**Alternatives considered:**` → `alternatives:`, `**Affects steps:**` → `affects_steps:`\n   - Set `confidence` from the same propagation logic used for `implement.md` provenance\n   - Set `trust_tier: shared`, `status: active`\n   - Populate `tags` from technology names, component types, and architectural concepts mentioned in the decision\n   - Populate `lineage` with references to the input spec files that informed this decision (e.g., `requirement-\u003Cticket>-raw`, `research-\u003Cticket>`)\n   - Populate `files` from files mentioned in the decision or the affected steps\n\n3. If decision YAML files already exist for this ticket (re-planning), overwrite them. Set `status: superseded` on any old decision files that are no longer in the new plan's Key Decisions section.\n\n### Content parity\n\nThe YAML files contain the **same information** as the markdown Key Decisions section — they are the structured counterpart for machine consumption. Do not add or remove decisions between the two formats.\n\n### Write edges\n\nAfter writing decision nodes, write (or update) the per-ticket edge file. Read `..\u002F..\u002Fshared\u002Fedge-schema.md` for the schema.\n\n```bash\nmkdir -p .ai\u002Fgraph\u002Fedges\n```\n\nWrite `.ai\u002Fgraph\u002Fedges\u002F\u003Cticket>.yaml` with edges derived from the planning context:\n\n1. **informed** edges — for each decision node, add edges from `requirement-\u003Cticket>-raw` and `research-\u003Cticket>` to the decision ID (these come from the decision's `lineage` field)\n2. **implemented-as** edges — for each decision node, add edges from the decision ID to `step-\u003Cticket>-\u003CN>` for each step in `affects_steps`\n3. **reuses** edges — if a plan step references a pattern from `## Relevant Patterns`, add an edge from `step-\u003Cticket>-\u003CN>` to the pattern ID\n\nIf the edge file already exists (re-planning), replace all edges where `agent: dx-plan` but preserve edges from other agents (e.g., `dx-step-verify`).\n\n## 6. Status Tracking\n\nEvery step MUST have a `**Status:**` line with one of:\n- `pending` — not yet started (initial state)\n- `in-progress` — currently being worked on\n- `done` — completed and verified\n- `blocked` — cannot proceed, with reason\n\nThe step-* skills update these statuses as they execute.\n\n## 7. Planning Principles\n\n- **Reuse before create** — if research.md's \"Existing Implementation Check\" shows existing code covers a requirement (✅ or ⚡), the step MUST reuse\u002Fextend that code. Never create a new utility, helper, service, or component when an existing one can be extended. If research.md doesn't have this section, search the codebase yourself before planning a \"Create new\" step.\n- **Every step references specific files and line numbers** from research.md\n- **Steps are ordered by dependency** — what must be done first for the next step to work\n- **Pattern references are concrete** — \"follow the pattern in ModelName.java:45\"\n- **Each step has a Test line** — specific test command or compile check\n- **Prototype-first** — if `prototype\u002F` exists, implementation steps adapt it into the project's build system. The step should reference specific prototype files:\n  - \"Adapt HTML structure from `prototype\u002Findex.html` into the HBS template\"\n  - \"Migrate CSS from `prototype\u002Fstyles.css` into component SCSS, replacing flat values with project variables\u002Fmixins\"\n  - \"Compare rendered output against `prototype\u002Ffigma-reference.png`\"\n  - The prototype uses the project's naming conventions, so class names and structure should carry over with minimal changes.\n- **Conventions as reference** — if `figma-conventions.md` exists, implementation steps should cite it for specific variable names, mixin usage, and naming patterns. E.g., \"Use `@include media-breakpoint-up(lg)` for desktop breakpoint (see figma-conventions.md).\"\n- **No time estimates**\n- **Scale to complexity** — simple change = 3-4 steps, complex feature = 10+\n\n## 8. Present Summary (standalone path only)\n\n\u003C!-- standalone-only — emit only when $ORCHESTRATED == 0 -->\n\nAfter all phases complete and only when running standalone, emit:\n\n```markdown\n## implement.md created\n\n**\u003CTitle>** (ADO #\u003Cid>)\n**Directory:** `.ai\u002Fspecs\u002F\u003Cid>-\u003Cslug>\u002F`\n\n### Plan:\n- `implement.md` — \u003Ccount> steps, \u003Ccount> files referenced\n- `plan-thinking.md` — design-rationale summary written\n\n### Key Decisions:\n\u003Cif Key Decisions section exists: list each decision title in one line>\n\u003Cif no Key Decisions: \"(none — straightforward implementation)\">\n\n### Risks:\n\u003Cif Risks section exists: list each risk in one line>\n\u003Cif no Risks: \"(none identified)\">\n\n### Next step:\n- `\u002Fdx-plan-validate` — cross-check plan against requirements\n```\n\nWhen orchestrated (`$ORCHESTRATED == 1`), skip this section entirely and emit only the `## Return` block.\n\n## Examples\n\n### Standard planning flow\n```\n\u002Fdx-plan 2416553\n```\nReads `.ai\u002Fspecs\u002F2416553-add-layout-switcher\u002Fexplain.md` and `research.md`, generates `implement.md` with 6 steps covering model changes, dialog updates, HTL template, JS logic, SCSS, and tests. All steps start as `pending`.\n\n### Re-run after research update\n```\n\u002Fdx-plan 2416553\n```\nDetects that `research.md` has changed since `implement.md` was generated. Prints \"implement.md exists but is outdated — regenerating\" and creates a fresh plan.\n\n### Without research (degraded mode)\n```\n\u002Fdx-plan 2416553\n```\nIf `research.md` doesn't exist, warns \"No research.md found — run `\u002Fdx-req` first for a better plan\" and generates from `explain.md` only. Plan will lack specific file paths and line numbers.\n\n## Troubleshooting\n\n### \"No spec directory found\"\n**Cause:** No `.ai\u002Fspecs\u002F` directory matches the given ID or slug.\n**Fix:** Run `\u002Fdx-req \u003Cid>` first to create the spec directory, or check the ID is correct.\n\n### Plan has vague steps without file paths\n**Cause:** `research.md` is missing or has thin results.\n**Fix:** Run `\u002Fdx-req \u003Cid>` with search hints to get better codebase findings, then re-run `\u002Fdx-plan`.\n\n### Plan creates new utilities instead of reusing existing ones\n**Cause:** `research.md` didn't find existing utilities, or the \"Existing Implementation Check\" section is missing.\n**Fix:** Run `\u002Fdx-req \u003Cid>` again — it may find more with different search terms. Or manually add findings to `research.md` before re-planning.\n\n## Decision Tree: Step Granularity\n\n```\nChange set identified →\n├── All files share one concern (same component) → 1 step (up to ~8 files)\n├── Files split across concerns (FE + BE + test) → split by concern\n├── >8 files in one concern → split by component boundary\n└── Test files →\n    ├── Unit tests for single component → include in component step\n    └── Integration tests spanning components → separate step\n```\n\n## Decision Examples\n\n### Reuse vs Create New\n**Scenario:** Plan step says \"add form validation for phone numbers\"\n**Discovery:** `src\u002Fcore\u002Fscripts\u002Flibs\u002Fforms.js` has `validateField()` with email, text, number patterns\n**Decision:** EXTEND — add phone regex to existing `validateField()`. Don't create new util.\n**Why:** Existing utility covers >70% of need. Only a new regex pattern is needed.\n\n**Key Decision entry:**\n```markdown\n### Form validation approach\n**Chosen:** Extend existing `validateField()` in `forms.js`\n**Why:** Covers >70% of need — only a new regex pattern is required\n**Alternatives considered:**\n- New `phoneValidator.js` utility — rejected because existing utility handles all other field types; a separate file fragments validation logic\n**Affects steps:** 2\n```\n\n### When to Create New\n**Scenario:** Need color-coded severity badge component for QA dashboard\n**Discovery:** Closest match is `HighlightBox` (callout alert) — wrong abstraction (alert vs badge)\n**Decision:** CREATE — no existing component serves this purpose\n**Why:** Repurposing HighlightBox would fight its design. Clean creation is simpler.\n\n### Step Granularity\n**Scenario:** Change touches hero.js (FE), HeroModel.java (BE), hero.html (template), hero-test.js (test)\n**Decision:** 2 steps — Step 1: BE (HeroModel.java), Step 2: FE (hero.js + hero.html + hero-test.js)\n**Why:** BE and FE are independent concerns. FE files change together (same concern).\n\n## Pre-Presentation Validation\n\nBefore presenting the generated plan:\n1. Re-read `explain.md` — list every requirement\n2. For each requirement, verify ≥1 plan step addresses it\n3. For each plan step, verify it traces to a requirement\n4. Flag gaps: \"Requirement #{N} has no corresponding plan step\"\n5. Flag extras: \"Step #{N} does not trace to any requirement\"\n\n## Success Criteria\n\n- [ ] `implement.md` exists in spec directory\n- [ ] Every step has `**Status:** pending`\n- [ ] Every step lists ≥1 file in `**Files:**`\n- [ ] No duplicate step numbers\n- [ ] Steps ordered by dependency (no forward references)\n\n## Anti-Rationalization\n\nCommon excuses for weak planning — and why they're wrong:\n\n| False Logic | Reality Check |\n|---|---|\n| \"I'll figure it out as I code\" | Coding without a plan produces twice the rework. Plan first, code once. |\n| \"The requirements are obvious\" | \"Obvious\" requirements produce the most bugs. Write them down explicitly. |\n| \"We don't need tests in the plan\" | Every step needs a verification command. Untested steps are unverified steps. |\n| \"I'll create a new utility for this\" | Search first. 80% of the time an existing utility covers the need. |\n| \"This is too simple for a plan\" | If it touches >2 files, it needs a plan. \"Simple\" changes cause unexpected ripple effects. |\n| \"I'll plan all the edge cases later\" | Edge cases discovered during coding cause scope creep and rework. Surface them now. |\n\n## Risk-First Slicing\n\nWhen ordering steps, tackle highest-uncertainty pieces first:\n\n- **Unknown APIs or integrations** → spike early, fail fast\n- **Core data model changes** → establish early, everything depends on them\n- **Complex algorithms** → prove feasibility before building UI around them\n- **Simple UI wiring** → leave for last, lowest risk\n\n**Change sizing:** Aim for steps that produce ~100 lines of diff each. Smaller is reviewable; larger hides problems.\n\n## Rules\n\n- **Grounded in research** — every file reference must come from research.md findings\n- **No duplication** — never plan to create something that already exists in the codebase. If research.md identifies existing utilities, helpers, services, or patterns, the plan MUST reuse them. A step that creates a new helper when an existing one covers the need is a plan defect.\n- **Concrete over abstract** — property names, types, default values, paths\n- **Dependency-ordered** — steps in the order they should be implemented\n- **No invented requirements** — only implements what explain.md says\n- **Domain-aware** — use correct terminology for the project's technology stack\n- **Status on every step** — `**Status:** pending` is mandatory\n- **Current repo only** — only plan steps for files that exist in this repo. If research.md has a \"Cross-Repo Scope\" section, add the `**Other repos required:**` header line but do NOT create steps for those repos. The developer runs the workflow in each repo separately.\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: Generated 4-step plan covering 9 requirements; 3 key decisions documented; 2 risks flagged.\nartifacts:\n  - .ai\u002Fspecs\u002F2490722-microsite\u002Fimplement.md\n  - .ai\u002Fspecs\u002F2490722-microsite\u002Fplan-thinking.md\nnext_action: run \u002Fdx-plan-validate\n```\n",{"name":5,"model":30,"effort":22,"context":44,"description":7,"allowed-tools":45,"argument-hint":47},"fork",[34,32,37,33,46],"agent","[Work Item ID or slug (optional — uses most recent if omitted)]","main","5c642842a92100dc7561ae0682a152a74846e186","plugins\u002Fdx-core\u002Fskills\u002Fdx-plan",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-plan",{"tool":63,"command":64},"bunx","bunx skills add easingthemes\u002Fdx-aem-flow --skill dx-plan",{"tool":66,"command":67},"pnpm","pnpm dlx skills add easingthemes\u002Fdx-aem-flow --skill dx-plan","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Feasingthemes\u002Fdx-aem-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fdx-core\u002Fskills\u002Fdx-plan\u002FSKILL.md",true,[],[72,92,113,131,147,162],{"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",[],[20,79,80,31,81,82,83,84,85,86,29,87,88,24,89,34,33,90,91],"dx hub status","hub","hub status","which","show","for","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,20,101,80,102,103,104,105,106,107,108,109,110,88,111,112,34,33,32],"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":119,"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",[],[20,120,89,80,121,84,122,123,124,85,125,126,29,127,88,128,129,130,24,36],"dx hub dispatch","ado","repo","work on","session","open","MCP","URL","vscode","code","across",{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"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",[],[20,138,80,139,83,140,122,141,142,143,144,29,109,88,145,34,146,33,32,90],"dx hub config","config","view","manage","trigger","true","adjust","terminal","settings",{"skillNo":148,"name":149,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":151,"categories":152,"keywords":153,"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",[],[154,20,155,90,82,122,130,156,24,157,36,158,80,159,160,161],"discover","dx discover repos","router","directive","simple","block","sonnet","table",{"skillNo":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":168,"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",[],[169,20,170,171,172,37,173,174,175,176,34,33,32,177,178,179,180,29,181,182],"upgrade","dx upgrade","project","actions","fix","files","auto","run","list","doctor","manual","missing","plugin","plugins"]