[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71KCHY4FKXA026GYQ2J7ZEB":3,"skill-same:01M71KCHY4FKXA026GYQ2J7ZEB":62},{"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":31,"linkOnly":32,"markdownContent":33,"markdownBody":34,"frontMatter":35,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":42,"repositoryHtmlUrl":43,"repositoryHomepageUrl":44,"ownerHtmlUrl":45,"ownerBlogUrl":46,"ownerDescription":47,"updatedAt":48,"install":49,"resources":61},"01M71KCHY4FKXA026GYQ2J7ZEB","design",null,"Use when a spec has requirements.md and needs technical design.","mugsun\u002Fcurdx-flow","mugsun","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F100790155?v=4","01M6KJSAN2W4WRPDFBKTJTDDQ2","Mugsun","01M71K65VJXA4C1KPJAHZ6ZVHC",4,"MIT","https:\u002F\u002Fgithub.com\u002Fmugsun\u002Fcurdx-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fcurdx-flow\u002Fskills\u002Fdesign\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28,29,30],"when","Bash","read","write","edit","technical design","true","technical","use","requirements","name","spec","2026-11-10 10:12:30",false,"---\nname: design\ndescription: Use when a spec has requirements.md and needs technical design.\nargument-hint: \"[spec-name]\"\nallowed-tools: \"Read Write Edit Bash Agent AskUserQuestion\"\ndisable-model-invocation: true\n---\n\n\n# Design Phase\n\nGenerate technical design for the active spec. Running this command implicitly approves requirements. You are a **coordinator, not an architect** -- delegate ALL work to the `architect-reviewer` subagent.\n\n## Coordinator Checklist\n\nComplete these coordination steps in order; do not create user-facing implementation tasks from this checklist:\n\n1. **Gather context** -- resolve spec, read requirements and research\n2. **Interview** -- brainstorming dialogue (skip if `--quick`)\n3. **Execute design** -- dispatch architect-reviewer via direct Agent; Agent Teams optional\n4. **Artifact review** -- parallel two-stage review (`spec-reviewer` + `code-quality-reviewer`); QuickMode bypass per D5\n5. **Walkthrough & approval** -- display summary, get user approval\n6. **Finalize** -- update state, commit, stop\n\n## Step 1: Gather Context\n\n1. Run `curdx-flow snapshot --spec \"$ARGUMENTS\"` when `$ARGUMENTS` begins with a spec name; otherwise run `curdx-flow snapshot`.\n2. If `snapshot.active` is false, error: \"No active spec. Run \u002Fcurdx-flow:new \u003Cname> first.\"\n3. Use `snapshot.spec.fsPath` as `$SPEC_PATH`.\n4. If `snapshot.artifacts.requirements.exists` is false, error: \"Requirements not found. Run \u002Fcurdx-flow:requirements first.\"\n5. Clear approval flag:\n   ```bash\n   curdx-flow state merge \"$SPEC_PATH\u002F.curdx-state.json\" '{\"awaitingApproval\":false}'\n   ```\n6. Read context: `requirements.md` (required), `research.md` (if exists), `.progress.md`, `snapshot.topology`.\n7. Read `references\u002Fworkflow-contract.md`, `references\u002Fagent-output-contract.md`, and `references\u002Fcontext-and-dispatch-policy.md`.\n\n## Step 2: Interview (skip if --quick)\n\nCheck if `--quick` appears in `$ARGUMENTS`. If present, skip to Step 3.\n\n### Read Context from .progress.md\n\nParse Intent Classification and all prior interview responses to skip already-answered questions.\n\n**Intent-Based Question Counts:**\n- TRIVIAL: 1-2 | REFACTOR: 3-5 | GREENFIELD: 5-10 | MID_SIZED: 3-7\n\n### Brainstorming Dialogue\n\nApply adaptive dialogue from `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Finterview-framework\u002FSKILL.md`. Ask context-driven questions one at a time.\n\n**Design Exploration Territory** (hints, not a script):\n- **Architecture fit** -- extend existing architecture, create isolated module, or require refactor?\n- **Technology constraints** -- any required or forbidden libraries, frameworks, or patterns?\n- **Integration tightness** -- how tightly should this integrate with existing systems?\n- **Failure modes** -- what failure scenarios matter? Graceful degradation, retry logic, alerting?\n- **Deployment model** -- feature flags, gradual rollout, migrations, or big-bang?\n\n### Design Approach Proposals\n\nAfter dialogue, propose 2-3 architectural approaches. Examples (illustrative only):\n- **(A)** Extend existing service\u002Fmodule layer -- minimal new abstractions\n- **(B)** New isolated component -- clean boundaries, own data layer\n- **(C)** Hybrid -- new module with shared infrastructure and data layer\n\n### Store Interview & Approach\n\nAppend to `.progress.md` under \"Interview Responses\":\n```markdown\n### Design Interview (from design.md)\n- [Topic 1]: [response]\n- Chosen approach: [name] -- [brief description]\n```\n\nPass combined context to delegation prompt as \"Interview Context\".\n\n## Step 3: Execute Design (Agent-Based, Teams Optional)\n\n\u003Cmandatory>\n**Default path: use the normal `Agent` tool with `architect-reviewer`. Do not require Agent Teams.**\n\nAgent Teams are experimental and disabled by default in Claude Code. Use the team lifecycle only when `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` is set and the `TeamCreate` \u002F `TaskCreate` \u002F `TaskList` \u002F `SendMessage` tools are visible in the current session. If any team tool is unavailable or fails, immediately continue with the direct `Agent(agent_type: architect-reviewer)` path. Treat this as the normal path, not a degraded path.\n\nDirect path:\n\n1. Optionally create a visible native task with `TaskCreate(subject: \"Generate technical design for $spec\", activeForm: \"Generating design\")`. If unavailable or failing, continue without it.\n2. Dispatch `Agent(agent_type: architect-reviewer)` with requirements, research, and interview context. Instruct it to design architecture with mermaid diagrams, component responsibilities, technical decisions with rationale, file structure, error handling, test strategy. Output to `.\u002Fspecs\u002F$spec\u002Fdesign.md`.\n3. Wait for the Agent result, then read `.\u002Fspecs\u002F$spec\u002Fdesign.md`.\n\nOptional Agent Teams path:\n\n1. `TeamDelete()` once to release any stale team; errors are harmless.\n2. `TeamCreate(team_name: \"design-$spec\")`\n3. `TaskCreate(subject: \"Generate technical design for $spec\", activeForm: \"Generating design\")`\n4. `Agent(agent_type: architect-reviewer, team_name: \"design-$spec\", name: \"architect-1\")` with the same prompt as the direct path.\n5. Wait via automatic teammate messages or a single `TaskList` check.\n6. `SendMessage(type: \"shutdown_request\", recipient: \"architect-1\")`\n7. Read `.\u002Fspecs\u002F$spec\u002Fdesign.md`, then `TeamDelete()`.\n\u003C\u002Fmandatory>\n\n## Step 4: Artifact Review (Parallel Two-Stage)\n\n\u003Cmandatory>\n**Review loop must complete before walkthrough. Max 3 iterations.**\n\nThis step runs the **two-stage review protocol** at the design phase boundary: `spec-reviewer` (specCompliance) and `code-quality-reviewer` (codeQuality) are dispatched **in parallel**, in ONE message, against the frozen `design.md` artifact. Both reviewers must complete before reconciliation.\n\n**Required reading before dispatch** (read once at top of step, do not skip):\n- [`bounded-parallel-dispatch.md`](${CLAUDE_PLUGIN_ROOT}\u002Freferences\u002Fbounded-parallel-dispatch.md) — independence criteria + the Review-domain \"ALL Agent calls in ONE message\" rule (anti-pattern #3 + #5–#8). Both reviewers must be spawned in the SAME message.\n- [`two-stage-review.md`](${CLAUDE_PLUGIN_ROOT}\u002Freferences\u002Ftwo-stage-review.md) — domain boundary table (specCompliance vs codeQuality), 3-layer drift defense, anti-rationalization rule, SLSA-shape verdict glossary, QuickMode behavior contract.\n\nThe two reviewers do **not** see each other's output (Layer 2 isolation). The coordinator never arbitrates findings across domains.\n\n### 4.1 Bounded parallel dispatch (direct Agent default)\n\n```\n1. Optional TaskCreate(subject: \"Spec-compliance review of design.md\",\n                       activeForm: \"Reviewing design (spec-compliance)\")\n   Optional TaskCreate(subject: \"Code-quality review of design.md\",\n                       activeForm: \"Reviewing design (code-quality)\")\n2. # ALL Agent calls in ONE message — see bounded-parallel-dispatch.md anti-pattern #3\n   Agent(agent_type: spec-reviewer,\n        prompt: \"Review .\u002Fspecs\u002F$spec\u002Fdesign.md for spec-compliance ONLY.\n                 Upstream: requirements.md + research.md.\n                 Your domain: traceability, phase artifact structure, requirement\n                 coverage, artifact format. Do NOT comment on code-quality concerns\n                 (smell \u002F security \u002F readability \u002F test-shape) — those belong to the\n                 peer code-quality-reviewer (which you do NOT see and MUST NOT\n                 reference). Emit a markdown findings table and a final line\n                 `REVIEW_PASS` or `REVIEW_FAIL` (byte-equal).\")\n   Agent(agent_type: code-quality-reviewer,\n        prompt: \"Review .\u002Fspecs\u002F$spec\u002Fdesign.md for code-quality ONLY.\n                 Your domain: code smell \u002F security \u002F implementation quality \u002F\n                 readability \u002F test quality \u002F no-hallucinations. Do NOT comment\n                 on traceability to requirements \u002F phase artifact structure \u002F\n                 requirement coverage \u002F artifact format \u002F front-matter — those\n                 belong to spec-reviewer (which you do NOT see and MUST NOT\n                 reference). Emit a markdown findings table and a final line\n                 `REVIEW_PASS` or `REVIEW_FAIL` (byte-equal).\")\n3. # Wait for both Agent results; collect REVIEW_PASS\u002FREVIEW_FAIL final lines.\n4. # Persist verdicts under verificationBlocks.design.reviews via merge-state (FR-T3 — never hand-edit state):\n   curdx-flow state merge \\\n     \"$SPEC_PATH\u002F.curdx-state.json\" \\\n     '{\"verificationBlocks\":{\"design\":{\"reviews\":{\n        \"specCompliance\":{\"verdict\":\"\u003CPASS|FAIL>\",\"findings\":[...],\"reviewerId\":\"spec-compliance\",\"timestamp\":\"\u003CISO8601>\"},\n        \"codeQuality\":{\"verdict\":\"\u003CPASS|FAIL>\",\"findings\":[...],\"reviewerId\":\"code-quality\",\"timestamp\":\"\u003CISO8601>\"}\n     }}}}'\n```\n\nOptional Agent Teams overlay: if Agent Teams are enabled and available, create `TeamCreate(team_name: \"review-design-$spec\")`, add matching `team_name` and `name` fields to both Agent calls, wait via automatic teammate messages or one `TaskList` check, then `SendMessage(...shutdown_request...)` and `TeamDelete()`. If any team step fails, rerun or continue with the direct dual `Agent(...)` calls above.\n\n### 4.2 QuickMode branch (D5)\n\nRead `state.quickMode` from `.curdx-state.json`. **specCompliance is always a hard gate**; QuickMode only relaxes codeQuality.\n\n```\nif state.quickMode === true:\n  if specCompliance.verdict === \"FAIL\":\n    # Hard gate even in QuickMode — FR-M2 reverse contract.\n    block; show findings; do NOT advance to Step 5.\n  if codeQuality.verdict === \"FAIL\":\n    # Advisory downgrade — set advisory:true via merge-state, surface findings,\n    # continue. Never set advisory on specCompliance.\n    merge-state into verificationBlocks.design.reviews.codeQuality.advisory = true\n    log warning to .progress.md; proceed to Step 5.\nelse:                                  # normal mode\n  if specCompliance.verdict === \"FAIL\" OR codeQuality.verdict === \"FAIL\":\n    # Either FAIL blocks. Display findings table, ask user (Step 5 \"Run review\" \u002F \"Request changes\" loop).\n    Iteration \u003C 3: re-invoke architect-reviewer with merged feedback, loop back to 4.1.\n    Iteration >= 3: graceful degradation, log warning, proceed (permissive ceiling matches prior behavior).\n  else:\n    proceed to Step 5.\n```\n\n**Anti-rationalization**: the coordinator MUST NOT pass spec-reviewer's findings into the code-quality-reviewer prompt (or vice versa). Both verdicts are stored verbatim under `verificationBlocks.design.reviews`. See [`two-stage-review.md`](${CLAUDE_PLUGIN_ROOT}\u002Freferences\u002Ftwo-stage-review.md) §2.\n\n**Revision delegation**: Re-invoke architect-reviewer with the merged feedback (both reviewers' findings concatenated, attributed by `reviewerId`) and requirements.md upstream context. Focus on the union of issues.\n\n**Error handling**: Reviewer no signal = treat as REVIEW_PASS for that slot (permissive ceiling). Agent failure = retry once, then use the surviving reviewer's verdict alone (still hard-gate on specCompliance if it survived).\n\n**Fallback**: Direct dual `Agent(...)` calls in ONE message are the default. Team failures are non-blocking unless both reviewers fail to return a verdict.\n\u003C\u002Fmandatory>\n\n## Step 5: Walkthrough & Approval\n\n\u003Cmandatory>\n**WALKTHROUGH IS REQUIRED - DO NOT SKIP.**\n\nRead `.\u002Fspecs\u002F$spec\u002Fdesign.md` and display:\n\n```\nDesign complete for '$spec'.\nOutput: $PWD\u002Fspecs\u002F$spec\u002Fdesign.md\n\n## What I Designed\n\n**Approach**: [1-2 sentences from Overview]\n\n**Components**:\n- [Component A]: [brief purpose]\n- [Component B]: [brief purpose]\n\n**Key Decisions**:\n- [Decision 1]: [choice made]\n- [Decision 2]: [choice made]\n\n**Files**: [X] to create, [Y] to modify\n```\n\u003C\u002Fmandatory>\n\n### User Approval (skip if --quick)\n\nIf `--quick`, skip to Step 6.\n\nAsk ONE question: \"How do you want to proceed?\" with these options via AskUserQuestion:\n1. **Approve** (Recommended) -- Accept artifact as-is, advance to next phase\n2. **Run review** -- Spawn spec-reviewer to validate against rubrics, show findings, then loop back to this choice\n3. **Request changes** -- Provide specific feedback to revise the artifact\n\n**If \"Approve\"**: proceed to Step 6.\n**If \"Run review\"**: Invoke spec-reviewer via Agent tool with full design.md content (upstream: research.md + requirements.md). Display findings table. If REVIEW_PASS, note it. If REVIEW_FAIL, show feedback. Then loop back to this same 3-choice question (user decides next action).\n**If \"Request changes\" or \"Other\"**:\n1. Ask what to change\n2. Re-invoke architect-reviewer with direct `Agent(agent_type: architect-reviewer)` and feedback; use the optional team lifecycle only if Agent Teams are enabled and available\n3. Re-display walkthrough, ask again with same 3 choices. Loop until approved.\n\n## Step 6: Finalize\n\n### Update State\n\n1. **Merge** into `.curdx-state.json` (preserve all existing fields):\n   ```bash\n   curdx-flow state merge \\\n     \"$SPEC_PATH\u002F.curdx-state.json\" '{\"phase\":\"design\",\"awaitingApproval\":true}'\n   ```\n2. Update `.progress.md`: mark requirements as implicitly approved, set current phase\n\n### Commit Spec (if enabled)\n\nRead `commitSpec` from `.curdx-state.json`. If true:\n```bash\ngit add .\u002Fspecs\u002F$spec\u002Fdesign.md\ngit commit -m \"spec($spec): add technical design\"\ngit push -u origin $(git branch --show-current)\n```\nIf commit or push fails, display warning but continue.\n\n### Stop\n\n\u003Cmandatory>\n**STOP HERE. DO NOT PROCEED TO TASKS.**\n\n(Does not apply in `--quick` mode.)\n\n1. Display: `-> Next: Run \u002Fcurdx-flow:tasks`\n2. End your response immediately\n3. Wait for user to explicitly run `\u002Fcurdx-flow:tasks`\n\u003C\u002Fmandatory>\n","# Design Phase\n\nGenerate technical design for the active spec. Running this command implicitly approves requirements. You are a **coordinator, not an architect** -- delegate ALL work to the `architect-reviewer` subagent.\n\n## Coordinator Checklist\n\nComplete these coordination steps in order; do not create user-facing implementation tasks from this checklist:\n\n1. **Gather context** -- resolve spec, read requirements and research\n2. **Interview** -- brainstorming dialogue (skip if `--quick`)\n3. **Execute design** -- dispatch architect-reviewer via direct Agent; Agent Teams optional\n4. **Artifact review** -- parallel two-stage review (`spec-reviewer` + `code-quality-reviewer`); QuickMode bypass per D5\n5. **Walkthrough & approval** -- display summary, get user approval\n6. **Finalize** -- update state, commit, stop\n\n## Step 1: Gather Context\n\n1. Run `curdx-flow snapshot --spec \"$ARGUMENTS\"` when `$ARGUMENTS` begins with a spec name; otherwise run `curdx-flow snapshot`.\n2. If `snapshot.active` is false, error: \"No active spec. Run \u002Fcurdx-flow:new \u003Cname> first.\"\n3. Use `snapshot.spec.fsPath` as `$SPEC_PATH`.\n4. If `snapshot.artifacts.requirements.exists` is false, error: \"Requirements not found. Run \u002Fcurdx-flow:requirements first.\"\n5. Clear approval flag:\n   ```bash\n   curdx-flow state merge \"$SPEC_PATH\u002F.curdx-state.json\" '{\"awaitingApproval\":false}'\n   ```\n6. Read context: `requirements.md` (required), `research.md` (if exists), `.progress.md`, `snapshot.topology`.\n7. Read `references\u002Fworkflow-contract.md`, `references\u002Fagent-output-contract.md`, and `references\u002Fcontext-and-dispatch-policy.md`.\n\n## Step 2: Interview (skip if --quick)\n\nCheck if `--quick` appears in `$ARGUMENTS`. If present, skip to Step 3.\n\n### Read Context from .progress.md\n\nParse Intent Classification and all prior interview responses to skip already-answered questions.\n\n**Intent-Based Question Counts:**\n- TRIVIAL: 1-2 | REFACTOR: 3-5 | GREENFIELD: 5-10 | MID_SIZED: 3-7\n\n### Brainstorming Dialogue\n\nApply adaptive dialogue from `${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Finterview-framework\u002FSKILL.md`. Ask context-driven questions one at a time.\n\n**Design Exploration Territory** (hints, not a script):\n- **Architecture fit** -- extend existing architecture, create isolated module, or require refactor?\n- **Technology constraints** -- any required or forbidden libraries, frameworks, or patterns?\n- **Integration tightness** -- how tightly should this integrate with existing systems?\n- **Failure modes** -- what failure scenarios matter? Graceful degradation, retry logic, alerting?\n- **Deployment model** -- feature flags, gradual rollout, migrations, or big-bang?\n\n### Design Approach Proposals\n\nAfter dialogue, propose 2-3 architectural approaches. Examples (illustrative only):\n- **(A)** Extend existing service\u002Fmodule layer -- minimal new abstractions\n- **(B)** New isolated component -- clean boundaries, own data layer\n- **(C)** Hybrid -- new module with shared infrastructure and data layer\n\n### Store Interview & Approach\n\nAppend to `.progress.md` under \"Interview Responses\":\n```markdown\n### Design Interview (from design.md)\n- [Topic 1]: [response]\n- Chosen approach: [name] -- [brief description]\n```\n\nPass combined context to delegation prompt as \"Interview Context\".\n\n## Step 3: Execute Design (Agent-Based, Teams Optional)\n\n\u003Cmandatory>\n**Default path: use the normal `Agent` tool with `architect-reviewer`. Do not require Agent Teams.**\n\nAgent Teams are experimental and disabled by default in Claude Code. Use the team lifecycle only when `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` is set and the `TeamCreate` \u002F `TaskCreate` \u002F `TaskList` \u002F `SendMessage` tools are visible in the current session. If any team tool is unavailable or fails, immediately continue with the direct `Agent(agent_type: architect-reviewer)` path. Treat this as the normal path, not a degraded path.\n\nDirect path:\n\n1. Optionally create a visible native task with `TaskCreate(subject: \"Generate technical design for $spec\", activeForm: \"Generating design\")`. If unavailable or failing, continue without it.\n2. Dispatch `Agent(agent_type: architect-reviewer)` with requirements, research, and interview context. Instruct it to design architecture with mermaid diagrams, component responsibilities, technical decisions with rationale, file structure, error handling, test strategy. Output to `.\u002Fspecs\u002F$spec\u002Fdesign.md`.\n3. Wait for the Agent result, then read `.\u002Fspecs\u002F$spec\u002Fdesign.md`.\n\nOptional Agent Teams path:\n\n1. `TeamDelete()` once to release any stale team; errors are harmless.\n2. `TeamCreate(team_name: \"design-$spec\")`\n3. `TaskCreate(subject: \"Generate technical design for $spec\", activeForm: \"Generating design\")`\n4. `Agent(agent_type: architect-reviewer, team_name: \"design-$spec\", name: \"architect-1\")` with the same prompt as the direct path.\n5. Wait via automatic teammate messages or a single `TaskList` check.\n6. `SendMessage(type: \"shutdown_request\", recipient: \"architect-1\")`\n7. Read `.\u002Fspecs\u002F$spec\u002Fdesign.md`, then `TeamDelete()`.\n\u003C\u002Fmandatory>\n\n## Step 4: Artifact Review (Parallel Two-Stage)\n\n\u003Cmandatory>\n**Review loop must complete before walkthrough. Max 3 iterations.**\n\nThis step runs the **two-stage review protocol** at the design phase boundary: `spec-reviewer` (specCompliance) and `code-quality-reviewer` (codeQuality) are dispatched **in parallel**, in ONE message, against the frozen `design.md` artifact. Both reviewers must complete before reconciliation.\n\n**Required reading before dispatch** (read once at top of step, do not skip):\n- [`bounded-parallel-dispatch.md`](${CLAUDE_PLUGIN_ROOT}\u002Freferences\u002Fbounded-parallel-dispatch.md) — independence criteria + the Review-domain \"ALL Agent calls in ONE message\" rule (anti-pattern #3 + #5–#8). Both reviewers must be spawned in the SAME message.\n- [`two-stage-review.md`](${CLAUDE_PLUGIN_ROOT}\u002Freferences\u002Ftwo-stage-review.md) — domain boundary table (specCompliance vs codeQuality), 3-layer drift defense, anti-rationalization rule, SLSA-shape verdict glossary, QuickMode behavior contract.\n\nThe two reviewers do **not** see each other's output (Layer 2 isolation). The coordinator never arbitrates findings across domains.\n\n### 4.1 Bounded parallel dispatch (direct Agent default)\n\n```\n1. Optional TaskCreate(subject: \"Spec-compliance review of design.md\",\n                       activeForm: \"Reviewing design (spec-compliance)\")\n   Optional TaskCreate(subject: \"Code-quality review of design.md\",\n                       activeForm: \"Reviewing design (code-quality)\")\n2. # ALL Agent calls in ONE message — see bounded-parallel-dispatch.md anti-pattern #3\n   Agent(agent_type: spec-reviewer,\n        prompt: \"Review .\u002Fspecs\u002F$spec\u002Fdesign.md for spec-compliance ONLY.\n                 Upstream: requirements.md + research.md.\n                 Your domain: traceability, phase artifact structure, requirement\n                 coverage, artifact format. Do NOT comment on code-quality concerns\n                 (smell \u002F security \u002F readability \u002F test-shape) — those belong to the\n                 peer code-quality-reviewer (which you do NOT see and MUST NOT\n                 reference). Emit a markdown findings table and a final line\n                 `REVIEW_PASS` or `REVIEW_FAIL` (byte-equal).\")\n   Agent(agent_type: code-quality-reviewer,\n        prompt: \"Review .\u002Fspecs\u002F$spec\u002Fdesign.md for code-quality ONLY.\n                 Your domain: code smell \u002F security \u002F implementation quality \u002F\n                 readability \u002F test quality \u002F no-hallucinations. Do NOT comment\n                 on traceability to requirements \u002F phase artifact structure \u002F\n                 requirement coverage \u002F artifact format \u002F front-matter — those\n                 belong to spec-reviewer (which you do NOT see and MUST NOT\n                 reference). Emit a markdown findings table and a final line\n                 `REVIEW_PASS` or `REVIEW_FAIL` (byte-equal).\")\n3. # Wait for both Agent results; collect REVIEW_PASS\u002FREVIEW_FAIL final lines.\n4. # Persist verdicts under verificationBlocks.design.reviews via merge-state (FR-T3 — never hand-edit state):\n   curdx-flow state merge \\\n     \"$SPEC_PATH\u002F.curdx-state.json\" \\\n     '{\"verificationBlocks\":{\"design\":{\"reviews\":{\n        \"specCompliance\":{\"verdict\":\"\u003CPASS|FAIL>\",\"findings\":[...],\"reviewerId\":\"spec-compliance\",\"timestamp\":\"\u003CISO8601>\"},\n        \"codeQuality\":{\"verdict\":\"\u003CPASS|FAIL>\",\"findings\":[...],\"reviewerId\":\"code-quality\",\"timestamp\":\"\u003CISO8601>\"}\n     }}}}'\n```\n\nOptional Agent Teams overlay: if Agent Teams are enabled and available, create `TeamCreate(team_name: \"review-design-$spec\")`, add matching `team_name` and `name` fields to both Agent calls, wait via automatic teammate messages or one `TaskList` check, then `SendMessage(...shutdown_request...)` and `TeamDelete()`. If any team step fails, rerun or continue with the direct dual `Agent(...)` calls above.\n\n### 4.2 QuickMode branch (D5)\n\nRead `state.quickMode` from `.curdx-state.json`. **specCompliance is always a hard gate**; QuickMode only relaxes codeQuality.\n\n```\nif state.quickMode === true:\n  if specCompliance.verdict === \"FAIL\":\n    # Hard gate even in QuickMode — FR-M2 reverse contract.\n    block; show findings; do NOT advance to Step 5.\n  if codeQuality.verdict === \"FAIL\":\n    # Advisory downgrade — set advisory:true via merge-state, surface findings,\n    # continue. Never set advisory on specCompliance.\n    merge-state into verificationBlocks.design.reviews.codeQuality.advisory = true\n    log warning to .progress.md; proceed to Step 5.\nelse:                                  # normal mode\n  if specCompliance.verdict === \"FAIL\" OR codeQuality.verdict === \"FAIL\":\n    # Either FAIL blocks. Display findings table, ask user (Step 5 \"Run review\" \u002F \"Request changes\" loop).\n    Iteration \u003C 3: re-invoke architect-reviewer with merged feedback, loop back to 4.1.\n    Iteration >= 3: graceful degradation, log warning, proceed (permissive ceiling matches prior behavior).\n  else:\n    proceed to Step 5.\n```\n\n**Anti-rationalization**: the coordinator MUST NOT pass spec-reviewer's findings into the code-quality-reviewer prompt (or vice versa). Both verdicts are stored verbatim under `verificationBlocks.design.reviews`. See [`two-stage-review.md`](${CLAUDE_PLUGIN_ROOT}\u002Freferences\u002Ftwo-stage-review.md) §2.\n\n**Revision delegation**: Re-invoke architect-reviewer with the merged feedback (both reviewers' findings concatenated, attributed by `reviewerId`) and requirements.md upstream context. Focus on the union of issues.\n\n**Error handling**: Reviewer no signal = treat as REVIEW_PASS for that slot (permissive ceiling). Agent failure = retry once, then use the surviving reviewer's verdict alone (still hard-gate on specCompliance if it survived).\n\n**Fallback**: Direct dual `Agent(...)` calls in ONE message are the default. Team failures are non-blocking unless both reviewers fail to return a verdict.\n\u003C\u002Fmandatory>\n\n## Step 5: Walkthrough & Approval\n\n\u003Cmandatory>\n**WALKTHROUGH IS REQUIRED - DO NOT SKIP.**\n\nRead `.\u002Fspecs\u002F$spec\u002Fdesign.md` and display:\n\n```\nDesign complete for '$spec'.\nOutput: $PWD\u002Fspecs\u002F$spec\u002Fdesign.md\n\n## What I Designed\n\n**Approach**: [1-2 sentences from Overview]\n\n**Components**:\n- [Component A]: [brief purpose]\n- [Component B]: [brief purpose]\n\n**Key Decisions**:\n- [Decision 1]: [choice made]\n- [Decision 2]: [choice made]\n\n**Files**: [X] to create, [Y] to modify\n```\n\u003C\u002Fmandatory>\n\n### User Approval (skip if --quick)\n\nIf `--quick`, skip to Step 6.\n\nAsk ONE question: \"How do you want to proceed?\" with these options via AskUserQuestion:\n1. **Approve** (Recommended) -- Accept artifact as-is, advance to next phase\n2. **Run review** -- Spawn spec-reviewer to validate against rubrics, show findings, then loop back to this choice\n3. **Request changes** -- Provide specific feedback to revise the artifact\n\n**If \"Approve\"**: proceed to Step 6.\n**If \"Run review\"**: Invoke spec-reviewer via Agent tool with full design.md content (upstream: research.md + requirements.md). Display findings table. If REVIEW_PASS, note it. If REVIEW_FAIL, show feedback. Then loop back to this same 3-choice question (user decides next action).\n**If \"Request changes\" or \"Other\"**:\n1. Ask what to change\n2. Re-invoke architect-reviewer with direct `Agent(agent_type: architect-reviewer)` and feedback; use the optional team lifecycle only if Agent Teams are enabled and available\n3. Re-display walkthrough, ask again with same 3 choices. Loop until approved.\n\n## Step 6: Finalize\n\n### Update State\n\n1. **Merge** into `.curdx-state.json` (preserve all existing fields):\n   ```bash\n   curdx-flow state merge \\\n     \"$SPEC_PATH\u002F.curdx-state.json\" '{\"phase\":\"design\",\"awaitingApproval\":true}'\n   ```\n2. Update `.progress.md`: mark requirements as implicitly approved, set current phase\n\n### Commit Spec (if enabled)\n\nRead `commitSpec` from `.curdx-state.json`. If true:\n```bash\ngit add .\u002Fspecs\u002F$spec\u002Fdesign.md\ngit commit -m \"spec($spec): add technical design\"\ngit push -u origin $(git branch --show-current)\n```\nIf commit or push fails, display warning but continue.\n\n### Stop\n\n\u003Cmandatory>\n**STOP HERE. DO NOT PROCEED TO TASKS.**\n\n(Does not apply in `--quick` mode.)\n\n1. Display: `-> Next: Run \u002Fcurdx-flow:tasks`\n2. End your response immediately\n3. Wait for user to explicitly run `\u002Fcurdx-flow:tasks`\n\u003C\u002Fmandatory>\n",{"name":5,"description":7,"allowed-tools":36,"argument-hint":37,"disable-model-invocation":38},"Read Write Edit Bash Agent AskUserQuestion","[spec-name]",true,"main","7357746802ae7a84cafa93b9dbffd138817b0290","plugins\u002Fcurdx-flow\u002Fskills\u002Fdesign",0,"https:\u002F\u002Fgithub.com\u002Fmugsun\u002Fcurdx-flow","https:\u002F\u002Fcurdx.org","https:\u002F\u002Fgithub.com\u002Fmugsun","📮 bydongxin@gmail.com","🧑‍💻 AI Builder & Software Engineer\r\n🚀 Turning ideas into software.          \r\n\r\n","2026-08-19 15:19:29",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":38},[51,54,57],{"tool":52,"command":53},"npx","npx skills add mugsun\u002Fcurdx-flow --skill design",{"tool":55,"command":56},"bunx","bunx skills add mugsun\u002Fcurdx-flow --skill design",{"tool":58,"command":59},"pnpm","pnpm dlx skills add mugsun\u002Fcurdx-flow --skill design","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmugsun\u002Fcurdx-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fcurdx-flow\u002Fskills\u002Fdesign\u002FSKILL.md",[],[63,71,89,100,110,120],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":31},"01M71KDR5EJP6G4VWFCHNJ35PT","help","Fixture help skill","https:\u002F\u002Fgithub.com\u002Fmugsun\u002Fcurdx-flow\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fruntime-readiness\u002Fclaude-code-plugin-like\u002Fskills\u002Fhelp\u002FSKILL.md",[],[65,70],"fixture",{"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":31},"01M71KDNAVB000W3MZB1W7CMD8","verification-before-completion","Use when checking fixes, phase exits, completion evidence, or mock-heavy tests before claiming success.","https:\u002F\u002Fgithub.com\u002Fmugsun\u002Fcurdx-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fcurdx-flow\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[78,79,80,81,19,82,83,84,85,86,27,87,88],"verification","verification before completion","only","false","tasks","phase","evidence","fixes","tests","mock","state",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":31},"01M71KDKFE975GFYRDC21H1NEE","triage","Use when a large feature should be decomposed into dependency-aware specs.","https:\u002F\u002Fgithub.com\u002Fmugsun\u002Fcurdx-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fcurdx-flow\u002Fskills\u002Ftriage\u002FSKILL.md",[],[91,96,25,97,22,21,98,29,20,19,27,99],"goal","feature","dependency","EPIC",{"skillNo":101,"name":82,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":31},"01M71KDH7XFQJPKYZ0H9JDNSA5","Use when a spec has design.md and needs implementation tasks.","https:\u002F\u002Fgithub.com\u002Fmugsun\u002Fcurdx-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fcurdx-flow\u002Fskills\u002Ftasks\u002FSKILL.md",[],[82,106,30,29,107,27,108,5,109,19,20,21,22,23,25],"implementation","task","standard","auto",{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":31},"01M71KDEV9G51MCXDQWPJH7QST","switch","Use when changing the active spec by name or path.","https:\u002F\u002Fgithub.com\u002Fmugsun\u002Fcurdx-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fcurdx-flow\u002Fskills\u002Fswitch\u002FSKILL.md",[],[112,20,117,25,27,19,118,29,21,30,22,119],"by name","active","path",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":31},"01M71KDDJFRV09YZ08B3WJ39SC","status","Use when inspecting curdx-flow specs, active state, progress, or index status.","https:\u002F\u002Fgithub.com\u002Fmugsun\u002Fcurdx-flow\u002Fblob\u002Fmain\u002Fplugins\u002Fcurdx-flow\u002Fskills\u002Fstatus\u002FSKILL.md",[],[122,25,27,19,20,88,127,118,128,21,129,130],"progress","update","flow","index"]