[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C2SV9VG4S6VM4CBQQ0FWGF":3,"skill-same:01M6C2SV9VG4S6VM4CBQQ0FWGF":81},{"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":23,"publishedAt":45,"linkOnly":46,"markdownContent":47,"markdownBody":48,"frontMatter":49,"refName":58,"commitSha":59,"skillDirectory":60,"forksCount":61,"repositoryHtmlUrl":62,"repositoryHomepageUrl":63,"ownerHtmlUrl":64,"ownerBlogUrl":65,"ownerDescription":66,"updatedAt":67,"install":68,"resources":80},"01M6C2SV9VG4S6VM4CBQQ0FWGF","generate-realization",null,"Generate behavioral specifications (Layer 3) from use cases and architecture documents using multi-agent orchestration","jmagly\u002Faiwg","jmagly","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1159087?v=4","01M6C10AK8N2WCSQN11FYGTJWN","Joseph Magly","01M6C10AQ8A2RMED1Y1BSVY7NF",229,"MIT","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fcodex-sdlc\u002Fskills\u002Fgenerate-realization\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],"generate","generate realization","sdlc","standard","layer","true","nnn","sonnet","task","agent orchestration","behavioral","use","orchestration","interactive","write","read","coding","multi-agent","text","documents","architecture","2026-11-10 10:12:30",false,"---\nnamespace: aiwg\nname: generate-realization\nplatforms: [all]\ndescription: Generate behavioral specifications (Layer 3) from use cases and architecture documents using multi-agent orchestration\ncommandHint:\n  argumentHint: \u003CUC-NNN> [--all] [--guidance \"text\"] [--interactive]\n  allowedTools: Task, Read, Write, Glob, TodoWrite\n  model: sonnet\n  category: sdlc-orchestration\n  orchestration: true\n  modelRole: coding\n  modelTier: standard\n---\n\n# Generate Use Case Realization\n\n**You are the Core Orchestrator** for use case realization generation — producing the behavioral specification layer (Layer 3) that bridges use cases (Layer 2) to implementation.\n\n## Your Role\n\n**You orchestrate multi-agent workflows. You do NOT execute bash scripts.**\n\nWhen the user requests this flow (via natural language or explicit command):\n\n1. **Interpret the request** and confirm understanding\n2. **Read this template** as your orchestration guide\n3. **Identify target use case(s)** — single or batch\n4. **Delegate agents with the current provider-native orchestration mechanism** in the correct sequence\n5. **Synthesize results** and finalize artifacts\n6. **Update traceability** and report completion\n\n## Natural Language Triggers\n\nUsers may say:\n- \"Generate realization for UC-001\"\n- \"Create behavioral spec for UC-042\"\n- \"Realize UC-007\"\n- \"Generate all use case realizations\"\n- \"Create the Layer 3 specs\"\n- \"Realize all use cases\"\n- \"Build the behavioral specifications\"\n- \"Generate realizations for all architecturally significant use cases\"\n- \"Create sequence diagrams for UC-NNN\"\n- \"Add DES-UCR for UC-NNN\"\n\nYou recognize these as requests for this orchestration flow.\n\n## Parameters\n\n### UC-NNN (positional, required unless --all)\n\nThe use case ID to generate a realization for: `UC-001`\n\nThe orchestrator reads the use case document from `.aiwg\u002Frequirements\u002FUC-NNN.md` (or any `.aiwg\u002Frequirements\u002FUC-NNN*.md` match).\n\n### --all (optional)\n\nBatch generate realizations for all use cases found in `.aiwg\u002Frequirements\u002FUC-*.md` that do not already have a corresponding realization in `.aiwg\u002Frequirements\u002Frealizations\u002F`.\n\nWhen `--all` is set:\n- Glob all `UC-*.md` files in `.aiwg\u002Frequirements\u002F`\n- Skip any UC that already has a `DES-UCR-NNN.md` in `.aiwg\u002Frequirements\u002Frealizations\u002F`\n- Process remaining use cases sequentially to control context budget\n- Report a completion table at the end\n\n### --guidance (optional)\n\n**Purpose**: User provides upfront direction to tailor the realization approach.\n\n**Examples**:\n```\n--guidance \"Focus on security flows — this system handles PII\"\n--guidance \"Emphasize async patterns, we use event-driven architecture\"\n--guidance \"Be thorough on error paths — this is a payment flow\"\n--guidance \"Include state machine specs for all stateful entities\"\n```\n\n**How to Apply**:\n- Pass guidance verbatim to all agent prompts as additional context\n- Guidance influences: depth of error path coverage, security emphasis, diagram density\n- Guidance does not override completeness criteria\n\n### --interactive (optional)\n\n**Purpose**: Ask clarifying questions before generating to tailor output.\n\n**Questions to Ask** (if --interactive):\n\n```\nI'll ask a few questions to tailor the realization:\n\nQ1: What is the primary architectural concern for this use case?\n    (e.g., security, performance, reliability, data consistency)\n\nQ2: Are there known integration points or external systems involved?\n    (Help me include the right participants in sequence diagrams)\n\nQ3: Should I generate supplementary specs if I find stateful entities\n    or complex branching? (State machine specs, decision tables)\n\nQ4: Are there existing ADRs that constrain this realization?\n    (e.g., \"we use event sourcing\", \"REST only, no gRPC\")\n\nQ5: Who will review this realization?\n    (Helps me calibrate depth and formality)\n```\n\n## Multi-Agent Orchestration Workflow\n\n### Pattern\n\n```\nArchitecture Designer (primary author)\n    ↓ draft DES-UCR-NNN.md\nParallel Reviewers (single message, all at once):\n    ├── Security Architect     → auth\u002Fauthz gap analysis\n    ├── Test Architect         → testability + test scenario extraction\n    └── Domain Expert          → business logic accuracy\n    ↓ all reviews complete\nDocumentation Synthesizer\n    ↓ merges feedback → final DES-UCR-NNN.md\nArchive → .aiwg\u002Frequirements\u002Frealizations\u002F\n```\n\n**Critical**: Launch all three parallel reviewers in a **single message** with multiple Task calls.\n\n---\n\n### Step 1: Initialize\n\n**Your Actions**:\n\n1. **Parse parameters** — determine UC-NNN or --all batch mode\n2. **Read the target use case(s)**:\n   ```\n   Glob: .aiwg\u002Frequirements\u002FUC-NNN*.md\n   Read: matched file(s)\n   ```\n3. **Read architecture inputs**:\n   ```\n   Read: .aiwg\u002Farchitecture\u002Fsoftware-architecture-doc.md\n   Glob: .aiwg\u002Farchitecture\u002Fadr\u002F*.md\n   Read: matched ADR files\n   ```\n4. **Check for existing realizations** (skip if present):\n   ```\n   Glob: .aiwg\u002Frequirements\u002Frealizations\u002FDES-UCR-NNN.md\n   ```\n5. **Ensure output directory exists**: `.aiwg\u002Frequirements\u002Frealizations\u002F`\n\n**Communicate Progress**:\n```\n✓ Use case loaded: UC-NNN — {title}\n✓ Architecture document loaded\n✓ ADRs loaded: {count} decisions\n⏳ Starting realization generation...\n```\n\n---\n\n### Step 2: Primary Author — Architecture Designer\n\n**Purpose**: Create the initial use case realization draft with sequence diagrams and component mapping.\n\n```\nTask(\n    subagent_type=\"architecture-designer\",\n    description=\"Create use case realization draft for UC-NNN\",\n    prompt=\"\"\"\n    Read the use case realization template:\n    $AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fanalysis-design\u002Fuse-case-realization-template.md\n\n    Read the target use case:\n    .aiwg\u002Frequirements\u002F{UC-NNN}.md\n\n    Read the architecture document:\n    .aiwg\u002Farchitecture\u002Fsoftware-architecture-doc.md\n\n    Read all ADRs from: .aiwg\u002Farchitecture\u002Fadr\u002F\n\n    Using the template and source documents, generate a complete use case realization:\n\n    REQUIRED SECTIONS:\n    - Metadata block (ID: DES-UCR-NNN, status: draft, dates, related IDs)\n    - Traceability (parent UC, SAD section, ADRs referenced)\n    - Use Case Summary (actor, scope, level, trigger, pre\u002Fpostconditions)\n    - Participating Components table (every actor and component with interface)\n    - Main Success Scenario — MermaidJS sequenceDiagram\n    - Alternate Flows (≥2 alternates if present in UC)\n    - Exception Flows (all exception paths from the UC)\n    - Component Responsibilities section\n    - Completeness checklist (all items evaluated)\n\n    DIAGRAM REQUIREMENTS:\n    - Use MermaidJS sequenceDiagram syntax\n    - Maximum 15 participants per diagram; split into sub-diagrams if needed\n    - Every UC step must map to at least one message in the sequence diagram\n    - Show activation boxes for long-running operations\n    - Include return messages for synchronous calls\n\n    SUPPLEMENTARY SPECS — generate these if applicable:\n    - State machine spec (DES-SM-NNN.md) if the UC involves stateful entities\n      (entities with lifecycle states like: order, session, workflow, subscription)\n    - Decision table (DES-DT-NNN.md) if the UC has ≥3 branching conditions\n    - Method interface contracts (DES-MIC-NNN.md) for each key method identified\n      in the sequence diagrams (one contract per method, minimum 3 for complex UCs)\n\n    ADDITIONAL GUIDANCE (if provided):\n    {guidance}\n\n    Save the primary draft to:\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-draft.md\n\n    If supplementary specs are generated, save to:\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-SM-NNN-draft.md (if applicable)\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-DT-NNN-draft.md (if applicable)\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-MIC-NNN-draft.md (if applicable)\n\n    At the end of your output, list:\n    - SUPPLEMENTARY_SPECS: [SM | DT | MIC | none]\n    - STATEFUL_ENTITIES: [entity names or none]\n    - BRANCH_CONDITIONS: [count or 0]\n    - KEY_METHODS: [method names or none]\n    \"\"\"\n)\n```\n\n**After primary author completes**:\n```\n✓ DES-UCR-NNN draft complete\n⏳ Launching parallel review (3 agents)...\n```\n\n---\n\n### Step 3: Parallel Review (single message — all three at once)\n\n**Launch all three reviewers in one message:**\n\n```\n# Reviewer 1: Security Architect\nTask(\n    subagent_type=\"security-architect\",\n    description=\"Security review of DES-UCR-NNN realization draft\",\n    prompt=\"\"\"\n    Read the use case realization draft:\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-draft.md\n\n    Read the original use case:\n    .aiwg\u002Frequirements\u002F{UC-NNN}.md\n\n    Perform a security-focused review of the behavioral specification:\n\n    CHECK FOR:\n    - Authentication: Is the actor's identity verified before sensitive operations?\n    - Authorization: Are permission checks shown at each access-controlled step?\n    - Data exposure: Are sensitive fields (PII, credentials, keys) protected in transit?\n    - Input validation: Are untrusted inputs validated before processing?\n    - Error message safety: Do exception flows avoid leaking internal details?\n    - Session management: Are session tokens created\u002Finvalidated correctly?\n    - Audit logging: Are security-relevant events logged in the sequence?\n    - OWASP Top 10 relevance: Flag any Top 10 patterns present in this UC\n\n    OUTPUT FORMAT:\n    ## Security Review: DES-UCR-NNN\n\n    ### Status: APPROVED | CONDITIONAL | BLOCKED\n\n    ### Gaps Found\n    (List each gap with: location in diagram, risk level [HIGH\u002FMED\u002FLOW], remediation)\n\n    ### Approved Flows\n    (List flows that pass security review)\n\n    ### Required Changes\n    (Numbered list of mandatory changes before approval)\n\n    ### Recommendations\n    (Optional improvements)\n\n    Save to: .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-review-security.md\n    \"\"\"\n)\n\n# Reviewer 2: Test Architect\nTask(\n    subagent_type=\"test-architect\",\n    description=\"Testability review of DES-UCR-NNN realization draft\",\n    prompt=\"\"\"\n    Read the use case realization draft:\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-draft.md\n\n    Read the original use case:\n    .aiwg\u002Frequirements\u002F{UC-NNN}.md\n\n    Perform a testability and test scenario review:\n\n    CHECK FOR:\n    - Testability: Is every sequence step observable and verifiable in tests?\n    - Test boundaries: Are integration seams clearly defined (mocking points)?\n    - Happy path coverage: Can the main success scenario be driven end-to-end?\n    - Negative path coverage: Are exception flows independently triggerable?\n    - State assertions: Are pre\u002Fpostconditions verifiable with assertions?\n    - Test data requirements: What fixtures or stubs are needed?\n    - Performance test hooks: Are SLO-relevant operations identifiable?\n\n    EXTRACT TEST SCENARIOS:\n    For each flow in the realization, write a one-line test scenario:\n    - \"GIVEN {precondition} WHEN {trigger} THEN {expected outcome}\"\n    Minimum: 1 scenario per flow (main + alternates + exceptions)\n\n    OUTPUT FORMAT:\n    ## Test Architect Review: DES-UCR-NNN\n\n    ### Status: APPROVED | CONDITIONAL | BLOCKED\n\n    ### Testability Issues\n    (List each issue with location and required fix)\n\n    ### Test Scenarios Extracted\n    (Numbered GIVEN\u002FWHEN\u002FTHEN list — these become test case seeds)\n\n    ### Required Changes\n    (Mandatory changes before implementation)\n\n    ### Test Data Requirements\n    (Fixtures, stubs, or external dependencies needed for testing)\n\n    Save to: .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-review-test.md\n    \"\"\"\n)\n\n# Reviewer 3: Domain Expert\nTask(\n    subagent_type=\"domain-expert\",\n    description=\"Business logic accuracy review of DES-UCR-NNN realization draft\",\n    prompt=\"\"\"\n    Read the use case realization draft:\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-draft.md\n\n    Read the original use case:\n    .aiwg\u002Frequirements\u002F{UC-NNN}.md\n\n    Read the architecture document:\n    .aiwg\u002Farchitecture\u002Fsoftware-architecture-doc.md\n\n    Perform a business logic and domain accuracy review:\n\n    CHECK FOR:\n    - Step fidelity: Does every UC step appear in the sequence diagrams?\n    - Business rule coverage: Are all business rules from the UC enforced in the flow?\n    - Domain language: Are entity names, actor names, and terms consistent with the UC?\n    - Alternate flow completeness: Do alternate flows match the UC alternate paths?\n    - Exception handling: Do exception flows match UC exception paths?\n    - Traceability accuracy: Are UC step references in the realization correct?\n    - Postcondition satisfaction: Does the main flow produce the stated postcondition?\n\n    OUTPUT FORMAT:\n    ## Domain Expert Review: DES-UCR-NNN\n\n    ### Status: APPROVED | CONDITIONAL | BLOCKED\n\n    ### Fidelity Gaps\n    (Steps in the UC not represented in the realization)\n\n    ### Business Rule Violations\n    (Rules present in the UC but missing or wrong in the realization)\n\n    ### Required Changes\n    (Mandatory corrections)\n\n    ### Minor Issues\n    (Non-blocking inconsistencies to address)\n\n    Save to: .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-review-domain.md\n    \"\"\"\n)\n```\n\n**After all three reviews complete**:\n```\n  ✓ Security Architect: {APPROVED | CONDITIONAL | BLOCKED}\n  ✓ Test Architect: {APPROVED | CONDITIONAL | BLOCKED}\n  ✓ Domain Expert: {APPROVED | CONDITIONAL | BLOCKED}\n⏳ Synthesizing final realization...\n```\n\n---\n\n### Step 4: Documentation Synthesizer\n\n**Purpose**: Merge all reviewer feedback into the final behavioral specification.\n\n```\nTask(\n    subagent_type=\"documentation-synthesizer\",\n    description=\"Synthesize DES-UCR-NNN final realization from reviews\",\n    prompt=\"\"\"\n    Read the primary draft:\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-draft.md\n\n    Read all three review files:\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-review-security.md\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-review-test.md\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-review-domain.md\n\n    Synthesize the final use case realization:\n\n    MERGE PROTOCOL:\n    1. Apply all REQUIRED CHANGES from every review (mandatory — do not skip)\n    2. Apply APPROVED items without modification\n    3. For CONDITIONAL status: resolve each condition by incorporating the fix\n    4. For BLOCKED status: flag the blocking issue clearly in the document header\n    5. Incorporate test scenarios from the Test Architect into a \"Test Scenarios\"\n       section at the end of the document\n    6. Update the metadata: status → \"approved\" (or \"blocked\" if any reviewer blocked)\n    7. Update the Reviewers field in the metadata block with all three reviewer roles\n    8. Update the completeness checklist — all items should now be checked\n\n    FINAL DOCUMENT STRUCTURE:\n    (Follow the use-case-realization template exactly)\n    - Metadata (status updated, reviewers listed)\n    - Traceability\n    - Use Case Summary\n    - Participating Components\n    - Main Success Scenario (sequence diagram — updated per reviews)\n    - Alternate Flows (updated per domain review)\n    - Exception Flows (updated per security and domain reviews)\n    - Component Responsibilities\n    - Test Scenarios (from test architect review)\n    - Completeness Checklist (all items evaluated and checked)\n\n    Save the final document to:\n    .aiwg\u002Frequirements\u002Frealizations\u002FDES-UCR-NNN.md\n\n    If supplementary specs were generated in the draft step, synthesize them too:\n    - Apply relevant review feedback to each spec\n    - Save to:\n      .aiwg\u002Frequirements\u002Frealizations\u002FDES-SM-NNN.md (if applicable)\n      .aiwg\u002Frequirements\u002Frealizations\u002FDES-DT-NNN.md (if applicable)\n      .aiwg\u002Frequirements\u002Frealizations\u002FDES-MIC-NNN.md (if applicable)\n\n    At the end of your output, report:\n    - FINAL_STATUS: approved | blocked | conditional\n    - BLOCKING_ISSUES: [list or none]\n    - SUPPLEMENTARY_ARTIFACTS: [list of DES-*-NNN.md files created or none]\n    \"\"\"\n)\n```\n\n---\n\n### Step 5: Update Traceability\n\n**Purpose**: Link the new realization back to its use case in the traceability index.\n\n**Your Direct Actions** (no Task needed for simple index update):\n\n1. **Read** `.aiwg\u002Frequirements\u002Ftraceability-index.md` (if it exists)\n2. **Add or update** the UC → realization link:\n   ```\n   UC-NNN → DES-UCR-NNN.md [+ DES-SM-NNN.md, DES-DT-NNN.md, DES-MIC-NNN.md if generated]\n   ```\n3. **Write** updated index\n\nIf no traceability index exists, create a minimal entry in a new file at `.aiwg\u002Frequirements\u002Ftraceability-index.md`.\n\n---\n\n### Step 6: Report Completion\n\n**Your Direct Communication**:\n\n```\n─────────────────────────────────────────────\nUse Case Realization Complete: UC-NNN\n─────────────────────────────────────────────\n\nPrimary Artifact:\n  .aiwg\u002Frequirements\u002Frealizations\u002FDES-UCR-NNN.md\n\nSupplementary Specs:\n  {DES-SM-NNN.md — State Machine: {entity name} | none}\n  {DES-DT-NNN.md — Decision Table: {condition count} branches | none}\n  {DES-MIC-NNN.md — Method Interface Contracts: {count} methods | none}\n\nReview Summary:\n  Security Architect:   {APPROVED | CONDITIONAL | BLOCKED}\n  Test Architect:       {APPROVED | CONDITIONAL | BLOCKED}\n  Domain Expert:        {APPROVED | CONDITIONAL | BLOCKED}\n\nFinal Status: {APPROVED | BLOCKED}\n\n{If BLOCKED:}\n  Blocking Issues:\n  - {issue 1}\n  - {issue 2}\n  These must be resolved before the realization can be used as implementation input.\n\nTest Scenarios Extracted: {count} scenarios\n  (See: .aiwg\u002Frequirements\u002Frealizations\u002FDES-UCR-NNN.md — Test Scenarios section)\n\nTraceability Updated:\n  UC-NNN → DES-UCR-NNN {+ supplementary IDs}\n\n─────────────────────────────────────────────\n```\n\n---\n\n## Batch Mode (--all)\n\nWhen `--all` is specified:\n\n### Step 1: Discover and Plan\n\n```\nGlob all: .aiwg\u002Frequirements\u002FUC-*.md\nGlob existing: .aiwg\u002Frequirements\u002Frealizations\u002FDES-UCR-*.md\n\nCompute:\n- PENDING = UC-*.md files with no corresponding DES-UCR\n- SKIP = UC-*.md files already realized\n\nReport plan to user:\n  Realizations to generate: {count} — {UC-NNN, UC-NNN, ...}\n  Already realized (skip): {count} — {UC-NNN, ...}\n  Starting batch generation...\n```\n\n### Step 2: Sequential Processing\n\nProcess each pending use case sequentially (not in parallel) to respect context budget.\n\nFor each UC in PENDING:\n- Execute Steps 1–5 above for that UC\n- Report per-UC status before moving to next\n\n### Step 3: Batch Summary\n\nAfter all use cases are processed:\n\n```\n─────────────────────────────────────────────\nBatch Realization Complete\n─────────────────────────────────────────────\n\n| Use Case | Status   | Artifacts Generated          |\n|----------|----------|------------------------------|\n| UC-001   | APPROVED | DES-UCR-001, DES-SM-001      |\n| UC-002   | APPROVED | DES-UCR-002                  |\n| UC-003   | BLOCKED  | DES-UCR-003 (see issues)     |\n| UC-004   | SKIPPED  | Already realized             |\n\nTotal: {approved}\u002F{total} approved, {blocked} blocked, {skipped} skipped\nTraceability index updated for all generated realizations.\n\n─────────────────────────────────────────────\n```\n\n---\n\n## Completeness Criteria\n\nA realization is complete when ALL of:\n\n- [ ] Metadata block present with status, dates, and related IDs\n- [ ] Traceability links to parent UC, SAD section, and relevant ADRs\n- [ ] All UC participants appear in Participating Components table\n- [ ] Main success scenario has a MermaidJS sequence diagram\n- [ ] Every UC step maps to at least one diagram message\n- [ ] All alternate flows from the UC are represented\n- [ ] All exception flows from the UC are represented\n- [ ] Security review: APPROVED or CONDITIONAL resolved\n- [ ] Test review: APPROVED or CONDITIONAL resolved, test scenarios extracted\n- [ ] Domain review: APPROVED or CONDITIONAL resolved\n- [ ] Supplementary specs generated if stateful entities or complex branching detected\n- [ ] Traceability index updated\n\n---\n\n## Error Handling\n\n**Use case not found**:\n```\n❌ No use case found: UC-NNN\n   Expected: .aiwg\u002Frequirements\u002FUC-NNN*.md\n\n   Available use cases:\n   {glob .aiwg\u002Frequirements\u002FUC-*.md and list}\n\n   Please verify the UC ID and try again.\n```\n\n**Architecture document missing**:\n```\n⚠️ Architecture document not found: .aiwg\u002Farchitecture\u002Fsoftware-architecture-doc.md\n   Generating realization with use case only — component mapping may be incomplete.\n   Run \u002Fflow-inception-to-elaboration to produce the architecture document first.\n```\n\n**Reviewer blocks realization**:\n```\n⚠️ Realization blocked by {reviewer role}:\n   {blocking issue description}\n\n   The draft has been saved to: .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-draft.md\n   Review the blocking issues, update the use case or architecture docs,\n   then re-run: generate-realization UC-NNN\n```\n\n**Realization already exists**:\n```\n⚠️ Realization already exists: .aiwg\u002Frequirements\u002Frealizations\u002FDES-UCR-NNN.md\n   Use --force to regenerate (overwrites existing realization).\n   Or open the existing file to inspect its status.\n```\n\n---\n\n## Examples\n\n### Single use case\n```\ngenerate-realization UC-001\n```\n\n### Single use case with guidance\n```\ngenerate-realization UC-042 --guidance \"This UC handles payment processing — be thorough on error paths and PCI-DSS relevant flows\"\n```\n\n### Interactive mode for a complex use case\n```\ngenerate-realization UC-017 --interactive\n```\n\n### Batch — generate all missing realizations\n```\ngenerate-realization --all\n```\n\n### Batch with guidance\n```\ngenerate-realization --all --guidance \"Emphasize async patterns — we use event-driven architecture throughout\"\n```\n\n---\n\n## References\n\n**Templates** (via $AIWG_ROOT):\n- Use Case Realization: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fanalysis-design\u002Fuse-case-realization-template.md`\n- Sequence Diagram: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fanalysis-design\u002Fsequence-diagram-template.md`\n- State Machine Spec: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fanalysis-design\u002Fstate-machine-spec-template.md`\n- Method Interface Contract: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fanalysis-design\u002Fmethod-interface-contract-template.md`\n- Activity Diagram: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fanalysis-design\u002Factivity-diagram-spec-template.md`\n\n**Multi-Agent Pattern**:\n- `$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fdocs\u002Fmulti-agent-documentation-pattern.md`\n\n**Orchestrator Architecture**:\n- `$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fdocs\u002Forchestrator-architecture.md`\n\n**Gate Integration**:\n- ABM gate checks for `DES-UCR-*.md` coverage in: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fskills\u002Fflow-gate-check\u002FSKILL.md`\n","# Generate Use Case Realization\n\n**You are the Core Orchestrator** for use case realization generation — producing the behavioral specification layer (Layer 3) that bridges use cases (Layer 2) to implementation.\n\n## Your Role\n\n**You orchestrate multi-agent workflows. You do NOT execute bash scripts.**\n\nWhen the user requests this flow (via natural language or explicit command):\n\n1. **Interpret the request** and confirm understanding\n2. **Read this template** as your orchestration guide\n3. **Identify target use case(s)** — single or batch\n4. **Delegate agents with the current provider-native orchestration mechanism** in the correct sequence\n5. **Synthesize results** and finalize artifacts\n6. **Update traceability** and report completion\n\n## Natural Language Triggers\n\nUsers may say:\n- \"Generate realization for UC-001\"\n- \"Create behavioral spec for UC-042\"\n- \"Realize UC-007\"\n- \"Generate all use case realizations\"\n- \"Create the Layer 3 specs\"\n- \"Realize all use cases\"\n- \"Build the behavioral specifications\"\n- \"Generate realizations for all architecturally significant use cases\"\n- \"Create sequence diagrams for UC-NNN\"\n- \"Add DES-UCR for UC-NNN\"\n\nYou recognize these as requests for this orchestration flow.\n\n## Parameters\n\n### UC-NNN (positional, required unless --all)\n\nThe use case ID to generate a realization for: `UC-001`\n\nThe orchestrator reads the use case document from `.aiwg\u002Frequirements\u002FUC-NNN.md` (or any `.aiwg\u002Frequirements\u002FUC-NNN*.md` match).\n\n### --all (optional)\n\nBatch generate realizations for all use cases found in `.aiwg\u002Frequirements\u002FUC-*.md` that do not already have a corresponding realization in `.aiwg\u002Frequirements\u002Frealizations\u002F`.\n\nWhen `--all` is set:\n- Glob all `UC-*.md` files in `.aiwg\u002Frequirements\u002F`\n- Skip any UC that already has a `DES-UCR-NNN.md` in `.aiwg\u002Frequirements\u002Frealizations\u002F`\n- Process remaining use cases sequentially to control context budget\n- Report a completion table at the end\n\n### --guidance (optional)\n\n**Purpose**: User provides upfront direction to tailor the realization approach.\n\n**Examples**:\n```\n--guidance \"Focus on security flows — this system handles PII\"\n--guidance \"Emphasize async patterns, we use event-driven architecture\"\n--guidance \"Be thorough on error paths — this is a payment flow\"\n--guidance \"Include state machine specs for all stateful entities\"\n```\n\n**How to Apply**:\n- Pass guidance verbatim to all agent prompts as additional context\n- Guidance influences: depth of error path coverage, security emphasis, diagram density\n- Guidance does not override completeness criteria\n\n### --interactive (optional)\n\n**Purpose**: Ask clarifying questions before generating to tailor output.\n\n**Questions to Ask** (if --interactive):\n\n```\nI'll ask a few questions to tailor the realization:\n\nQ1: What is the primary architectural concern for this use case?\n    (e.g., security, performance, reliability, data consistency)\n\nQ2: Are there known integration points or external systems involved?\n    (Help me include the right participants in sequence diagrams)\n\nQ3: Should I generate supplementary specs if I find stateful entities\n    or complex branching? (State machine specs, decision tables)\n\nQ4: Are there existing ADRs that constrain this realization?\n    (e.g., \"we use event sourcing\", \"REST only, no gRPC\")\n\nQ5: Who will review this realization?\n    (Helps me calibrate depth and formality)\n```\n\n## Multi-Agent Orchestration Workflow\n\n### Pattern\n\n```\nArchitecture Designer (primary author)\n    ↓ draft DES-UCR-NNN.md\nParallel Reviewers (single message, all at once):\n    ├── Security Architect     → auth\u002Fauthz gap analysis\n    ├── Test Architect         → testability + test scenario extraction\n    └── Domain Expert          → business logic accuracy\n    ↓ all reviews complete\nDocumentation Synthesizer\n    ↓ merges feedback → final DES-UCR-NNN.md\nArchive → .aiwg\u002Frequirements\u002Frealizations\u002F\n```\n\n**Critical**: Launch all three parallel reviewers in a **single message** with multiple Task calls.\n\n---\n\n### Step 1: Initialize\n\n**Your Actions**:\n\n1. **Parse parameters** — determine UC-NNN or --all batch mode\n2. **Read the target use case(s)**:\n   ```\n   Glob: .aiwg\u002Frequirements\u002FUC-NNN*.md\n   Read: matched file(s)\n   ```\n3. **Read architecture inputs**:\n   ```\n   Read: .aiwg\u002Farchitecture\u002Fsoftware-architecture-doc.md\n   Glob: .aiwg\u002Farchitecture\u002Fadr\u002F*.md\n   Read: matched ADR files\n   ```\n4. **Check for existing realizations** (skip if present):\n   ```\n   Glob: .aiwg\u002Frequirements\u002Frealizations\u002FDES-UCR-NNN.md\n   ```\n5. **Ensure output directory exists**: `.aiwg\u002Frequirements\u002Frealizations\u002F`\n\n**Communicate Progress**:\n```\n✓ Use case loaded: UC-NNN — {title}\n✓ Architecture document loaded\n✓ ADRs loaded: {count} decisions\n⏳ Starting realization generation...\n```\n\n---\n\n### Step 2: Primary Author — Architecture Designer\n\n**Purpose**: Create the initial use case realization draft with sequence diagrams and component mapping.\n\n```\nTask(\n    subagent_type=\"architecture-designer\",\n    description=\"Create use case realization draft for UC-NNN\",\n    prompt=\"\"\"\n    Read the use case realization template:\n    $AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fanalysis-design\u002Fuse-case-realization-template.md\n\n    Read the target use case:\n    .aiwg\u002Frequirements\u002F{UC-NNN}.md\n\n    Read the architecture document:\n    .aiwg\u002Farchitecture\u002Fsoftware-architecture-doc.md\n\n    Read all ADRs from: .aiwg\u002Farchitecture\u002Fadr\u002F\n\n    Using the template and source documents, generate a complete use case realization:\n\n    REQUIRED SECTIONS:\n    - Metadata block (ID: DES-UCR-NNN, status: draft, dates, related IDs)\n    - Traceability (parent UC, SAD section, ADRs referenced)\n    - Use Case Summary (actor, scope, level, trigger, pre\u002Fpostconditions)\n    - Participating Components table (every actor and component with interface)\n    - Main Success Scenario — MermaidJS sequenceDiagram\n    - Alternate Flows (≥2 alternates if present in UC)\n    - Exception Flows (all exception paths from the UC)\n    - Component Responsibilities section\n    - Completeness checklist (all items evaluated)\n\n    DIAGRAM REQUIREMENTS:\n    - Use MermaidJS sequenceDiagram syntax\n    - Maximum 15 participants per diagram; split into sub-diagrams if needed\n    - Every UC step must map to at least one message in the sequence diagram\n    - Show activation boxes for long-running operations\n    - Include return messages for synchronous calls\n\n    SUPPLEMENTARY SPECS — generate these if applicable:\n    - State machine spec (DES-SM-NNN.md) if the UC involves stateful entities\n      (entities with lifecycle states like: order, session, workflow, subscription)\n    - Decision table (DES-DT-NNN.md) if the UC has ≥3 branching conditions\n    - Method interface contracts (DES-MIC-NNN.md) for each key method identified\n      in the sequence diagrams (one contract per method, minimum 3 for complex UCs)\n\n    ADDITIONAL GUIDANCE (if provided):\n    {guidance}\n\n    Save the primary draft to:\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-draft.md\n\n    If supplementary specs are generated, save to:\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-SM-NNN-draft.md (if applicable)\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-DT-NNN-draft.md (if applicable)\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-MIC-NNN-draft.md (if applicable)\n\n    At the end of your output, list:\n    - SUPPLEMENTARY_SPECS: [SM | DT | MIC | none]\n    - STATEFUL_ENTITIES: [entity names or none]\n    - BRANCH_CONDITIONS: [count or 0]\n    - KEY_METHODS: [method names or none]\n    \"\"\"\n)\n```\n\n**After primary author completes**:\n```\n✓ DES-UCR-NNN draft complete\n⏳ Launching parallel review (3 agents)...\n```\n\n---\n\n### Step 3: Parallel Review (single message — all three at once)\n\n**Launch all three reviewers in one message:**\n\n```\n# Reviewer 1: Security Architect\nTask(\n    subagent_type=\"security-architect\",\n    description=\"Security review of DES-UCR-NNN realization draft\",\n    prompt=\"\"\"\n    Read the use case realization draft:\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-draft.md\n\n    Read the original use case:\n    .aiwg\u002Frequirements\u002F{UC-NNN}.md\n\n    Perform a security-focused review of the behavioral specification:\n\n    CHECK FOR:\n    - Authentication: Is the actor's identity verified before sensitive operations?\n    - Authorization: Are permission checks shown at each access-controlled step?\n    - Data exposure: Are sensitive fields (PII, credentials, keys) protected in transit?\n    - Input validation: Are untrusted inputs validated before processing?\n    - Error message safety: Do exception flows avoid leaking internal details?\n    - Session management: Are session tokens created\u002Finvalidated correctly?\n    - Audit logging: Are security-relevant events logged in the sequence?\n    - OWASP Top 10 relevance: Flag any Top 10 patterns present in this UC\n\n    OUTPUT FORMAT:\n    ## Security Review: DES-UCR-NNN\n\n    ### Status: APPROVED | CONDITIONAL | BLOCKED\n\n    ### Gaps Found\n    (List each gap with: location in diagram, risk level [HIGH\u002FMED\u002FLOW], remediation)\n\n    ### Approved Flows\n    (List flows that pass security review)\n\n    ### Required Changes\n    (Numbered list of mandatory changes before approval)\n\n    ### Recommendations\n    (Optional improvements)\n\n    Save to: .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-review-security.md\n    \"\"\"\n)\n\n# Reviewer 2: Test Architect\nTask(\n    subagent_type=\"test-architect\",\n    description=\"Testability review of DES-UCR-NNN realization draft\",\n    prompt=\"\"\"\n    Read the use case realization draft:\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-draft.md\n\n    Read the original use case:\n    .aiwg\u002Frequirements\u002F{UC-NNN}.md\n\n    Perform a testability and test scenario review:\n\n    CHECK FOR:\n    - Testability: Is every sequence step observable and verifiable in tests?\n    - Test boundaries: Are integration seams clearly defined (mocking points)?\n    - Happy path coverage: Can the main success scenario be driven end-to-end?\n    - Negative path coverage: Are exception flows independently triggerable?\n    - State assertions: Are pre\u002Fpostconditions verifiable with assertions?\n    - Test data requirements: What fixtures or stubs are needed?\n    - Performance test hooks: Are SLO-relevant operations identifiable?\n\n    EXTRACT TEST SCENARIOS:\n    For each flow in the realization, write a one-line test scenario:\n    - \"GIVEN {precondition} WHEN {trigger} THEN {expected outcome}\"\n    Minimum: 1 scenario per flow (main + alternates + exceptions)\n\n    OUTPUT FORMAT:\n    ## Test Architect Review: DES-UCR-NNN\n\n    ### Status: APPROVED | CONDITIONAL | BLOCKED\n\n    ### Testability Issues\n    (List each issue with location and required fix)\n\n    ### Test Scenarios Extracted\n    (Numbered GIVEN\u002FWHEN\u002FTHEN list — these become test case seeds)\n\n    ### Required Changes\n    (Mandatory changes before implementation)\n\n    ### Test Data Requirements\n    (Fixtures, stubs, or external dependencies needed for testing)\n\n    Save to: .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-review-test.md\n    \"\"\"\n)\n\n# Reviewer 3: Domain Expert\nTask(\n    subagent_type=\"domain-expert\",\n    description=\"Business logic accuracy review of DES-UCR-NNN realization draft\",\n    prompt=\"\"\"\n    Read the use case realization draft:\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-draft.md\n\n    Read the original use case:\n    .aiwg\u002Frequirements\u002F{UC-NNN}.md\n\n    Read the architecture document:\n    .aiwg\u002Farchitecture\u002Fsoftware-architecture-doc.md\n\n    Perform a business logic and domain accuracy review:\n\n    CHECK FOR:\n    - Step fidelity: Does every UC step appear in the sequence diagrams?\n    - Business rule coverage: Are all business rules from the UC enforced in the flow?\n    - Domain language: Are entity names, actor names, and terms consistent with the UC?\n    - Alternate flow completeness: Do alternate flows match the UC alternate paths?\n    - Exception handling: Do exception flows match UC exception paths?\n    - Traceability accuracy: Are UC step references in the realization correct?\n    - Postcondition satisfaction: Does the main flow produce the stated postcondition?\n\n    OUTPUT FORMAT:\n    ## Domain Expert Review: DES-UCR-NNN\n\n    ### Status: APPROVED | CONDITIONAL | BLOCKED\n\n    ### Fidelity Gaps\n    (Steps in the UC not represented in the realization)\n\n    ### Business Rule Violations\n    (Rules present in the UC but missing or wrong in the realization)\n\n    ### Required Changes\n    (Mandatory corrections)\n\n    ### Minor Issues\n    (Non-blocking inconsistencies to address)\n\n    Save to: .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-review-domain.md\n    \"\"\"\n)\n```\n\n**After all three reviews complete**:\n```\n  ✓ Security Architect: {APPROVED | CONDITIONAL | BLOCKED}\n  ✓ Test Architect: {APPROVED | CONDITIONAL | BLOCKED}\n  ✓ Domain Expert: {APPROVED | CONDITIONAL | BLOCKED}\n⏳ Synthesizing final realization...\n```\n\n---\n\n### Step 4: Documentation Synthesizer\n\n**Purpose**: Merge all reviewer feedback into the final behavioral specification.\n\n```\nTask(\n    subagent_type=\"documentation-synthesizer\",\n    description=\"Synthesize DES-UCR-NNN final realization from reviews\",\n    prompt=\"\"\"\n    Read the primary draft:\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-draft.md\n\n    Read all three review files:\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-review-security.md\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-review-test.md\n    .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-review-domain.md\n\n    Synthesize the final use case realization:\n\n    MERGE PROTOCOL:\n    1. Apply all REQUIRED CHANGES from every review (mandatory — do not skip)\n    2. Apply APPROVED items without modification\n    3. For CONDITIONAL status: resolve each condition by incorporating the fix\n    4. For BLOCKED status: flag the blocking issue clearly in the document header\n    5. Incorporate test scenarios from the Test Architect into a \"Test Scenarios\"\n       section at the end of the document\n    6. Update the metadata: status → \"approved\" (or \"blocked\" if any reviewer blocked)\n    7. Update the Reviewers field in the metadata block with all three reviewer roles\n    8. Update the completeness checklist — all items should now be checked\n\n    FINAL DOCUMENT STRUCTURE:\n    (Follow the use-case-realization template exactly)\n    - Metadata (status updated, reviewers listed)\n    - Traceability\n    - Use Case Summary\n    - Participating Components\n    - Main Success Scenario (sequence diagram — updated per reviews)\n    - Alternate Flows (updated per domain review)\n    - Exception Flows (updated per security and domain reviews)\n    - Component Responsibilities\n    - Test Scenarios (from test architect review)\n    - Completeness Checklist (all items evaluated and checked)\n\n    Save the final document to:\n    .aiwg\u002Frequirements\u002Frealizations\u002FDES-UCR-NNN.md\n\n    If supplementary specs were generated in the draft step, synthesize them too:\n    - Apply relevant review feedback to each spec\n    - Save to:\n      .aiwg\u002Frequirements\u002Frealizations\u002FDES-SM-NNN.md (if applicable)\n      .aiwg\u002Frequirements\u002Frealizations\u002FDES-DT-NNN.md (if applicable)\n      .aiwg\u002Frequirements\u002Frealizations\u002FDES-MIC-NNN.md (if applicable)\n\n    At the end of your output, report:\n    - FINAL_STATUS: approved | blocked | conditional\n    - BLOCKING_ISSUES: [list or none]\n    - SUPPLEMENTARY_ARTIFACTS: [list of DES-*-NNN.md files created or none]\n    \"\"\"\n)\n```\n\n---\n\n### Step 5: Update Traceability\n\n**Purpose**: Link the new realization back to its use case in the traceability index.\n\n**Your Direct Actions** (no Task needed for simple index update):\n\n1. **Read** `.aiwg\u002Frequirements\u002Ftraceability-index.md` (if it exists)\n2. **Add or update** the UC → realization link:\n   ```\n   UC-NNN → DES-UCR-NNN.md [+ DES-SM-NNN.md, DES-DT-NNN.md, DES-MIC-NNN.md if generated]\n   ```\n3. **Write** updated index\n\nIf no traceability index exists, create a minimal entry in a new file at `.aiwg\u002Frequirements\u002Ftraceability-index.md`.\n\n---\n\n### Step 6: Report Completion\n\n**Your Direct Communication**:\n\n```\n─────────────────────────────────────────────\nUse Case Realization Complete: UC-NNN\n─────────────────────────────────────────────\n\nPrimary Artifact:\n  .aiwg\u002Frequirements\u002Frealizations\u002FDES-UCR-NNN.md\n\nSupplementary Specs:\n  {DES-SM-NNN.md — State Machine: {entity name} | none}\n  {DES-DT-NNN.md — Decision Table: {condition count} branches | none}\n  {DES-MIC-NNN.md — Method Interface Contracts: {count} methods | none}\n\nReview Summary:\n  Security Architect:   {APPROVED | CONDITIONAL | BLOCKED}\n  Test Architect:       {APPROVED | CONDITIONAL | BLOCKED}\n  Domain Expert:        {APPROVED | CONDITIONAL | BLOCKED}\n\nFinal Status: {APPROVED | BLOCKED}\n\n{If BLOCKED:}\n  Blocking Issues:\n  - {issue 1}\n  - {issue 2}\n  These must be resolved before the realization can be used as implementation input.\n\nTest Scenarios Extracted: {count} scenarios\n  (See: .aiwg\u002Frequirements\u002Frealizations\u002FDES-UCR-NNN.md — Test Scenarios section)\n\nTraceability Updated:\n  UC-NNN → DES-UCR-NNN {+ supplementary IDs}\n\n─────────────────────────────────────────────\n```\n\n---\n\n## Batch Mode (--all)\n\nWhen `--all` is specified:\n\n### Step 1: Discover and Plan\n\n```\nGlob all: .aiwg\u002Frequirements\u002FUC-*.md\nGlob existing: .aiwg\u002Frequirements\u002Frealizations\u002FDES-UCR-*.md\n\nCompute:\n- PENDING = UC-*.md files with no corresponding DES-UCR\n- SKIP = UC-*.md files already realized\n\nReport plan to user:\n  Realizations to generate: {count} — {UC-NNN, UC-NNN, ...}\n  Already realized (skip): {count} — {UC-NNN, ...}\n  Starting batch generation...\n```\n\n### Step 2: Sequential Processing\n\nProcess each pending use case sequentially (not in parallel) to respect context budget.\n\nFor each UC in PENDING:\n- Execute Steps 1–5 above for that UC\n- Report per-UC status before moving to next\n\n### Step 3: Batch Summary\n\nAfter all use cases are processed:\n\n```\n─────────────────────────────────────────────\nBatch Realization Complete\n─────────────────────────────────────────────\n\n| Use Case | Status   | Artifacts Generated          |\n|----------|----------|------------------------------|\n| UC-001   | APPROVED | DES-UCR-001, DES-SM-001      |\n| UC-002   | APPROVED | DES-UCR-002                  |\n| UC-003   | BLOCKED  | DES-UCR-003 (see issues)     |\n| UC-004   | SKIPPED  | Already realized             |\n\nTotal: {approved}\u002F{total} approved, {blocked} blocked, {skipped} skipped\nTraceability index updated for all generated realizations.\n\n─────────────────────────────────────────────\n```\n\n---\n\n## Completeness Criteria\n\nA realization is complete when ALL of:\n\n- [ ] Metadata block present with status, dates, and related IDs\n- [ ] Traceability links to parent UC, SAD section, and relevant ADRs\n- [ ] All UC participants appear in Participating Components table\n- [ ] Main success scenario has a MermaidJS sequence diagram\n- [ ] Every UC step maps to at least one diagram message\n- [ ] All alternate flows from the UC are represented\n- [ ] All exception flows from the UC are represented\n- [ ] Security review: APPROVED or CONDITIONAL resolved\n- [ ] Test review: APPROVED or CONDITIONAL resolved, test scenarios extracted\n- [ ] Domain review: APPROVED or CONDITIONAL resolved\n- [ ] Supplementary specs generated if stateful entities or complex branching detected\n- [ ] Traceability index updated\n\n---\n\n## Error Handling\n\n**Use case not found**:\n```\n❌ No use case found: UC-NNN\n   Expected: .aiwg\u002Frequirements\u002FUC-NNN*.md\n\n   Available use cases:\n   {glob .aiwg\u002Frequirements\u002FUC-*.md and list}\n\n   Please verify the UC ID and try again.\n```\n\n**Architecture document missing**:\n```\n⚠️ Architecture document not found: .aiwg\u002Farchitecture\u002Fsoftware-architecture-doc.md\n   Generating realization with use case only — component mapping may be incomplete.\n   Run \u002Fflow-inception-to-elaboration to produce the architecture document first.\n```\n\n**Reviewer blocks realization**:\n```\n⚠️ Realization blocked by {reviewer role}:\n   {blocking issue description}\n\n   The draft has been saved to: .aiwg\u002Fworking\u002Frealizations\u002FDES-UCR-NNN-draft.md\n   Review the blocking issues, update the use case or architecture docs,\n   then re-run: generate-realization UC-NNN\n```\n\n**Realization already exists**:\n```\n⚠️ Realization already exists: .aiwg\u002Frequirements\u002Frealizations\u002FDES-UCR-NNN.md\n   Use --force to regenerate (overwrites existing realization).\n   Or open the existing file to inspect its status.\n```\n\n---\n\n## Examples\n\n### Single use case\n```\ngenerate-realization UC-001\n```\n\n### Single use case with guidance\n```\ngenerate-realization UC-042 --guidance \"This UC handles payment processing — be thorough on error paths and PCI-DSS relevant flows\"\n```\n\n### Interactive mode for a complex use case\n```\ngenerate-realization UC-017 --interactive\n```\n\n### Batch — generate all missing realizations\n```\ngenerate-realization --all\n```\n\n### Batch with guidance\n```\ngenerate-realization --all --guidance \"Emphasize async patterns — we use event-driven architecture throughout\"\n```\n\n---\n\n## References\n\n**Templates** (via $AIWG_ROOT):\n- Use Case Realization: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fanalysis-design\u002Fuse-case-realization-template.md`\n- Sequence Diagram: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fanalysis-design\u002Fsequence-diagram-template.md`\n- State Machine Spec: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fanalysis-design\u002Fstate-machine-spec-template.md`\n- Method Interface Contract: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fanalysis-design\u002Fmethod-interface-contract-template.md`\n- Activity Diagram: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Ftemplates\u002Fanalysis-design\u002Factivity-diagram-spec-template.md`\n\n**Multi-Agent Pattern**:\n- `$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fdocs\u002Fmulti-agent-documentation-pattern.md`\n\n**Orchestrator Architecture**:\n- `$AIWG_ROOT\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fdocs\u002Forchestrator-architecture.md`\n\n**Gate Integration**:\n- ABM gate checks for `DES-UCR-*.md` coverage in: `agentic\u002Fcode\u002Fframeworks\u002Fsdlc-complete\u002Fskills\u002Fflow-gate-check\u002FSKILL.md`\n",{"name":5,"namespace":50,"platforms":51,"commandHint":53,"description":7},"aiwg",[52],"all",{"model":31,"category":54,"modelRole":40,"modelTier":27,"allowedTools":55,"argumentHint":56,"orchestration":57},"sdlc-orchestration","Task, Read, Write, Glob, TodoWrite","\u003CUC-NNN> [--all] [--guidance \"text\"] [--interactive]",true,"main","6754967c344ccb087a8de06972f55a41067b291b","agentic\u002Fcode\u002Fplugins\u002Fcodex-sdlc\u002Fskills\u002Fgenerate-realization",36,"https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg","https:\u002F\u002Faiwg.io","https:\u002F\u002Fgithub.com\u002Fjmagly","https:\u002F\u002Fintegrolabs.io","ml\u002Fai, industrial automation, safety\u002Fsecurity, ssi\r\n\r\nmagly.net\r\nintegrolabs.io\r\naiwg.io\r\nfortemi.com\r\npagenary.com\r\nbytecask.com","2026-11-12 00:33:10",{"source":8,"skillName":5,"commands":69,"prompt":79,"zipAvailable":57},[70,73,76],{"tool":71,"command":72},"npx","npx skills add jmagly\u002Faiwg --skill generate-realization",{"tool":74,"command":75},"bunx","bunx skills add jmagly\u002Faiwg --skill generate-realization",{"tool":77,"command":78},"pnpm","pnpm dlx skills add jmagly\u002Faiwg --skill generate-realization","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fcodex-sdlc\u002Fskills\u002Fgenerate-realization\u002FSKILL.md",[],[82,109,132,138,145,158],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":89,"publishedAt":45},"01M70QA0BSYJ49EES9V4RE8QH1","host-hardening","Read-only system hardening baseline and plan-first host hardening recommendations for SSH, Docker bind addresses, firewall persistence, datastores, exporters and audit retention.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fsecurity-engineering\u002Fskills\u002Fhost-hardening\u002FSKILL.md",[88],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[90,91,92,39,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108],"host","host hardening","hardening","re","recommendations","remediation","plan","port","verification","Bash","access","only","retention","audit","never","firewall","bind","secrets","request",{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":119,"publishedAt":45},"01M70PNT2Z4HMZPRBTAF6073NN","exposure-analysis","Read-only firewall analysis and effective host exposure reconstruction for Docker published ports, UFW bypass, stale rules, CDN scope, IPv6 asymmetry and external probe allowlists.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fplugins\u002Fforensics\u002Fskills\u002Fexposure-analysis\u002FSKILL.md",[115,118],{"categoryNo":116,"categoryName":117,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000011","运维与部署",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[120,121,122,39,123,97,124,125,99,126,90,127,101,128,129,104,105,130,131,38],"exposure analysis","analysis","unknown","credentials","collection","ufw","ports","internet","local","scope","reconstruction","operator",{"skillNo":133,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":134,"categories":135,"keywords":137,"publishedAt":45},"01M70P8QATMPKA78E4FT5D2TNA","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fframeworks\u002Fsecurity-engineering\u002Fskills\u002Fhost-hardening\u002FSKILL.md",[136],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[92,90,91,100,39,108,95,94,103,96,97,98,99,107,101,102,93,104,105,106],{"skillNo":139,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":144,"publishedAt":45},"01M70NMPVJ5H0JH131P60FW4R8","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Fagentic\u002Fcode\u002Fframeworks\u002Fforensics-complete\u002Fskills\u002Fexposure-analysis\u002FSKILL.md",[142,143],{"categoryNo":116,"categoryName":117,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[121,120,104,123,97,124,99,122,90,127,101,128,129,39,105,126,125,130,131,38],{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":152,"publishedAt":45},"01M6CB4DDR0B4NNCFK7ZK7449H","fixture-skill","Exercise rule delivery.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Frule-delivery\u002Fskills\u002Ffixture-skill\u002FSKILL.md",[151],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[153,154,155,156,29,157],"fixture skill","fixture","rule","delivery","exercise",{"skillNo":159,"name":160,"nameZh":6,"description":161,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":162,"categories":163,"keywords":165,"publishedAt":45},"01M6CB4AVK1W76MFMPP0JP32CJ","pi-local","Pi-local duplicate-precedence fixture.","https:\u002F\u002Fgithub.com\u002Fjmagly\u002Faiwg\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fproviders\u002Fpi\u002Fproject\u002F.pi\u002Fskills\u002Fpi-local\u002FSKILL.md",[164],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[166,167,128,168,154],"pi","pi local","duplicate"]