[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M753CQSWMYAY09KPSRVNC2TG":3,"skill-same:01M753CQSWMYAY09KPSRVNC2TG":56},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":33,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M753CQSWMYAY09KPSRVNC2TG","x-lib-decompose-task",null,"Decomposes an implementation plan into tasks. Primary mode: derives tasks from test scenarios (x-plan-tests output) using TDD structure (RED\u002FGREEN\u002FREFACTOR). Fallback mode: uses Layer Task Catalog (G1-G7) when no test plan exists.","review-bench\u002Federcnj_ia-dev-environment","review-bench","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F286778065?v=4","01M7517F9NTEPDZDAXJBR30FWT","ReviewBench","01M7517FAC9F4P7TGWCNJ8VYVW",0,"MIT","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring-elasticsearch\u002F.claude\u002Fskills\u002Flib\u002Fx-lib-decompose-task\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: x-lib-decompose-task\ndescription: \"Decomposes an implementation plan into tasks. Primary mode: derives tasks from test scenarios (x-plan-tests output) using TDD structure (RED\u002FGREEN\u002FREFACTOR). Fallback mode: uses Layer Task Catalog (G1-G7) when no test plan exists.\"\nuser-invocable: false\nallowed-tools: Read, Write, Grep, Glob\nrequires-capabilities: []\ncontext-budget: medium\n---\n\n## Global Output Policy\n\n- **Language**: English ONLY.\n- **Tone**: Technical, Direct, and Concise.\n- **Efficiency**: Remove all conversational fillers and greetings to save tokens.\n\n# Skill: Task Decomposer (Library)\n\n## Purpose\n\nDecomposes an implementation plan into granular tasks. When a test plan exists (from `x-plan-tests`), derives tasks from test scenarios using TDD structure (RED\u002FGREEN\u002FREFACTOR) with a per-task `Parallel` flag. Falls back to the Layer Task Catalog (G1-G7) when no test plan is available, where tasks are additionally assigned to parallelism groups. Each task is assigned a model tier (Junior\u002FMid\u002FSenior) and context budget.\n\n## When Called\n\n| Caller Skill | Phase | Context |\n|-------------|-------|---------|\n| x-implement-story | Phase 1C | After the Architect produces the plan, BEFORE implementation |\n| (standalone) | N\u002FA | When breaking down a plan into implementable tasks |\n\n## Inputs\n\n| Input | Path | Required |\n|-------|------|----------|\n| Architect's plan | `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Fplan-story-XXXX-YYYY.md` | Yes |\n| Story requirements | Story file | Yes |\n| Test plan (from x-plan-tests) | `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftests-story-XXXX-YYYY.md` | No |\n\n## Procedure\n\n### Step 0 — Idempotency Pre-Check (RULE-002 — Artifact reuse)\n\nBefore any decomposition work, verify whether a valid task breakdown already exists:\n\n1. **Derive artifact path**: `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftasks-story-XXXX-YYYY.md` (extract epic ID XXXX and story sequence YYYY from the story ID)\n2. **Check existence**: Use Glob or Read to verify if the file exists\n3. **Staleness check** (if file exists):\n   - Compare modification times: `mtime(story file)` vs `mtime(tasks file)`\n   - **Fresh** (`mtime(story) \u003C= mtime(tasks)`): Log `\"Reusing existing task breakdown from {date}\"` and **RETURN the existing file without regeneration**. No subagent invocation needed.\n   - **Stale** (`mtime(story) > mtime(tasks)`): Log `\"Regenerating stale task breakdown for {story-id}\"` and proceed to STEP 0.5\n4. **File absent**: Log `\"Generating task breakdown for {story-id}\"` and proceed to STEP 0.5\n\n> **Rationale**: Task breakdowns are expensive to generate (2-5 min, significant token cost). When a session is resumed after interruption, the existing breakdown should be reused if the story has not changed. This saves tokens and ensures continuity.\n\n**Idempotency Summary:**\n\n| Aspect | Behavior |\n|--------|----------|\n| **Check** | Compare `mtime(story)` vs `mtime(tasks)` |\n| **Skip** | Reuse existing breakdown when `mtime(story) \u003C= mtime(tasks)` |\n| **Override** | Regenerate when story is newer than existing breakdown |\n\n### Step 0.5 — Read Architecture Context\n\nBefore decomposing, read the project's architecture and layer definitions:\n- `knowledge\u002Farchitecture\u002Farchitecture-principles.md` — layer structure, dependency direction, package organization\n- `knowledge\u002Flayer-templates.md` — complete layer catalog with package locations, code templates, and checklist per layer\n\nThese files define the available layers for YOUR project. The Layer Task Catalog below is derived from them.\n\n### Step 1 — Read Story Context and Template (RULE-007, RULE-012)\n\nRead these files:\n- `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Fplan-story-XXXX-YYYY.md` (Architect's plan)\n- Story requirements file\n\n**Template Reference (RULE-007):**\n\nRead template at `.claude\u002Ftemplates\u002F_TEMPLATE-TASK-BREAKDOWN.md` for required output format.\n\n- **Template found**: Use the template's sections as the mandatory output structure. The template defines: Header (Story ID, Date, Author), Summary, Dependency Graph, Tasks Table, and Escalation Notes.\n- **Template NOT found (RULE-012 fallback)**: Log `\"Template not found, using inline format\"` and use the inline format defined in STEP 2A (test-driven) or STEP 2B (layer-based) of this skill. Execution continues normally without interruption.\n\n> **Note**: The template contains `{{PLACEHOLDER}}` markers. These are NOT rendered by the engine — they are filled by the LLM at runtime based on the decomposition results.\n\n### Step 1.5 — Detect Decomposition Mode\n\nCheck if test plan exists at `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftests-story-XXXX-YYYY.md`:\n\n1. **File exists AND has structured TPP scenario markers** (scenario IDs like `UT-01:`, `AT-01:`, `IT-01:` at start of line under a dedicated scenarios section):\n   - Use **TEST-DRIVEN MODE** (proceed to STEP 2A)\n   - Derive tasks from test scenarios with RED\u002FGREEN\u002FREFACTOR structure\n\n2. **File exists but NO structured TPP markers** (may mention TPP\u002FUT\u002FAT in prose but lacks scenario ID lines):\n   - Use **LAYER-BASED MODE** (proceed to STEP 2B)\n   - Emit warning: \"Test plan found but lacks structured TPP markers. Falling back to layer-based decomposition (G1-G7).\"\n\n3. **File absent**:\n   - Use **LAYER-BASED MODE** (proceed to STEP 2B)\n   - Emit warning: \"No test plan found. Falling back to layer-based decomposition (G1-G7).\"\n\n### Step 2A — Test-Driven Decomposition (Primary Mode)\n\n> Used when a test plan with TPP markers is available at\n> `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftests-story-XXXX-YYYY.md`.\n\nFor each test scenario in the test plan (ordered by TPP level):\n\n1. **Map scenario to task**: One task per test scenario (UT\u002FIT\u002FAT)\n2. **Identify layer components**: Which layers does this scenario touch?\n3. **Determine dependencies**: Which tasks must complete before this one?\n4. **Assess parallelism**: Can this task run concurrently with others?\n5. **Assign tier**: Based on the highest-complexity layer touched\n\n#### TDD Task Structure\n\nEach generated task MUST contain:\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| Test Scenario | M | Reference to UT-N, IT-N, or AT-N from test plan |\n| TPP Level | M | 1-7 from TPP ordering |\n| RED | M | What the test asserts (expected behavior) |\n| GREEN | M | Minimum implementation to make test pass |\n| REFACTOR | O | Refactoring opportunities after green |\n| Layer Components | M | Which layers\u002Fclasses are touched |\n| Parallel | M | yes\u002Fno — can run concurrently with other tasks |\n| Depends On | M | List of prerequisite TASK-N references |\n| Tier | M | Junior\u002FMid\u002FSenior based on complexity |\n| Budget | M | S\u002FM\u002FL context budget |\n\n#### Parallelism Detection\n\nA task is parallelizable when ALL of:\n1. Its test scenario operates on different layers than concurrent tasks\n2. No shared state with concurrent tasks\n3. No dependency on output of concurrent tasks\n\n#### Ordering Rules\n\n1. Unit test tasks ordered by TPP level (degenerate first, complex last)\n2. Within same TPP level, inner layers before outer layers\n3. Acceptance test tasks ALWAYS come after ALL related unit test tasks\n4. Tasks with dependencies come after their prerequisites\n\n#### Task Type Classification\n\n| Scenario Type | Task Marker | Dependency Rule |\n|--------------|-------------|-----------------|\n| UT (Unit Test) | `[UT]` | Depends on earlier TPP-level tasks that create shared components |\n| AT (Acceptance Test) | `[AT]` | Depends on ALL related UT tasks |\n| IT (Integration Test) | `[IT]` | Depends on UT tasks for involved components |\n\n#### TDD Task Output Format\n\nWhen using test-driven mode, generate tasks in this format:\n\n```\n### TASK-N: [UT-X\u002FAT-X] scenario-name\n- **TPP Level:** N\n- **Type:** UT | AT | IT\n- **Tier:** Junior | Mid | Senior\n- **Budget:** S | M | L\n- **Parallel:** yes | no\n- **Depends On:** TASK-N, TASK-M (or \"none\")\n\n**RED:** [What the test asserts — expected behavior]\n\n**GREEN:** [Minimum implementation steps]\n- Layer: component to create\u002Fmodify\n- Layer: component to create\u002Fmodify\n\n**REFACTOR:** [Optional refactoring opportunities]\n\n**Layer Components:**\n- domain.model: EntityName\n- domain.port: PortName\n- adapter.outbound: RepositoryName\n```\n\nAfter generating all TDD tasks, proceed to STEP 5 (Generate Output).\n\n### Step 2B — Identify Affected Layers (Layer-Based Fallback)\n\n> Used when no test plan with TPP markers is available.\n\nFor each section in the Architect's plan, check which architectural layers are involved. Mark each layer as active or inactive.\n\n### Step 3B — Apply the Layer Task Catalog (Layer-Based Fallback)\n\n> Used when no test plan with TPP markers is available.\n\nFor each active layer, create ONE task using the fixed catalog below.\n\n### Step 4B — Variable Tier Decision (Layer-Based Fallback)\n\n> Used when no test plan with TPP markers is available.\n\nFor complex domain logic tasks, read the Architect's plan carefully:\n- **Simple mapping\u002Flookup** (1 decision, no state) -> Mid tier\n- **Multi-branch logic** (type hierarchies with 3+ implementations, resilience patterns) -> Senior tier\n\n### Step 5 — Generate Output\n\nSave to: `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftasks-story-XXXX-YYYY.md` (extract epic ID XXXX and story sequence YYYY from the story ID). Ensure directory exists: `mkdir -p ai\u002Fepics\u002Fepic-XXXX\u002Fplans`.\n\n**Output format selection:**\n- If the template was loaded in STEP 1, structure the output following the template's sections (Header, Summary, Dependency Graph, Tasks Table, Escalation Notes)\n- If the template was not found (fallback), use the inline TDD Task Output Format (STEP 2A) or Layer Task Catalog format (STEP 2B) as defined in this skill\n\n---\n\n## Fallback: Layer Task Catalog (G1-G7)\n\n> **When to use:** Only when no test plan with TPP markers exists at\n> `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftests-story-XXXX-YYYY.md`.\n> Prefer test-driven decomposition when test plan is available.\n\nDerive the task catalog from the **layer-templates knowledge pack** (`knowledge\u002Flayer-templates.md`). Each section in the knowledge pack corresponds to one task type. The table below shows the **generic structure** — adapt layer names and packages to match YOUR project's architecture rules (`knowledge\u002Farchitecture\u002Farchitecture-principles.md`).\n\n| Task Type                     | Architecture Layer      | Tier   | Budget | Group |\n| ----------------------------- | ----------------------- | ------ | ------ | ----- |\n| Database Migration            | migration               | Junior | S      | G1    |\n| Domain Models                 | domain model            | Junior | S      | G1    |\n| Ports (Inbound Interfaces)    | domain port inbound     | Junior | S      | G2    |\n| Ports (Outbound Interfaces)   | domain port outbound    | Junior | S      | G2    |\n| DTOs (Request\u002FResponse)       | inbound adapter dto     | Junior | S      | G2    |\n| Domain Engine\u002FRules (simple)  | domain engine           | Mid    | M      | G2    |\n| Domain Engine\u002FRules (complex) | domain engine           | Senior | L      | G2    |\n| Persistence Entity            | outbound adapter entity | Junior | S      | G3    |\n| Entity Mapper                 | outbound adapter mapper | Junior | S      | G3    |\n| DTO Mapper (Inbound)          | inbound adapter mapper  | Junior | S      | G3    |\n| Repository                    | outbound adapter repo   | Mid    | M      | G3    |\n| Use Case (Application)        | application             | Mid    | M      | G4    |\n| REST Resource\u002FController      | inbound adapter rest    | Mid    | M      | G5    |\n| Exception Mapper              | inbound adapter rest    | Mid    | M      | G5    |\n| Protocol Handler              | inbound adapter protocol| Senior | L      | G5    |\n| Configuration                 | config                  | Junior | S      | G5    |\n| Observability (Spans\u002FMetrics) | cross-cutting           | Mid    | M      | G6    |\n| Unit Tests                    | test                    | Follows tested layer | G7 |\n| Integration Tests             | test                    | Mid    | M      | G7    |\n| API Tests                     | test                    | Mid    | M      | G7    |\n| E2E Tests                     | test                    | Mid    | M      | G7    |\n\n> **Note:** The exact package names (e.g., `domain.model`, `adapter.outbound.entity`) are defined in `knowledge\u002Farchitecture\u002Farchitecture-principles.md`. Consult that file for your project's specific package structure.\n\n## Fallback: Layer Dependency Graph (G1-G7)\n\n> **When to use:** Only when no test plan with TPP markers exists at\n> `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftests-story-XXXX-YYYY.md`.\n> Prefer test-driven decomposition when test plan is available.\n\nThe dependency direction follows the architecture rule: `adapter.inbound → application → domain ← adapter.outbound`. Groups are derived from this dependency chain:\n\n```\nG1: FOUNDATION (Migration + Domain Models) — PARALLEL\nG2: CONTRACTS (Ports + DTOs + Engine) — PARALLEL, depends on G1\nG3: OUTBOUND ADAPTERS (Entity + Mapper + Repository) — PARALLEL, depends on G1, G2\nG4: ORCHESTRATION (Use Case) — SEQUENTIAL, depends on G2, G3\nG5: INBOUND ADAPTERS (Controllers + Protocol Handlers + Config) — PARALLEL, depends on G4\nG6: OBSERVABILITY — SEQUENTIAL, depends on G4, G5\nG7: TESTS — PARALLEL (max 4 concurrent), depends on ALL previous\n```\n\n> **Note:** Group contents may vary by project architecture. The principle is: **inner layers first, then outer layers**. Verify against `knowledge\u002Farchitecture\u002Farchitecture-principles.md` for your project.\n\n## Context Budget Sizes\n\n| Size | Range        | Includes                                              |\n| ---- | ------------ | ----------------------------------------------------- |\n| S    | 100-200 lines| Plan section + inline rules + 1 template              |\n| M    | 250-400 lines| Plan section + rules files + dependency outputs        |\n| L    | 500-800 lines| Story + plan + rules + dependency outputs + existing code |\n\n## Review Tier Assignment\n\nEach engineer's model tier = highest task tier in their review domain:\n\n| Engineer      | Relevant Task Types                    |\n| ------------- | -------------------------------------- |\n| Security      | Domain Engine, TCP Handler, Repository |\n| QA            | All test tasks                         |\n| Performance   | Domain Engine, TCP Handler, Repository |\n| Database      | Migration, Entity, Repository          |\n| Observability | Observability task                     |\n| DevOps        | Config task                            |\n| API           | DTOs, REST Resource                    |\n\n**Tech Lead** tier = story max task tier (highest across ALL tasks).\n\n## Escalation Rules\n\nWhen a task fails compilation after 2 retries at its assigned tier:\n- Junior -> Mid (escalate)\n- Mid -> Senior (escalate)\n- Senior -> Flag for manual intervention\n\nTarget: \u003C 15% of tasks escalate.\n\n## Error Handling\n\n| Scenario | Action |\n|----------|--------|\n| Architect's plan not found | Abort with message: \"Plan file not found at expected path. Run planning phase first.\" |\n| Story requirements file not found | Abort with message: \"Story file not found. Verify story ID and epic directory.\" |\n| Template `_TEMPLATE-TASK-BREAKDOWN.md` missing | Log warning, use inline format as fallback (RULE-012 — Graceful template fallback) |\n| Test plan has no structured TPP markers | Fall back to layer-based decomposition (G1-G7) with warning |\n| Escalation threshold exceeded (>15% tasks escalate) | Flag in output report for manual review |\n\n## Integration Notes\n\n| Skill | Relationship | Context |\n|-------|-------------|---------|\n| x-implement-story | called-by | Invoked during Phase 1C |\n| x-plan-tests | reads | Consumes test plan (Phase 1B output) when available |\n| x-implement-story Phase 2 | produces-for | Output consumed by group-based or TDD-based implementation |\n\n- Works with any layered architecture (hexagonal, clean, onion) — layer names derived from project rules\n- When test plan present: generates TDD tasks with RED\u002FGREEN\u002FREFACTOR structure\n- When test plan absent: generates layer-based tasks using G1-G7 catalog (backward compatible)\n- **Idempotency (RULE-002 — Artifact reuse)**: Checks `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftasks-story-XXXX-YYYY.md` existence and staleness before regenerating. Second invocation with unchanged story reuses existing breakdown.\n- **Template reference (RULE-007)**: Reads `.claude\u002Ftemplates\u002F_TEMPLATE-TASK-BREAKDOWN.md` for standardized output format\n- **Graceful fallback (RULE-012 — Graceful template fallback)**: Functions without template (pre-EPIC-0024 projects). Logs warning and uses inline format when template absent.\n","## Global Output Policy\n\n- **Language**: English ONLY.\n- **Tone**: Technical, Direct, and Concise.\n- **Efficiency**: Remove all conversational fillers and greetings to save tokens.\n\n# Skill: Task Decomposer (Library)\n\n## Purpose\n\nDecomposes an implementation plan into granular tasks. When a test plan exists (from `x-plan-tests`), derives tasks from test scenarios using TDD structure (RED\u002FGREEN\u002FREFACTOR) with a per-task `Parallel` flag. Falls back to the Layer Task Catalog (G1-G7) when no test plan is available, where tasks are additionally assigned to parallelism groups. Each task is assigned a model tier (Junior\u002FMid\u002FSenior) and context budget.\n\n## When Called\n\n| Caller Skill | Phase | Context |\n|-------------|-------|---------|\n| x-implement-story | Phase 1C | After the Architect produces the plan, BEFORE implementation |\n| (standalone) | N\u002FA | When breaking down a plan into implementable tasks |\n\n## Inputs\n\n| Input | Path | Required |\n|-------|------|----------|\n| Architect's plan | `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Fplan-story-XXXX-YYYY.md` | Yes |\n| Story requirements | Story file | Yes |\n| Test plan (from x-plan-tests) | `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftests-story-XXXX-YYYY.md` | No |\n\n## Procedure\n\n### Step 0 — Idempotency Pre-Check (RULE-002 — Artifact reuse)\n\nBefore any decomposition work, verify whether a valid task breakdown already exists:\n\n1. **Derive artifact path**: `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftasks-story-XXXX-YYYY.md` (extract epic ID XXXX and story sequence YYYY from the story ID)\n2. **Check existence**: Use Glob or Read to verify if the file exists\n3. **Staleness check** (if file exists):\n   - Compare modification times: `mtime(story file)` vs `mtime(tasks file)`\n   - **Fresh** (`mtime(story) \u003C= mtime(tasks)`): Log `\"Reusing existing task breakdown from {date}\"` and **RETURN the existing file without regeneration**. No subagent invocation needed.\n   - **Stale** (`mtime(story) > mtime(tasks)`): Log `\"Regenerating stale task breakdown for {story-id}\"` and proceed to STEP 0.5\n4. **File absent**: Log `\"Generating task breakdown for {story-id}\"` and proceed to STEP 0.5\n\n> **Rationale**: Task breakdowns are expensive to generate (2-5 min, significant token cost). When a session is resumed after interruption, the existing breakdown should be reused if the story has not changed. This saves tokens and ensures continuity.\n\n**Idempotency Summary:**\n\n| Aspect | Behavior |\n|--------|----------|\n| **Check** | Compare `mtime(story)` vs `mtime(tasks)` |\n| **Skip** | Reuse existing breakdown when `mtime(story) \u003C= mtime(tasks)` |\n| **Override** | Regenerate when story is newer than existing breakdown |\n\n### Step 0.5 — Read Architecture Context\n\nBefore decomposing, read the project's architecture and layer definitions:\n- `knowledge\u002Farchitecture\u002Farchitecture-principles.md` — layer structure, dependency direction, package organization\n- `knowledge\u002Flayer-templates.md` — complete layer catalog with package locations, code templates, and checklist per layer\n\nThese files define the available layers for YOUR project. The Layer Task Catalog below is derived from them.\n\n### Step 1 — Read Story Context and Template (RULE-007, RULE-012)\n\nRead these files:\n- `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Fplan-story-XXXX-YYYY.md` (Architect's plan)\n- Story requirements file\n\n**Template Reference (RULE-007):**\n\nRead template at `.claude\u002Ftemplates\u002F_TEMPLATE-TASK-BREAKDOWN.md` for required output format.\n\n- **Template found**: Use the template's sections as the mandatory output structure. The template defines: Header (Story ID, Date, Author), Summary, Dependency Graph, Tasks Table, and Escalation Notes.\n- **Template NOT found (RULE-012 fallback)**: Log `\"Template not found, using inline format\"` and use the inline format defined in STEP 2A (test-driven) or STEP 2B (layer-based) of this skill. Execution continues normally without interruption.\n\n> **Note**: The template contains `{{PLACEHOLDER}}` markers. These are NOT rendered by the engine — they are filled by the LLM at runtime based on the decomposition results.\n\n### Step 1.5 — Detect Decomposition Mode\n\nCheck if test plan exists at `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftests-story-XXXX-YYYY.md`:\n\n1. **File exists AND has structured TPP scenario markers** (scenario IDs like `UT-01:`, `AT-01:`, `IT-01:` at start of line under a dedicated scenarios section):\n   - Use **TEST-DRIVEN MODE** (proceed to STEP 2A)\n   - Derive tasks from test scenarios with RED\u002FGREEN\u002FREFACTOR structure\n\n2. **File exists but NO structured TPP markers** (may mention TPP\u002FUT\u002FAT in prose but lacks scenario ID lines):\n   - Use **LAYER-BASED MODE** (proceed to STEP 2B)\n   - Emit warning: \"Test plan found but lacks structured TPP markers. Falling back to layer-based decomposition (G1-G7).\"\n\n3. **File absent**:\n   - Use **LAYER-BASED MODE** (proceed to STEP 2B)\n   - Emit warning: \"No test plan found. Falling back to layer-based decomposition (G1-G7).\"\n\n### Step 2A — Test-Driven Decomposition (Primary Mode)\n\n> Used when a test plan with TPP markers is available at\n> `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftests-story-XXXX-YYYY.md`.\n\nFor each test scenario in the test plan (ordered by TPP level):\n\n1. **Map scenario to task**: One task per test scenario (UT\u002FIT\u002FAT)\n2. **Identify layer components**: Which layers does this scenario touch?\n3. **Determine dependencies**: Which tasks must complete before this one?\n4. **Assess parallelism**: Can this task run concurrently with others?\n5. **Assign tier**: Based on the highest-complexity layer touched\n\n#### TDD Task Structure\n\nEach generated task MUST contain:\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| Test Scenario | M | Reference to UT-N, IT-N, or AT-N from test plan |\n| TPP Level | M | 1-7 from TPP ordering |\n| RED | M | What the test asserts (expected behavior) |\n| GREEN | M | Minimum implementation to make test pass |\n| REFACTOR | O | Refactoring opportunities after green |\n| Layer Components | M | Which layers\u002Fclasses are touched |\n| Parallel | M | yes\u002Fno — can run concurrently with other tasks |\n| Depends On | M | List of prerequisite TASK-N references |\n| Tier | M | Junior\u002FMid\u002FSenior based on complexity |\n| Budget | M | S\u002FM\u002FL context budget |\n\n#### Parallelism Detection\n\nA task is parallelizable when ALL of:\n1. Its test scenario operates on different layers than concurrent tasks\n2. No shared state with concurrent tasks\n3. No dependency on output of concurrent tasks\n\n#### Ordering Rules\n\n1. Unit test tasks ordered by TPP level (degenerate first, complex last)\n2. Within same TPP level, inner layers before outer layers\n3. Acceptance test tasks ALWAYS come after ALL related unit test tasks\n4. Tasks with dependencies come after their prerequisites\n\n#### Task Type Classification\n\n| Scenario Type | Task Marker | Dependency Rule |\n|--------------|-------------|-----------------|\n| UT (Unit Test) | `[UT]` | Depends on earlier TPP-level tasks that create shared components |\n| AT (Acceptance Test) | `[AT]` | Depends on ALL related UT tasks |\n| IT (Integration Test) | `[IT]` | Depends on UT tasks for involved components |\n\n#### TDD Task Output Format\n\nWhen using test-driven mode, generate tasks in this format:\n\n```\n### TASK-N: [UT-X\u002FAT-X] scenario-name\n- **TPP Level:** N\n- **Type:** UT | AT | IT\n- **Tier:** Junior | Mid | Senior\n- **Budget:** S | M | L\n- **Parallel:** yes | no\n- **Depends On:** TASK-N, TASK-M (or \"none\")\n\n**RED:** [What the test asserts — expected behavior]\n\n**GREEN:** [Minimum implementation steps]\n- Layer: component to create\u002Fmodify\n- Layer: component to create\u002Fmodify\n\n**REFACTOR:** [Optional refactoring opportunities]\n\n**Layer Components:**\n- domain.model: EntityName\n- domain.port: PortName\n- adapter.outbound: RepositoryName\n```\n\nAfter generating all TDD tasks, proceed to STEP 5 (Generate Output).\n\n### Step 2B — Identify Affected Layers (Layer-Based Fallback)\n\n> Used when no test plan with TPP markers is available.\n\nFor each section in the Architect's plan, check which architectural layers are involved. Mark each layer as active or inactive.\n\n### Step 3B — Apply the Layer Task Catalog (Layer-Based Fallback)\n\n> Used when no test plan with TPP markers is available.\n\nFor each active layer, create ONE task using the fixed catalog below.\n\n### Step 4B — Variable Tier Decision (Layer-Based Fallback)\n\n> Used when no test plan with TPP markers is available.\n\nFor complex domain logic tasks, read the Architect's plan carefully:\n- **Simple mapping\u002Flookup** (1 decision, no state) -> Mid tier\n- **Multi-branch logic** (type hierarchies with 3+ implementations, resilience patterns) -> Senior tier\n\n### Step 5 — Generate Output\n\nSave to: `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftasks-story-XXXX-YYYY.md` (extract epic ID XXXX and story sequence YYYY from the story ID). Ensure directory exists: `mkdir -p ai\u002Fepics\u002Fepic-XXXX\u002Fplans`.\n\n**Output format selection:**\n- If the template was loaded in STEP 1, structure the output following the template's sections (Header, Summary, Dependency Graph, Tasks Table, Escalation Notes)\n- If the template was not found (fallback), use the inline TDD Task Output Format (STEP 2A) or Layer Task Catalog format (STEP 2B) as defined in this skill\n\n---\n\n## Fallback: Layer Task Catalog (G1-G7)\n\n> **When to use:** Only when no test plan with TPP markers exists at\n> `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftests-story-XXXX-YYYY.md`.\n> Prefer test-driven decomposition when test plan is available.\n\nDerive the task catalog from the **layer-templates knowledge pack** (`knowledge\u002Flayer-templates.md`). Each section in the knowledge pack corresponds to one task type. The table below shows the **generic structure** — adapt layer names and packages to match YOUR project's architecture rules (`knowledge\u002Farchitecture\u002Farchitecture-principles.md`).\n\n| Task Type                     | Architecture Layer      | Tier   | Budget | Group |\n| ----------------------------- | ----------------------- | ------ | ------ | ----- |\n| Database Migration            | migration               | Junior | S      | G1    |\n| Domain Models                 | domain model            | Junior | S      | G1    |\n| Ports (Inbound Interfaces)    | domain port inbound     | Junior | S      | G2    |\n| Ports (Outbound Interfaces)   | domain port outbound    | Junior | S      | G2    |\n| DTOs (Request\u002FResponse)       | inbound adapter dto     | Junior | S      | G2    |\n| Domain Engine\u002FRules (simple)  | domain engine           | Mid    | M      | G2    |\n| Domain Engine\u002FRules (complex) | domain engine           | Senior | L      | G2    |\n| Persistence Entity            | outbound adapter entity | Junior | S      | G3    |\n| Entity Mapper                 | outbound adapter mapper | Junior | S      | G3    |\n| DTO Mapper (Inbound)          | inbound adapter mapper  | Junior | S      | G3    |\n| Repository                    | outbound adapter repo   | Mid    | M      | G3    |\n| Use Case (Application)        | application             | Mid    | M      | G4    |\n| REST Resource\u002FController      | inbound adapter rest    | Mid    | M      | G5    |\n| Exception Mapper              | inbound adapter rest    | Mid    | M      | G5    |\n| Protocol Handler              | inbound adapter protocol| Senior | L      | G5    |\n| Configuration                 | config                  | Junior | S      | G5    |\n| Observability (Spans\u002FMetrics) | cross-cutting           | Mid    | M      | G6    |\n| Unit Tests                    | test                    | Follows tested layer | G7 |\n| Integration Tests             | test                    | Mid    | M      | G7    |\n| API Tests                     | test                    | Mid    | M      | G7    |\n| E2E Tests                     | test                    | Mid    | M      | G7    |\n\n> **Note:** The exact package names (e.g., `domain.model`, `adapter.outbound.entity`) are defined in `knowledge\u002Farchitecture\u002Farchitecture-principles.md`. Consult that file for your project's specific package structure.\n\n## Fallback: Layer Dependency Graph (G1-G7)\n\n> **When to use:** Only when no test plan with TPP markers exists at\n> `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftests-story-XXXX-YYYY.md`.\n> Prefer test-driven decomposition when test plan is available.\n\nThe dependency direction follows the architecture rule: `adapter.inbound → application → domain ← adapter.outbound`. Groups are derived from this dependency chain:\n\n```\nG1: FOUNDATION (Migration + Domain Models) — PARALLEL\nG2: CONTRACTS (Ports + DTOs + Engine) — PARALLEL, depends on G1\nG3: OUTBOUND ADAPTERS (Entity + Mapper + Repository) — PARALLEL, depends on G1, G2\nG4: ORCHESTRATION (Use Case) — SEQUENTIAL, depends on G2, G3\nG5: INBOUND ADAPTERS (Controllers + Protocol Handlers + Config) — PARALLEL, depends on G4\nG6: OBSERVABILITY — SEQUENTIAL, depends on G4, G5\nG7: TESTS — PARALLEL (max 4 concurrent), depends on ALL previous\n```\n\n> **Note:** Group contents may vary by project architecture. The principle is: **inner layers first, then outer layers**. Verify against `knowledge\u002Farchitecture\u002Farchitecture-principles.md` for your project.\n\n## Context Budget Sizes\n\n| Size | Range        | Includes                                              |\n| ---- | ------------ | ----------------------------------------------------- |\n| S    | 100-200 lines| Plan section + inline rules + 1 template              |\n| M    | 250-400 lines| Plan section + rules files + dependency outputs        |\n| L    | 500-800 lines| Story + plan + rules + dependency outputs + existing code |\n\n## Review Tier Assignment\n\nEach engineer's model tier = highest task tier in their review domain:\n\n| Engineer      | Relevant Task Types                    |\n| ------------- | -------------------------------------- |\n| Security      | Domain Engine, TCP Handler, Repository |\n| QA            | All test tasks                         |\n| Performance   | Domain Engine, TCP Handler, Repository |\n| Database      | Migration, Entity, Repository          |\n| Observability | Observability task                     |\n| DevOps        | Config task                            |\n| API           | DTOs, REST Resource                    |\n\n**Tech Lead** tier = story max task tier (highest across ALL tasks).\n\n## Escalation Rules\n\nWhen a task fails compilation after 2 retries at its assigned tier:\n- Junior -> Mid (escalate)\n- Mid -> Senior (escalate)\n- Senior -> Flag for manual intervention\n\nTarget: \u003C 15% of tasks escalate.\n\n## Error Handling\n\n| Scenario | Action |\n|----------|--------|\n| Architect's plan not found | Abort with message: \"Plan file not found at expected path. Run planning phase first.\" |\n| Story requirements file not found | Abort with message: \"Story file not found. Verify story ID and epic directory.\" |\n| Template `_TEMPLATE-TASK-BREAKDOWN.md` missing | Log warning, use inline format as fallback (RULE-012 — Graceful template fallback) |\n| Test plan has no structured TPP markers | Fall back to layer-based decomposition (G1-G7) with warning |\n| Escalation threshold exceeded (>15% tasks escalate) | Flag in output report for manual review |\n\n## Integration Notes\n\n| Skill | Relationship | Context |\n|-------|-------------|---------|\n| x-implement-story | called-by | Invoked during Phase 1C |\n| x-plan-tests | reads | Consumes test plan (Phase 1B output) when available |\n| x-implement-story Phase 2 | produces-for | Output consumed by group-based or TDD-based implementation |\n\n- Works with any layered architecture (hexagonal, clean, onion) — layer names derived from project rules\n- When test plan present: generates TDD tasks with RED\u002FGREEN\u002FREFACTOR structure\n- When test plan absent: generates layer-based tasks using G1-G7 catalog (backward compatible)\n- **Idempotency (RULE-002 — Artifact reuse)**: Checks `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftasks-story-XXXX-YYYY.md` existence and staleness before regenerating. Second invocation with unchanged story reuses existing breakdown.\n- **Template reference (RULE-007)**: Reads `.claude\u002Ftemplates\u002F_TEMPLATE-TASK-BREAKDOWN.md` for standardized output format\n- **Graceful fallback (RULE-012 — Graceful template fallback)**: Functions without template (pre-EPIC-0024 projects). Logs warning and uses inline format when template absent.\n",{"name":5,"description":7,"allowed-tools":24,"context-budget":25,"user-invocable":20,"requires-capabilities":26},"Read, Write, Grep, Glob","medium",[],"main","952a630c6f38d193a349d86fa18db1de8843e837","src\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring-elasticsearch\u002F.claude\u002Fskills\u002Flib\u002Fx-lib-decompose-task",1,"https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment","https:\u002F\u002Fgithub.com\u002Freview-bench","https:\u002F\u002Freview-bench.ai","An open benchmark for AI code review.","2026-10-27 06:56:37",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add review-bench\u002Federcnj_ia-dev-environment --skill x-lib-decompose-task",{"tool":42,"command":43},"bunx","bunx skills add review-bench\u002Federcnj_ia-dev-environment --skill x-lib-decompose-task",{"tool":45,"command":46},"pnpm","pnpm dlx skills add review-bench\u002Federcnj_ia-dev-environment --skill x-lib-decompose-task","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring-elasticsearch\u002F.claude\u002Fskills\u002Flib\u002Fx-lib-decompose-task\u002FSKILL.md",true,[50],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"README.md","REFERENCE","参考文档",2091,"https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring-elasticsearch\u002F.claude\u002Fskills\u002Flib\u002Fx-lib-decompose-task\u002FREADME.md",[57,64,71,78,85,92],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M757M8J48TQ1Y3X25GSJBXAS","x-parallel-eval","Detects and classifies file-collision risks between work units (tasks, stories, or epic phases) before parallel execution. Reads ## File Footprint blocks produced by x-task-plan \u002F x-story-plan, applies the parallelism-heuristics knowledge pack (hard \u002F regen \u002F soft categories + hotspot overrides), and emits a collision matrix + serialization recommendation in Markdown (default) or JSON.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fx-parallel-eval\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M757M57XMR9546S69466HDWT","parallelism-heuristics","Canonical catalog of file-collision heuristics for parallel task, story, and epic execution. Defines the File Footprint block format, the three Conflict Categories (hard \u002F regen \u002F soft), a hotspot list of high-contention paths, and the degrade-with-warning policy. Consumed by x-task-plan, x-story-plan, x-epic-map, x-parallel-eval, and x-dev-*-implement.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fparallelism-heuristics\u002FSKILL.md",[],[],{"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":19},"01M757M11SZ8P1VCQABT08QVYA","x-watch-pr-ci","Polls a PR's CI checks and Copilot review status, blocking until checks complete or timeout. Returns one of 8 stable exit codes (SUCCESS=0, CI_PENDING_PROCEED=10, CI_FAILED=20, TIMEOUT=30, PR_ALREADY_MERGED=40, NO_CI_CONFIGURED=50, PR_CLOSED=60, PR_NOT_FOUND=70). Writes a versioned state-file for session resume.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring\u002Fplatform-claude-code\u002F.claude\u002Fskills\u002Fx-watch-pr-ci\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M757KW53K8KFPGADFB4PH949","x-validate-docs","Documentation freshness gate: validates 6 dimensions (readme, api-specs, grpc-proto, adr, skill-docs, system-architecture) against code changes in a PR. Stack-aware — only validates targets declared\u002Fauto-detected from ProjectConfig.documentation.targets. Returns exit non-zero on staleness; produces structured report.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring\u002Fplatform-claude-code\u002F.claude\u002Fskills\u002Fx-validate-docs\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M757KQZHSA10MKC0CR571D60","x-update-system-architecture","Incrementally updates docs\u002Farchitecture\u002Fsystem.md after an epic completes. Appends new entries to the Decision Log (§11) using x-internal-write-report --append (dedup by ## ID: marker) and surgically inserts component\u002Fintegration changes into sections 1-10 via Edit. Idempotent: re-running with the same epic produces a byte-identical system.md.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring\u002Fplatform-claude-code\u002F.claude\u002Fskills\u002Fx-update-system-architecture\u002FSKILL.md",[],[],{"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":19},"01M757KKBT5Q1SVF8DMJBVF46M","x-update-architecture","Incrementally updates the service architecture document with changes from architecture plans. Adds new components, integrations, flows, and ADR references without rewriting existing content. Use after implementation to keep architecture documentation current.","https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring\u002Fplatform-claude-code\u002F.claude\u002Fskills\u002Fx-update-architecture\u002FSKILL.md",[],[]]