[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M751MQV6CRCAT9EESCJMQX32":3,"skill-same:01M751MQV6CRCAT9EESCJMQX32":58},{"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":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":41,"ownerDescription":42,"updatedAt":43,"install":44,"resources":57},"01M751MQV6CRCAT9EESCJMQX32","x-internal-render-pr-body",null,"Renders PR body Markdown from existing disk artifacts using one of two templates. --kind=implementation: reads review\u002Fverify\u002Ftelemetry artifacts for a story and emits a structured implementation PR body. --kind=backlog: reads epic\u002Fmap artifacts and emits a scaffolding PR body. Fail-open: absent artifacts produce human-readable placeholders, never audit-sentinel strings. Internal — invoked only by x-create-pr and x-create-feature.","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\u002Fmain\u002Fresources\u002Ftargets\u002Fclaude\u002Fskills\u002Fcore\u002Finternal\u002Fpr\u002Fx-internal-render-pr-body\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: x-internal-render-pr-body\ndescription: \"Renders PR body Markdown from existing disk artifacts using one of two templates. --kind=implementation: reads review\u002Fverify\u002Ftelemetry artifacts for a story and emits a structured implementation PR body. --kind=backlog: reads epic\u002Fmap artifacts and emits a scaffolding PR body. Fail-open: absent artifacts produce human-readable placeholders, never audit-sentinel strings. Internal — invoked only by x-create-pr and x-create-feature.\"\nvisibility: internal\nuser-invocable: false\nmodel: haiku\nallowed-tools: [Read, Write, Bash, Skill]\nargument-hint: \"--kind=implementation|backlog --story-id \u003Cstory-XXXX-YYYY> --out \u003Cabs-path>\"\ncategory: internal-pr\ncontext-budget: light\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> 🔒 **INTERNAL SKILL** — Invoked only by other skills via the Skill tool. Not user-invocable.\n\n# Skill: x-internal-render-pr-body\n\n## Purpose\n\nRenders a PR body Markdown file from existing on-disk artifacts (review, verify, telemetry,\ncommits) and writes it to `--out`. Consumed by `x-create-pr` (kind=implementation) and\n`x-create-feature` (kind=backlog). Fail-open: any missing source produces a human-readable\nplaceholder — never an audit-sentinel string recognized by `audit-pr-evidence.sh`.\n\n## Parameters\n\n| Parameter | Required | Description |\n| :--- | :--- | :--- |\n| `--kind` | Yes | `implementation` or `backlog` |\n| `--story-id` | When `--kind=implementation` | Pattern `story-XXXX-YYYY` |\n| `--epic-id` | When `--kind=backlog` | Pattern `epic-XXXX` or `EPIC-XXXX` |\n| `--out` | Yes | Absolute path for output Markdown file |\n\n## Exit Codes\n\n| Exit | Code | Condition |\n| :--- | :--- | :--- |\n| 0 | OK | Body rendered and written successfully |\n| 1 | INVALID_KIND | `--kind` absent or not `implementation`\u002F`backlog` |\n| 2 | OPERATIONAL_ERROR | template missing, write permission denied, path traversal detected |\n| 3 | INVALID_SCOPE | `--story-id` absent for `--kind=implementation`; `--epic-id` absent for `--kind=backlog` |\n\n## Fail-Open Contract (RULE-004)\n\nEvery absent artifact produces a human-readable placeholder. Permitted placeholders:\n- `(pending)` — review artifacts not yet produced\n- `(not yet run)` — verify gate not yet executed\n- `(no telemetry available)` — events.ndjson absent or empty\n- `(none)` — no tasks or commits found\n- `(no commits)` — git log returns empty\n\n**Forbidden placeholder values** (would trigger `audit-pr-evidence.sh`): `story-XXXX-YYYY`,\n`EPIC-XXXX`, any pattern matching `story-[0-9]{4}-[0-9]{4}` as a verdict\u002Fdecision value.\n\n## Triggers\n\nThis skill is internal — never typed by a user. Callers use Rule 13 INLINE-SKILL pattern:\n\n```markdown\nSkill(skill: \"x-internal-render-pr-body\", args: \"--kind=implementation --story-id story-XXXX-YYYY --out \u002Fabs\u002Fpath\u002Fbody.md\")\n```\n\n## Phase 0 — ARGS\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-internal-render-pr-body Phase-0-Args`\n\nParse and validate all arguments:\n\n1. Extract `--kind`, `--story-id`, `--epic-id`, `--out` from argv.\n2. Validate `--kind`:\n   ```bash\n   case \"$KIND\" in\n     implementation|backlog) ;;\n     *) echo \"INVALID_KIND: --kind is required (implementation|backlog)\" >&2; exit 1 ;;\n   esac\n   ```\n3. Validate scope argument:\n   ```bash\n   if [[ \"$KIND\" == \"implementation\" && -z \"$STORY_ID\" ]]; then\n     echo \"INVALID_SCOPE: --story-id required for --kind=implementation\" >&2; exit 3\n   fi\n   if [[ \"$KIND\" == \"backlog\" && -z \"$EPIC_ID\" ]]; then\n     echo \"INVALID_SCOPE: --epic-id required for --kind=backlog\" >&2; exit 3\n   fi\n   ```\n4. Validate `--story-id` format (kind=implementation): `^story-[0-9]{4}-[0-9]{4}$`.\n5. Canonicalize `--out` and verify it stays within `${REPO_ROOT}` (Rule 06 J6 — path traversal):\n   ```bash\n   REPO_ROOT=$(realpath \"$CLAUDE_PROJECT_DIR\")\n   OUT_CANONICAL=$(realpath --canonicalize-missing \"$OUT\")\n   if [[ \"$OUT_CANONICAL\" != \"$REPO_ROOT\"* ]]; then\n     echo \"OPERATIONAL_ERROR: --out path traversal detected: $OUT\" >&2; exit 2\n   fi\n   ```\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-internal-render-pr-body Phase-0-Args ok`\n\n## Phase 1 — GATHER\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-internal-render-pr-body Phase-1-Gather`\n\nRead 7 data sources (kind=implementation only; backlog uses a different set — see Phase 1b in §Backlog extension). Build intermediate JSON envelope. Apply fail-open fallbacks.\n\n### Source 1 — Story markdown (Acceptance Criteria)\n\nLocate `story-{storyId}.md` via PathResolver (searches `ai\u002Fepics\u002F*\u002F`, `plans\u002Fepic-XXXX\u002F`).\nParse Gherkin `Cenário:` headings for acceptance criteria list.\nFallback: `acceptanceCriteria: []` (empty list).\n\n### Source 2 — Specialist review verdict\n\nLocate `review-story-{storyId}.md` under `ai\u002Fepics\u002Fepic-XXXX-*\u002Fplans\u002F` (v4) or `plans\u002Fepic-XXXX\u002Fplans\u002F` (v3).\n\nParse **YAML-when-available**: if `head -1 \u003Cfile>` returns `---` (YAML frontmatter), use\n`yq '.verdict' \u003Cfile>` (EPIC-0067 structured verdict). Otherwise, fallback regex:\n```bash\ngrep -oP '(?\u003C=\\*\\*Verdict:\\s)(GO|NO-GO)' \"$REVIEW_FILE\" | head -1\n```\nFallback if file absent or regex fails: `specialistVerdict: \"(pending)\"`.\n\n### Source 3 — Tech-lead review decision\n\nLocate `techlead-review-story-{storyId}.md`. Same YAML-when-available logic.\nFallback regex: `grep -oP '(?\u003C=\\*\\*Decision:\\s)(GO|NO-GO)'`.\nFallback: `techleadDecision: \"(pending)\"`.\n\n### Source 4 — Verify envelope\n\nLocate `reports\u002Fverify-envelope-{storyId}.json`. Parse via jq:\n```bash\njq -r '.testsResult, .coverageLine, .coverageBranch' \"$ENVELOPE\"\n```\nFallback per field: `\"(not yet run)\"`.\n\n### Source 5 — Story completion report (task IDs)\n\nLocate `reports\u002Fstory-completion-report-{storyId}.md`. Parse task table rows:\n```bash\ngrep -oP 'TASK-[0-9]{4}-[0-9]{4}-[0-9]{3}' \"$REPORT\" | sort -u | tr '\\n' ', '\n```\nFallback: `taskIds: \"(none)\"`.\n\n### Source 6 — Commits\n\nRun `git log origin\u002Fdevelop..HEAD --oneline` in REPO_ROOT. Capture stdout as commit list.\nFallback: `commitsList: \"(no commits)\"`.\n\n### Source 7 — Orchestrator metadata\n\nCapture:\n- `orchSha`: `git rev-parse HEAD`\n- `invocationSkill`: `x-implement-story`\n- `phase1Artifacts`: list files matching `ai\u002Fepics\u002F*\u002Fplans\u002F*-{storyId}.md`\n- `phase3Artifacts`: list files matching `ai\u002Fepics\u002F*\u002Freports\u002F*-{storyId}.*`\n\nEscape all string values: replace `|` with `\\|`, backticks with `\\``, newlines with space.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-internal-render-pr-body Phase-1-Gather ok`\n\n## Phase 2 — TELEMETRY\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-internal-render-pr-body Phase-2-Telemetry`\n\nInvoke `scripts\u002Ftelemetry-consolidate.sh` (story-0066-0002) for the story scope:\n\n```bash\nTEL_JSON=$(scripts\u002Ftelemetry-consolidate.sh --story=\"$STORY_ID\" --format=json 2>\u002Ftmp\u002Ftel-err.txt)\nTEL_EXIT=$?\n```\n\n- `TEL_EXIT=0`: parse `$TEL_JSON` for `activeMs`, `elapsedMs`, `events`, `tasks[]`, `topTools[]`. Incorporate into envelope.\n- `TEL_EXIT=1` (NO_TELEMETRY): set `storyActiveMin=(no telemetry available)`, `storyElapsedMin=(no telemetry available)`, `storyEventCount=(no telemetry available)`, `tasks=[]`, `topTools=[]`. Emit WARNING to stderr.\n- `TEL_EXIT=2` (OPERATIONAL_ERROR): same as exit 1 (warning + placeholder). Do NOT abort — telemetry is non-blocking per RULE-002.\n\nConvert activeMs\u002FelapsedMs to minutes: `floor(ms \u002F 60000)`.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-internal-render-pr-body Phase-2-Telemetry ok`\n\n## Phase 3 — RENDER\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-internal-render-pr-body Phase-3-Render`\n\nSelect template based on `--kind`:\n\n```bash\ncase \"$KIND\" in\n  implementation) TEMPLATE_NAME=\"_TEMPLATE-PR-IMPLEMENTATION.md\" ;;\n  backlog)        TEMPLATE_NAME=\"_TEMPLATE-PR-BACKLOG.md\" ;;\nesac\nTEMPLATE_PATH=\"$CLAUDE_PROJECT_DIR\u002F.claude\u002Ftemplates\u002F$TEMPLATE_NAME\"\n```\n\nIf `$TEMPLATE_PATH` not found → emit `OPERATIONAL_ERROR: template missing: $TEMPLATE_PATH` and exit 2.\n\nInvoke `x-internal-write-report` via Rule 13 Pattern 1 (INLINE-SKILL):\n\n```\nSkill(skill: \"x-internal-write-report\", args: \"--template $TEMPLATE_PATH --data \u003Cjson-envelope> --output $TEMP_OUT\")\n```\n\n`$TEMP_OUT` is a temp file under `${REPO_ROOT}\u002F.claude\u002Ftmp\u002Fpr-render-$STORY_ID.md`.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-internal-render-pr-body Phase-3-Render ok`\n\n## Phase 4 — WRITE\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-internal-render-pr-body Phase-4-Write`\n\nAtomic write: move temp file to final `--out` path:\n\n```bash\nmv \"$TEMP_OUT\" \"$OUT_CANONICAL\" 2>\u002Ftmp\u002Fwrite-err.txt || {\n  echo \"OPERATIONAL_ERROR: write permission denied or disk full: $(cat \u002Ftmp\u002Fwrite-err.txt)\" >&2\n  exit 2\n}\necho \"$OUT_CANONICAL\"\n```\n\nOn success, emit the final path to stdout and exit 0.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-internal-render-pr-body Phase-4-Write ok`\n\n\u003C!-- phase-no-gate: Phase 1.5 is a conditional sub-phase inside Phase 1 — no independent gate -->\n## Phase 1.5 — BACKLOG-GATHER (conditional on --kind=backlog)\n\nExecuted only when `--kind=backlog`. Reads backlog-specific sources to build the backlog\nJSON envelope (distinct from the implementation envelope built in Phase 1).\n\n### Source 1 — Epic markdown\n\nLocate `epic-XXXX.md` via PathResolver (searches `ai\u002Fepics\u002Fepic-XXXX-*\u002F`, `plans\u002Fepic-XXXX\u002F`).\nParse:\n- `summary`: first paragraph under `## 1. Contexto & Escopo` or `## 1.1 Problema`\n- `stories`: table rows in `## 9.2 Stories` — extract Phase, Story ID, Layer, Bloqueada por\n- `successMetrics`: bullet items under `## 5.2 Métricas Quantitativas` or `## Métricas de Sucesso`\n- `outOfScopeList`: bullet items under section containing \"Fora do escopo\"\n\n**Escape all string values before JSON injection**: replace `|` with `\\|`, backticks with `` \\` ``, newlines with space.\n\nFallbacks: `summary: \"(no summary)\"`, `stories: []`, `successMetrics: [\"(no metrics declared)\"]`, `outOfScopeList: \"(not documented)\"`.\n\n### Source 2 — IMPLEMENTATION-MAP.md\n\nLocate `IMPLEMENTATION-MAP.md` in the epic directory. Parse:\n- `criticalPath`: regex `\\*\\*Critical path.*?:\\*\\*\\s*(.+)` or `Caminho crítico.*?:\\s*(.+)`\n- `maxParallelism`: regex `\\*\\*Maximum parallelism.*?:\\*\\*\\s*(\\d+)` or `Paralelismo máximo.*?:\\s*(\\d+)`\n- `maxParallelPhase`: regex `\\(Phase\\s+([\\w ]+)\\)` after maxParallelism\n- `totalPhases`: count of `## Phase N` headers\n\nIf IMPLEMENTATION-MAP.md absent:\n```bash\necho \"WARN: IMPLEMENTATION-MAP.md not found for ${EPIC_ID}\" >&2\ncriticalPath=\"(map missing)\"\nmaxParallelism=0\ntotalPhases=0\n```\n\n### Source 3 — Spec markdown\n\nSearch for spec file:\n```bash\nSPEC=$(find \"${REPO_ROOT}\" -name \"spec-*.md\" -path \"*\u002Fepic-XXXX-*\u002F*\" 2>\u002Fdev\u002Fnull | head -1)\n```\nIf found: `specPath=$(realpath --relative-to=\"${REPO_ROOT}\" \"$SPEC\")`, `specSha=$(git rev-parse \"HEAD:${specPath}\" 2>\u002Fdev\u002Fnull || echo \"(unknown)\")`.\nIf not found: `specPath=\"(spec not found)\"`, `specSha=\"(unknown)\"`.\n\n### Source 4 — Coordinations with in-progress epics\n\n```bash\nfor state_file in \"${REPO_ROOT}\"\u002Fai\u002Fepics\u002F*\u002Fexecution-state.json; do\n  status=$(jq -r '.status \u002F\u002F empty' \"$state_file\" 2>\u002Fdev\u002Fnull)\n  if [[ \"$status\" == \"Em Andamento\" ]]; then\n    epic_id=$(jq -r '.epicId \u002F\u002F empty' \"$state_file\" 2>\u002Fdev\u002Fnull)\n    coordinations+=\"{\\\"epicId\\\":\\\"$epic_id\\\",\\\"status\\\":\\\"in_progress\\\"}\"\n  fi\ndone\n```\nFallback if none: `coordinations: [{\"epicId\":\"(none)\",\"status\":\"none\",\"hotFiles\":\"\",\"risk\":\"none\"}]`.\n\n## Error Handling\n\n| Scenario | Action |\n| :--- | :--- |\n| `--kind` absent\u002Finvalid | Exit 1 `INVALID_KIND` |\n| `--story-id` absent for implementation | Exit 3 `INVALID_SCOPE` |\n| `--out` path traversal | Exit 2 `OPERATIONAL_ERROR: path traversal` |\n| Template file missing | Exit 2 `OPERATIONAL_ERROR: template missing` |\n| Write permission denied | Exit 2 `OPERATIONAL_ERROR: write permission denied` |\n| `telemetry-consolidate.sh` exit 1\u002F2 | WARNING + placeholder (continue) |\n| Any artifact absent | Placeholder per RULE-004 (continue) |\n\n## Integration Notes\n\n| Skill | Relationship |\n| :--- | :--- |\n| `x-create-pr` | Primary caller for `--kind=implementation` |\n| `x-create-feature` | Caller for `--kind=backlog` (story-0066-0006) — RULE-007: backlog PR `## Orchestrator Evidence` is reduced (no Story IDs; accrues in subsequent story PRs) |\n| `x-internal-write-report` | Delegate for template rendering (Phase 3) |\n| `scripts\u002Ftelemetry-consolidate.sh` | Telemetry aggregator (Phase 2, story-0066-0002) |\n| `_TEMPLATE-PR-IMPLEMENTATION.md` | Template consumed by Phase 3 (story-0066-0001) |\n| `_TEMPLATE-PR-BACKLOG.md` | Template for backlog kind (story-0066-0001) |\n\n**Haiku eligibility (Rule 23 §criterion a):** utility without design reasoning — reads files,\nformats data, writes output. No architectural choices. Upgrade to sonnet\u002Fopus must be justified\nin this section with concrete rationale.\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> 🔒 **INTERNAL SKILL** — Invoked only by other skills via the Skill tool. Not user-invocable.\n\n# Skill: x-internal-render-pr-body\n\n## Purpose\n\nRenders a PR body Markdown file from existing on-disk artifacts (review, verify, telemetry,\ncommits) and writes it to `--out`. Consumed by `x-create-pr` (kind=implementation) and\n`x-create-feature` (kind=backlog). Fail-open: any missing source produces a human-readable\nplaceholder — never an audit-sentinel string recognized by `audit-pr-evidence.sh`.\n\n## Parameters\n\n| Parameter | Required | Description |\n| :--- | :--- | :--- |\n| `--kind` | Yes | `implementation` or `backlog` |\n| `--story-id` | When `--kind=implementation` | Pattern `story-XXXX-YYYY` |\n| `--epic-id` | When `--kind=backlog` | Pattern `epic-XXXX` or `EPIC-XXXX` |\n| `--out` | Yes | Absolute path for output Markdown file |\n\n## Exit Codes\n\n| Exit | Code | Condition |\n| :--- | :--- | :--- |\n| 0 | OK | Body rendered and written successfully |\n| 1 | INVALID_KIND | `--kind` absent or not `implementation`\u002F`backlog` |\n| 2 | OPERATIONAL_ERROR | template missing, write permission denied, path traversal detected |\n| 3 | INVALID_SCOPE | `--story-id` absent for `--kind=implementation`; `--epic-id` absent for `--kind=backlog` |\n\n## Fail-Open Contract (RULE-004)\n\nEvery absent artifact produces a human-readable placeholder. Permitted placeholders:\n- `(pending)` — review artifacts not yet produced\n- `(not yet run)` — verify gate not yet executed\n- `(no telemetry available)` — events.ndjson absent or empty\n- `(none)` — no tasks or commits found\n- `(no commits)` — git log returns empty\n\n**Forbidden placeholder values** (would trigger `audit-pr-evidence.sh`): `story-XXXX-YYYY`,\n`EPIC-XXXX`, any pattern matching `story-[0-9]{4}-[0-9]{4}` as a verdict\u002Fdecision value.\n\n## Triggers\n\nThis skill is internal — never typed by a user. Callers use Rule 13 INLINE-SKILL pattern:\n\n```markdown\nSkill(skill: \"x-internal-render-pr-body\", args: \"--kind=implementation --story-id story-XXXX-YYYY --out \u002Fabs\u002Fpath\u002Fbody.md\")\n```\n\n## Phase 0 — ARGS\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-internal-render-pr-body Phase-0-Args`\n\nParse and validate all arguments:\n\n1. Extract `--kind`, `--story-id`, `--epic-id`, `--out` from argv.\n2. Validate `--kind`:\n   ```bash\n   case \"$KIND\" in\n     implementation|backlog) ;;\n     *) echo \"INVALID_KIND: --kind is required (implementation|backlog)\" >&2; exit 1 ;;\n   esac\n   ```\n3. Validate scope argument:\n   ```bash\n   if [[ \"$KIND\" == \"implementation\" && -z \"$STORY_ID\" ]]; then\n     echo \"INVALID_SCOPE: --story-id required for --kind=implementation\" >&2; exit 3\n   fi\n   if [[ \"$KIND\" == \"backlog\" && -z \"$EPIC_ID\" ]]; then\n     echo \"INVALID_SCOPE: --epic-id required for --kind=backlog\" >&2; exit 3\n   fi\n   ```\n4. Validate `--story-id` format (kind=implementation): `^story-[0-9]{4}-[0-9]{4}$`.\n5. Canonicalize `--out` and verify it stays within `${REPO_ROOT}` (Rule 06 J6 — path traversal):\n   ```bash\n   REPO_ROOT=$(realpath \"$CLAUDE_PROJECT_DIR\")\n   OUT_CANONICAL=$(realpath --canonicalize-missing \"$OUT\")\n   if [[ \"$OUT_CANONICAL\" != \"$REPO_ROOT\"* ]]; then\n     echo \"OPERATIONAL_ERROR: --out path traversal detected: $OUT\" >&2; exit 2\n   fi\n   ```\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-internal-render-pr-body Phase-0-Args ok`\n\n## Phase 1 — GATHER\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-internal-render-pr-body Phase-1-Gather`\n\nRead 7 data sources (kind=implementation only; backlog uses a different set — see Phase 1b in §Backlog extension). Build intermediate JSON envelope. Apply fail-open fallbacks.\n\n### Source 1 — Story markdown (Acceptance Criteria)\n\nLocate `story-{storyId}.md` via PathResolver (searches `ai\u002Fepics\u002F*\u002F`, `plans\u002Fepic-XXXX\u002F`).\nParse Gherkin `Cenário:` headings for acceptance criteria list.\nFallback: `acceptanceCriteria: []` (empty list).\n\n### Source 2 — Specialist review verdict\n\nLocate `review-story-{storyId}.md` under `ai\u002Fepics\u002Fepic-XXXX-*\u002Fplans\u002F` (v4) or `plans\u002Fepic-XXXX\u002Fplans\u002F` (v3).\n\nParse **YAML-when-available**: if `head -1 \u003Cfile>` returns `---` (YAML frontmatter), use\n`yq '.verdict' \u003Cfile>` (EPIC-0067 structured verdict). Otherwise, fallback regex:\n```bash\ngrep -oP '(?\u003C=\\*\\*Verdict:\\s)(GO|NO-GO)' \"$REVIEW_FILE\" | head -1\n```\nFallback if file absent or regex fails: `specialistVerdict: \"(pending)\"`.\n\n### Source 3 — Tech-lead review decision\n\nLocate `techlead-review-story-{storyId}.md`. Same YAML-when-available logic.\nFallback regex: `grep -oP '(?\u003C=\\*\\*Decision:\\s)(GO|NO-GO)'`.\nFallback: `techleadDecision: \"(pending)\"`.\n\n### Source 4 — Verify envelope\n\nLocate `reports\u002Fverify-envelope-{storyId}.json`. Parse via jq:\n```bash\njq -r '.testsResult, .coverageLine, .coverageBranch' \"$ENVELOPE\"\n```\nFallback per field: `\"(not yet run)\"`.\n\n### Source 5 — Story completion report (task IDs)\n\nLocate `reports\u002Fstory-completion-report-{storyId}.md`. Parse task table rows:\n```bash\ngrep -oP 'TASK-[0-9]{4}-[0-9]{4}-[0-9]{3}' \"$REPORT\" | sort -u | tr '\\n' ', '\n```\nFallback: `taskIds: \"(none)\"`.\n\n### Source 6 — Commits\n\nRun `git log origin\u002Fdevelop..HEAD --oneline` in REPO_ROOT. Capture stdout as commit list.\nFallback: `commitsList: \"(no commits)\"`.\n\n### Source 7 — Orchestrator metadata\n\nCapture:\n- `orchSha`: `git rev-parse HEAD`\n- `invocationSkill`: `x-implement-story`\n- `phase1Artifacts`: list files matching `ai\u002Fepics\u002F*\u002Fplans\u002F*-{storyId}.md`\n- `phase3Artifacts`: list files matching `ai\u002Fepics\u002F*\u002Freports\u002F*-{storyId}.*`\n\nEscape all string values: replace `|` with `\\|`, backticks with `\\``, newlines with space.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-internal-render-pr-body Phase-1-Gather ok`\n\n## Phase 2 — TELEMETRY\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-internal-render-pr-body Phase-2-Telemetry`\n\nInvoke `scripts\u002Ftelemetry-consolidate.sh` (story-0066-0002) for the story scope:\n\n```bash\nTEL_JSON=$(scripts\u002Ftelemetry-consolidate.sh --story=\"$STORY_ID\" --format=json 2>\u002Ftmp\u002Ftel-err.txt)\nTEL_EXIT=$?\n```\n\n- `TEL_EXIT=0`: parse `$TEL_JSON` for `activeMs`, `elapsedMs`, `events`, `tasks[]`, `topTools[]`. Incorporate into envelope.\n- `TEL_EXIT=1` (NO_TELEMETRY): set `storyActiveMin=(no telemetry available)`, `storyElapsedMin=(no telemetry available)`, `storyEventCount=(no telemetry available)`, `tasks=[]`, `topTools=[]`. Emit WARNING to stderr.\n- `TEL_EXIT=2` (OPERATIONAL_ERROR): same as exit 1 (warning + placeholder). Do NOT abort — telemetry is non-blocking per RULE-002.\n\nConvert activeMs\u002FelapsedMs to minutes: `floor(ms \u002F 60000)`.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-internal-render-pr-body Phase-2-Telemetry ok`\n\n## Phase 3 — RENDER\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-internal-render-pr-body Phase-3-Render`\n\nSelect template based on `--kind`:\n\n```bash\ncase \"$KIND\" in\n  implementation) TEMPLATE_NAME=\"_TEMPLATE-PR-IMPLEMENTATION.md\" ;;\n  backlog)        TEMPLATE_NAME=\"_TEMPLATE-PR-BACKLOG.md\" ;;\nesac\nTEMPLATE_PATH=\"$CLAUDE_PROJECT_DIR\u002F.claude\u002Ftemplates\u002F$TEMPLATE_NAME\"\n```\n\nIf `$TEMPLATE_PATH` not found → emit `OPERATIONAL_ERROR: template missing: $TEMPLATE_PATH` and exit 2.\n\nInvoke `x-internal-write-report` via Rule 13 Pattern 1 (INLINE-SKILL):\n\n```\nSkill(skill: \"x-internal-write-report\", args: \"--template $TEMPLATE_PATH --data \u003Cjson-envelope> --output $TEMP_OUT\")\n```\n\n`$TEMP_OUT` is a temp file under `${REPO_ROOT}\u002F.claude\u002Ftmp\u002Fpr-render-$STORY_ID.md`.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-internal-render-pr-body Phase-3-Render ok`\n\n## Phase 4 — WRITE\n\n\u003C!-- TELEMETRY: phase.start -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh start x-internal-render-pr-body Phase-4-Write`\n\nAtomic write: move temp file to final `--out` path:\n\n```bash\nmv \"$TEMP_OUT\" \"$OUT_CANONICAL\" 2>\u002Ftmp\u002Fwrite-err.txt || {\n  echo \"OPERATIONAL_ERROR: write permission denied or disk full: $(cat \u002Ftmp\u002Fwrite-err.txt)\" >&2\n  exit 2\n}\necho \"$OUT_CANONICAL\"\n```\n\nOn success, emit the final path to stdout and exit 0.\n\n\u003C!-- TELEMETRY: phase.end -->\nBash command: `$CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Ftelemetry-phase.sh end x-internal-render-pr-body Phase-4-Write ok`\n\n\u003C!-- phase-no-gate: Phase 1.5 is a conditional sub-phase inside Phase 1 — no independent gate -->\n## Phase 1.5 — BACKLOG-GATHER (conditional on --kind=backlog)\n\nExecuted only when `--kind=backlog`. Reads backlog-specific sources to build the backlog\nJSON envelope (distinct from the implementation envelope built in Phase 1).\n\n### Source 1 — Epic markdown\n\nLocate `epic-XXXX.md` via PathResolver (searches `ai\u002Fepics\u002Fepic-XXXX-*\u002F`, `plans\u002Fepic-XXXX\u002F`).\nParse:\n- `summary`: first paragraph under `## 1. Contexto & Escopo` or `## 1.1 Problema`\n- `stories`: table rows in `## 9.2 Stories` — extract Phase, Story ID, Layer, Bloqueada por\n- `successMetrics`: bullet items under `## 5.2 Métricas Quantitativas` or `## Métricas de Sucesso`\n- `outOfScopeList`: bullet items under section containing \"Fora do escopo\"\n\n**Escape all string values before JSON injection**: replace `|` with `\\|`, backticks with `` \\` ``, newlines with space.\n\nFallbacks: `summary: \"(no summary)\"`, `stories: []`, `successMetrics: [\"(no metrics declared)\"]`, `outOfScopeList: \"(not documented)\"`.\n\n### Source 2 — IMPLEMENTATION-MAP.md\n\nLocate `IMPLEMENTATION-MAP.md` in the epic directory. Parse:\n- `criticalPath`: regex `\\*\\*Critical path.*?:\\*\\*\\s*(.+)` or `Caminho crítico.*?:\\s*(.+)`\n- `maxParallelism`: regex `\\*\\*Maximum parallelism.*?:\\*\\*\\s*(\\d+)` or `Paralelismo máximo.*?:\\s*(\\d+)`\n- `maxParallelPhase`: regex `\\(Phase\\s+([\\w ]+)\\)` after maxParallelism\n- `totalPhases`: count of `## Phase N` headers\n\nIf IMPLEMENTATION-MAP.md absent:\n```bash\necho \"WARN: IMPLEMENTATION-MAP.md not found for ${EPIC_ID}\" >&2\ncriticalPath=\"(map missing)\"\nmaxParallelism=0\ntotalPhases=0\n```\n\n### Source 3 — Spec markdown\n\nSearch for spec file:\n```bash\nSPEC=$(find \"${REPO_ROOT}\" -name \"spec-*.md\" -path \"*\u002Fepic-XXXX-*\u002F*\" 2>\u002Fdev\u002Fnull | head -1)\n```\nIf found: `specPath=$(realpath --relative-to=\"${REPO_ROOT}\" \"$SPEC\")`, `specSha=$(git rev-parse \"HEAD:${specPath}\" 2>\u002Fdev\u002Fnull || echo \"(unknown)\")`.\nIf not found: `specPath=\"(spec not found)\"`, `specSha=\"(unknown)\"`.\n\n### Source 4 — Coordinations with in-progress epics\n\n```bash\nfor state_file in \"${REPO_ROOT}\"\u002Fai\u002Fepics\u002F*\u002Fexecution-state.json; do\n  status=$(jq -r '.status \u002F\u002F empty' \"$state_file\" 2>\u002Fdev\u002Fnull)\n  if [[ \"$status\" == \"Em Andamento\" ]]; then\n    epic_id=$(jq -r '.epicId \u002F\u002F empty' \"$state_file\" 2>\u002Fdev\u002Fnull)\n    coordinations+=\"{\\\"epicId\\\":\\\"$epic_id\\\",\\\"status\\\":\\\"in_progress\\\"}\"\n  fi\ndone\n```\nFallback if none: `coordinations: [{\"epicId\":\"(none)\",\"status\":\"none\",\"hotFiles\":\"\",\"risk\":\"none\"}]`.\n\n## Error Handling\n\n| Scenario | Action |\n| :--- | :--- |\n| `--kind` absent\u002Finvalid | Exit 1 `INVALID_KIND` |\n| `--story-id` absent for implementation | Exit 3 `INVALID_SCOPE` |\n| `--out` path traversal | Exit 2 `OPERATIONAL_ERROR: path traversal` |\n| Template file missing | Exit 2 `OPERATIONAL_ERROR: template missing` |\n| Write permission denied | Exit 2 `OPERATIONAL_ERROR: write permission denied` |\n| `telemetry-consolidate.sh` exit 1\u002F2 | WARNING + placeholder (continue) |\n| Any artifact absent | Placeholder per RULE-004 (continue) |\n\n## Integration Notes\n\n| Skill | Relationship |\n| :--- | :--- |\n| `x-create-pr` | Primary caller for `--kind=implementation` |\n| `x-create-feature` | Caller for `--kind=backlog` (story-0066-0006) — RULE-007: backlog PR `## Orchestrator Evidence` is reduced (no Story IDs; accrues in subsequent story PRs) |\n| `x-internal-write-report` | Delegate for template rendering (Phase 3) |\n| `scripts\u002Ftelemetry-consolidate.sh` | Telemetry aggregator (Phase 2, story-0066-0002) |\n| `_TEMPLATE-PR-IMPLEMENTATION.md` | Template consumed by Phase 3 (story-0066-0001) |\n| `_TEMPLATE-PR-BACKLOG.md` | Template for backlog kind (story-0066-0001) |\n\n**Haiku eligibility (Rule 23 §criterion a):** utility without design reasoning — reads files,\nformats data, writes output. No architectural choices. Upgrade to sonnet\u002Fopus must be justified\nin this section with concrete rationale.\n",{"name":5,"model":24,"category":25,"visibility":26,"description":7,"allowed-tools":27,"argument-hint":32,"context-budget":33,"user-invocable":20,"requires-capabilities":34},"haiku","internal-pr","internal",[28,29,30,31],"Read","Write","Bash","Skill","--kind=implementation|backlog --story-id \u003Cstory-XXXX-YYYY> --out \u003Cabs-path>","light",[],"main","952a630c6f38d193a349d86fa18db1de8843e837","src\u002Fmain\u002Fresources\u002Ftargets\u002Fclaude\u002Fskills\u002Fcore\u002Finternal\u002Fpr\u002Fx-internal-render-pr-body",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":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add review-bench\u002Federcnj_ia-dev-environment --skill x-internal-render-pr-body",{"tool":50,"command":51},"bunx","bunx skills add review-bench\u002Federcnj_ia-dev-environment --skill x-internal-render-pr-body",{"tool":53,"command":54},"pnpm","pnpm dlx skills add review-bench\u002Federcnj_ia-dev-environment --skill x-internal-render-pr-body","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Freview-bench\u002Federcnj_ia-dev-environment\u002Fblob\u002Fmain\u002Fsrc\u002Fmain\u002Fresources\u002Ftargets\u002Fclaude\u002Fskills\u002Fcore\u002Finternal\u002Fpr\u002Fx-internal-render-pr-body\u002FSKILL.md",true,[],[59,66,73,80,87,94],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"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":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"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":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"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":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"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":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"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":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"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",[],[]]