[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71XJ07P736RXH50D0TC5J00":3,"skill-same:01M71XJ07P736RXH50D0TC5J00":57},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":21,"linkOnly":22,"markdownContent":23,"markdownBody":24,"frontMatter":25,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":13,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M71XJ07P736RXH50D0TC5J00","spec-close",null,"Vigil-Harbor\u002Fvigil-skills","Vigil-Harbor","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F274451992?v=4","01M71XFV786Y0N52C3M5D2WF4H","Vigil Harbor","01M71XFV7ZCE2MKGJX8DP3SGKD",0,"MIT","https:\u002F\u002Fgithub.com\u002FVigil-Harbor\u002Fvigil-skills\u002Fblob\u002Fmain\u002Fskills\u002Fspec-close\u002FSKILL.md",[],[18,19,20],"spec","close","spec close","2026-11-10 13:45:54",false,"---\nname: spec-close\ndescription: Close a shipped spec in one pass — reconcile it against the shipped code, harvest wiki entries sized to the brief's tier, archive its artifacts from TODO\u002F to DONE\u002F, and prepend a close entry to the wiki's log.md. Also archives tickets that have artifacts but no spec. Run after \u002Fspec-land.\nuser_invocable: true\nrequires:\n  shell: true\n  filesystem: [read, write]\n  network: true\n  services: [issue-tracker?, vcs-host?]\n---\n\n```\n\u002Fspec-close \u003Cspec-path | TICKET-ID | docs\u002Fspecs\u002FTODO\u002F\u003CTICKET-ID>\u002F> [--report-only | --partial]\n```\n\n`--report-only` and `--partial` together halt with `Usage: --report-only and --partial are mutually exclusive — pick one.`\n\nNothing changes before the Phase 4 confirmation except the reconciliation report.\n\n## Phase 0 — Preflight\n\n- **Resolve.** `project_root` is the repo root (the directory holding `docs\u002Fspecs\u002F`); run every command from it. Take the ticket id from the argument: the `.spec.md` stem, the `DONE\u002F\u003CID>\u002F` directory name, the `TODO\u002F\u003CID>\u002F` folder name, or the id itself. Uppercase it. `project_prefix` is the part before the first hyphen. The spec is `docs\u002Fspecs\u002FTODO\u002F\u003CID>.spec.md`, else `docs\u002Fspecs\u002FDONE\u002F\u003CID>\u002Fspec.md`.\n  - A spec exists: the spec flow (Phases 1–5).\n  - No spec, but a `docs\u002Fspecs\u002FTODO\u002F\u003CID>.*` entry, a `docs\u002Fspecs\u002FTODO\u002F\u003CID>\u002F` folder, or an existing `docs\u002Fspecs\u002FDONE\u002F\u003CID>\u002F`: the archive-only close (Phase 2A).\n  - Nothing found: halt with `nothing to close for \u003CID> under docs\u002Fspecs\u002F`.\n- **Wiki.** Read `wiki_root` and `project_slug` from the project's `CLAUDE.md` or `AGENTS.md`. If a path with a username segment does not exist, retry it with the current user's name. A missing wiki is a warning; Phase 1 handles it.\n- **Origin.** Run `timeout 30 git fetch origin`, then `git rev-list --count HEAD..origin\u002F\u003Cbranch>` (the default branch when the current one has no origin counterpart). When behind, print one line: `origin: local \u003Cbranch> is \u003CN> commits behind origin\u002F\u003Ccmp> — reconciliation reads the working tree; never updated here.` Any git failure prints `origin: skipped (\u003Creason>)`. Never update the tree.\n\nPrint one preflight line: ticket, flow (spec | archive-only), flags, wiki, origin.\n\n## Phase 1 — Mode\n\nSpec flow only. The archive-only close skips this phase whatever the ticket's state. First match wins:\n\n1. `--report-only` → report only. No tracker read; the report's Plane line reads `not checked (--report-only)`.\n2. `--partial`, or no tracker config → partial-close. No tracker config means the installed `${CLAUDE_CONFIG_DIR:-$HOME\u002F.claude}\u002Fskills\u002Fship-spec\u002Fstates.json` is missing, unreadable, or has no `project_prefix` key.\n3. The ticket's state group is `completed` or `cancelled`, and the wiki exists → full-close.\n4. Anything else → print why, then the partial-or-abort prompt: `1. Partial-close  2. Abort`. This covers another group, a read with no group, Plane unreachable or ticket not found, and a missing wiki for a full close.\n\nRead the ticket with the issue tracker's retrieve-by-identifier capability (e.g., `mcp__claude_ai_Plane__workitem` with `action: retrieve_by_identifier`, `workitem_identifier: \"\u003CTICKET-ID>\"`, `fields: \"name,state,completed_at\"` and `expand: \"state\"` in Claude Code, or the equivalent in your host; load the tool first if your host defers tool schemas). `state.group` is the gate. A failed read prints `ticket: could not read \u003CTICKET-ID> from the issue tracker (\u003Cerror>). Usually a login problem: re-authenticate the tracker connection.` and takes rule 4.\n\nNever gate on `completed_at`: some states that are not done still set it. It is only a ship-date source.\n\nPartial-close skips Phases 2 and 3. With no wiki it archives only and prints `wiki not found — skipping log.md entry; archive only`.\n\n## Phase 2 — Reconcile (full-close and report-only)\n\n- **Merge.** In `\u003Cwiki_root>\u002Flog.md`, find the headings that contain `merge | \u003CPREFIX> — \u003CTICKET-ID> PR #`. spec-land writes one per landed PR. The PR number follows `PR #` up to the `:`. The SHA is that entry's `Landed: \u003Csha>` body line; an entry without one gives only its PR number. Several entries: read each and combine them. With no wiki or no entry, run `git log --all --oneline -i -E --grep=\"\u003CTICKET-ID>([^0-9]|$)\" -- .` (the suffix keeps `VHS-1` off `VHS-11`). Nothing found: ask `Could not find merge commit for \u003CTICKET-ID>. Enter PR number or commit SHA:`.\n- **Diff.** For each SHA, read the first-parent diff: `git diff --stat \u003CSHA>^1 \u003CSHA>`, then `git diff \u003CSHA>^1 \u003CSHA>`. That is the change for a squash commit and for a two-parent merge commit, where `git show` prints no diff. If `\u003CSHA>^1` does not resolve, the clone lacks the commit: say so and ask the operator to fetch. With only a PR number, run `gh pr view \u003CN> --json files,additions,deletions` and `gh pr diff \u003CN>`. If `gh` is absent or either command fails, stop and ask for the merge SHA. Over 500 diff lines: summarize by file, and read the paths the spec's decisions name.\n- **Brief.** `\u003CID>.brief.md` beside a TODO spec, `brief.md` beside a DONE spec. Its acceptance criteria are reconciliation targets. Its `## Tier` `**Level:**` line drives Phase 3.\n- **Walk.** Read the code; do not infer.\n  - Scope: each spec file in the diff, dropped, or unexpected.\n  - Decisions: Confirmed, Drifted, or Unverifiable.\n  - Done-when criteria: Met, Unmet, or Unverifiable, each with evidence.\n  - Test plan: does each test exist?\n- **Report.** Write `\u003CID>.reconciliation.md` beside the spec (`reconciliation.md` beside a DONE spec). Overwrite an old one.\n\n```markdown\n# Reconciliation Report: \u003CTICKET-ID>\n\n> Date: YYYY-MM-DD\n> Spec: \u003Cspec path>\n> Merge: \u003CPR number(s) and SHA(s)>\n> Plane state: \u003Cstate_name> (group: \u003Cgroup>)\n\n## Summary\n\u003C1-2 sentences.>\n\n## Scope\n| Spec file | In diff? | Notes |\n|---|---|---|\n\nUnexpected files in diff (not in spec):\n- `path` — \u003Cwhat it does>\n\n## Decisions\n| # | Decision | Status | Evidence |\n|---|---|---|---|\n\n## Acceptance Criteria\n| # | Criterion | Status | Evidence |\n|---|---|---|---|\n\n## Test Plan\n| Test | Exists? | Location |\n|---|---|---|\n\n## Wiki-ready\n\u003Cone line per entry worth writing, or `none`>\n\nRECONCILED: \u003Cyes|no> DRIFT: \u003Cn>\n```\n\n`RECONCILED: yes` needs zero Unmet. `DRIFT` counts Drifted + Dropped + Unexpected. Report-only ends here: print the report path and `Re-run \u002Fspec-close \u003Cspec-path> without --report-only to complete the close.` On `RECONCILED: no`, ask `Spec has unmet acceptance criteria. Continue anyway? [y\u002FN]` and halt on N.\n\n## Phase 2A — Archive-only close\n\nFor a ticket with artifacts but no spec. There is no reconciliation, no harvest and no mode-gate read. `--report-only` stops with `nothing to reconcile: \u003CID> has no spec`. `--partial` is accepted and changes nothing.\n\nPhase 4 shows the archive plan and the log entry. Phase 5 runs the archive and the log write. The log heading is `## [\u003Cdate>] close | \u003CPREFIX> — \u003CID>: \u003Ctitle> (archive only, no spec)`. `\u003Ctitle>` is the brief's `# ` heading when a brief exists. Otherwise it is the ticket name from a tracker read when one succeeds, else `\u003CID> artifacts`. The body is one sentence naming what was archived.\n\nA ticket already in `DONE\u002F\u003CID>\u002F`, with nothing left in `TODO\u002F`, only gets the log line; the guard keeps it to one. With no wiki, it archives only and prints the skipped-log notice.\n\n## Phase 3 — Harvest (full-close only)\n\n- **Duplicates.** Run `grep -rlw \"\u003CTICKET-ID>\"` over `decisions\u002F`, `comprehension\u002F` and `projects\u002F\u003Cslug>\u002Fstate.md`, and show the hits. Do not propose a kind of entry the wiki already has for this ticket unless the operator asks. A state.md hit counts only when it sits under What's Shipped; a hit under What's Active or What's Next is the entry to move to What's Shipped. spec-close never edits the filemap; spec-land owns it.\n- **Weight.** Brief tier `small`: a state.md entry and the log line only. Any other tier, or no tier:\n  - a decision page only when the spec chose between real options;\n  - a comprehension page only for a new module, data flow or integration.\n\n  Follow the wiki's SCHEMA.md templates.\n- **state.md.** A What's Shipped entry has three parts:\n  - the evidence-triple heading `(\u003CID>, \u003Cship-date>, commit \u003Csha>)`;\n  - the `Verification: \u003Cfile>:\u003Cline> -- '\u003Cexcerpt>'` line, taken from the report;\n  - 1–2 sentences and links.\n\n  The ship date is `completed_at`, else the merge commit's date, else today with a warning. With incomplete evidence, skip the state.md edit and say so. Replace the `> Last updated:` line with one line, `> Last updated: \u003Ctoday> (\u003CID> \u003Cshort note>)`. Never keep or extend a `Prior:` chain.\n\n## Phase 4 — Confirm\n\nOne checkpoint covers every change after the report. Run the archive block (Phase 5) with `--dry-run` added after the ticket id, and paste its output, or its `archive NOT run` line, into the plan verbatim:\n\n```text\n=== CLOSE PLAN: \u003CTICKET-ID> ===\nMode: \u003Cfull-close | partial-close | archive-only>\nReconciliation: \u003CRECONCILED: yes|no, DRIFT: n | skipped>\nWiki: \u003Cavailable | not found — log.md entry omitted>\n\nWiki entries to create:\n  1. decisions\u002FYYYY-MM-DD-\u003Cslug>.md — \"\u003Ctitle>\"\n     \u003C3-line preview>\n\nState.md update:\n  File: projects\u002F\u003Cproject>\u002Fstate.md\n  \u003CWhat's Shipped entry and the new Last updated line>\n\nArchive (dry run):\n  \u003Carchive_spec.py --dry-run output>\n\nLog.md entry (prepended):\n  ## [\u003Cdate>] close | \u003CPREFIX> — \u003CTICKET-ID>: \u003Ctitle>\n  \u003Cbody>\n\nProceed? [y\u002FN]\n```\n\nOn `N`, stop: nothing changes after the report.\n\n## Phase 5 — Execute\n\n1. **Wiki** (full-close only). Write the approved pages, then the state.md edit.\n2. **Archive.** Run this block and show its output:\n\n   ```bash\n   ARCHIVE=\"${CLAUDE_CONFIG_DIR:-$HOME\u002F.claude}\u002Fskills\u002Fspec-close\u002Fscripts\u002Farchive_spec.py\"\n   command -v python3 >\u002Fdev\u002Fnull 2>&1 && python3 -c '' >\u002Fdev\u002Fnull 2>&1 && PY=python3 || PY=python\n   cd \"\u003Cproject_root>\"\n   if test -f \"$ARCHIVE\"; then \"$PY\" \"$ARCHIVE\" \u003CTICKET-ID> \u003C \u002Fdev\u002Fnull; else echo \"archive NOT run: archive_spec.py not found at $ARCHIVE — install with 'python sync.py install'\"; fi\n   ```\n\n   The script moves `TODO\u002F\u003CID>.*` to `DONE\u002F\u003CID>\u002F` with the prefix stripped, then the children of a `TODO\u002F\u003CID>\u002F` folder. It skips sources already gone and never moves onto an existing path. It stages tracked moves, and untracked ones only when git does not ignore the destination. It prints one `staged:` line per staged path, `staged: none`, or `nothing to archive` (nothing new staged). Exit 0 is all done, and 1 is some item skipped or failed. Exit 2 is a usage error.\n\n   On exit 0, continue. On any other exit, or `archive NOT run`, the archive is incomplete: skip the log write, report `Archive: incomplete` with the script's problem lines, and ask the operator to clear each one and re-run `\u002Fspec-close \u003CTICKET-ID>`. A `destination exists` line means two artifacts claim one path: show the operator both paths and let them resolve it by hand before the re-run. Never delete, overwrite or rename either one yourself. For a tracked file, the operator uses `git mv`, so the index follows. To clear `moved, NOT staged`, run `git add` on that path. The re-run archives what is left and writes the log line. If it rewrites a reconciliation report that was already staged, run `git add` on the report again; leave an ignored one alone.\n3. **Log** (skipped when there is no wiki). Prepend the entry with `prepend_log_entry.py`; it places the entry above the newest dated one, checks the guard, and writes atomically.\n   - Spec-flow heading: `## [\u003Cdate>] close | \u003CPREFIX> — \u003CTICKET-ID>: \u003Cspec title> (archived from TODO\u002F)`, with a 1–2 sentence body.\n   - Guard: `close | \u003CPREFIX> — \u003CTICKET-ID>:`. The `close |` keeps it apart from spec-land's merge lines. The colon keeps `VHS-1` from matching `VHS-11`.\n   - `\u003Cdate>` is today in UTC, or the newest date already heading `log.md` when that is later; the script refuses an entry older than the newest one.\n\n   ```bash\n   SCRIPT=\"${CLAUDE_CONFIG_DIR:-$HOME\u002F.claude}\u002Fskills\u002Fspec-close\u002Fscripts\u002Fprepend_log_entry.py\"\n   LOGPATH=\"\u003Cwiki_root>\u002Flog.md\"\n   command -v python3 >\u002Fdev\u002Fnull 2>&1 && python3 -c '' >\u002Fdev\u002Fnull 2>&1 && PY=python3 || PY=python\n   if test -f \"$SCRIPT\"; then\n   if \"$PY\" \"$SCRIPT\" \"$LOGPATH\" --guard 'close | \u003CPREFIX> — \u003CTICKET-ID>:' \u003C\u003C'PREPEND_LOG_ENTRY_EOF'\n   ## [\u003Cdate>] close | \u003CPREFIX> — \u003CTICKET-ID>: \u003Ctitle>\n\n   \u003Cbody>\n   PREPEND_LOG_ENTRY_EOF\n   then rc=0; else rc=$?; fi\n   echo \"prepend_log_entry_exit=$rc\"\n   else echo \"log.md NOT written: prepend_log_entry.py not found at $SCRIPT — install with 'python sync.py install'\"; fi\n   ```\n\n   Single-quote the guard. Double-quote both paths. Keep the `PREPEND_LOG_ENTRY_EOF` delimiter. Branch on the echoed integer, not on the harness's pass or fail:\n\n   | Exit | Report |\n   |---|---|\n   | 0 | `Prepended: log.md` on `prepend_log_entry_outcome=prepended`; on `=fresh` or `=created`, the script's stderr notice verbatim |\n   | 1 | `log.md: entry already present — skipped` |\n   | other | `log.md NOT written: \u003Cstderr>` |\n\n   A failed log write never stops the close. To recover, re-run `\u002Fspec-close \u003CTICKET-ID>`.\n4. **Never commit.**\n\n```text\n=== CLOSE COMPLETE: \u003CTICKET-ID> ===\n\nTarget repo (\u003Cproject_root>):\n  Reconciliation: docs\u002Fspecs\u002FDONE\u002F\u003CTICKET-ID>\u002Freconciliation.md\n  Archived: TODO\u002F\u003CTICKET-ID>.* → DONE\u002F\u003CTICKET-ID>\u002F\n  Staged: \u003Ceach path from the script's staged: lines>\n  Status: uncommitted — review with `git diff --stat` then commit.\n\nWiki (\u003Cwiki_root>):\n  Created: decisions\u002FYYYY-MM-DD-\u003Cslug>.md\n  Updated: projects\u002F\u003Cproject>\u002Fstate.md\n  \u003Cthe log.md report line>\n  Status: uncommitted.\n\nSuggested commits:\n  (in target repo)  git commit -m \"close(\u003Cticket-lower>): archive spec to DONE\u002F\"\n  (in wiki)         git add \u003Ceach wiki file this run wrote> && git commit -m \"close(\u003Cticket-lower>): wiki harvest from \u003CTICKET-ID>\"\n```\n\nThe archive paths are already staged, so the target-repo suggestion is a plain `git commit` with no `git add` and no pathspec. Print it only when the script printed at least one `staged: \u003Cpath>` line. On `staged: none` or `nothing to archive`, drop that line and print `Nothing was staged in the target repo by this run.` Name in the wiki suggestion only the files this run wrote; `log.md` only when the script wrote it. Never `git add docs\u002Fspecs\u002F` or `git add -A`. Omit the reconciliation line when no report exists.\n\n## Re-runs\n\n- **Interrupted execute.** Re-run with the DONE path or the ticket id. The archive script skips what already moved, and the guard skips the log line.\n- **Partial, then full.** The later full close's guard matches the partial's `close |` line, so there is no second log line, by design.\n- Keep the em dash in the guard: a tool that turns it into `-` breaks the match.\n\n## Tool-use notes\n\n- File read and write: the report, the wiki pages, and the state.md edit. `log.md` changes only through `prepend_log_entry.py`.\n- Shell with git; `archive_spec.py` and `prepend_log_entry.py` run through the resolved interpreter.\n- `gh`, optional (`vcs-host?`): only for a PR-number-only diff.\n- The issue tracker's ticket read (`issue-tracker?`).\n- Never commit, push, or open a PR.\n","```\n\u002Fspec-close \u003Cspec-path | TICKET-ID | docs\u002Fspecs\u002FTODO\u002F\u003CTICKET-ID>\u002F> [--report-only | --partial]\n```\n\n`--report-only` and `--partial` together halt with `Usage: --report-only and --partial are mutually exclusive — pick one.`\n\nNothing changes before the Phase 4 confirmation except the reconciliation report.\n\n## Phase 0 — Preflight\n\n- **Resolve.** `project_root` is the repo root (the directory holding `docs\u002Fspecs\u002F`); run every command from it. Take the ticket id from the argument: the `.spec.md` stem, the `DONE\u002F\u003CID>\u002F` directory name, the `TODO\u002F\u003CID>\u002F` folder name, or the id itself. Uppercase it. `project_prefix` is the part before the first hyphen. The spec is `docs\u002Fspecs\u002FTODO\u002F\u003CID>.spec.md`, else `docs\u002Fspecs\u002FDONE\u002F\u003CID>\u002Fspec.md`.\n  - A spec exists: the spec flow (Phases 1–5).\n  - No spec, but a `docs\u002Fspecs\u002FTODO\u002F\u003CID>.*` entry, a `docs\u002Fspecs\u002FTODO\u002F\u003CID>\u002F` folder, or an existing `docs\u002Fspecs\u002FDONE\u002F\u003CID>\u002F`: the archive-only close (Phase 2A).\n  - Nothing found: halt with `nothing to close for \u003CID> under docs\u002Fspecs\u002F`.\n- **Wiki.** Read `wiki_root` and `project_slug` from the project's `CLAUDE.md` or `AGENTS.md`. If a path with a username segment does not exist, retry it with the current user's name. A missing wiki is a warning; Phase 1 handles it.\n- **Origin.** Run `timeout 30 git fetch origin`, then `git rev-list --count HEAD..origin\u002F\u003Cbranch>` (the default branch when the current one has no origin counterpart). When behind, print one line: `origin: local \u003Cbranch> is \u003CN> commits behind origin\u002F\u003Ccmp> — reconciliation reads the working tree; never updated here.` Any git failure prints `origin: skipped (\u003Creason>)`. Never update the tree.\n\nPrint one preflight line: ticket, flow (spec | archive-only), flags, wiki, origin.\n\n## Phase 1 — Mode\n\nSpec flow only. The archive-only close skips this phase whatever the ticket's state. First match wins:\n\n1. `--report-only` → report only. No tracker read; the report's Plane line reads `not checked (--report-only)`.\n2. `--partial`, or no tracker config → partial-close. No tracker config means the installed `${CLAUDE_CONFIG_DIR:-$HOME\u002F.claude}\u002Fskills\u002Fship-spec\u002Fstates.json` is missing, unreadable, or has no `project_prefix` key.\n3. The ticket's state group is `completed` or `cancelled`, and the wiki exists → full-close.\n4. Anything else → print why, then the partial-or-abort prompt: `1. Partial-close  2. Abort`. This covers another group, a read with no group, Plane unreachable or ticket not found, and a missing wiki for a full close.\n\nRead the ticket with the issue tracker's retrieve-by-identifier capability (e.g., `mcp__claude_ai_Plane__workitem` with `action: retrieve_by_identifier`, `workitem_identifier: \"\u003CTICKET-ID>\"`, `fields: \"name,state,completed_at\"` and `expand: \"state\"` in Claude Code, or the equivalent in your host; load the tool first if your host defers tool schemas). `state.group` is the gate. A failed read prints `ticket: could not read \u003CTICKET-ID> from the issue tracker (\u003Cerror>). Usually a login problem: re-authenticate the tracker connection.` and takes rule 4.\n\nNever gate on `completed_at`: some states that are not done still set it. It is only a ship-date source.\n\nPartial-close skips Phases 2 and 3. With no wiki it archives only and prints `wiki not found — skipping log.md entry; archive only`.\n\n## Phase 2 — Reconcile (full-close and report-only)\n\n- **Merge.** In `\u003Cwiki_root>\u002Flog.md`, find the headings that contain `merge | \u003CPREFIX> — \u003CTICKET-ID> PR #`. spec-land writes one per landed PR. The PR number follows `PR #` up to the `:`. The SHA is that entry's `Landed: \u003Csha>` body line; an entry without one gives only its PR number. Several entries: read each and combine them. With no wiki or no entry, run `git log --all --oneline -i -E --grep=\"\u003CTICKET-ID>([^0-9]|$)\" -- .` (the suffix keeps `VHS-1` off `VHS-11`). Nothing found: ask `Could not find merge commit for \u003CTICKET-ID>. Enter PR number or commit SHA:`.\n- **Diff.** For each SHA, read the first-parent diff: `git diff --stat \u003CSHA>^1 \u003CSHA>`, then `git diff \u003CSHA>^1 \u003CSHA>`. That is the change for a squash commit and for a two-parent merge commit, where `git show` prints no diff. If `\u003CSHA>^1` does not resolve, the clone lacks the commit: say so and ask the operator to fetch. With only a PR number, run `gh pr view \u003CN> --json files,additions,deletions` and `gh pr diff \u003CN>`. If `gh` is absent or either command fails, stop and ask for the merge SHA. Over 500 diff lines: summarize by file, and read the paths the spec's decisions name.\n- **Brief.** `\u003CID>.brief.md` beside a TODO spec, `brief.md` beside a DONE spec. Its acceptance criteria are reconciliation targets. Its `## Tier` `**Level:**` line drives Phase 3.\n- **Walk.** Read the code; do not infer.\n  - Scope: each spec file in the diff, dropped, or unexpected.\n  - Decisions: Confirmed, Drifted, or Unverifiable.\n  - Done-when criteria: Met, Unmet, or Unverifiable, each with evidence.\n  - Test plan: does each test exist?\n- **Report.** Write `\u003CID>.reconciliation.md` beside the spec (`reconciliation.md` beside a DONE spec). Overwrite an old one.\n\n```markdown\n# Reconciliation Report: \u003CTICKET-ID>\n\n> Date: YYYY-MM-DD\n> Spec: \u003Cspec path>\n> Merge: \u003CPR number(s) and SHA(s)>\n> Plane state: \u003Cstate_name> (group: \u003Cgroup>)\n\n## Summary\n\u003C1-2 sentences.>\n\n## Scope\n| Spec file | In diff? | Notes |\n|---|---|---|\n\nUnexpected files in diff (not in spec):\n- `path` — \u003Cwhat it does>\n\n## Decisions\n| # | Decision | Status | Evidence |\n|---|---|---|---|\n\n## Acceptance Criteria\n| # | Criterion | Status | Evidence |\n|---|---|---|---|\n\n## Test Plan\n| Test | Exists? | Location |\n|---|---|---|\n\n## Wiki-ready\n\u003Cone line per entry worth writing, or `none`>\n\nRECONCILED: \u003Cyes|no> DRIFT: \u003Cn>\n```\n\n`RECONCILED: yes` needs zero Unmet. `DRIFT` counts Drifted + Dropped + Unexpected. Report-only ends here: print the report path and `Re-run \u002Fspec-close \u003Cspec-path> without --report-only to complete the close.` On `RECONCILED: no`, ask `Spec has unmet acceptance criteria. Continue anyway? [y\u002FN]` and halt on N.\n\n## Phase 2A — Archive-only close\n\nFor a ticket with artifacts but no spec. There is no reconciliation, no harvest and no mode-gate read. `--report-only` stops with `nothing to reconcile: \u003CID> has no spec`. `--partial` is accepted and changes nothing.\n\nPhase 4 shows the archive plan and the log entry. Phase 5 runs the archive and the log write. The log heading is `## [\u003Cdate>] close | \u003CPREFIX> — \u003CID>: \u003Ctitle> (archive only, no spec)`. `\u003Ctitle>` is the brief's `# ` heading when a brief exists. Otherwise it is the ticket name from a tracker read when one succeeds, else `\u003CID> artifacts`. The body is one sentence naming what was archived.\n\nA ticket already in `DONE\u002F\u003CID>\u002F`, with nothing left in `TODO\u002F`, only gets the log line; the guard keeps it to one. With no wiki, it archives only and prints the skipped-log notice.\n\n## Phase 3 — Harvest (full-close only)\n\n- **Duplicates.** Run `grep -rlw \"\u003CTICKET-ID>\"` over `decisions\u002F`, `comprehension\u002F` and `projects\u002F\u003Cslug>\u002Fstate.md`, and show the hits. Do not propose a kind of entry the wiki already has for this ticket unless the operator asks. A state.md hit counts only when it sits under What's Shipped; a hit under What's Active or What's Next is the entry to move to What's Shipped. spec-close never edits the filemap; spec-land owns it.\n- **Weight.** Brief tier `small`: a state.md entry and the log line only. Any other tier, or no tier:\n  - a decision page only when the spec chose between real options;\n  - a comprehension page only for a new module, data flow or integration.\n\n  Follow the wiki's SCHEMA.md templates.\n- **state.md.** A What's Shipped entry has three parts:\n  - the evidence-triple heading `(\u003CID>, \u003Cship-date>, commit \u003Csha>)`;\n  - the `Verification: \u003Cfile>:\u003Cline> -- '\u003Cexcerpt>'` line, taken from the report;\n  - 1–2 sentences and links.\n\n  The ship date is `completed_at`, else the merge commit's date, else today with a warning. With incomplete evidence, skip the state.md edit and say so. Replace the `> Last updated:` line with one line, `> Last updated: \u003Ctoday> (\u003CID> \u003Cshort note>)`. Never keep or extend a `Prior:` chain.\n\n## Phase 4 — Confirm\n\nOne checkpoint covers every change after the report. Run the archive block (Phase 5) with `--dry-run` added after the ticket id, and paste its output, or its `archive NOT run` line, into the plan verbatim:\n\n```text\n=== CLOSE PLAN: \u003CTICKET-ID> ===\nMode: \u003Cfull-close | partial-close | archive-only>\nReconciliation: \u003CRECONCILED: yes|no, DRIFT: n | skipped>\nWiki: \u003Cavailable | not found — log.md entry omitted>\n\nWiki entries to create:\n  1. decisions\u002FYYYY-MM-DD-\u003Cslug>.md — \"\u003Ctitle>\"\n     \u003C3-line preview>\n\nState.md update:\n  File: projects\u002F\u003Cproject>\u002Fstate.md\n  \u003CWhat's Shipped entry and the new Last updated line>\n\nArchive (dry run):\n  \u003Carchive_spec.py --dry-run output>\n\nLog.md entry (prepended):\n  ## [\u003Cdate>] close | \u003CPREFIX> — \u003CTICKET-ID>: \u003Ctitle>\n  \u003Cbody>\n\nProceed? [y\u002FN]\n```\n\nOn `N`, stop: nothing changes after the report.\n\n## Phase 5 — Execute\n\n1. **Wiki** (full-close only). Write the approved pages, then the state.md edit.\n2. **Archive.** Run this block and show its output:\n\n   ```bash\n   ARCHIVE=\"${CLAUDE_CONFIG_DIR:-$HOME\u002F.claude}\u002Fskills\u002Fspec-close\u002Fscripts\u002Farchive_spec.py\"\n   command -v python3 >\u002Fdev\u002Fnull 2>&1 && python3 -c '' >\u002Fdev\u002Fnull 2>&1 && PY=python3 || PY=python\n   cd \"\u003Cproject_root>\"\n   if test -f \"$ARCHIVE\"; then \"$PY\" \"$ARCHIVE\" \u003CTICKET-ID> \u003C \u002Fdev\u002Fnull; else echo \"archive NOT run: archive_spec.py not found at $ARCHIVE — install with 'python sync.py install'\"; fi\n   ```\n\n   The script moves `TODO\u002F\u003CID>.*` to `DONE\u002F\u003CID>\u002F` with the prefix stripped, then the children of a `TODO\u002F\u003CID>\u002F` folder. It skips sources already gone and never moves onto an existing path. It stages tracked moves, and untracked ones only when git does not ignore the destination. It prints one `staged:` line per staged path, `staged: none`, or `nothing to archive` (nothing new staged). Exit 0 is all done, and 1 is some item skipped or failed. Exit 2 is a usage error.\n\n   On exit 0, continue. On any other exit, or `archive NOT run`, the archive is incomplete: skip the log write, report `Archive: incomplete` with the script's problem lines, and ask the operator to clear each one and re-run `\u002Fspec-close \u003CTICKET-ID>`. A `destination exists` line means two artifacts claim one path: show the operator both paths and let them resolve it by hand before the re-run. Never delete, overwrite or rename either one yourself. For a tracked file, the operator uses `git mv`, so the index follows. To clear `moved, NOT staged`, run `git add` on that path. The re-run archives what is left and writes the log line. If it rewrites a reconciliation report that was already staged, run `git add` on the report again; leave an ignored one alone.\n3. **Log** (skipped when there is no wiki). Prepend the entry with `prepend_log_entry.py`; it places the entry above the newest dated one, checks the guard, and writes atomically.\n   - Spec-flow heading: `## [\u003Cdate>] close | \u003CPREFIX> — \u003CTICKET-ID>: \u003Cspec title> (archived from TODO\u002F)`, with a 1–2 sentence body.\n   - Guard: `close | \u003CPREFIX> — \u003CTICKET-ID>:`. The `close |` keeps it apart from spec-land's merge lines. The colon keeps `VHS-1` from matching `VHS-11`.\n   - `\u003Cdate>` is today in UTC, or the newest date already heading `log.md` when that is later; the script refuses an entry older than the newest one.\n\n   ```bash\n   SCRIPT=\"${CLAUDE_CONFIG_DIR:-$HOME\u002F.claude}\u002Fskills\u002Fspec-close\u002Fscripts\u002Fprepend_log_entry.py\"\n   LOGPATH=\"\u003Cwiki_root>\u002Flog.md\"\n   command -v python3 >\u002Fdev\u002Fnull 2>&1 && python3 -c '' >\u002Fdev\u002Fnull 2>&1 && PY=python3 || PY=python\n   if test -f \"$SCRIPT\"; then\n   if \"$PY\" \"$SCRIPT\" \"$LOGPATH\" --guard 'close | \u003CPREFIX> — \u003CTICKET-ID>:' \u003C\u003C'PREPEND_LOG_ENTRY_EOF'\n   ## [\u003Cdate>] close | \u003CPREFIX> — \u003CTICKET-ID>: \u003Ctitle>\n\n   \u003Cbody>\n   PREPEND_LOG_ENTRY_EOF\n   then rc=0; else rc=$?; fi\n   echo \"prepend_log_entry_exit=$rc\"\n   else echo \"log.md NOT written: prepend_log_entry.py not found at $SCRIPT — install with 'python sync.py install'\"; fi\n   ```\n\n   Single-quote the guard. Double-quote both paths. Keep the `PREPEND_LOG_ENTRY_EOF` delimiter. Branch on the echoed integer, not on the harness's pass or fail:\n\n   | Exit | Report |\n   |---|---|\n   | 0 | `Prepended: log.md` on `prepend_log_entry_outcome=prepended`; on `=fresh` or `=created`, the script's stderr notice verbatim |\n   | 1 | `log.md: entry already present — skipped` |\n   | other | `log.md NOT written: \u003Cstderr>` |\n\n   A failed log write never stops the close. To recover, re-run `\u002Fspec-close \u003CTICKET-ID>`.\n4. **Never commit.**\n\n```text\n=== CLOSE COMPLETE: \u003CTICKET-ID> ===\n\nTarget repo (\u003Cproject_root>):\n  Reconciliation: docs\u002Fspecs\u002FDONE\u002F\u003CTICKET-ID>\u002Freconciliation.md\n  Archived: TODO\u002F\u003CTICKET-ID>.* → DONE\u002F\u003CTICKET-ID>\u002F\n  Staged: \u003Ceach path from the script's staged: lines>\n  Status: uncommitted — review with `git diff --stat` then commit.\n\nWiki (\u003Cwiki_root>):\n  Created: decisions\u002FYYYY-MM-DD-\u003Cslug>.md\n  Updated: projects\u002F\u003Cproject>\u002Fstate.md\n  \u003Cthe log.md report line>\n  Status: uncommitted.\n\nSuggested commits:\n  (in target repo)  git commit -m \"close(\u003Cticket-lower>): archive spec to DONE\u002F\"\n  (in wiki)         git add \u003Ceach wiki file this run wrote> && git commit -m \"close(\u003Cticket-lower>): wiki harvest from \u003CTICKET-ID>\"\n```\n\nThe archive paths are already staged, so the target-repo suggestion is a plain `git commit` with no `git add` and no pathspec. Print it only when the script printed at least one `staged: \u003Cpath>` line. On `staged: none` or `nothing to archive`, drop that line and print `Nothing was staged in the target repo by this run.` Name in the wiki suggestion only the files this run wrote; `log.md` only when the script wrote it. Never `git add docs\u002Fspecs\u002F` or `git add -A`. Omit the reconciliation line when no report exists.\n\n## Re-runs\n\n- **Interrupted execute.** Re-run with the DONE path or the ticket id. The archive script skips what already moved, and the guard skips the log line.\n- **Partial, then full.** The later full close's guard matches the partial's `close |` line, so there is no second log line, by design.\n- Keep the em dash in the guard: a tool that turns it into `-` breaks the match.\n\n## Tool-use notes\n\n- File read and write: the report, the wiki pages, and the state.md edit. `log.md` changes only through `prepend_log_entry.py`.\n- Shell with git; `archive_spec.py` and `prepend_log_entry.py` run through the resolved interpreter.\n- `gh`, optional (`vcs-host?`): only for a PR-number-only diff.\n- The issue tracker's ticket read (`issue-tracker?`).\n- Never commit, push, or open a PR.\n",{},"main","7ea4cc6f73e7d33f418734ebbc004955eb1ce984","skills\u002Fspec-close","https:\u002F\u002Fgithub.com\u002FVigil-Harbor\u002Fvigil-skills","https:\u002F\u002Fgithub.com\u002FVigil-Harbor","https:\u002F\u002Fvigilharbor.com","2026-11-09 09:04:05",{"source":7,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Vigil-Harbor\u002Fvigil-skills --skill spec-close",{"tool":39,"command":40},"bunx","bunx skills add Vigil-Harbor\u002Fvigil-skills --skill spec-close",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Vigil-Harbor\u002Fvigil-skills --skill spec-close","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FVigil-Harbor\u002Fvigil-skills\u002Fblob\u002Fmain\u002Fskills\u002Fspec-close\u002FSKILL.md",true,[47,53],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"scripts\u002Farchive_spec.py","SCRIPT","脚本",6676,"https:\u002F\u002Fgithub.com\u002FVigil-Harbor\u002Fvigil-skills\u002Fblob\u002Fmain\u002Fskills\u002Fspec-close\u002Fscripts\u002Farchive_spec.py",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"scripts\u002Fprepend_log_entry.py",25988,"https:\u002F\u002Fgithub.com\u002FVigil-Harbor\u002Fvigil-skills\u002Fblob\u002Fmain\u002Fskills\u002Fspec-close\u002Fscripts\u002Fprepend_log_entry.py",[58,73,88,104,115,123],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":21},"01M71XKRKQKW37MQFZ3HTJ609D","split-marker","a case-2 tag that wraps onto the line after the tool token.","https:\u002F\u002Fgithub.com\u002FVigil-Harbor\u002Fvigil-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fsplit-marker\u002FSKILL.md",[],[65,66,67,68,69,70,71,72],"split marker","marker","split","token","tool","line","case","true",{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":21},"01M71XKQ57F2ZVNW6K4W9VWBKS","optional-bool","A skill that declares optional booleans, used only by the lint test suite.","https:\u002F\u002Fgithub.com\u002FVigil-Harbor\u002Fvigil-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Foptional-bool\u002FSKILL.md",[],[80,81,82,83,84,85,86,87],"optional bool","lint","read","only","test suite","suite","a skill","test",{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":21},"01M71XKN6VPTF1KE94VGM338VS","notes-bare-name","a bare harness tool name in a non-operative Tool-use notes section.","https:\u002F\u002Fgithub.com\u002FVigil-Harbor\u002Fvigil-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fnotes-bare-name\u002FSKILL.md",[],[95,96,97,98,99,100,72,101,102,69,103],"name","notes bare name","bare","notes","section","tool name","tool-use","use","harness",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":21},"01M71XKM5R0Q4N7MBATYBP1YB1","indented-fence","a tool token inside an indented fenced code block.","https:\u002F\u002Fgithub.com\u002FVigil-Harbor\u002Fvigil-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Findented-fence\u002FSKILL.md",[],[111,112,72,113,68,69,114],"indented fence","code block","block","code",{"skillNo":116,"name":117,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":21},"01M71XKK80YEASYAHNAPCNYH0S","good-skill","https:\u002F\u002Fgithub.com\u002FVigil-Harbor\u002Fvigil-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fgood-skill\u002FSKILL.md",[],[121,122],"good skill","good",{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":21},"01M71XKJAG58KDWPP2XEHCT7TZ","crlf-skill","a valid skill saved with CRLF line endings.","https:\u002F\u002Fgithub.com\u002FVigil-Harbor\u002Fvigil-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fcrlf-skill\u002FSKILL.md",[],[130,131,132,72,70,133,134,135],"CRLF","crlf skill","with","valid","saved","valid skill"]