[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M754M3Z5G33XF1Q5F23ZSHT0":3,"skill-same:01M754M3Z5G33XF1Q5F23ZSHT0":52},{"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":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":36,"ownerDescription":37,"updatedAt":38,"install":39,"resources":51},"01M754M3Z5G33XF1Q5F23ZSHT0","x-feature-create",null,"Create a complete feature (Epic + N Stories + Implementation Map) from a spec file, with a worktree-isolated docs\u002F branch, consolidated commit, and auto-merged PR into epic\u002FXXXX.","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-fintech-pci\u002F.claude\u002Fskills\u002Fx-feature-create\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: x-feature-create\nmodel: sonnet\ndescription: \"Create a complete feature (Epic + N Stories + Implementation Map) from a spec file, with a worktree-isolated docs\u002F branch, consolidated commit, and auto-merged PR into epic\u002FXXXX.\"\nuser-invocable: true\nallowed-tools: Read, Write, Edit, Bash, Grep, Glob, AskUserQuestion, Skill\nargument-hint: \"[SPEC-FILE-PATH] --epic-id \u003CNNNN> [--no-jira] [--dry-run]\"\ncontext-budget: medium\nrequires-capabilities: []\n---\n\n## Output Policy\n\n- **Language**: Portuguese (pt-BR) for all content. English for technical terms (cache, timeout, handler, endpoint) and code identifiers.\n- **Tone**: Technical, Direct, and Concise.\n- **Efficiency**: Remove all conversational fillers and greetings to save tokens.\n\n# Skill: x-feature-create (Feature Creation Chain Orchestrator)\n\n## Purpose\n\nOrchestrate the full creation of a feature from a system specification: an **Epic**, individual **Story** files, and an **Implementation Map**. The entire operation runs inside an isolated worktree (`feature-XXXX-\u003Cslug>`), producing a `docs\u002F\u003Cepic-id>-\u003Cslug>` branch with a single consolidated commit, auto-merged into `epic\u002FXXXX` via PR.\n\n**EPIC-0065 hard-cut (Rule 19 §Hard-cut autorizado):** This skill supersedes `x-epic-decompose` (removed). Internal sub-skills `x-internal-epic-create`, `x-internal-epic-map`, and `x-internal-story-create` are now the implementation of the generation phases (not user-invocable).\n\n## When to Use\n\n- Create a complete feature backlog from a spec: epic + stories + implementation map\n- After reviewing the spec PR produced by `x-feature-ideate`\n- User wants to turn a specification into immediately implementable work items\n\n## Prerequisites\n\nRead before starting:\n\n- `.claude\u002Ftemplates\u002F_TEMPLATE-EPIC.md` (RA9 v2: 9 sections)\n- `.claude\u002Ftemplates\u002F_TEMPLATE-STORY.md` (RA9 v2: 9 sections)\n- `.claude\u002Ftemplates\u002F_TEMPLATE-IMPLEMENTATION-MAP.md`\n- `.claude\u002Fskills\u002Fplanning-standards-kp\u002FSKILL.md` — **Mandatory** RA9 9-section model (source of truth), granularity per level (Epic\u002FStory\u002FTask), Packages Hexagonal catalog format, Decision Rationale micro-template\n- `references\u002Fdecomposition-guide.md` (bundled with this skill)\n\nIf any template is missing, stop and tell the user.\n\n## Workflow Overview\n\n```\nP1.5 WORKTREE      -> x-internal-worktree-precheck + x-git-worktree create feature-XXXX-\u003Cslug>\nP2.  BRANCH        -> x-internal-epic-branch-ensure --epic-id XXXX (RULE-001)\n1.   ANALYSIS      -> Read spec, identify rules, stories, dependencies, phases (inline)\n1.5  JIRA          -> Determine Jira integration mode (conditional, inline)\n2.   EPIC          -> x-internal-epic-create instructions (Phase 2 below)\n3.   STORIES       -> x-internal-story-create instructions (Phase 3 below)\n4.   MAP           -> x-internal-epic-map instructions (Phase 4 below)\n4.5  JIRA LINKS    -> Create Jira dependency links (conditional, inline)\nP4.  COMMIT        -> x-planning-commit consolidated commit on docs\u002F\u003Cepic-id>-\u003Cslug>\nP5.  PUSH          -> git push docs\u002F\u003Cepic-id>-\u003Cslug> to origin\nP6.  PR            -> x-pr-create --target-branch epic\u002FXXXX --auto-merge merge --label docs\nP7.  CI-WATCH      -> x-pr-watch-ci MANDATORY (Rule 45)\n5.   REPORT        -> Save all files, validate quality, report summary\n```\n\n### Note on consolidated commit\n\n`x-feature-create` uses a **single consolidated commit** in Phase P4 covering the full batch (epic + N stories + implementation map). Sub-skill phases write artifacts but do NOT commit individually — the orchestrator owns the commit on branch `docs\u002F\u003Cepic-id>-\u003Cslug>`, not on `epic\u002FXXXX` directly.\n\n---\n\n## Phase P1.5 — Worktree Setup (RULE-001 + EPIC-0065 D-R5)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-P1_5-Worktree`\n\n**P1.5.1 — Idempotent re-entrancy check:**\n\n    Skill(skill: \"x-internal-worktree-precheck\", model: \"haiku\", args: \"--identifier feature-\u003Cepic-id>-\u003Cslug> --allow-dirty\")\n\n- Exit 0 (CLEAN): proceed to worktree creation.\n- Exit 15 (WORKTREE_AMBIGUOUS): log warning and proceed with caution.\n- On non-zero for other reasons: abort with `WORKTREE_FAILED`.\n\n**P1.5.2 — Create feature worktree:**\n\nDerive slug from the spec file title or filename (kebab-case, max 40 chars, ASCII-only).\n\n    Skill(skill: \"x-git-worktree\", model: \"haiku\", args: \"create --identifier feature-\u003Cepic-id>-\u003Cslug> --branch docs\u002F\u003Cepic-id>-\u003Cslug> --base epic\u002F\u003Cepic-id>\")\n\n- Worktree path: `.claude\u002Fworktrees\u002Ffeature-\u003Cepic-id>-\u003Cslug>\u002F`\n- Branch: `docs\u002F\u003Cepic-id>-\u003Cslug>` (base: `epic\u002FXXXX`, per D-R6 — docs PRs auto-merge into epic branch)\n- All subsequent file writes happen inside this worktree.\n- Worktree is creator-owned (Rule 14 §Invariants) — removed only after successful PR merge.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-P1_5-Worktree ok`\n\n---\n\n## Phase P2 — Ensure `epic\u002F\u003CID>` Branch (RULE-001)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-P2-Epic-Branch`\n\nEnsure the canonical `epic\u002F\u003CID>` branch exists locally AND on origin before writing any artifact:\n\n    Skill(skill: \"x-internal-epic-branch-ensure\", model: \"haiku\", args: \"--epic-id \u003CXXXX>\")\n\nAbort with `EPIC_BRANCH_ENSURE_FAILED` on any non-zero exit.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-P2-Epic-Branch ok`\n\n---\n\n## Phase 1 — Analysis\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-1-Analysis`\n\n1. Read the spec file (path from argument or the spec PR produced by `x-feature-ideate`)\n2. Read `references\u002Fdecomposition-guide.md`\n3. Analyze the spec:\n   - Identify cross-cutting rules (spanning multiple journeys)\n   - Identify stories by layer (foundation → core → extensions → compositions → cross-cutting)\n   - Map dependencies between stories\n   - Compute phases from the dependency DAG\n   - Identify the critical path\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-1-Analysis ok`\n\n---\n\n## Phase 1.5 — Jira Integration Decision\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-1_5-Jira`\n\nBefore generating artifacts, determine Jira integration mode. Logic unchanged from predecessor:\n\n- If `--no-jira`: `jiraContext = { enabled: false }`, skip.\n- If `--jira \u003CPROJECT_KEY>`: discover `cloudId` via `mcp__atlassian__getAccessibleAtlassianResources`, set `jiraContext`.\n- If no flag: prompt via `AskUserQuestion` (3 options: all Jira \u002F epic only \u002F markdown only).\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-1_5-Jira ok`\n\n---\n\n## Phase 2 — Generate the Epic (x-internal-epic-create)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-2-Epic`\n\nFollow the instructions in `.claude\u002Fskills\u002Fx-internal-epic-create\u002FSKILL.md`:\n\n- Determine epic number (scan `ai\u002Fepics\u002F` for existing `epic-XXXX-*` folders; use `--epic-id` override when supplied)\n- Create directory `ai\u002Fepics\u002Fepic-XXXX-\u003Cslug>\u002F` inside the worktree\n- Extract rules → RULE-001..N table\n- Build story index with titles and dependencies\n- Define DoR\u002FDoD (must include TDD Compliance + Double-Loop TDD)\n- Generate `ai\u002Fepics\u002Fepic-XXXX-\u003Cslug>\u002Fepic-XXXX.md` following `_TEMPLATE-EPIC.md`\n\n**Jira integration:** same logic as predecessor (create Epic issue if `jiraContext.enabled`).\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-2-Epic ok`\n\n---\n\n## Phase 3 — Generate the Stories (x-internal-story-create)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-3-Stories`\n\nFollow the instructions in `.claude\u002Fskills\u002Fx-internal-story-create\u002FSKILL.md`:\n\nFor each story in the Epic index:\n- Dependencies, applicable rules, user story description, technical context\n- Entrega de Valor (Section 3.5) — measurable business value\n- Data contracts (precise field names, types, formats)\n- Mermaid sequence diagrams (real component names)\n- Gherkin acceptance criteria (all 4 mandatory categories, TPP order)\n- Sub-tasks tagged `[Dev]`, `[Test]`, `[Doc]` — at least one `[Test] Smoke\u002FE2E`\n\nGenerate files as `ai\u002Fepics\u002Fepic-XXXX-\u003Cslug>\u002Fstory-XXXX-YYYY.md` following `_TEMPLATE-STORY.md`.\n\n**Jira integration:** same cascade logic as predecessor.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-3-Stories ok`\n\n---\n\n## Phase 4 — Generate the Implementation Map (x-internal-epic-map)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-4-Map`\n\nFollow the instructions in `.claude\u002Fskills\u002Fx-internal-epic-map\u002FSKILL.md`:\n\n- Dependency matrix (all stories, validated for consistency)\n- Phase diagram (ASCII box-drawing)\n- Critical path analysis\n- Mermaid dependency graph (color-coded by phase)\n- Phase summary and detail tables\n- Strategic observations\n\nGenerate `ai\u002Fepics\u002Fepic-XXXX-\u003Cslug>\u002FIMPLEMENTATION-MAP.md` following `_TEMPLATE-IMPLEMENTATION-MAP.md`.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-4-Map ok`\n\n---\n\n## Phase 4.5 — Jira Dependency Linking (conditional)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-4_5-Jira-Links`\n\nIf `jiraContext.enabled == true` and `jiraContext.cascadeToStories == true`: create Jira dependency links between stories via `mcp__atlassian__createIssueLink`. Best-effort — failures are warned, not fatal.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-4_5-Jira-Links ok`\n\n---\n\n## Phase P4 — Consolidated Planning Commit (RULE-007)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-P4-Commit`\n\nIf `--dry-run`: log `\"dry-run, skipping commit\"` and skip.\n\nCollect the full path set (epic + all stories + map) and commit via `x-planning-commit`:\n\n    Skill(skill: \"x-planning-commit\", model: \"haiku\",\n          args: \"--scope chore --epic-id \u003CXXXX> --paths ai\u002Fepics\u002Fepic-\u003CXXXX>-\u003Cslug>\u002Fepic-\u003CXXXX>.md,ai\u002Fepics\u002Fepic-\u003CXXXX>-\u003Cslug>\u002Fstory-*.md,ai\u002Fepics\u002Fepic-\u003CXXXX>-\u003Cslug>\u002FIMPLEMENTATION-MAP.md --subject \\\"full decomposition (epic + \u003CN> stories + map)\\\" --branch docs\u002F\u003Cepic-id>-\u003Cslug>\")\n\nOn `COMMIT_FAILED` (exit 4): abort. On `noOp=true`: silent no-op.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-P4-Commit ok`\n\n---\n\n## Phase P5 — Push docs Branch\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-P5-Push`\n\nIf `--dry-run`: skip.\n\nPush the docs branch to origin:\n\n```bash\ngit push -u origin docs\u002F\u003Cepic-id>-\u003Cslug>\n```\n\nOn push failure: log WARNING and continue. Local commit preserved.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-P5-Push ok`\n\n---\n\n## Phase P5.5 — BACKLOG-RENDER (EPIC-0066, story-0066-0006)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-P55-Render`\n\n**MANDATORY TOOL CALL — Rule 24 §Camada-1 \u002F Rule 13 Pattern 1 (INLINE-SKILL):**\n\nRender the backlog PR body from the committed epic.md + IMPLEMENTATION-MAP.md + stories. This produces a body Markdown that includes the `\u003C!-- template-version: 1.0 -->` marker required by `audit-pr-template.sh` (story-0066-0007).\n\n```bash\nTMP_BODY_PATH=$(mktemp -t feature-pr-body-XXXXXX.md)\nchmod 600 \"$TMP_BODY_PATH\"\ntrap 'rm -f \"$TMP_BODY_PATH\"' EXIT\necho \"INFO: Invoking x-internal-pr-body-render --kind=backlog --epic-id=$EPIC_ID\"\n```\n\nInvoke the `x-internal-pr-body-render` skill via the Skill tool:\n\n    Skill(skill: \"x-internal-pr-body-render\", model: \"haiku\", args: \"--kind=backlog --epic-id=epic-\u003CEPIC_ID> --out=$TMP_BODY_PATH\")\n\n```bash\nRENDER_EXIT=$?\nif [[ $RENDER_EXIT -eq 0 ]]; then\n  PR_BODY_FILE=\"$TMP_BODY_PATH\"   # rendered body with template-version marker\nelse\n  echo \"WARN [render-fallback]: x-internal-pr-body-render falhou (exit $RENDER_EXIT). Usando body manual.\" >&2\n  echo \"     audit-pr-template.sh reportará PR_TEMPLATE_VIOLATION para este PR.\" >&2\n  PR_BODY_FILE=\"\"   # empty → fallback path in Phase P6\nfi\n```\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-P55-Render ok`\n\n---\n\n## Phase P6 — PR Creation (docs → epic\u002FXXXX)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-P6-PR`\n\nIf `--dry-run`: skip.\n\nCreate the docs PR using the body rendered in Phase P5.5. Auto-merge is authorized for `docs\u002F\u003Cepic-id>-*` → `epic\u002FXXXX` per Rule 21 §Anti-Patterns exception. The flow uses `gh pr create --body-file` (not the `x-pr-create` skill) because `x-pr-create` is task-scoped and renders `--kind=implementation`; backlog PRs need `--kind=backlog` (story-0066-0006).\n\n```bash\nPR_TITLE=\"chore(epic-${EPIC_ID}): full decomposition (epic + ${STORY_COUNT} stories + map)\"\n\nif [[ -n \"$PR_BODY_FILE\" ]]; then\n  # Happy path — use rendered body with template-version marker\n  PR_URL=$(gh pr create \\\n    --base \"epic\u002F${EPIC_ID}\" \\\n    --head \"docs\u002F${EPIC_ID}-${SLUG}\" \\\n    --title \"$PR_TITLE\" \\\n    --body-file \"$PR_BODY_FILE\" \\\n    --label docs --label \"epic-${EPIC_ID}\")\nelse\n  # Fallback path — see ## Recovery (manual body without template-version marker)\n  PR_URL=$(gh pr create \\\n    --base \"epic\u002F${EPIC_ID}\" \\\n    --head \"docs\u002F${EPIC_ID}-${SLUG}\" \\\n    --title \"$PR_TITLE\" \\\n    --body \"$(cat \u003C\u003CEOF\nchore(epic-${EPIC_ID}): full decomposition (epic + ${STORY_COUNT} stories + map)\n\n(rendered via fallback path — body lacks template-version marker; audit will block merge)\nEOF\n)\" \\\n    --label docs --label \"epic-${EPIC_ID}\")\nfi\n\n# Enable auto-merge (Rule 21 §Anti-Patterns docs\u002F* exception)\nPR_NUMBER=$(echo \"$PR_URL\" | grep -oE '[0-9]+$')\ngh pr merge \"$PR_NUMBER\" --merge --auto\n\n# Capture {prUrl, prNumber} for Phase P7\n```\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-P6-PR ok`\n\n---\n\n## Phase P7 — CI-Watch (Rule 45 — MANDATORY)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-P7-CIWatch`\n\n**MANDATORY TOOL CALL — NON-NEGOTIABLE (Rule 45):** Invoke `x-pr-watch-ci` to wait for CI + merge status:\n\n    Skill(skill: \"x-pr-watch-ci\", model: \"haiku\", args: \"--pr-number \u003CprNumber>\")\n\nPersist `.claude\u002Fstate\u002Fpr-watch-{prNumber}.json` (Rule 45 evidence).\n\nDispatch on exit code:\n- `SUCCESS` (0): CI green + PR merged → proceed to Phase 5 (report)\n- `CI_PENDING_PROCEED` (10): CI green, no Copilot review → proceed with WARNING\n- `CI_FAILED` (20): block; log `CI_FAILED` and abort\n- `TIMEOUT` (30): surface to operator; abort\n- `PR_ALREADY_MERGED` (40): idempotent → proceed\n- `NO_CI_CONFIGURED` (50): skip CI gate; proceed\n- `PR_CLOSED` (60): abort\n- `PR_NOT_FOUND` (70): abort\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-P7-CIWatch ok`\n\n---\n\n## Phase 5 — Save and Report\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-5-Report`\n\nAll files saved inside `ai\u002Fepics\u002Fepic-XXXX-\u003Cslug>\u002F` (v4 layout — D-R1). Quality validation:\n\n- [ ] Every story has Entrega de Valor (measurable, not technical)\n- [ ] Every story has at least one `[Test] Smoke\u002FE2E` sub-task\n- [ ] Every story DoD includes automated test requirement\n- [ ] Dependencies are symmetric\n- [ ] No circular dependencies\n- [ ] Phase computation is correct\n\nReport summary:\n- Total rules extracted, stories generated, phases computed, critical path, max parallelism\n- PR: `#\u003CprNumber>` — `\u003CprUrl>` — Status: MERGED (or AWAITING CI)\n- Jira summary (if applicable)\n\nPrint:\n```\n====================================================\n x-feature-create — Feature ready\n====================================================\n Epic:    ai\u002Fepics\u002Fepic-XXXX-\u003Cslug>\u002Fepic-XXXX.md\n Stories: N files under ai\u002Fepics\u002Fepic-XXXX-\u003Cslug>\u002F\n Map:     ai\u002Fepics\u002Fepic-XXXX-\u003Cslug>\u002FIMPLEMENTATION-MAP.md\n Branch:  docs\u002F\u003Cepic-id>-\u003Cslug>\n PR:      #\u003CprNumber> — \u003CprUrl> — MERGED\n----------------------------------------------------\n Next step: \u002Fx-epic-implement XXXX\n====================================================\n```\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-5-Report ok`\n\n---\n\n## Recovery (Render Skill Fallback — EPIC-0066, story-0066-0006)\n\nWhen `x-internal-pr-body-render` returns exit ≠ 0 in Phase P5.5, this skill falls back to a minimal manual body in Phase P6 to ensure PR creation never aborts (RULE-004 fail-open). The fallback body lacks the `\u003C!-- template-version: 1.0 -->` marker — `audit-pr-template.sh` (story-0066-0007) will block the merge with `PR_TEMPLATE_VIOLATION`. This is intentional: the preventive render path produces the marker; the detective audit gate enforces it.\n\nThe WARN message includes `RENDER_EXIT` (the render skill exit code) so the operator can diagnose the cause: typically `OPERATIONAL_ERROR` (exit 2) when `_TEMPLATE-PR-BACKLOG.md` is missing from `.claude\u002Ftemplates\u002F` (rerun `mvn process-resources`).\n\n## Error Handling\n\n| Scenario | Action |\n|----------|--------|\n| Spec file not found or empty | Abort: `Spec file not found or is empty.` |\n| Template file missing | Stop and tell the user which template is missing |\n| `x-internal-worktree-precheck` exit 15 | Log WARNING, proceed with caution |\n| `x-git-worktree` fails | Abort with `WORKTREE_FAILED` |\n| `x-internal-epic-branch-ensure` fails | Abort with `EPIC_BRANCH_ENSURE_FAILED` |\n| `x-planning-commit` exit 4 | Abort with `COMMIT_FAILED` |\n| `x-planning-commit` `noOp=true` | Silent no-op, continue to P5 |\n| `x-pr-create` fails | Abort with `PR_CREATE_FAILED` |\n| `x-pr-watch-ci` exit 20 (`CI_FAILED`) | Abort; preserve worktree for diagnosis |\n| `--dry-run` set | Phases P4, P5, P6, P7 are no-ops |\n| Circular dependency detected | Abort with cycle description |\n| Story fails quality validation | Fix before saving — do not skip validation |\n\n## Integration Notes\n\n| Skill | Relationship | Notes |\n|-------|-------------|-------|\n| `x-internal-worktree-precheck` | delegates (P1.5.1) | Idempotent re-entrancy check |\n| `x-git-worktree` | delegates (P1.5.2) | Creates `feature-XXXX-\u003Cslug>` worktree |\n| `x-internal-epic-branch-ensure` | delegates (P2) | Ensures `epic\u002FXXXX` on local + origin |\n| `x-internal-epic-create` | follows instructions (Ph 2) | Generates Epic file |\n| `x-internal-story-create` | follows instructions (Ph 3) | Generates Story files |\n| `x-internal-epic-map` | follows instructions (Ph 4) | Generates Implementation Map |\n| `x-planning-commit` | delegates (P4) | Single consolidated commit on docs branch |\n| `x-pr-create` | delegates (P6) | Opens PR with auto-merge (Rule 21 docs\u002F exception) |\n| `x-pr-watch-ci` | delegates (P7) | MANDATORY CI-watch (Rule 45) |\n| `x-feature-ideate` | preceded by | Optional — produces spec PR reviewed by operator |\n| `x-epic-implement` | followed by | Implements the generated epic |\n\n## Backward Compatibility (EPIC-0065)\n\n`x-epic-decompose` was removed via hard-cut (Rule 19 §Hard-cut autorizado — RULE-004). No alias. Operators update invocations to `\u002Fx-feature-create`. Internal sub-skills (`x-internal-epic-create`, `x-internal-epic-map`, `x-internal-story-create`) are not user-invocable (Rule 22 — visibility: internal).\n","## Output Policy\n\n- **Language**: Portuguese (pt-BR) for all content. English for technical terms (cache, timeout, handler, endpoint) and code identifiers.\n- **Tone**: Technical, Direct, and Concise.\n- **Efficiency**: Remove all conversational fillers and greetings to save tokens.\n\n# Skill: x-feature-create (Feature Creation Chain Orchestrator)\n\n## Purpose\n\nOrchestrate the full creation of a feature from a system specification: an **Epic**, individual **Story** files, and an **Implementation Map**. The entire operation runs inside an isolated worktree (`feature-XXXX-\u003Cslug>`), producing a `docs\u002F\u003Cepic-id>-\u003Cslug>` branch with a single consolidated commit, auto-merged into `epic\u002FXXXX` via PR.\n\n**EPIC-0065 hard-cut (Rule 19 §Hard-cut autorizado):** This skill supersedes `x-epic-decompose` (removed). Internal sub-skills `x-internal-epic-create`, `x-internal-epic-map`, and `x-internal-story-create` are now the implementation of the generation phases (not user-invocable).\n\n## When to Use\n\n- Create a complete feature backlog from a spec: epic + stories + implementation map\n- After reviewing the spec PR produced by `x-feature-ideate`\n- User wants to turn a specification into immediately implementable work items\n\n## Prerequisites\n\nRead before starting:\n\n- `.claude\u002Ftemplates\u002F_TEMPLATE-EPIC.md` (RA9 v2: 9 sections)\n- `.claude\u002Ftemplates\u002F_TEMPLATE-STORY.md` (RA9 v2: 9 sections)\n- `.claude\u002Ftemplates\u002F_TEMPLATE-IMPLEMENTATION-MAP.md`\n- `.claude\u002Fskills\u002Fplanning-standards-kp\u002FSKILL.md` — **Mandatory** RA9 9-section model (source of truth), granularity per level (Epic\u002FStory\u002FTask), Packages Hexagonal catalog format, Decision Rationale micro-template\n- `references\u002Fdecomposition-guide.md` (bundled with this skill)\n\nIf any template is missing, stop and tell the user.\n\n## Workflow Overview\n\n```\nP1.5 WORKTREE      -> x-internal-worktree-precheck + x-git-worktree create feature-XXXX-\u003Cslug>\nP2.  BRANCH        -> x-internal-epic-branch-ensure --epic-id XXXX (RULE-001)\n1.   ANALYSIS      -> Read spec, identify rules, stories, dependencies, phases (inline)\n1.5  JIRA          -> Determine Jira integration mode (conditional, inline)\n2.   EPIC          -> x-internal-epic-create instructions (Phase 2 below)\n3.   STORIES       -> x-internal-story-create instructions (Phase 3 below)\n4.   MAP           -> x-internal-epic-map instructions (Phase 4 below)\n4.5  JIRA LINKS    -> Create Jira dependency links (conditional, inline)\nP4.  COMMIT        -> x-planning-commit consolidated commit on docs\u002F\u003Cepic-id>-\u003Cslug>\nP5.  PUSH          -> git push docs\u002F\u003Cepic-id>-\u003Cslug> to origin\nP6.  PR            -> x-pr-create --target-branch epic\u002FXXXX --auto-merge merge --label docs\nP7.  CI-WATCH      -> x-pr-watch-ci MANDATORY (Rule 45)\n5.   REPORT        -> Save all files, validate quality, report summary\n```\n\n### Note on consolidated commit\n\n`x-feature-create` uses a **single consolidated commit** in Phase P4 covering the full batch (epic + N stories + implementation map). Sub-skill phases write artifacts but do NOT commit individually — the orchestrator owns the commit on branch `docs\u002F\u003Cepic-id>-\u003Cslug>`, not on `epic\u002FXXXX` directly.\n\n---\n\n## Phase P1.5 — Worktree Setup (RULE-001 + EPIC-0065 D-R5)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-P1_5-Worktree`\n\n**P1.5.1 — Idempotent re-entrancy check:**\n\n    Skill(skill: \"x-internal-worktree-precheck\", model: \"haiku\", args: \"--identifier feature-\u003Cepic-id>-\u003Cslug> --allow-dirty\")\n\n- Exit 0 (CLEAN): proceed to worktree creation.\n- Exit 15 (WORKTREE_AMBIGUOUS): log warning and proceed with caution.\n- On non-zero for other reasons: abort with `WORKTREE_FAILED`.\n\n**P1.5.2 — Create feature worktree:**\n\nDerive slug from the spec file title or filename (kebab-case, max 40 chars, ASCII-only).\n\n    Skill(skill: \"x-git-worktree\", model: \"haiku\", args: \"create --identifier feature-\u003Cepic-id>-\u003Cslug> --branch docs\u002F\u003Cepic-id>-\u003Cslug> --base epic\u002F\u003Cepic-id>\")\n\n- Worktree path: `.claude\u002Fworktrees\u002Ffeature-\u003Cepic-id>-\u003Cslug>\u002F`\n- Branch: `docs\u002F\u003Cepic-id>-\u003Cslug>` (base: `epic\u002FXXXX`, per D-R6 — docs PRs auto-merge into epic branch)\n- All subsequent file writes happen inside this worktree.\n- Worktree is creator-owned (Rule 14 §Invariants) — removed only after successful PR merge.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-P1_5-Worktree ok`\n\n---\n\n## Phase P2 — Ensure `epic\u002F\u003CID>` Branch (RULE-001)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-P2-Epic-Branch`\n\nEnsure the canonical `epic\u002F\u003CID>` branch exists locally AND on origin before writing any artifact:\n\n    Skill(skill: \"x-internal-epic-branch-ensure\", model: \"haiku\", args: \"--epic-id \u003CXXXX>\")\n\nAbort with `EPIC_BRANCH_ENSURE_FAILED` on any non-zero exit.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-P2-Epic-Branch ok`\n\n---\n\n## Phase 1 — Analysis\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-1-Analysis`\n\n1. Read the spec file (path from argument or the spec PR produced by `x-feature-ideate`)\n2. Read `references\u002Fdecomposition-guide.md`\n3. Analyze the spec:\n   - Identify cross-cutting rules (spanning multiple journeys)\n   - Identify stories by layer (foundation → core → extensions → compositions → cross-cutting)\n   - Map dependencies between stories\n   - Compute phases from the dependency DAG\n   - Identify the critical path\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-1-Analysis ok`\n\n---\n\n## Phase 1.5 — Jira Integration Decision\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-1_5-Jira`\n\nBefore generating artifacts, determine Jira integration mode. Logic unchanged from predecessor:\n\n- If `--no-jira`: `jiraContext = { enabled: false }`, skip.\n- If `--jira \u003CPROJECT_KEY>`: discover `cloudId` via `mcp__atlassian__getAccessibleAtlassianResources`, set `jiraContext`.\n- If no flag: prompt via `AskUserQuestion` (3 options: all Jira \u002F epic only \u002F markdown only).\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-1_5-Jira ok`\n\n---\n\n## Phase 2 — Generate the Epic (x-internal-epic-create)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-2-Epic`\n\nFollow the instructions in `.claude\u002Fskills\u002Fx-internal-epic-create\u002FSKILL.md`:\n\n- Determine epic number (scan `ai\u002Fepics\u002F` for existing `epic-XXXX-*` folders; use `--epic-id` override when supplied)\n- Create directory `ai\u002Fepics\u002Fepic-XXXX-\u003Cslug>\u002F` inside the worktree\n- Extract rules → RULE-001..N table\n- Build story index with titles and dependencies\n- Define DoR\u002FDoD (must include TDD Compliance + Double-Loop TDD)\n- Generate `ai\u002Fepics\u002Fepic-XXXX-\u003Cslug>\u002Fepic-XXXX.md` following `_TEMPLATE-EPIC.md`\n\n**Jira integration:** same logic as predecessor (create Epic issue if `jiraContext.enabled`).\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-2-Epic ok`\n\n---\n\n## Phase 3 — Generate the Stories (x-internal-story-create)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-3-Stories`\n\nFollow the instructions in `.claude\u002Fskills\u002Fx-internal-story-create\u002FSKILL.md`:\n\nFor each story in the Epic index:\n- Dependencies, applicable rules, user story description, technical context\n- Entrega de Valor (Section 3.5) — measurable business value\n- Data contracts (precise field names, types, formats)\n- Mermaid sequence diagrams (real component names)\n- Gherkin acceptance criteria (all 4 mandatory categories, TPP order)\n- Sub-tasks tagged `[Dev]`, `[Test]`, `[Doc]` — at least one `[Test] Smoke\u002FE2E`\n\nGenerate files as `ai\u002Fepics\u002Fepic-XXXX-\u003Cslug>\u002Fstory-XXXX-YYYY.md` following `_TEMPLATE-STORY.md`.\n\n**Jira integration:** same cascade logic as predecessor.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-3-Stories ok`\n\n---\n\n## Phase 4 — Generate the Implementation Map (x-internal-epic-map)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-4-Map`\n\nFollow the instructions in `.claude\u002Fskills\u002Fx-internal-epic-map\u002FSKILL.md`:\n\n- Dependency matrix (all stories, validated for consistency)\n- Phase diagram (ASCII box-drawing)\n- Critical path analysis\n- Mermaid dependency graph (color-coded by phase)\n- Phase summary and detail tables\n- Strategic observations\n\nGenerate `ai\u002Fepics\u002Fepic-XXXX-\u003Cslug>\u002FIMPLEMENTATION-MAP.md` following `_TEMPLATE-IMPLEMENTATION-MAP.md`.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-4-Map ok`\n\n---\n\n## Phase 4.5 — Jira Dependency Linking (conditional)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-4_5-Jira-Links`\n\nIf `jiraContext.enabled == true` and `jiraContext.cascadeToStories == true`: create Jira dependency links between stories via `mcp__atlassian__createIssueLink`. Best-effort — failures are warned, not fatal.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-4_5-Jira-Links ok`\n\n---\n\n## Phase P4 — Consolidated Planning Commit (RULE-007)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-P4-Commit`\n\nIf `--dry-run`: log `\"dry-run, skipping commit\"` and skip.\n\nCollect the full path set (epic + all stories + map) and commit via `x-planning-commit`:\n\n    Skill(skill: \"x-planning-commit\", model: \"haiku\",\n          args: \"--scope chore --epic-id \u003CXXXX> --paths ai\u002Fepics\u002Fepic-\u003CXXXX>-\u003Cslug>\u002Fepic-\u003CXXXX>.md,ai\u002Fepics\u002Fepic-\u003CXXXX>-\u003Cslug>\u002Fstory-*.md,ai\u002Fepics\u002Fepic-\u003CXXXX>-\u003Cslug>\u002FIMPLEMENTATION-MAP.md --subject \\\"full decomposition (epic + \u003CN> stories + map)\\\" --branch docs\u002F\u003Cepic-id>-\u003Cslug>\")\n\nOn `COMMIT_FAILED` (exit 4): abort. On `noOp=true`: silent no-op.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-P4-Commit ok`\n\n---\n\n## Phase P5 — Push docs Branch\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-P5-Push`\n\nIf `--dry-run`: skip.\n\nPush the docs branch to origin:\n\n```bash\ngit push -u origin docs\u002F\u003Cepic-id>-\u003Cslug>\n```\n\nOn push failure: log WARNING and continue. Local commit preserved.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-P5-Push ok`\n\n---\n\n## Phase P5.5 — BACKLOG-RENDER (EPIC-0066, story-0066-0006)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-P55-Render`\n\n**MANDATORY TOOL CALL — Rule 24 §Camada-1 \u002F Rule 13 Pattern 1 (INLINE-SKILL):**\n\nRender the backlog PR body from the committed epic.md + IMPLEMENTATION-MAP.md + stories. This produces a body Markdown that includes the `\u003C!-- template-version: 1.0 -->` marker required by `audit-pr-template.sh` (story-0066-0007).\n\n```bash\nTMP_BODY_PATH=$(mktemp -t feature-pr-body-XXXXXX.md)\nchmod 600 \"$TMP_BODY_PATH\"\ntrap 'rm -f \"$TMP_BODY_PATH\"' EXIT\necho \"INFO: Invoking x-internal-pr-body-render --kind=backlog --epic-id=$EPIC_ID\"\n```\n\nInvoke the `x-internal-pr-body-render` skill via the Skill tool:\n\n    Skill(skill: \"x-internal-pr-body-render\", model: \"haiku\", args: \"--kind=backlog --epic-id=epic-\u003CEPIC_ID> --out=$TMP_BODY_PATH\")\n\n```bash\nRENDER_EXIT=$?\nif [[ $RENDER_EXIT -eq 0 ]]; then\n  PR_BODY_FILE=\"$TMP_BODY_PATH\"   # rendered body with template-version marker\nelse\n  echo \"WARN [render-fallback]: x-internal-pr-body-render falhou (exit $RENDER_EXIT). Usando body manual.\" >&2\n  echo \"     audit-pr-template.sh reportará PR_TEMPLATE_VIOLATION para este PR.\" >&2\n  PR_BODY_FILE=\"\"   # empty → fallback path in Phase P6\nfi\n```\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-P55-Render ok`\n\n---\n\n## Phase P6 — PR Creation (docs → epic\u002FXXXX)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-P6-PR`\n\nIf `--dry-run`: skip.\n\nCreate the docs PR using the body rendered in Phase P5.5. Auto-merge is authorized for `docs\u002F\u003Cepic-id>-*` → `epic\u002FXXXX` per Rule 21 §Anti-Patterns exception. The flow uses `gh pr create --body-file` (not the `x-pr-create` skill) because `x-pr-create` is task-scoped and renders `--kind=implementation`; backlog PRs need `--kind=backlog` (story-0066-0006).\n\n```bash\nPR_TITLE=\"chore(epic-${EPIC_ID}): full decomposition (epic + ${STORY_COUNT} stories + map)\"\n\nif [[ -n \"$PR_BODY_FILE\" ]]; then\n  # Happy path — use rendered body with template-version marker\n  PR_URL=$(gh pr create \\\n    --base \"epic\u002F${EPIC_ID}\" \\\n    --head \"docs\u002F${EPIC_ID}-${SLUG}\" \\\n    --title \"$PR_TITLE\" \\\n    --body-file \"$PR_BODY_FILE\" \\\n    --label docs --label \"epic-${EPIC_ID}\")\nelse\n  # Fallback path — see ## Recovery (manual body without template-version marker)\n  PR_URL=$(gh pr create \\\n    --base \"epic\u002F${EPIC_ID}\" \\\n    --head \"docs\u002F${EPIC_ID}-${SLUG}\" \\\n    --title \"$PR_TITLE\" \\\n    --body \"$(cat \u003C\u003CEOF\nchore(epic-${EPIC_ID}): full decomposition (epic + ${STORY_COUNT} stories + map)\n\n(rendered via fallback path — body lacks template-version marker; audit will block merge)\nEOF\n)\" \\\n    --label docs --label \"epic-${EPIC_ID}\")\nfi\n\n# Enable auto-merge (Rule 21 §Anti-Patterns docs\u002F* exception)\nPR_NUMBER=$(echo \"$PR_URL\" | grep -oE '[0-9]+$')\ngh pr merge \"$PR_NUMBER\" --merge --auto\n\n# Capture {prUrl, prNumber} for Phase P7\n```\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-P6-PR ok`\n\n---\n\n## Phase P7 — CI-Watch (Rule 45 — MANDATORY)\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-P7-CIWatch`\n\n**MANDATORY TOOL CALL — NON-NEGOTIABLE (Rule 45):** Invoke `x-pr-watch-ci` to wait for CI + merge status:\n\n    Skill(skill: \"x-pr-watch-ci\", model: \"haiku\", args: \"--pr-number \u003CprNumber>\")\n\nPersist `.claude\u002Fstate\u002Fpr-watch-{prNumber}.json` (Rule 45 evidence).\n\nDispatch on exit code:\n- `SUCCESS` (0): CI green + PR merged → proceed to Phase 5 (report)\n- `CI_PENDING_PROCEED` (10): CI green, no Copilot review → proceed with WARNING\n- `CI_FAILED` (20): block; log `CI_FAILED` and abort\n- `TIMEOUT` (30): surface to operator; abort\n- `PR_ALREADY_MERGED` (40): idempotent → proceed\n- `NO_CI_CONFIGURED` (50): skip CI gate; proceed\n- `PR_CLOSED` (60): abort\n- `PR_NOT_FOUND` (70): abort\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-P7-CIWatch ok`\n\n---\n\n## Phase 5 — Save and Report\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-feature-create Phase-5-Report`\n\nAll files saved inside `ai\u002Fepics\u002Fepic-XXXX-\u003Cslug>\u002F` (v4 layout — D-R1). Quality validation:\n\n- [ ] Every story has Entrega de Valor (measurable, not technical)\n- [ ] Every story has at least one `[Test] Smoke\u002FE2E` sub-task\n- [ ] Every story DoD includes automated test requirement\n- [ ] Dependencies are symmetric\n- [ ] No circular dependencies\n- [ ] Phase computation is correct\n\nReport summary:\n- Total rules extracted, stories generated, phases computed, critical path, max parallelism\n- PR: `#\u003CprNumber>` — `\u003CprUrl>` — Status: MERGED (or AWAITING CI)\n- Jira summary (if applicable)\n\nPrint:\n```\n====================================================\n x-feature-create — Feature ready\n====================================================\n Epic:    ai\u002Fepics\u002Fepic-XXXX-\u003Cslug>\u002Fepic-XXXX.md\n Stories: N files under ai\u002Fepics\u002Fepic-XXXX-\u003Cslug>\u002F\n Map:     ai\u002Fepics\u002Fepic-XXXX-\u003Cslug>\u002FIMPLEMENTATION-MAP.md\n Branch:  docs\u002F\u003Cepic-id>-\u003Cslug>\n PR:      #\u003CprNumber> — \u003CprUrl> — MERGED\n----------------------------------------------------\n Next step: \u002Fx-epic-implement XXXX\n====================================================\n```\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-feature-create Phase-5-Report ok`\n\n---\n\n## Recovery (Render Skill Fallback — EPIC-0066, story-0066-0006)\n\nWhen `x-internal-pr-body-render` returns exit ≠ 0 in Phase P5.5, this skill falls back to a minimal manual body in Phase P6 to ensure PR creation never aborts (RULE-004 fail-open). The fallback body lacks the `\u003C!-- template-version: 1.0 -->` marker — `audit-pr-template.sh` (story-0066-0007) will block the merge with `PR_TEMPLATE_VIOLATION`. This is intentional: the preventive render path produces the marker; the detective audit gate enforces it.\n\nThe WARN message includes `RENDER_EXIT` (the render skill exit code) so the operator can diagnose the cause: typically `OPERATIONAL_ERROR` (exit 2) when `_TEMPLATE-PR-BACKLOG.md` is missing from `.claude\u002Ftemplates\u002F` (rerun `mvn process-resources`).\n\n## Error Handling\n\n| Scenario | Action |\n|----------|--------|\n| Spec file not found or empty | Abort: `Spec file not found or is empty.` |\n| Template file missing | Stop and tell the user which template is missing |\n| `x-internal-worktree-precheck` exit 15 | Log WARNING, proceed with caution |\n| `x-git-worktree` fails | Abort with `WORKTREE_FAILED` |\n| `x-internal-epic-branch-ensure` fails | Abort with `EPIC_BRANCH_ENSURE_FAILED` |\n| `x-planning-commit` exit 4 | Abort with `COMMIT_FAILED` |\n| `x-planning-commit` `noOp=true` | Silent no-op, continue to P5 |\n| `x-pr-create` fails | Abort with `PR_CREATE_FAILED` |\n| `x-pr-watch-ci` exit 20 (`CI_FAILED`) | Abort; preserve worktree for diagnosis |\n| `--dry-run` set | Phases P4, P5, P6, P7 are no-ops |\n| Circular dependency detected | Abort with cycle description |\n| Story fails quality validation | Fix before saving — do not skip validation |\n\n## Integration Notes\n\n| Skill | Relationship | Notes |\n|-------|-------------|-------|\n| `x-internal-worktree-precheck` | delegates (P1.5.1) | Idempotent re-entrancy check |\n| `x-git-worktree` | delegates (P1.5.2) | Creates `feature-XXXX-\u003Cslug>` worktree |\n| `x-internal-epic-branch-ensure` | delegates (P2) | Ensures `epic\u002FXXXX` on local + origin |\n| `x-internal-epic-create` | follows instructions (Ph 2) | Generates Epic file |\n| `x-internal-story-create` | follows instructions (Ph 3) | Generates Story files |\n| `x-internal-epic-map` | follows instructions (Ph 4) | Generates Implementation Map |\n| `x-planning-commit` | delegates (P4) | Single consolidated commit on docs branch |\n| `x-pr-create` | delegates (P6) | Opens PR with auto-merge (Rule 21 docs\u002F exception) |\n| `x-pr-watch-ci` | delegates (P7) | MANDATORY CI-watch (Rule 45) |\n| `x-feature-ideate` | preceded by | Optional — produces spec PR reviewed by operator |\n| `x-epic-implement` | followed by | Implements the generated epic |\n\n## Backward Compatibility (EPIC-0065)\n\n`x-epic-decompose` was removed via hard-cut (Rule 19 §Hard-cut autorizado — RULE-004). No alias. Operators update invocations to `\u002Fx-feature-create`. Internal sub-skills (`x-internal-epic-create`, `x-internal-epic-map`, `x-internal-story-create`) are not user-invocable (Rule 22 — visibility: internal).\n",{"name":5,"model":24,"description":7,"allowed-tools":25,"argument-hint":26,"context-budget":27,"user-invocable":28,"requires-capabilities":29},"sonnet","Read, Write, Edit, Bash, Grep, Glob, AskUserQuestion, Skill","[SPEC-FILE-PATH] --epic-id \u003CNNNN> [--no-jira] [--dry-run]","medium",true,[],"main","952a630c6f38d193a349d86fa18db1de8843e837","src\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring-fintech-pci\u002F.claude\u002Fskills\u002Fx-feature-create",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":40,"prompt":50,"zipAvailable":28},[41,44,47],{"tool":42,"command":43},"npx","npx skills add review-bench\u002Federcnj_ia-dev-environment --skill x-feature-create",{"tool":45,"command":46},"bunx","bunx skills add review-bench\u002Federcnj_ia-dev-environment --skill x-feature-create",{"tool":48,"command":49},"pnpm","pnpm dlx skills add review-bench\u002Federcnj_ia-dev-environment --skill x-feature-create","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Ftest\u002Fresources\u002Fgolden\u002Fjava-spring-fintech-pci\u002F.claude\u002Fskills\u002Fx-feature-create\u002FSKILL.md",[],[53,60,67,74,81,88],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"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":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"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":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"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":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"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":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"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":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"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",[],[]]