[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M756WTXSWC9ZTYMG7Z5MTMP1":3,"skill-same:01M756WTXSWC9ZTYMG7Z5MTMP1":61},{"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":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":35,"ownerDescription":36,"updatedAt":37,"install":38,"resources":50},"01M756WTXSWC9ZTYMG7Z5MTMP1","x-plan-task",null,"Generates a detailed per-task implementation plan (plan-task-TASK-XXXX-YYYY-NNN.md) with TDD cycles in TPP order, file impact analysis by architecture layer, security checklist by task type, and exit criteria. Two invocation modes: task-file-first (--task-file) consumes a standalone task-TASK-XXXX-YYYY-NNN.md contract (EPIC-0038); story-scoped (STORY-ID --task TASK-ID) reads the task from story Section 8 (legacy). Invocable standalone OR via x-plan-story (future).","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\u002F.claude\u002Fskills\u002Fx-plan-task\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: x-plan-task\ndescription: \"Generates a detailed per-task implementation plan (plan-task-TASK-XXXX-YYYY-NNN.md) with TDD cycles in TPP order, file impact analysis by architecture layer, security checklist by task type, and exit criteria. Two invocation modes: task-file-first (--task-file) consumes a standalone task-TASK-XXXX-YYYY-NNN.md contract (EPIC-0038); story-scoped (STORY-ID --task TASK-ID) reads the task from story Section 8 (legacy). Invocable standalone OR via x-plan-story (future).\"\nuser-invocable: true\nallowed-tools: Read, Write, Edit, Bash, Grep, Glob, Skill\nargument-hint: \"--task-file \u003Cpath> [--output-dir \u003Cdir>] [--no-commit] [--dry-run]  |  [STORY-ID] --task [TASK-ID] [--force] [--no-commit] [--dry-run]\"\ncontext-budget: heavy\nrequires-capabilities: []\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: Plan Task\n\n## Purpose\n\nProduces a detailed implementation plan for a single task extracted from a story's Section 8. The plan contains: objective, implementation guide with class\u002Fmethod\u002Fpattern, TDD cycles mapped in TPP order (degenerate -> constants -> conditionals -> iterations -> complex), affected files organized by architecture layer, security checklist adapted to the task type, dependencies, and definition of done. Each task plan is a self-contained execution guide that eliminates ad-hoc decisions during coding.\n\n## Triggers\n\n- `\u002Fx-plan-task --task-file \u003Cpath>` -- **task-file-first** (EPIC-0038): consume a standalone `task-TASK-XXXX-YYYY-NNN.md` contract, write the plan next to it.\n- `\u002Fx-plan-task --task-file \u003Cpath> --output-dir \u003Cdir>` -- override output directory.\n- `\u002Fx-plan-task --task-file \u003Cpath> --no-commit` -- **batch mode** (EPIC-0049 story-0049-0017): write the plan file but SKIP the individual planning-commit. Callers (e.g., `x-plan-story`) aggregate N plans and issue ONE batched commit.\n- `\u002Fx-plan-task STORY-ID --task TASK-ID` -- **story-scoped (legacy)**: read task from story Section 8.\n- `\u002Fx-plan-task STORY-ID --task TASK-ID --force` -- regenerate even if plan exists.\n- `\u002Fx-plan-task STORY-ID --task TASK-ID --no-commit` -- **batch mode (story-scoped)**: write plan but skip commit.\n\n> **Invocation modes.** Task-file-first is the canonical path post-EPIC-0038: an\n> orchestrator (human or `x-plan-story` in the future) generates `task-TASK-NNN.md`\n> files and pipes each one through this skill. Story-scoped mode is retained for\n> backward compatibility with epics 0025-0037 that still declare tasks as sub-sections\n> of the story file.\n\n## Parameters\n\n### Task-file-first mode (EPIC-0038)\n\n| Parameter | Required | Description |\n|-----------|----------|-------------|\n| `--task-file` | Yes | Path to a `task-TASK-XXXX-YYYY-NNN.md` file (schema: story-0038-0001). MUST pass `TaskFileParser` validation. |\n| `--output-dir` | No (default: same dir as `--task-file`) | Directory to write `plan-task-TASK-XXXX-YYYY-NNN.md`. |\n| `--force` | No | Regenerate plan even if a fresh one already exists. |\n| `--no-commit` | No (default: `false`) | When `true`, skip the Planning Status Propagation commit (Phase 5.4). Plan file is still written to disk and status is still flipped `Pendente -> Planejada`, but the commit step is deferred to the caller. Used by `x-plan-story` to batch-commit N plans in a single commit (EPIC-0049 story-0049-0017). |\n| `--dry-run` | No (default: `false`) | When `true`, plan file is written to disk but Steps P2 \u002F P4 \u002F P5 (branch-ensure \u002F planning-commit \u002F push) become no-ops (EPIC-0049 \u002F RULE-007). |\n\n### Story-scoped mode (legacy — epics 0025-0037)\n\n| Parameter | Required | Description |\n|-----------|----------|-------------|\n| `STORY-ID` | Yes | Story identifier (pattern: `story-XXXX-YYYY`). |\n| `--task` | Yes | Task identifier (pattern: `TASK-XXXX-YYYY-NNN`). Must exist in story Section 8. |\n| `--force` | No | Regenerate plan even if a fresh one already exists. |\n| `--no-commit` | No (default: `false`) | Same semantics as in task-file-first mode: write plan, skip commit; caller handles batched commit. |\n| `--dry-run` | No (default: `false`) | Same semantics as in task-file-first mode: Steps P2 \u002F P4 \u002F P5 become no-ops. |\n\n## Workflow\n\n```\n0. VALIDATE & PRE-CHECK  -> Parse arguments, resolve paths, staleness check\n1. EXTRACT CONTRACTS      -> Read task source (task-file OR story Section 8)\n2. MAP TDD CYCLES         -> Generate TDD cycles in TPP order\n3. ANALYZE FILES          -> Identify affected files by architecture layer\n3.5 COMPUTE FOOTPRINT     -> Emit structured File Footprint (write\u002Fread\u002Fregen)\n4. SECURITY CHECKLIST     -> Generate security items based on task type\n5. WRITE PLAN             -> Assemble and write plan-task-TASK-XXXX-YYYY-NNN.md\n```\n\n> **Phase 1 dispatch:** If `--task-file` is present, extract contracts from that file\n> via TaskFileParser semantics (story-0038-0001 schema). Otherwise, fall back to the\n> story-scoped reader that locates the task in `## 8. Tasks` of the story file.\n\n### Step P1 — Detect Worktree Context (EPIC-0049 \u002F RULE-001)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-plan-task Phase-P1-Worktree-Detect`\n\nInvoke `x-manage-worktrees` in detect-context mode to record whether the current checkout is already inside an epic worktree. Result is advisory only — `x-internal-ensure-epic-branch` (Step P2) makes the authoritative decision.\n\n    Skill(skill: \"x-manage-worktrees\", args: \"detect-context\")\n\nContinue on any detect-context failure (fail-open, RULE-006) — log a WARNING and proceed to Step P2.\n\nWhen `--no-commit` is set (orchestrator mode, e.g., called by `x-plan-story`), skip this step — the parent owns branch lifecycle.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-plan-task Phase-P1-Worktree-Detect ok`\n\n### Step P2 — Ensure `epic\u002F\u003CID>` Branch (EPIC-0049 \u002F RULE-001)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-plan-task Phase-P2-Epic-Branch-Ensure`\n\nResolve the effective epic ID from the task source:\n\n- **Task-file mode (`--task-file`):** extract `XXXX` from the task-file path (`ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftask-TASK-XXXX-YYYY-NNN.md`) or from the task's `**Task ID:**` header.\n- **Story-scoped mode:** extract `XXXX` from the `STORY-ID` argument (e.g., `story-0049-0001` → `0049`).\n\nInvoke `x-internal-ensure-epic-branch` so the canonical `epic\u002F\u003CID>` branch exists locally AND on origin (idempotent). The skill is a no-op when the current checkout is already on `epic\u002F\u003CID>` or a worktree rooted at that branch.\n\n    Skill(skill: \"x-internal-ensure-epic-branch\", args: \"--epic-id \u003CXXXX>\")\n\nOn failure (non-zero exit), abort with `EPIC_BRANCH_ENSURE_FAILED` — a clean audit trail cannot be produced without the canonical branch.\n\nWhen `--no-commit` or `--dry-run` is set, skip this step.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-plan-task Phase-P2-Epic-Branch-Ensure ok`\n\n### Phase 0 -- Validate and Pre-Check\n\n#### 0.1 Parse Arguments\n\nExtract from story ID and task ID:\n- Epic ID (XXXX) from `story-XXXX-YYYY`\n- Story sequence (YYYY) from `story-XXXX-YYYY`\n- Task number (NNN) from `TASK-XXXX-YYYY-NNN`\n\nValidation rules:\n- Story ID MUST match pattern `story-XXXX-YYYY` (4-digit groups)\n- Task ID MUST match pattern `TASK-XXXX-YYYY-NNN` (3-digit task number)\n- Epic ID from story MUST match epic ID in task ID\n- Story sequence from story MUST match story sequence in task ID\n\nIf validation fails, abort with descriptive error message.\n\n#### 0.2 Resolve Epic Directory\n\n1. Extract epic ID from story ID (`story-XXXX-YYYY` -> `epic-XXXX`)\n2. Resolve `EPIC_DIR` with a glob that supports both exact and suffix variants:\n   - Exact match: `ai\u002Fepics\u002Fepic-XXXX`\n   - Suffix variant: `ai\u002Fepics\u002Fepic-XXXX-*`\n3. If exactly one directory matches, use that as `EPIC_DIR`\n4. If both exist, prefer exact match `ai\u002Fepics\u002Fepic-XXXX`\n5. If no directory matches, abort: `\"Epic directory not found for epic-XXXX\"`\n\n#### 0.3 Resolve Paths\n\n| Path | Pattern | Example |\n|------|---------|---------|\n| Story file | `\u003CEPIC_DIR>\u002Fstory-XXXX-YYYY.md` | `ai\u002Fepics\u002Fepic-XXXX\u002Fstory-XXXX-YYYY.md` |\n| Plan output | `\u003CEPIC_DIR>\u002Fplans\u002Ftask-plan-XXXX-YYYY-NNN.md` | `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftask-plan-XXXX-YYYY-NNN.md` |\n| Output dir | `\u003CEPIC_DIR>\u002Fplans\u002F` | `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002F` |\n\n#### 0.4 Idempotency Check (Staleness)\n\nBefore generating, verify whether a valid plan already exists:\n\n1. If the plan file does NOT exist, proceed to Phase 1.\n2. If the plan file exists AND `--force` is set, log: `\"Regenerating task plan (--force)\"`. Proceed to Phase 1.\n3. If the plan file exists AND `--force` is NOT set:\n   - If `mtime(story file) \u003C= mtime(plan file)` -- plan is **fresh**. Log: `\"Task plan already exists and is up-to-date\"`. Return existing plan. Stop.\n   - If `mtime(story file) > mtime(plan file)` -- plan is **stale**. Log: `\"Regenerating stale task plan for TASK-XXXX-YYYY-NNN\"`. Proceed to Phase 1.\n\n### Phase 1 -- Extract Contracts\n\n> **RA9 guidance (EPIC-0056 \u002F planning-standards-kp):** Before reading contracts, read\n> `.claude\u002Fskills\u002Fplanning-standards-kp\u002FSKILL.md` to understand the RA9 9-section model.\n> When the task file uses the RA9 v2 format (sections 1-9), map its Section 2 (Packages)\n> and Section 8 (Decision Rationale — N\u002FA accepted for tasks) to the plan output.\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-plan-task Phase-1-Context-Gathering`\n\n#### 1A. Task-file-first branch (EPIC-0038 — `--task-file` present)\n\n1. Read the file at `\u003Ctask-file>`. Abort with exit code 1 if missing.\n2. Validate structure per story-0038-0001 schema (`ai\u002Fepics\u002Fepic-XXXX\u002Fschemas\u002Ftask-schema.md`):\n   - `**ID:** TASK-XXXX-YYYY-NNN` present and matches filename.\n   - `**Story:** story-XXXX-YYYY` present and well-formed.\n   - `**Status:**` in the allowed enum (`Pendente | Em Andamento | Concluída | Bloqueada | Falha`).\n   - `## 2. Contratos I\u002FO` with subsections `### 2.1 Inputs`, `### 2.2 Outputs`, `### 2.3 Testabilidade` — all three present.\n   - `### 2.3 Testabilidade` has exactly one checked declaration (INDEPENDENT \u002F REQUIRES_MOCK \u002F COALESCED).\n   - `## 3. Definition of Done` present with ≥ 6 items (warn otherwise).\n3. If validation fails, abort with exit code 1 and message `Task file invalid: {violations}`.\n4. If testability is absent, abort with exit code 3: `Testability not declared (RULE-TF-01)`.\n5. Project extracted fields into the internal TaskContract:\n   - **Objective**: body of `## 1. Objetivo`.\n   - **Inputs**: body of `### 2.1 Inputs`.\n   - **Outputs**: body of `### 2.2 Outputs` (drives File Impact analysis in Phase 3).\n   - **TestabilityKind**: the single checked option (drives Phase 2 cycle shape).\n   - **TestabilityReferences**: TASK-IDs cited (REQUIRES_MOCK \u002F COALESCED partners).\n   - **DependsOn**: TASK-IDs from the first column of `## 4. Dependências`.\n\n#### 1B. Story-scoped branch (legacy — no `--task-file`)\n\n1. Read the story file at the resolved path.\n2. Locate **Section 8** (heading `## 8.` or `## 8 `).\n3. Find the task heading matching the task ID: `### TASK-XXXX-YYYY-NNN:` (case-insensitive match on the ID portion).\n4. Extract the task definition including all fields:\n   - **Title**: from the heading text after the task ID\n   - **Layer**: Domain, Port, Adapter, Application, Config, Test, Doc\n   - **Test Type**: Unit, Integration, API, Contract, E2E, Smoke, Verification\n   - **Size**: S, M, L\n   - **Dependencies**: list of TASK IDs or `--`\n   - **Testability**: valid pattern from Section 8 table\n   - **Files**: list of affected file paths\n   - **Acceptance Criteria**: list of criteria\n5. If the task ID is NOT found in Section 8, abort: `\"Task TASK-XXXX-YYYY-NNN not found in story-XXXX-YYYY Section 8\"`\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-plan-task Phase-1-Context-Gathering ok`\n\n### Phase 2 -- Map TDD Cycles (TPP Order)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-plan-task Phase-2-Task-Breakdown`\n\nGenerate TDD cycles based on the task's layer, test type, and acceptance criteria. Cycles MUST follow strict **Transformation Priority Premise** order:\n\n#### TPP Cycle Order\n\n| Order | TPP Level | Transform | Description |\n|-------|-----------|-----------|-------------|\n| 1 | Degenerate | `{} -> nil` | Null\u002Fempty\u002Fzero inputs return default or error |\n| 2 | Constant | `nil -> constant` | Single hardcoded return value |\n| 3 | Scalar | `constant -> variable` | Parameterized return based on input |\n| 4 | Conditional | `unconditional -> conditional` | Single if\u002Felse branching |\n| 5 | Collection | `scalar -> collection` | Multiple items, iteration, map\u002Ffilter |\n| 6 | Complex | `collection -> complex` | Compound logic, nested conditions, state |\n\n#### Per-Cycle Structure\n\nEach TDD cycle MUST contain:\n\n```markdown\n#### Cycle N: [Description]\n\n- **TPP Level**: [degenerate|constant|scalar|conditional|collection|complex]\n- **Transform**: [TPP transformation applied]\n\n**RED** (Write Failing Test):\n- Test name: `[methodUnderTest]_[scenario]_[expectedBehavior]`\n- Assertion: [primary assertion description]\n- Run: `{{TEST_COMMAND}}`\n- Expected: FAIL (test fails with specific error)\n\n**GREEN** (Minimum Implementation):\n- Implementation: [minimum code to make test pass]\n- Run: `{{COMPILE_COMMAND}}` then `{{TEST_COMMAND}}`\n- Expected: PASS (all tests green)\n\n**REFACTOR** (Improve Design):\n- Opportunities: [extract method, rename, eliminate duplication, or \"None at this cycle\"]\n- Run: `{{TEST_COMMAND}}`\n- Expected: PASS (no behavior change)\n\n**Commit**: `feat(TASK-XXXX-YYYY-NNN): [description] [TDD:RED|GREEN|REFACTOR]`\n```\n\n#### Minimum Cycles\n\nEvery task plan MUST contain at least 3 TDD cycles. The first cycle MUST always be a degenerate case (TPP Level 1). For domain logic tasks, target 4-6 cycles. For simple config\u002Fdoc tasks, 3 cycles suffice.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-plan-task Phase-2-Task-Breakdown ok`\n\n### Phase 3 -- Analyze Affected Files by Layer\n\nOrganize all affected files by architecture layer following the {{ARCHITECTURE}} structure. For each file, indicate whether it is **new** (to be created) or **modified** (existing).\n\n#### Layer Order (Implementation Sequence)\n\nFiles MUST be listed in implementation order (inner layers first):\n\n| Order | Layer | Package Pattern | Description |\n|-------|-------|----------------|-------------|\n| 1 | Domain | `domain\u002Fmodel\u002F`, `domain\u002Fengine\u002F` | Entities, value objects, business logic |\n| 2 | Port | `domain\u002Fport\u002F` | Inbound and outbound interfaces |\n| 3 | Adapter (outbound) | `adapter\u002Foutbound\u002F` | DB repositories, external clients |\n| 4 | Adapter (inbound) | `adapter\u002Finbound\u002F` | REST controllers, CLI handlers, DTOs, mappers |\n| 5 | Application | `application\u002F` | Use cases, orchestration |\n| 6 | Config | `config\u002F` | Framework configuration |\n| 7 | Test | `test\u002F` | Test classes (mirrors production structure) |\n\n#### File Entry Format\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| Path | M | Relative file path |\n| Action | M | `CREATE` or `MODIFY` |\n| Layer | M | Architecture layer |\n| Purpose | M | Brief description of what this file does\u002Fchanges |\n\n### Phase 4 -- Generate Security Checklist\n\nGenerate a security checklist based on the task type. The checklist adapts to the nature of the task:\n\n#### Security Checklist by Task Type\n\n| Task Type | Security Items |\n|-----------|---------------|\n| Endpoint \u002F API | Input validation on all parameters; Output encoding (prevent XSS); Authentication check (endpoint protected); Authorization check (role\u002Fpermission); Rate limiting consideration; CORS policy adherence |\n| Persistence \u002F DB | Parameterized queries only (no SQL concatenation); Sensitive data encryption at rest; Column-level access control; Audit logging for data mutations; No PII in log statements |\n| Domain Logic | Business rule bypass prevention; State manipulation guards; Privilege escalation checks; Input boundary validation; Immutable value objects for sensitive data |\n| Config | No hardcoded secrets or credentials; Secure defaults (fail-closed); Environment variable externalization; No default credentials; Configuration validation on startup |\n| Integration | TLS validation (no trust-all); Certificate pinning where applicable; Timeout configuration (prevent hanging); Retry with backoff (prevent amplification); Circuit breaker for external calls |\n\nFor each applicable security item, generate a checklist entry with:\n- [ ] Item description\n- Severity: CRITICAL \u002F HIGH \u002F MEDIUM\n- Reference: CWE identifier or OWASP category where applicable\n\n### Phase 4.5 -- Compute File Footprint\n\nEmit a structured machine-readable footprint so downstream tooling (e.g., `\u002Fx-evaluate-parallelism`) can detect write-conflicts deterministically, without relying on prose parsing of \"Affected Files\".\n\n#### Inference Rules\n\nFor each path in the task's `Files:` list (Section 8 of the story):\n\n| Rule | Condition | Target sub-section |\n|------|-----------|--------------------|\n| R1 (default) | Any path declared on the task | `write:` |\n| R2 (golden regen — pom) | Path ends in `pom.xml` | Add `regen:` entry for corresponding artifacts |\n| R3 (golden regen — skill source) | Path matches `src\u002Fmain\u002Fresources\u002Ftargets\u002Fclaude\u002F**\u002FSKILL.md` | Add `regen:` entry in `.claude\u002Fskills\u002F**` at mirror path |\n| R4 (golden regen — targets tree) | Path under `src\u002Fmain\u002Fresources\u002Ftargets\u002Fclaude\u002F` (non-SKILL.md) | Add matching `regen:` entry in `.claude\u002F` or `src\u002Ftest\u002Fresources\u002Fgolden\u002F` |\n| R5 (reads) | Path listed in task's `Dependencies -> reads` section | `read:` |\n\nEmpty sub-sections MUST be omitted from the plan output. Paths within each sub-section MUST be sorted alphabetically for determinism (RULE-008).\n\n#### Output Layout\n\nInject a `## File Footprint` section into the plan document, immediately BEFORE `## Definition of Done`:\n\n```markdown\n## File Footprint\n\n### write:\n- path\u002Fto\u002FwriteA\n- path\u002Fto\u002FwriteB\n\n### read:\n- path\u002Fto\u002FreadA\n\n### regen:\n- path\u002Fto\u002FregenA\n```\n\n#### Knowledge Pack Reference\n\nThe inference rules above are the working contract documented in the `parallelism-heuristics` knowledge pack (`knowledge\u002Fparallelism-heuristics.md`). Read that KP when extending the rules (e.g., adding new regen patterns) to keep consumer tooling in sync.\n\n### Phase 5 -- Write Plan\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-plan-task Phase-3-Validation`\n\n#### 5.1 Ensure Output Directory\n\n```bash\nmkdir -p \u003CEPIC_DIR>\u002Fplans\u002F\n```\n\n#### 5.2 Assemble Plan Document\n\nWrite the plan to `\u003CEPIC_DIR>\u002Fplans\u002Fplan-task-TASK-XXXX-YYYY-NNN.md` with the following structure.\n\n**MANDATORY — Origin Marker (EPIC-0059):** Prepend the YAML frontmatter block before any Markdown content:\n\n```yaml\n---\ngenerated-by: x-plan-task@$(git rev-parse HEAD 2>\u002Fdev\u002Fnull || echo \"unknown\")\ngenerated-at: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nstory-id: story-XXXX-YYYY\n---\n```\n\nThis frontmatter is required by `audit-execution-integrity.sh` Phase-1 validation (EPIC-0059, Rule 24).\nArtifacts without this block fail the CI audit with `EIE_EVIDENCE_MISSING`.\n\n```markdown\n# Task Plan: TASK-XXXX-YYYY-NNN\n\n## Header\n\n| Field | Value |\n|-------|-------|\n| Task ID | TASK-XXXX-YYYY-NNN |\n| Story ID | story-XXXX-YYYY |\n| Epic ID | epic-XXXX |\n| Layer | [extracted from Section 8] |\n| Type | [extracted from Section 8: test type] |\n| TDD Cycles | [count of cycles] |\n| Estimated Effort | [S\u002FM\u002FL mapped to time] |\n| Generated | [ISO-8601 date] |\n\n## Objective\n\n[Description of what this task accomplishes, extracted from Section 8 title and acceptance criteria]\n\n## Implementation Guide\n\n### Target Class\u002FMethod\n\n[Specific class, method, and design pattern to implement, with examples in {{LANGUAGE}}]\n\n### Design Pattern\n\n[Pattern being applied: Strategy, Factory, Repository, etc.]\n\n### Implementation Steps (Layer Order)\n\n1. [Step 1 - innermost layer first]\n2. [Step 2]\n3. [Step N]\n\n## TDD Cycles\n\n[Generated cycles from Phase 2, in TPP order]\n\n## Affected Files\n\n| # | Path | Action | Layer | Purpose |\n|---|------|--------|-------|---------|\n| 1 | [path] | [CREATE\u002FMODIFY] | [layer] | [purpose] |\n\n## Security Checklist\n\n[Generated checklist from Phase 4, adapted to task type]\n\n## Dependencies\n\n| Depends On | Reason |\n|------------|--------|\n| [TASK ID or cross-story reference] | [Why this dependency exists] |\n\n## File Footprint\n\n[Generated block from Phase 4.5 — sub-sections `write:`, `read:`, `regen:` with alphabetically-sorted paths. Empty sub-sections omitted.]\n\n## Definition of Done\n\n- [ ] All TDD cycles completed (RED -> GREEN -> REFACTOR)\n- [ ] All tests passing: `{{TEST_COMMAND}}`\n- [ ] Code compiles cleanly: `{{COMPILE_COMMAND}}`\n- [ ] Security checklist items addressed\n- [ ] No TODO\u002FFIXME\u002FHACK comments in task scope\n- [ ] Acceptance criteria from Section 8 satisfied\n- [extracted DoD criteria from task definition]\n```\n\n#### 5.3 Report\n\nAfter writing, log: `\"Task plan generated: task-plan-XXXX-YYYY-NNN.md (N TDD cycles, M affected files)\"`.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-plan-task Phase-3-Validation ok`\n\n## Anti-Patterns\n\n- Do NOT write implementation code -- only plan the approach\n- Do NOT skip degenerate cases in TDD cycles (Cycle 1 is ALWAYS degenerate)\n- Do NOT generate security items unrelated to the task type\n- Do NOT list files outside the task scope\n- Do NOT include cycles beyond what the task complexity requires (CRUD tasks need 3-4 cycles, not 8)\n- Do NOT ignore the task's layer assignment -- files must align with the declared layer\n- Do NOT generate cycles in non-TPP order (never start with complex cases)\n\n## Error Handling\n\n### Task-file-first mode (EPIC-0038)\n\n| Scenario | Exit Code | Message |\n|----------|-----------|---------|\n| Task file missing or unreadable | 1 | `Task file invalid: file not found at {path}` |\n| Task file schema violations (story-0038-0001) | 1 | `Task file invalid: {violations}` |\n| Testability not declared (§2.3 empty \u002F multiple checked) | 3 | `Testability not declared (RULE-TF-01). Declare Testability: Independent OR Requires Mock OR Coalesced` |\n| Output dir not writable | 2 | `Output dir not writable: {path}` |\n| Plan generated | 0 | `Plan written to {path}` |\n| Plan exists and fresh (no `--force`) | 0 | `Task plan already exists and is up-to-date` |\n\n### Story-scoped mode (legacy)\n\n| Scenario | Action |\n|----------|--------|\n| No story ID provided | Prompt: `\"Usage: \u002Fx-plan-task [STORY-ID] --task [TASK-ID] [--force]\"` |\n| No task ID provided | Abort: `\"--task flag is required. Provide a TASK-XXXX-YYYY-NNN identifier.\"` |\n| Story file not found | Abort: `\"Story file not found at {path}\"` |\n| Section 8 not found | Abort: `\"Section 8 (Tasks) not found in story {story-id}\"` |\n| Task ID not in Section 8 | Abort: `\"Task {task-id} not found in story {story-id} Section 8\"` |\n| Plan exists and fresh | Return existing: `\"Task plan already exists and is up-to-date\"` |\n| Plan exists with --force | Regenerate: `\"Regenerating task plan (--force)\"` |\n| Epic directory not found | Abort: `\"Epic directory not found for epic-XXXX\"` |\n| `x-internal-ensure-epic-branch` fails (Step P2) | Abort with `EPIC_BRANCH_ENSURE_FAILED`; canonical branch is required for versioning |\n| `x-push-branch` fails (Step P5) | WARN only; local commit preserved; operator re-runs manually |\n| `--dry-run` set | Steps P2, P4 (Phase 5.4) and P5 become no-ops |\n| `--no-commit` set | Steps P2, P4 (Phase 5.4) and P5 become no-ops — orchestrator owns branch + commit lifecycle |\n\n## Integration Notes\n\n| Skill | Relationship | Context |\n|-------|-------------|---------|\n| `x-plan-story` | complementary | x-plan-story generates task breakdown; x-plan-task generates per-task execution plans |\n| `x-implement-story` | called-by | Phase 2 (PRE_PLANNED mode) reads task plans to drive implementation |\n| `x-implement-task` | consumed-by | Task plans serve as implementation guides for the developer |\n| `x-plan-tests` | complementary | x-plan-tests covers story-level tests; x-plan-task maps per-task TDD cycles |\n| `x-manage-worktrees` | calls (Step P1) | Detect-context (EPIC-0049 \u002F RULE-001) |\n| `x-internal-ensure-epic-branch` | calls (Step P2) | Ensure `epic\u002F\u003CID>` exists locally + origin (EPIC-0049 \u002F RULE-001) |\n| `x-commit-changes` | calls (Phase 5.4 \u002F Step P4) | Commit plan + status flip in standalone mode |\n| `x-push-branch` | calls (Step P5) | Push canonical epic branch to origin (optional) |\n\n## Knowledge Pack References\n\n| Pack | Files | Purpose |\n|------|-------|---------|\n| testing | `knowledge\u002Ftesting.md` | TDD patterns, TPP levels, test naming conventions |\n| architecture | `knowledge\u002Farchitecture.md` | Layer definitions, package structure, dependency rules |\n| security | `knowledge\u002Fsecurity\u002Findex.md` | OWASP Top 10, security checklist items |\n| parallelism-heuristics | `knowledge\u002Fparallelism-heuristics.md` | File Footprint semantics (write\u002Fread\u002Fregen sub-sections) consumed by Phase 4.5 |\n| coding-standards | `knowledge\u002Fcoding-standards.md` | {{LANGUAGE}} conventions, naming, SOLID principles |\n\n## Planning Status Propagation (Rule 22 \u002F EPIC-0046)\n\n> V2-gated: only runs when `SchemaVersionResolver.resolve(ai\u002Fepics\u002Fepic-XXXX\u002Fexecution-state.json) == V2`. v1 epics: skip silently (Rule 19).\n\nAfter writing `plan-task-TASK-XXXX-YYYY-NNN.md`, propagate the lifecycle status of the source task artifact (`task-TASK-XXXX-YYYY-NNN.md` in v2, or the Section 8 task entry in v1) from `Pendente` to `Planejada` in the SAME commit as the plan artefact.\n\n**Steps (end of Phase 3, BEFORE the final commit):**\n\n1. Detect v2 via SchemaVersionResolver on the epic's `execution-state.json`. If v1: skip this entire block.\n2. For the source task file `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftask-TASK-XXXX-YYYY-NNN.md`, read current status with the CLI:\n   ```bash\n   CURRENT=$(java -cp $CLAUDE_PROJECT_DIR\u002Fjava\u002Ftarget\u002Fclasses \\\n       dev.iadev.adapter.inbound.cli.StatusFieldParserCli \\\n       read ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftask-TASK-XXXX-YYYY-NNN.md)\n   ```\n3. If `CURRENT == \"Pendente\"`, write `Planejada` atomically:\n   ```bash\n   java -cp $CLAUDE_PROJECT_DIR\u002Fjava\u002Ftarget\u002Fclasses \\\n       dev.iadev.adapter.inbound.cli.StatusFieldParserCli \\\n       write ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftask-TASK-XXXX-YYYY-NNN.md Planejada\n   ```\n   If `CURRENT == \"Planejada\"`: idempotent re-run, skip the write.\n4. Stage both the source task file and the plan artefact:\n   ```bash\n   git add ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftask-TASK-XXXX-YYYY-NNN.md ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Fplan-task-TASK-XXXX-YYYY-NNN.md\n   ```\n5. **Commit gate (`--no-commit` aware):**\n   - If `--no-commit=false` (default): commit via `x-commit-changes` (Rule 13 Pattern 1 INLINE-SKILL):\n\n         Skill(skill: \"x-commit-changes\", args: \"docs(task-TASK-XXXX-YYYY-NNN): add plan + update status to Planejada\")\n\n   - If `--no-commit=true` (EPIC-0049 batch mode): **SKIP the commit step**. The plan file and status write remain on disk (staged) but no commit is produced. Log: `\"[no-commit] Plan written; commit deferred to caller\"`. Return response with `commitSha: null`.\n\n**Fail-loud:** non-zero CLI exit → abort skill with the same exit code (RULE-046-08).\n\n### `--no-commit` Contract (story-0049-0017)\n\n| Aspect | `--no-commit=false` (default) | `--no-commit=true` (batch) |\n|--------|-------------------------------|----------------------------|\n| Plan file written to disk | Yes | Yes |\n| Status flipped `Pendente -> Planejada` | Yes | Yes |\n| `git add` of plan + task file | Yes | Yes |\n| `x-commit-changes` invoked | Yes | **NO** (deferred to caller) |\n| Response `commitSha` | non-null SHA | `null` |\n| Re-invocation semantics | Idempotent (staleness check) | Idempotent; flipping the flag between runs alternates commit behavior |\n\n**Caller contract (e.g., `x-plan-story`):** when invoking N tasks with `--no-commit=true`, the caller MUST aggregate all written paths and issue ONE consolidated `x-commit-planning` call covering every plan + status update — producing a single commit per story instead of N commits.\n\n**Backward compat:** absence of `--no-commit` (or explicit `--no-commit=false`) preserves pre-EPIC-0049 behavior byte-for-byte.\n\n### Step P4 — Planning Status Commit (alias of Phase 5.4)\n\nThe planning-commit step for `x-plan-task` is performed by **Phase 5.4 — Planning Status Propagation** (above). When `--no-commit=true` or `--dry-run=true`, that step becomes a no-op (logged as `\"[no-commit] Plan written; commit deferred to caller\"` or `\"dry-run, skipping commit\"` respectively). No additional P4 invocation is issued; this alias exists solely so the P1-P5 convention is readable end-to-end in the skill body (EPIC-0049 \u002F RULE-007).\n\n### Step P5 — Push to Origin (optional, EPIC-0049)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-plan-task Phase-P5-Push`\n\nIf `--dry-run` or `--no-commit` is set, log `\"dry-run, skipping push\"` \u002F `\"orchestrated mode, skipping push\"` and skip.\n\nDelegate the push to `x-push-branch` so the canonical `epic\u002F\u003CID>` branch is synchronized with origin:\n\n    Skill(skill: \"x-push-branch\", args: \"--branch epic\u002F\u003CXXXX>\")\n\nOn push failure (remote rejection, no connectivity), log a WARNING and continue — the local commit is preserved; the operator can re-run Step P5 or `git push` manually. Do NOT abort.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-plan-task Phase-P5-Push ok`\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: Plan Task\n\n## Purpose\n\nProduces a detailed implementation plan for a single task extracted from a story's Section 8. The plan contains: objective, implementation guide with class\u002Fmethod\u002Fpattern, TDD cycles mapped in TPP order (degenerate -> constants -> conditionals -> iterations -> complex), affected files organized by architecture layer, security checklist adapted to the task type, dependencies, and definition of done. Each task plan is a self-contained execution guide that eliminates ad-hoc decisions during coding.\n\n## Triggers\n\n- `\u002Fx-plan-task --task-file \u003Cpath>` -- **task-file-first** (EPIC-0038): consume a standalone `task-TASK-XXXX-YYYY-NNN.md` contract, write the plan next to it.\n- `\u002Fx-plan-task --task-file \u003Cpath> --output-dir \u003Cdir>` -- override output directory.\n- `\u002Fx-plan-task --task-file \u003Cpath> --no-commit` -- **batch mode** (EPIC-0049 story-0049-0017): write the plan file but SKIP the individual planning-commit. Callers (e.g., `x-plan-story`) aggregate N plans and issue ONE batched commit.\n- `\u002Fx-plan-task STORY-ID --task TASK-ID` -- **story-scoped (legacy)**: read task from story Section 8.\n- `\u002Fx-plan-task STORY-ID --task TASK-ID --force` -- regenerate even if plan exists.\n- `\u002Fx-plan-task STORY-ID --task TASK-ID --no-commit` -- **batch mode (story-scoped)**: write plan but skip commit.\n\n> **Invocation modes.** Task-file-first is the canonical path post-EPIC-0038: an\n> orchestrator (human or `x-plan-story` in the future) generates `task-TASK-NNN.md`\n> files and pipes each one through this skill. Story-scoped mode is retained for\n> backward compatibility with epics 0025-0037 that still declare tasks as sub-sections\n> of the story file.\n\n## Parameters\n\n### Task-file-first mode (EPIC-0038)\n\n| Parameter | Required | Description |\n|-----------|----------|-------------|\n| `--task-file` | Yes | Path to a `task-TASK-XXXX-YYYY-NNN.md` file (schema: story-0038-0001). MUST pass `TaskFileParser` validation. |\n| `--output-dir` | No (default: same dir as `--task-file`) | Directory to write `plan-task-TASK-XXXX-YYYY-NNN.md`. |\n| `--force` | No | Regenerate plan even if a fresh one already exists. |\n| `--no-commit` | No (default: `false`) | When `true`, skip the Planning Status Propagation commit (Phase 5.4). Plan file is still written to disk and status is still flipped `Pendente -> Planejada`, but the commit step is deferred to the caller. Used by `x-plan-story` to batch-commit N plans in a single commit (EPIC-0049 story-0049-0017). |\n| `--dry-run` | No (default: `false`) | When `true`, plan file is written to disk but Steps P2 \u002F P4 \u002F P5 (branch-ensure \u002F planning-commit \u002F push) become no-ops (EPIC-0049 \u002F RULE-007). |\n\n### Story-scoped mode (legacy — epics 0025-0037)\n\n| Parameter | Required | Description |\n|-----------|----------|-------------|\n| `STORY-ID` | Yes | Story identifier (pattern: `story-XXXX-YYYY`). |\n| `--task` | Yes | Task identifier (pattern: `TASK-XXXX-YYYY-NNN`). Must exist in story Section 8. |\n| `--force` | No | Regenerate plan even if a fresh one already exists. |\n| `--no-commit` | No (default: `false`) | Same semantics as in task-file-first mode: write plan, skip commit; caller handles batched commit. |\n| `--dry-run` | No (default: `false`) | Same semantics as in task-file-first mode: Steps P2 \u002F P4 \u002F P5 become no-ops. |\n\n## Workflow\n\n```\n0. VALIDATE & PRE-CHECK  -> Parse arguments, resolve paths, staleness check\n1. EXTRACT CONTRACTS      -> Read task source (task-file OR story Section 8)\n2. MAP TDD CYCLES         -> Generate TDD cycles in TPP order\n3. ANALYZE FILES          -> Identify affected files by architecture layer\n3.5 COMPUTE FOOTPRINT     -> Emit structured File Footprint (write\u002Fread\u002Fregen)\n4. SECURITY CHECKLIST     -> Generate security items based on task type\n5. WRITE PLAN             -> Assemble and write plan-task-TASK-XXXX-YYYY-NNN.md\n```\n\n> **Phase 1 dispatch:** If `--task-file` is present, extract contracts from that file\n> via TaskFileParser semantics (story-0038-0001 schema). Otherwise, fall back to the\n> story-scoped reader that locates the task in `## 8. Tasks` of the story file.\n\n### Step P1 — Detect Worktree Context (EPIC-0049 \u002F RULE-001)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-plan-task Phase-P1-Worktree-Detect`\n\nInvoke `x-manage-worktrees` in detect-context mode to record whether the current checkout is already inside an epic worktree. Result is advisory only — `x-internal-ensure-epic-branch` (Step P2) makes the authoritative decision.\n\n    Skill(skill: \"x-manage-worktrees\", args: \"detect-context\")\n\nContinue on any detect-context failure (fail-open, RULE-006) — log a WARNING and proceed to Step P2.\n\nWhen `--no-commit` is set (orchestrator mode, e.g., called by `x-plan-story`), skip this step — the parent owns branch lifecycle.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-plan-task Phase-P1-Worktree-Detect ok`\n\n### Step P2 — Ensure `epic\u002F\u003CID>` Branch (EPIC-0049 \u002F RULE-001)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-plan-task Phase-P2-Epic-Branch-Ensure`\n\nResolve the effective epic ID from the task source:\n\n- **Task-file mode (`--task-file`):** extract `XXXX` from the task-file path (`ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftask-TASK-XXXX-YYYY-NNN.md`) or from the task's `**Task ID:**` header.\n- **Story-scoped mode:** extract `XXXX` from the `STORY-ID` argument (e.g., `story-0049-0001` → `0049`).\n\nInvoke `x-internal-ensure-epic-branch` so the canonical `epic\u002F\u003CID>` branch exists locally AND on origin (idempotent). The skill is a no-op when the current checkout is already on `epic\u002F\u003CID>` or a worktree rooted at that branch.\n\n    Skill(skill: \"x-internal-ensure-epic-branch\", args: \"--epic-id \u003CXXXX>\")\n\nOn failure (non-zero exit), abort with `EPIC_BRANCH_ENSURE_FAILED` — a clean audit trail cannot be produced without the canonical branch.\n\nWhen `--no-commit` or `--dry-run` is set, skip this step.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-plan-task Phase-P2-Epic-Branch-Ensure ok`\n\n### Phase 0 -- Validate and Pre-Check\n\n#### 0.1 Parse Arguments\n\nExtract from story ID and task ID:\n- Epic ID (XXXX) from `story-XXXX-YYYY`\n- Story sequence (YYYY) from `story-XXXX-YYYY`\n- Task number (NNN) from `TASK-XXXX-YYYY-NNN`\n\nValidation rules:\n- Story ID MUST match pattern `story-XXXX-YYYY` (4-digit groups)\n- Task ID MUST match pattern `TASK-XXXX-YYYY-NNN` (3-digit task number)\n- Epic ID from story MUST match epic ID in task ID\n- Story sequence from story MUST match story sequence in task ID\n\nIf validation fails, abort with descriptive error message.\n\n#### 0.2 Resolve Epic Directory\n\n1. Extract epic ID from story ID (`story-XXXX-YYYY` -> `epic-XXXX`)\n2. Resolve `EPIC_DIR` with a glob that supports both exact and suffix variants:\n   - Exact match: `ai\u002Fepics\u002Fepic-XXXX`\n   - Suffix variant: `ai\u002Fepics\u002Fepic-XXXX-*`\n3. If exactly one directory matches, use that as `EPIC_DIR`\n4. If both exist, prefer exact match `ai\u002Fepics\u002Fepic-XXXX`\n5. If no directory matches, abort: `\"Epic directory not found for epic-XXXX\"`\n\n#### 0.3 Resolve Paths\n\n| Path | Pattern | Example |\n|------|---------|---------|\n| Story file | `\u003CEPIC_DIR>\u002Fstory-XXXX-YYYY.md` | `ai\u002Fepics\u002Fepic-XXXX\u002Fstory-XXXX-YYYY.md` |\n| Plan output | `\u003CEPIC_DIR>\u002Fplans\u002Ftask-plan-XXXX-YYYY-NNN.md` | `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftask-plan-XXXX-YYYY-NNN.md` |\n| Output dir | `\u003CEPIC_DIR>\u002Fplans\u002F` | `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002F` |\n\n#### 0.4 Idempotency Check (Staleness)\n\nBefore generating, verify whether a valid plan already exists:\n\n1. If the plan file does NOT exist, proceed to Phase 1.\n2. If the plan file exists AND `--force` is set, log: `\"Regenerating task plan (--force)\"`. Proceed to Phase 1.\n3. If the plan file exists AND `--force` is NOT set:\n   - If `mtime(story file) \u003C= mtime(plan file)` -- plan is **fresh**. Log: `\"Task plan already exists and is up-to-date\"`. Return existing plan. Stop.\n   - If `mtime(story file) > mtime(plan file)` -- plan is **stale**. Log: `\"Regenerating stale task plan for TASK-XXXX-YYYY-NNN\"`. Proceed to Phase 1.\n\n### Phase 1 -- Extract Contracts\n\n> **RA9 guidance (EPIC-0056 \u002F planning-standards-kp):** Before reading contracts, read\n> `.claude\u002Fskills\u002Fplanning-standards-kp\u002FSKILL.md` to understand the RA9 9-section model.\n> When the task file uses the RA9 v2 format (sections 1-9), map its Section 2 (Packages)\n> and Section 8 (Decision Rationale — N\u002FA accepted for tasks) to the plan output.\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-plan-task Phase-1-Context-Gathering`\n\n#### 1A. Task-file-first branch (EPIC-0038 — `--task-file` present)\n\n1. Read the file at `\u003Ctask-file>`. Abort with exit code 1 if missing.\n2. Validate structure per story-0038-0001 schema (`ai\u002Fepics\u002Fepic-XXXX\u002Fschemas\u002Ftask-schema.md`):\n   - `**ID:** TASK-XXXX-YYYY-NNN` present and matches filename.\n   - `**Story:** story-XXXX-YYYY` present and well-formed.\n   - `**Status:**` in the allowed enum (`Pendente | Em Andamento | Concluída | Bloqueada | Falha`).\n   - `## 2. Contratos I\u002FO` with subsections `### 2.1 Inputs`, `### 2.2 Outputs`, `### 2.3 Testabilidade` — all three present.\n   - `### 2.3 Testabilidade` has exactly one checked declaration (INDEPENDENT \u002F REQUIRES_MOCK \u002F COALESCED).\n   - `## 3. Definition of Done` present with ≥ 6 items (warn otherwise).\n3. If validation fails, abort with exit code 1 and message `Task file invalid: {violations}`.\n4. If testability is absent, abort with exit code 3: `Testability not declared (RULE-TF-01)`.\n5. Project extracted fields into the internal TaskContract:\n   - **Objective**: body of `## 1. Objetivo`.\n   - **Inputs**: body of `### 2.1 Inputs`.\n   - **Outputs**: body of `### 2.2 Outputs` (drives File Impact analysis in Phase 3).\n   - **TestabilityKind**: the single checked option (drives Phase 2 cycle shape).\n   - **TestabilityReferences**: TASK-IDs cited (REQUIRES_MOCK \u002F COALESCED partners).\n   - **DependsOn**: TASK-IDs from the first column of `## 4. Dependências`.\n\n#### 1B. Story-scoped branch (legacy — no `--task-file`)\n\n1. Read the story file at the resolved path.\n2. Locate **Section 8** (heading `## 8.` or `## 8 `).\n3. Find the task heading matching the task ID: `### TASK-XXXX-YYYY-NNN:` (case-insensitive match on the ID portion).\n4. Extract the task definition including all fields:\n   - **Title**: from the heading text after the task ID\n   - **Layer**: Domain, Port, Adapter, Application, Config, Test, Doc\n   - **Test Type**: Unit, Integration, API, Contract, E2E, Smoke, Verification\n   - **Size**: S, M, L\n   - **Dependencies**: list of TASK IDs or `--`\n   - **Testability**: valid pattern from Section 8 table\n   - **Files**: list of affected file paths\n   - **Acceptance Criteria**: list of criteria\n5. If the task ID is NOT found in Section 8, abort: `\"Task TASK-XXXX-YYYY-NNN not found in story-XXXX-YYYY Section 8\"`\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-plan-task Phase-1-Context-Gathering ok`\n\n### Phase 2 -- Map TDD Cycles (TPP Order)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-plan-task Phase-2-Task-Breakdown`\n\nGenerate TDD cycles based on the task's layer, test type, and acceptance criteria. Cycles MUST follow strict **Transformation Priority Premise** order:\n\n#### TPP Cycle Order\n\n| Order | TPP Level | Transform | Description |\n|-------|-----------|-----------|-------------|\n| 1 | Degenerate | `{} -> nil` | Null\u002Fempty\u002Fzero inputs return default or error |\n| 2 | Constant | `nil -> constant` | Single hardcoded return value |\n| 3 | Scalar | `constant -> variable` | Parameterized return based on input |\n| 4 | Conditional | `unconditional -> conditional` | Single if\u002Felse branching |\n| 5 | Collection | `scalar -> collection` | Multiple items, iteration, map\u002Ffilter |\n| 6 | Complex | `collection -> complex` | Compound logic, nested conditions, state |\n\n#### Per-Cycle Structure\n\nEach TDD cycle MUST contain:\n\n```markdown\n#### Cycle N: [Description]\n\n- **TPP Level**: [degenerate|constant|scalar|conditional|collection|complex]\n- **Transform**: [TPP transformation applied]\n\n**RED** (Write Failing Test):\n- Test name: `[methodUnderTest]_[scenario]_[expectedBehavior]`\n- Assertion: [primary assertion description]\n- Run: `{{TEST_COMMAND}}`\n- Expected: FAIL (test fails with specific error)\n\n**GREEN** (Minimum Implementation):\n- Implementation: [minimum code to make test pass]\n- Run: `{{COMPILE_COMMAND}}` then `{{TEST_COMMAND}}`\n- Expected: PASS (all tests green)\n\n**REFACTOR** (Improve Design):\n- Opportunities: [extract method, rename, eliminate duplication, or \"None at this cycle\"]\n- Run: `{{TEST_COMMAND}}`\n- Expected: PASS (no behavior change)\n\n**Commit**: `feat(TASK-XXXX-YYYY-NNN): [description] [TDD:RED|GREEN|REFACTOR]`\n```\n\n#### Minimum Cycles\n\nEvery task plan MUST contain at least 3 TDD cycles. The first cycle MUST always be a degenerate case (TPP Level 1). For domain logic tasks, target 4-6 cycles. For simple config\u002Fdoc tasks, 3 cycles suffice.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-plan-task Phase-2-Task-Breakdown ok`\n\n### Phase 3 -- Analyze Affected Files by Layer\n\nOrganize all affected files by architecture layer following the {{ARCHITECTURE}} structure. For each file, indicate whether it is **new** (to be created) or **modified** (existing).\n\n#### Layer Order (Implementation Sequence)\n\nFiles MUST be listed in implementation order (inner layers first):\n\n| Order | Layer | Package Pattern | Description |\n|-------|-------|----------------|-------------|\n| 1 | Domain | `domain\u002Fmodel\u002F`, `domain\u002Fengine\u002F` | Entities, value objects, business logic |\n| 2 | Port | `domain\u002Fport\u002F` | Inbound and outbound interfaces |\n| 3 | Adapter (outbound) | `adapter\u002Foutbound\u002F` | DB repositories, external clients |\n| 4 | Adapter (inbound) | `adapter\u002Finbound\u002F` | REST controllers, CLI handlers, DTOs, mappers |\n| 5 | Application | `application\u002F` | Use cases, orchestration |\n| 6 | Config | `config\u002F` | Framework configuration |\n| 7 | Test | `test\u002F` | Test classes (mirrors production structure) |\n\n#### File Entry Format\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| Path | M | Relative file path |\n| Action | M | `CREATE` or `MODIFY` |\n| Layer | M | Architecture layer |\n| Purpose | M | Brief description of what this file does\u002Fchanges |\n\n### Phase 4 -- Generate Security Checklist\n\nGenerate a security checklist based on the task type. The checklist adapts to the nature of the task:\n\n#### Security Checklist by Task Type\n\n| Task Type | Security Items |\n|-----------|---------------|\n| Endpoint \u002F API | Input validation on all parameters; Output encoding (prevent XSS); Authentication check (endpoint protected); Authorization check (role\u002Fpermission); Rate limiting consideration; CORS policy adherence |\n| Persistence \u002F DB | Parameterized queries only (no SQL concatenation); Sensitive data encryption at rest; Column-level access control; Audit logging for data mutations; No PII in log statements |\n| Domain Logic | Business rule bypass prevention; State manipulation guards; Privilege escalation checks; Input boundary validation; Immutable value objects for sensitive data |\n| Config | No hardcoded secrets or credentials; Secure defaults (fail-closed); Environment variable externalization; No default credentials; Configuration validation on startup |\n| Integration | TLS validation (no trust-all); Certificate pinning where applicable; Timeout configuration (prevent hanging); Retry with backoff (prevent amplification); Circuit breaker for external calls |\n\nFor each applicable security item, generate a checklist entry with:\n- [ ] Item description\n- Severity: CRITICAL \u002F HIGH \u002F MEDIUM\n- Reference: CWE identifier or OWASP category where applicable\n\n### Phase 4.5 -- Compute File Footprint\n\nEmit a structured machine-readable footprint so downstream tooling (e.g., `\u002Fx-evaluate-parallelism`) can detect write-conflicts deterministically, without relying on prose parsing of \"Affected Files\".\n\n#### Inference Rules\n\nFor each path in the task's `Files:` list (Section 8 of the story):\n\n| Rule | Condition | Target sub-section |\n|------|-----------|--------------------|\n| R1 (default) | Any path declared on the task | `write:` |\n| R2 (golden regen — pom) | Path ends in `pom.xml` | Add `regen:` entry for corresponding artifacts |\n| R3 (golden regen — skill source) | Path matches `src\u002Fmain\u002Fresources\u002Ftargets\u002Fclaude\u002F**\u002FSKILL.md` | Add `regen:` entry in `.claude\u002Fskills\u002F**` at mirror path |\n| R4 (golden regen — targets tree) | Path under `src\u002Fmain\u002Fresources\u002Ftargets\u002Fclaude\u002F` (non-SKILL.md) | Add matching `regen:` entry in `.claude\u002F` or `src\u002Ftest\u002Fresources\u002Fgolden\u002F` |\n| R5 (reads) | Path listed in task's `Dependencies -> reads` section | `read:` |\n\nEmpty sub-sections MUST be omitted from the plan output. Paths within each sub-section MUST be sorted alphabetically for determinism (RULE-008).\n\n#### Output Layout\n\nInject a `## File Footprint` section into the plan document, immediately BEFORE `## Definition of Done`:\n\n```markdown\n## File Footprint\n\n### write:\n- path\u002Fto\u002FwriteA\n- path\u002Fto\u002FwriteB\n\n### read:\n- path\u002Fto\u002FreadA\n\n### regen:\n- path\u002Fto\u002FregenA\n```\n\n#### Knowledge Pack Reference\n\nThe inference rules above are the working contract documented in the `parallelism-heuristics` knowledge pack (`knowledge\u002Fparallelism-heuristics.md`). Read that KP when extending the rules (e.g., adding new regen patterns) to keep consumer tooling in sync.\n\n### Phase 5 -- Write Plan\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-plan-task Phase-3-Validation`\n\n#### 5.1 Ensure Output Directory\n\n```bash\nmkdir -p \u003CEPIC_DIR>\u002Fplans\u002F\n```\n\n#### 5.2 Assemble Plan Document\n\nWrite the plan to `\u003CEPIC_DIR>\u002Fplans\u002Fplan-task-TASK-XXXX-YYYY-NNN.md` with the following structure.\n\n**MANDATORY — Origin Marker (EPIC-0059):** Prepend the YAML frontmatter block before any Markdown content:\n\n```yaml\n---\ngenerated-by: x-plan-task@$(git rev-parse HEAD 2>\u002Fdev\u002Fnull || echo \"unknown\")\ngenerated-at: $(date -u +%Y-%m-%dT%H:%M:%SZ)\nstory-id: story-XXXX-YYYY\n---\n```\n\nThis frontmatter is required by `audit-execution-integrity.sh` Phase-1 validation (EPIC-0059, Rule 24).\nArtifacts without this block fail the CI audit with `EIE_EVIDENCE_MISSING`.\n\n```markdown\n# Task Plan: TASK-XXXX-YYYY-NNN\n\n## Header\n\n| Field | Value |\n|-------|-------|\n| Task ID | TASK-XXXX-YYYY-NNN |\n| Story ID | story-XXXX-YYYY |\n| Epic ID | epic-XXXX |\n| Layer | [extracted from Section 8] |\n| Type | [extracted from Section 8: test type] |\n| TDD Cycles | [count of cycles] |\n| Estimated Effort | [S\u002FM\u002FL mapped to time] |\n| Generated | [ISO-8601 date] |\n\n## Objective\n\n[Description of what this task accomplishes, extracted from Section 8 title and acceptance criteria]\n\n## Implementation Guide\n\n### Target Class\u002FMethod\n\n[Specific class, method, and design pattern to implement, with examples in {{LANGUAGE}}]\n\n### Design Pattern\n\n[Pattern being applied: Strategy, Factory, Repository, etc.]\n\n### Implementation Steps (Layer Order)\n\n1. [Step 1 - innermost layer first]\n2. [Step 2]\n3. [Step N]\n\n## TDD Cycles\n\n[Generated cycles from Phase 2, in TPP order]\n\n## Affected Files\n\n| # | Path | Action | Layer | Purpose |\n|---|------|--------|-------|---------|\n| 1 | [path] | [CREATE\u002FMODIFY] | [layer] | [purpose] |\n\n## Security Checklist\n\n[Generated checklist from Phase 4, adapted to task type]\n\n## Dependencies\n\n| Depends On | Reason |\n|------------|--------|\n| [TASK ID or cross-story reference] | [Why this dependency exists] |\n\n## File Footprint\n\n[Generated block from Phase 4.5 — sub-sections `write:`, `read:`, `regen:` with alphabetically-sorted paths. Empty sub-sections omitted.]\n\n## Definition of Done\n\n- [ ] All TDD cycles completed (RED -> GREEN -> REFACTOR)\n- [ ] All tests passing: `{{TEST_COMMAND}}`\n- [ ] Code compiles cleanly: `{{COMPILE_COMMAND}}`\n- [ ] Security checklist items addressed\n- [ ] No TODO\u002FFIXME\u002FHACK comments in task scope\n- [ ] Acceptance criteria from Section 8 satisfied\n- [extracted DoD criteria from task definition]\n```\n\n#### 5.3 Report\n\nAfter writing, log: `\"Task plan generated: task-plan-XXXX-YYYY-NNN.md (N TDD cycles, M affected files)\"`.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-plan-task Phase-3-Validation ok`\n\n## Anti-Patterns\n\n- Do NOT write implementation code -- only plan the approach\n- Do NOT skip degenerate cases in TDD cycles (Cycle 1 is ALWAYS degenerate)\n- Do NOT generate security items unrelated to the task type\n- Do NOT list files outside the task scope\n- Do NOT include cycles beyond what the task complexity requires (CRUD tasks need 3-4 cycles, not 8)\n- Do NOT ignore the task's layer assignment -- files must align with the declared layer\n- Do NOT generate cycles in non-TPP order (never start with complex cases)\n\n## Error Handling\n\n### Task-file-first mode (EPIC-0038)\n\n| Scenario | Exit Code | Message |\n|----------|-----------|---------|\n| Task file missing or unreadable | 1 | `Task file invalid: file not found at {path}` |\n| Task file schema violations (story-0038-0001) | 1 | `Task file invalid: {violations}` |\n| Testability not declared (§2.3 empty \u002F multiple checked) | 3 | `Testability not declared (RULE-TF-01). Declare Testability: Independent OR Requires Mock OR Coalesced` |\n| Output dir not writable | 2 | `Output dir not writable: {path}` |\n| Plan generated | 0 | `Plan written to {path}` |\n| Plan exists and fresh (no `--force`) | 0 | `Task plan already exists and is up-to-date` |\n\n### Story-scoped mode (legacy)\n\n| Scenario | Action |\n|----------|--------|\n| No story ID provided | Prompt: `\"Usage: \u002Fx-plan-task [STORY-ID] --task [TASK-ID] [--force]\"` |\n| No task ID provided | Abort: `\"--task flag is required. Provide a TASK-XXXX-YYYY-NNN identifier.\"` |\n| Story file not found | Abort: `\"Story file not found at {path}\"` |\n| Section 8 not found | Abort: `\"Section 8 (Tasks) not found in story {story-id}\"` |\n| Task ID not in Section 8 | Abort: `\"Task {task-id} not found in story {story-id} Section 8\"` |\n| Plan exists and fresh | Return existing: `\"Task plan already exists and is up-to-date\"` |\n| Plan exists with --force | Regenerate: `\"Regenerating task plan (--force)\"` |\n| Epic directory not found | Abort: `\"Epic directory not found for epic-XXXX\"` |\n| `x-internal-ensure-epic-branch` fails (Step P2) | Abort with `EPIC_BRANCH_ENSURE_FAILED`; canonical branch is required for versioning |\n| `x-push-branch` fails (Step P5) | WARN only; local commit preserved; operator re-runs manually |\n| `--dry-run` set | Steps P2, P4 (Phase 5.4) and P5 become no-ops |\n| `--no-commit` set | Steps P2, P4 (Phase 5.4) and P5 become no-ops — orchestrator owns branch + commit lifecycle |\n\n## Integration Notes\n\n| Skill | Relationship | Context |\n|-------|-------------|---------|\n| `x-plan-story` | complementary | x-plan-story generates task breakdown; x-plan-task generates per-task execution plans |\n| `x-implement-story` | called-by | Phase 2 (PRE_PLANNED mode) reads task plans to drive implementation |\n| `x-implement-task` | consumed-by | Task plans serve as implementation guides for the developer |\n| `x-plan-tests` | complementary | x-plan-tests covers story-level tests; x-plan-task maps per-task TDD cycles |\n| `x-manage-worktrees` | calls (Step P1) | Detect-context (EPIC-0049 \u002F RULE-001) |\n| `x-internal-ensure-epic-branch` | calls (Step P2) | Ensure `epic\u002F\u003CID>` exists locally + origin (EPIC-0049 \u002F RULE-001) |\n| `x-commit-changes` | calls (Phase 5.4 \u002F Step P4) | Commit plan + status flip in standalone mode |\n| `x-push-branch` | calls (Step P5) | Push canonical epic branch to origin (optional) |\n\n## Knowledge Pack References\n\n| Pack | Files | Purpose |\n|------|-------|---------|\n| testing | `knowledge\u002Ftesting.md` | TDD patterns, TPP levels, test naming conventions |\n| architecture | `knowledge\u002Farchitecture.md` | Layer definitions, package structure, dependency rules |\n| security | `knowledge\u002Fsecurity\u002Findex.md` | OWASP Top 10, security checklist items |\n| parallelism-heuristics | `knowledge\u002Fparallelism-heuristics.md` | File Footprint semantics (write\u002Fread\u002Fregen sub-sections) consumed by Phase 4.5 |\n| coding-standards | `knowledge\u002Fcoding-standards.md` | {{LANGUAGE}} conventions, naming, SOLID principles |\n\n## Planning Status Propagation (Rule 22 \u002F EPIC-0046)\n\n> V2-gated: only runs when `SchemaVersionResolver.resolve(ai\u002Fepics\u002Fepic-XXXX\u002Fexecution-state.json) == V2`. v1 epics: skip silently (Rule 19).\n\nAfter writing `plan-task-TASK-XXXX-YYYY-NNN.md`, propagate the lifecycle status of the source task artifact (`task-TASK-XXXX-YYYY-NNN.md` in v2, or the Section 8 task entry in v1) from `Pendente` to `Planejada` in the SAME commit as the plan artefact.\n\n**Steps (end of Phase 3, BEFORE the final commit):**\n\n1. Detect v2 via SchemaVersionResolver on the epic's `execution-state.json`. If v1: skip this entire block.\n2. For the source task file `ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftask-TASK-XXXX-YYYY-NNN.md`, read current status with the CLI:\n   ```bash\n   CURRENT=$(java -cp $CLAUDE_PROJECT_DIR\u002Fjava\u002Ftarget\u002Fclasses \\\n       dev.iadev.adapter.inbound.cli.StatusFieldParserCli \\\n       read ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftask-TASK-XXXX-YYYY-NNN.md)\n   ```\n3. If `CURRENT == \"Pendente\"`, write `Planejada` atomically:\n   ```bash\n   java -cp $CLAUDE_PROJECT_DIR\u002Fjava\u002Ftarget\u002Fclasses \\\n       dev.iadev.adapter.inbound.cli.StatusFieldParserCli \\\n       write ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftask-TASK-XXXX-YYYY-NNN.md Planejada\n   ```\n   If `CURRENT == \"Planejada\"`: idempotent re-run, skip the write.\n4. Stage both the source task file and the plan artefact:\n   ```bash\n   git add ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Ftask-TASK-XXXX-YYYY-NNN.md ai\u002Fepics\u002Fepic-XXXX\u002Fplans\u002Fplan-task-TASK-XXXX-YYYY-NNN.md\n   ```\n5. **Commit gate (`--no-commit` aware):**\n   - If `--no-commit=false` (default): commit via `x-commit-changes` (Rule 13 Pattern 1 INLINE-SKILL):\n\n         Skill(skill: \"x-commit-changes\", args: \"docs(task-TASK-XXXX-YYYY-NNN): add plan + update status to Planejada\")\n\n   - If `--no-commit=true` (EPIC-0049 batch mode): **SKIP the commit step**. The plan file and status write remain on disk (staged) but no commit is produced. Log: `\"[no-commit] Plan written; commit deferred to caller\"`. Return response with `commitSha: null`.\n\n**Fail-loud:** non-zero CLI exit → abort skill with the same exit code (RULE-046-08).\n\n### `--no-commit` Contract (story-0049-0017)\n\n| Aspect | `--no-commit=false` (default) | `--no-commit=true` (batch) |\n|--------|-------------------------------|----------------------------|\n| Plan file written to disk | Yes | Yes |\n| Status flipped `Pendente -> Planejada` | Yes | Yes |\n| `git add` of plan + task file | Yes | Yes |\n| `x-commit-changes` invoked | Yes | **NO** (deferred to caller) |\n| Response `commitSha` | non-null SHA | `null` |\n| Re-invocation semantics | Idempotent (staleness check) | Idempotent; flipping the flag between runs alternates commit behavior |\n\n**Caller contract (e.g., `x-plan-story`):** when invoking N tasks with `--no-commit=true`, the caller MUST aggregate all written paths and issue ONE consolidated `x-commit-planning` call covering every plan + status update — producing a single commit per story instead of N commits.\n\n**Backward compat:** absence of `--no-commit` (or explicit `--no-commit=false`) preserves pre-EPIC-0049 behavior byte-for-byte.\n\n### Step P4 — Planning Status Commit (alias of Phase 5.4)\n\nThe planning-commit step for `x-plan-task` is performed by **Phase 5.4 — Planning Status Propagation** (above). When `--no-commit=true` or `--dry-run=true`, that step becomes a no-op (logged as `\"[no-commit] Plan written; commit deferred to caller\"` or `\"dry-run, skipping commit\"` respectively). No additional P4 invocation is issued; this alias exists solely so the P1-P5 convention is readable end-to-end in the skill body (EPIC-0049 \u002F RULE-007).\n\n### Step P5 — Push to Origin (optional, EPIC-0049)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-plan-task Phase-P5-Push`\n\nIf `--dry-run` or `--no-commit` is set, log `\"dry-run, skipping push\"` \u002F `\"orchestrated mode, skipping push\"` and skip.\n\nDelegate the push to `x-push-branch` so the canonical `epic\u002F\u003CID>` branch is synchronized with origin:\n\n    Skill(skill: \"x-push-branch\", args: \"--branch epic\u002F\u003CXXXX>\")\n\nOn push failure (remote rejection, no connectivity), log a WARNING and continue — the local commit is preserved; the operator can re-run Step P5 or `git push` manually. Do NOT abort.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-plan-task Phase-P5-Push ok`\n",{"name":5,"description":7,"allowed-tools":24,"argument-hint":25,"context-budget":26,"user-invocable":27,"requires-capabilities":28},"Read, Write, Edit, Bash, Grep, Glob, Skill","--task-file \u003Cpath> [--output-dir \u003Cdir>] [--no-commit] [--dry-run]  |  [STORY-ID] --task [TASK-ID] [--force] [--no-commit] [--dry-run]","heavy",true,[],"main","952a630c6f38d193a349d86fa18db1de8843e837","src\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring\u002F.claude\u002Fskills\u002Fx-plan-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":39,"prompt":49,"zipAvailable":27},[40,43,46],{"tool":41,"command":42},"npx","npx skills add review-bench\u002Federcnj_ia-dev-environment --skill x-plan-task",{"tool":44,"command":45},"bunx","bunx skills add review-bench\u002Federcnj_ia-dev-environment --skill x-plan-task",{"tool":47,"command":48},"pnpm","pnpm dlx skills add review-bench\u002Federcnj_ia-dev-environment --skill x-plan-task","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring\u002F.claude\u002Fskills\u002Fx-plan-task\u002FSKILL.md",[51,57],{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"README.md","REFERENCE","参考文档",3643,"https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring\u002F.claude\u002Fskills\u002Fx-plan-task\u002FREADME.md",{"path":58,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Ffull-protocol.md",4469,"https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring\u002F.claude\u002Fskills\u002Fx-plan-task\u002Freferences\u002Ffull-protocol.md",[62,69,76,83,90,97],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"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":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"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":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"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":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"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":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"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":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"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",[],[]]