java/src/main/resources/targets/claude/skills/core/ops/x-status-reconcile/SKILL.md
Reconciles execution-state.json (telemetry) against the **Status:** field of Epic / Story markdown artifacts. Default mode (diagnose) is read-only and prints a divergence table. Opt-in --apply rewrites the markdowns atomically via StatusFieldParser and commits via x-git-commit. Respects Rule 19 (legacy v1 epics skip silently) and Rule 22 (markdown is SoT; state.json is telemetry). Use for manual recovery of legacy epics whose markdown status drifted from execution checkpoints.
npx skillsauth add edercnj/ia-dev-environment x-status-reconcileInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Reconcile drift between plans/epic-XXXX/execution-state.json
(telemetry, per RULE-046-07) and the canonical **Status:**
field of Epic / Story markdown artifacts (source of truth, per
Rule 22 — Lifecycle Integrity).
Typical use case: legacy epic EPIC-0024 has 16 stories with
status: SUCCESS in execution-state.json but every story
markdown still says **Status:** Pendente. Running
/x-status-reconcile --epic 0024 --apply rewrites the 16
markdowns (plus the epic-level rollup) and emits a single
audit commit.
/x-status-reconcile --epic 0024 — diagnose mode (read-only)/x-status-reconcile --epic 0024 --apply — apply + commit/x-status-reconcile --epic 0024 --apply --non-interactive — CI/x-status-reconcile --story story-0024-0005 --apply — narrow scope/x-status-reconcile --epic 0024 --apply --dry-run — force diagnose even with --apply| Parameter | Required | Description |
| :--- | :--- | :--- |
| --epic XXXX | one of (--epic, --story) | Full epic scope |
| --story story-XXXX-YYYY | one of (--epic, --story) | Single-story scope |
| --apply | no | Rewrites markdowns + commits; default is diagnose |
| --non-interactive | no | Skips the PROCEED/FIX/ABORT gate (assumes PROCEED) |
| --dry-run | no | Forces diagnose output even when --apply is present |
| Code | Name | Meaning |
| :--- | :--- | :--- |
| 0 | SUCCESS | No divergence OR diagnose mode |
| 10 | APPLIED | --apply succeeded (commit created) |
| 20 | STATUS_SYNC_FAILED | Markdown write failure |
| 30 | STATE_FILE_INVALID | execution-state.json missing or malformed |
| 40 | STATUS_TRANSITION_INVALID | Suspicious transition (e.g., CONCLUIDA→PENDENTE) |
| 50 | USER_ABORTED | Operator chose ABORT at gate |
--epic XXXX or parse story id from --story.plans/epic-XXXX/execution-state.json.Delegate to LifecycleReconciler.isLegacyV1(epicDir). When
true, print "legacy epic; skipping per Rule 19" and exit 0
without any side effect.
Call LifecycleReconciler.diff(epicDir) and render a table:
Divergence report for epic 0024:
story-0024-0001.md: Pendente → Concluída
story-0024-0002.md: Pendente → Concluída
...
epic-0024.md: Em Andamento → Concluída
Total divergences: N
When --apply is NOT present (or --dry-run forces diagnose),
print the final JSON with "mode": "diagnose" and exit 0.
--apply and NOT --non-interactive)Present the canonical 3-option menu (reuse Rule 20 / EPIC-0043 when available):
AskUserQuestion(
question: "N divergences detected for epic XXXX. Apply?",
options: [
{ header: "Proceed", label: "Continue (Recommended)",
description: "Apply all markdown rewrites and commit." },
{ header: "Fix", label: "Regenerate diagnose",
description: "Re-run diagnose with verbose detail; menu reappears." },
{ header: "Abort", label: "Cancel",
description: "Exit 50 — no markdown is touched." }
]
)
LifecycleReconciler.apply(divergences) — validates every
transition against LifecycleTransitionMatrix BEFORE any
write (atomicity). A forbidden transition → exit 40.
Delegate the commit to x-git-commit via Rule 13
INLINE-SKILL:
Skill(skill: "x-git-commit",
args: "--type chore --scope epic-XXXX --subject 'reconcile lifecycle status backfill'")
On success, print the final JSON with "mode": "apply",
"commitSha": "<sha>", and exit 10.
{
"status": "APPLIED",
"epicId": "0024",
"divergences": [
{"artifact": "story-0024-0001.md",
"from": "Pendente", "to": "Concluída"}
],
"divergenceCount": 33,
"commitSha": "abc1234",
"mode": "apply"
}
Consumer tests parse the final line as JSON; everything preceding is human-readable diagnostics.
execution-state.json (RULE-046-07).plans/epic-XXXX/ (path
canonicalization; no traversal).StatusFieldParser
(atomic temp-file + rename, per Rule 22).--apply AND divergences exist AND
gate = PROCEED AND apply() succeeds.| Condition | Action |
| :--- | :--- |
| --epic and --story both missing | exit 2 with usage |
| execution-state.json missing or malformed | exit 30 |
| Legacy v1 epic | exit 0 with "skipping" message |
| Forbidden transition | exit 40; no markdown rewritten |
| Markdown write failure | exit 20; partial writes possible (rare — rename is atomic); operator inspects git status |
| Gate → ABORT | exit 50; working tree unchanged |
x-git-commit).StatusFieldParser, LifecycleTransitionMatrix, LifecycleReconciler (story-0046-0001 + 0046-0006).testing
Scaffolds a Helidon SE/MP service with routing, health, config, Dockerfile, and tests.
tools
Generates a Picocli @Command with subcommands, options, converters, and unit tests.
testing
Scaffolds a Micronaut service with @Controller, DI, health, Dockerfile, and tests.
testing
Scaffolds a Helidon SE/MP service with routing, health, config, Dockerfile, and tests.