Skip to content
Back to skills

Commit

ASecurity

Commit the current session's changes only, gateway-inline. Session-isolated (never -A, never stages into the shared index; what commits is read back against the session list), doc-sync-gated. The gateway runs the commit inline — it already holds the diff, session file list, and change intent; on a mechanical gate hit it counts the scope docs: at or under the scope ceiling it judges doc-sync warm in its own context, above it the cold doc-sync-scan agent judges the whole scope, and the premise-...

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added June 1, 2026
ai-agentsgoshellbashgit

Works with

  • terminal
  • cli

Security analysis

A100/100

Scanned November 27, 2026

npx -y skills add RockyHong/super-bootstrap --skill commit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Commit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Commit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rockyhong-commit/badge)](https://www.skillsdirectory.com/skills/rockyhong-commit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: commit
description: "Commit the current session's changes only, gateway-inline. Session-isolated (never -A, never stages into the shared index; what commits is read back against the session list), doc-sync-gated. The gateway runs the commit inline — it already holds the diff, session file list, and change intent; on a mechanical gate hit it counts the scope docs: at or under the scope ceiling it judges doc-sync warm in its own context, above it the cold doc-sync-scan agent judges the whole scope, and the premise-closure judge dispatches on a product-anchor hit. Conventional message, commits directly and locally. Bundled with super-bootstrap — encodes the harness commit rules."
tags: [commit, git, session, doc-sync]
---

# Commit — Session-Isolated, Doc-Sync-Gated (gateway-inline)

Commits the changes this Claude session produced, leaving prior uncommitted work alone. The gateway runs the flow inline — it holds the session's diff, file list, and change intent, so the mechanics carry no closure a fresh container would hold. A doc-sync judgment at or under the scope ceiling runs warm in that same context: the diff, the change intent, and the session's read docs are the judgment's inputs, and the gateway already holds them all. A scan scope above the ceiling moves whole to the cold `doc-sync-scan` agent rather than being truncated inline. Both are ordinary lanes.

## Execution (gateway-inline)

**Session-close entries — check first.** `/super-bootstrap:session-close` invokes this door with one argument, a close entry; `merge` invokes it with `range` below; no argument is the flow below, whole.

- **`close-detect`** — the close's pre-pick judgment, read-only. Run §3's gate, §3b and §4 over the session's changes. §3's lanes see the worktree only, so the close's drafts — fix-now edits, resolve outcomes and the park move's durable doc edits — join by hand: their paths run the grep lane as `<skill-base>/assets/doc-links.sh terms - | <skill-base>/assets/doc-links.sh hits -` (a draft has no worktree diff for `grep-scope` to read; `hits --by-term -` in place of `hits -` prints their per-term counts), take the citer lane at whole-file grain (`refs <path>`), and join the scan scope, and §4 reads their text, terminology, volatile-ID and date checks included. A close with no session changes runs this over the drafts alone. Stop after §4 and hand the caller each stale candidate, harness row, premise sheet row, restatement, terminology miss, volatile-ID or date hit, register item and integrity break, its exact edit drafted, plus the count of scope docs read and confirmed unchanged: the caller's pick is the user's round, so every resolve, offer and ask in §3b and §4 lands there. Worktree, HEAD and shared index stay as found, so new files take a throwaway index in place of §1's `git add -N`: `<tmpidx>` of role `detect`, built with `GIT_INDEX_FILE=<tmpidx> git read-tree HEAD` and `GIT_INDEX_FILE=<tmpidx> git add -N -- <new paths>`, exported as `GIT_INDEX_FILE` in each call that runs a §3 lane, and removed with `rm -f <tmpidx>` after §4.
- **`close-commit`** — the post-pick run; the rows the user picked are landed and join the session list. Run §1, §2, §3's two integrity checks on the final tree, then §5 over the commit row the caller hands over: one commit, or the N its "splits into N commits" clause states, partitioned by §5's test with no further ask; a different count stops and surfaces. Each part's paths are what that run's readback and final check read, and each part's readback runs as its own call after the previous commit, immediately before that part's commit. The pick settled every other §3, §3b and §4 result: no re-scan. A broken link or stale pin in an edit the close landed → the gateway repairs that link or pin and continues; a repair reaching further stops and surfaces; a break the pick declined stands acknowledged.

**Batch-landing entry — check first.** `/super-bootstrap:merge` § 5b step 6 invokes this door as `range <base-tip> <tip>`, on a clean checkout of `<tip>` (the integration branch):

- **`range <base-tip> <tip>`** — doc-sync for commits already landed on `<tip>`: deferred mode's skipped §3, run once over the whole batch. The range replaces the session: no §1 list, no §2 gather, and deferred mode does not apply. Where §3 says "go to §5", go to **Commit** below. Where §1, §4 or §5 say "§1 list", "session list" or `<session paths>`, read the edited list below. A routed row — a card via `/super-bootstrap:log`, a foreign-owned harness route — is listed in the return for the caller to act on after the landing; the entry writes no card and no foreign file.
  - **Inputs.** `<changed-list>` is `git -c core.quotePath=false diff --name-only --no-renames <base-tip> <tip>` — a renamed path lists as its old and its new name, so the old name still yields its term. Every diff a §3 lane, §3b or §4 reads off `git diff HEAD` reads `git diff <base-tip> <tip>` instead, same flags, with the lane's own path as pathspec where it names one and `<changed-list>`'s paths where it names `<session paths>`: the citer lane's hunk ranges, the forward-link `+` lines (read per changed doc, so each target resolves against its own file), §3b's anchor hunks, §4's cold-lane diff. Each `doc-links.sh` invocation carries `DOCLINK_DIFF_RANGE="<base-tip> <tip>"` as its own prefix, inside a pipe too and in the `--by-term` form — `grep-scope`, `term-uses`, `volatile-ids` and `dates` read their diff through it. Path-only lanes (`terms`, `refs`, `self`, `anchors`) and the two integrity checks read the checked-out `<tip>` tree, so no throwaway index is needed.
  - **Run** §3 whole (exemptions, premise lane, every lane, the scope ceiling, link and model-pin integrity), §3b and §4. The warm lane holds the range's commit subjects (`git log --format=%s <base-tip>..<tip>`) as the change intent and reads every scope doc fresh — the caller's session holds no reads of this diff; the cold prompt stays as §4 states it. One resolution list takes one ask, put to the user in the caller's session: §4's rows, §3b's re-frame and dangling rows, and every integrity break. The user approves it whole, names rows to change, or holds the landing; the caller waits on the answer.
  - **Commit** the approved edits — docs, owned-harness rows after their audit, register entries — as one commit on `<tip>`'s branch: `doc-links.sh check` and `pins` on the edited tree first — a break the edits introduced → repair that link or pin; a break it cannot repair stops the entry as below; a new file takes `git add -N`; readback `git diff HEAD --name-only -- <edited paths>` equals the edited list; then, with HEAD still on `<tip>`'s branch, `git commit -o -- <edited paths>` (`docs: sync docs to the batch landing`, type by content, in the style of `git log --oneline -10`); then `git show --name-only --format= HEAD` equals that list. §5's stamp seam applies, file grain; its staged-tree verify does not — the caller re-runs its verify. §5's call granularity applies: each check and the readback is its own call, read before the commit issues. An audit finding on a harness row stops the entry: revert the uncommitted edits (`git checkout -- <edited paths>`; for new files `git rm --cached -q -- <new paths>`, then `rm`), confirm `git status --porcelain` is empty, and return `held` with the finding. The user holding the landing, and any other stop the entry inherits from §3-§5 (a second `no-diff`, a readback mismatch, a hook failure, a stamp exit other than 0 or 3, an unrepairable integrity break), revert the same way and return `held` with the stop reason. Nothing approved → no commit.
  - **Return** to the caller, as one line set, no §6 report: the commit's short sha, `no doc edits` (nothing stale), `declined` (rows declined, none landed) or `held` (the user held the landing, or an audit finding stopped it); the scope count; each row the user declined or acknowledged and each integrity break left standing. `held` → the caller does not fast-forward.

1. **Session file list + grain** — from this conversation, the files this session edited/wrote. This is the session-isolation ground truth; a file you don't remember touching stays off it. Each listed path takes a grain, read off `git diff HEAD -- <path>` — base HEAD, never the shared index, which can hold another writer's stale entry: **file grain** when every hunk there is this session's edit (the normal case; a new file is file grain, recorded now with `git add -N <path>` — intent-to-add, so every later `git diff HEAD` here sees it and another writer's plain commit does not take it); **hunk grain** when the file also holds another writer's uncommitted edits. §5 commits each grain in its own lane; neither stages into the shared index.

2. **Gather state** — `git status`, `git diff HEAD`, `git diff --staged`, `git log --oneline -10` (recent style). A staged path outside the §1 list is another writer's state — so is a staged change or deletion on a path the worktree holds at HEAD (an entry an out-of-door commit left stale). Early warning only: name it with the commit; §5's lanes commit past it and leave it as it is — they refresh only the session paths' own shared-index entries. Another writer's staged change on a session path → stop and surface: committing would drop their staging. Unstage or restage another writer's entry only on the user's say-so.

3. **Doc-sync grep-gate** — mechanical, no judgment:
   - **Deferred mode — check first** (autorun-worktree isolated commit): doc-sync belongs to the merge boundary — `merge/SKILL.md` § 5b runs it through the `range` entry — skip all of §3, go to §5 (§5's staged-tree verify is skipped too).
   - **Frozen-provenance exemption — card lifecycle, history dimension:** every changed path inside `docs/work/` (card-thread appends, card deletions), plus every changed `docs/outward/OUT-*.md` (thread appends, entry deletions) → skip the gate, go to the link check below then §5. Both are append-only threads, self-contained; cross-card ID mentions are frozen provenance, not behavior narration — so `hits` and `refs` leave every `docs/work/` card thread and every `docs/outward/OUT-*.md` thread out of the scan scope too, whatever term they name or anchor they cite; each folder's standing `README.md` narrates its thread contract and stays in both lanes. A doc whose leading frontmatter declares `dimension: history` is frozen provenance the same way — a change to it yields no term (`terms` skips it), `hits` and `refs` leave it out of the scan scope, and the link check below still covers it. Mixed diff → run the gate on the other paths only.
   - **Premise lane — product-anchor paths:** the diff touches the product anchor (`docs/overview.md` § Problem / § User, or a dedicated product doc where the repo splits one out) and those sections' post-image carries a premise — body past the skeleton's `{…}` placeholder line, or, for a dedicated product doc with no shipped skeleton, prose beyond a scaffold stub in its Problem / User-equivalent sections → route the anchor portion through §3b — its closure set is the whole doc surface, so it already covers everything this gate would reach for the anchor; the rest of the diff continues through this gate. Sections still on the placeholder revise no premise → the anchor path stays in this gate like any other changed doc.
   - **Grep lane — every list on stdin, `-` argument:** a path or term can hold spaces, so lists ride stdin via `-`, one item per line, never an unquoted expansion. `<changed-list>` below is `git -c core.quotePath=false diff --name-only HEAD -- <session paths…>`. Each changed path yields at most one term — its basename minus the extension, or a skill's directory name for its `SKILL.md` — `<changed-list> | <skill-base>/assets/doc-links.sh terms -` prints them, one per line; scaffolding paths (bench, tests, fixtures, goldens, session ledgers), asset extensions, generic basenames, terms under four characters, and the machine state harness-bootstrap seeds under `.claude/` (the runway receipt, `templates/`) yield none. `<changed-list> | <skill-base>/assets/doc-links.sh grep-scope - | grep -vxF -f <(<changed-list>)` prints the doc-surface files mentioning a term in **code shape** — a whole word inside backticks, or a path segment — so bare prose stays out; nothing printed → the grep lane is empty. `grep-scope` demotes a wide code term: a term that on its own hits more docs than the scope ceiling, and whose every changed path is a modified file off the doc surface, counts only as a bare token inside backticks, and the symbol-shaped identifiers on those paths' changed lines (`git diff HEAD`) join the terms. A term from an added, deleted or renamed path, or one a changed doc also yields, is never demoted. So a doc narrating such a file's changed behavior while naming neither a changed identifier nor the bare stem is not scanned; `/super-bootstrap:check-docs-consistency` is the backstop. Harness-seeded hub stems (`overview`, `techstack`, `decisions`, the runway receipt, the worktree template) count only as a bare token inside backticks: hub path mentions stay out of this lane to keep scope bounded. So an unlinked path mention of a hub doc is not scanned, and on a section-grain change neither is an anchorless link to one; `/super-bootstrap:check-docs-consistency` is the backstop. A Godot text asset (`.tscn`, `.tres`) runs the inverse: `terms` keeps its extension (`levels/Ending.tscn` → `Ending.tscn`), and `hits` counts that term only as a path segment (`levels/Ending.tscn`, `Ending.tscn`), never as a bare backticked `Ending` — a scene or resource basename doubles as domain vocabulary. Hit files join the scan scope; the agent judges them cold (§4). The grep lane walks the markdown surface — a manifest description field the diff changes is read here directly.
   - **Link-hit (reverse citers) — mechanical, beside the grep:** for each changed `docs/**` / root `README.md` / plugin-README (`plugins/*/README.md`) path, and each changed `*.md` path a glob in the repo's `.claude/doc-surface` matches (`*` crossing `/`), take its post-image hunk ranges from `git diff HEAD -U0 -- <path>` (`@@ -a,b +c,d @@` → `+c,d`) and run `<skill-base>/assets/doc-links.sh anchors <path> <ranges…>`. `(top)` among the slugs means whole-file grain → `<skill-base>/assets/doc-links.sh refs <path>`; otherwise `refs <path>#<slug>…` in one call of the same script, which prints the union. Exclude the changed files themselves. Every file returned is a declared citer of the changed truth — collect them as the **citer read-set**.
   - **Self-scope (changed docs) — mechanical, beside the citer lookup:** `<changed-list> | <skill-base>/assets/doc-links.sh self -` prints the changed paths that are doc-surface files in their own right — a deleted path, an off-surface path, and frozen provenance (card threads, `docs/outward/OUT-*.md`, `dimension: history`) all drop out. Every path printed joins the scan scope as its own scope doc: §4 reads it whole and holds its **unchanged** sections against the diff's claims, which is where a same-commit contradiction with the file's pre-existing prose sits.
   - **Terminology candidates — mechanical, beside the self lane:** `<changed-list> | <skill-base>/assets/doc-links.sh term-uses -` prints `doc<TAB>line<TAB>term|avoid<TAB>matched text<TAB>Term` — an added line of a changed doc that uses a term registered in `docs/terminology.md` (a `**Term**:` entry, or a word on its `_Avoid_:` line), case-insensitive whole word, outside fenced blocks. `docs/terminology.md` itself and frozen provenance drop out; a doc that already links `docs/terminology.md` drops its `term` candidates and keeps its `avoid` ones — a wrong word is wrong whatever the doc links; no `docs/terminology.md` → the lane is empty. Every candidate's doc is already a scope doc through the self lane, so candidates ride beside the scope as lines to judge (§4), not as scope docs — they add nothing to the ceiling count.
   - **Volatile-ID and date hits — mechanical, beside the terminology lane:** both read every changed path, any file type, so a code comment or a test label is in reach, not only a doc. `<changed-list> | <skill-base>/assets/doc-links.sh volatile-ids -` prints `path<TAB>line<TAB>id` — an added line carrying a `BUG` / `DEBT` / `GAP` / `OUT` / `PARK` ID (fenced blocks skipped in markdown only). `<changed-list> | <skill-base>/assets/doc-links.sh dates -` prints `path<TAB>line<TAB>date` — an ISO date (`20YY-MM-DD`) on an added markdown line outside fences, or on an added line of any other file whose text leads with a comment marker; a date elsewhere in code is data. Both drop `docs/work/`, `docs/outward/`, `docs/parked.md`, `docs/test-queue.md`, `SESSION-STATE/`, `dimension: history` docs, the placeholder suffix `xxxx` (IDs), and every path matching a glob in `.claude/provenance-exempt` — the repo's declaration of paths that hold IDs or dates as data: one glob per line, `#` and blank lines ignored, `*` crosses `/`, the `.claude/doc-surface` syntax. A hit's path may sit off the doc surface, so hits ride beside the scope as lines to surface (§4), never as scope docs — they add nothing to the ceiling count.
   - **Link-target extraction (forward links) — mechanical, beside the reverse lookup:** from the diff's added lines, extract every markdown link target (`grep -oE '\]\([^)]+\.md[^)]*\)'` over `+` lines), resolve each relative to its linking file. Each target is a doc the new prose claims agreement with — add the target files to the scan scope.
   - **Scope ceiling — count before judging:** the scan scope is citers ∪ grep hits ∪ link-targets ∪ changed docs. Print it before judging, in either lane — `scope: N docs`, then one path per line. At or under **8** docs → the gateway judges the scope warm-inline (§4). Above 8 → the scope moves whole to the cold `doc-sync-scan` dispatch (§4's cold lane) — never truncated to fit inline. In that lane, print the per-term hit counts beside the scope count — the grep-lane pipe with `grep-scope --by-term -` in place of `grep-scope -` prints `term<TAB>count` per term, highest first, a demoted term carrying its post-demotion count and a third column `demoted`; counts are per term and include the changed files; the `grep -vxF` stage drops out.
   - **Any grep hit OR any citer OR any link-target OR any changed doc → run the doc-sync judgment (§4) over the scan scope — citer read-set + grep-hit files + link-target files + the changed docs themselves.**
   - **All four lanes empty → the diff narrates nothing.** The self lane makes this the narrow branch it reads as: a diff that touched no doc-surface file outside the frozen-provenance exemptions — an asset, code, or exempt-thread diff. No volatile-ID or date hit either → go to §5. Hits → skip §3b and §4's scan; §4's **Volatile IDs and dates** rows form the list alone and take its one ask, then go to §5.
   - **Link integrity (every non-deferred commit, exemption included):** run `<skill-base>/assets/doc-links.sh check` from the repo root — `<skill-base>` is the `Base directory for this skill:` path surfaced at invocation; zero model tokens. Broken links (path or anchor) surface to the user with the commit: fix or explicitly acknowledge before landing; never silently skip. One class is exempt by construction — the consumed-card-link skip: a link from a card thread (`docs/work/{BUG,DEBT,GAP}-*.md`) to an absent card ID is consumed provenance — the sibling resolved — so `check` skips it uncounted, while every other target from a card, and any dangling card link from a non-card doc, stays strict.
   - **Model-pin integrity (every non-deferred commit):** run `<skill-base>/assets/doc-links.sh pins` from the repo root; zero model tokens. Reads each agent file's frontmatter `model:` and reports doc-surface lines whose restated tier disagrees with the agent named inside an inline code span — `<doc>:<lineno>` + claimed tokens + actual tier + source path. Deliberately narrow, so the per-commit gate stays quiet: a line resolving to no agent or to several is skipped, and any one agreeing tier token clears it. Whole-surface by construction: it consults no scan scope, so a doc no enumeration lane reached is covered the same. Frozen provenance is out, as in every other claim lane — a closed-fork row or card thread restates a past tier by design. Stale pins surface to the user with the commit: fix or explicitly acknowledge before landing; never silently skip.

3b. **Premise-closure lane (product-anchor diff)** — a problem/ICP revision changes premise, not behavior; its closure is every doc whose framing leans on the anchor. Enumerate mechanically — `<skill-base>/assets/doc-links.sh closure <anchor-path>` prints the set: the doc surface minus consumables (per-item work files — `docs/work/{BUG,DEBT}-*.md`, `docs/work/TEMPLATE.md`) minus the anchor. Judgment runs only over the enumerated set — dispatch the `premise-closure` agent (`Agent` tool, `subagent_type: "premise-closure"`; prompt = the anchor diff hunks — `git diff HEAD -U0 -- <anchor-path>`, output pasted verbatim into the prompt (the judge has no shell; the pasted lines are its only view of the old premise) — + the anchor path + the enumerated paths, no staleness leans): its sheet (holds / re-frame / dangling per doc + coverage line) returns here; a coverage mismatch or a `no-hunks` line re-dispatches, the latter with the hunks pasted. Resolve with the user before the commit lands — re-frame: update the doc to align / acknowledge still-accurate; dangling: drop / merge / defer. Never silently fix, never silently skip. Then continue §3 on the rest of the diff.

4. **Doc-sync judgment (gate hit)** — two lanes, picked by §3's scope count: warm gateway-inline or the cold dispatch. Both lanes run the same procedure — `agents/doc-sync-scan.md` § Scan — and end in the same resolution.
   - **Warm-inline (scope ≤ ceiling):** the gateway applies § Scan itself, in its own context. Warm eyes are the point: hold the change intent and the session's reads beside the diff while judging. Every scope doc gets an outcome — a stale candidate (path + what's outdated + hunk) or read-and-confirmed-unchanged — printed as one line per doc before the resolution below: `<path> → stale: <what's outdated>` or `<path> → unchanged: <the sections read against the diff>`. Done when every path §3 printed has its own line; a path without one is an incomplete gate, not a `clean` — judge that doc, then print its line.
   - **Cold dispatch (scope > ceiling):** `Agent`, `subagent_type: "doc-sync-scan"`; prompt = the diff — the output of `git diff HEAD -- <session paths>` (a hunk-grain path is read against the session's hunks only), pasted verbatim or written to a file outside the worktree whose path the prompt names (`rm -f` it once the judge returns); the judge has no shell, so the output itself reaches it, never the command — + today's date + the scan scope + the restatement predicate's path (`<skill-base>/assets/restatement-predicate.md`) + the terminology candidate lines, verbatim, with the link predicate's path (`<skill-base>/../check-docs-consistency/assets/link-predicate.md`). The prompt carries these items and nothing beside them — no change intent, no suspects, no staleness leans. The agent judges the same procedure in its own window and returns `stale-docs` or `clean`, with any `harness`, `restatements`, `terminology` and `register` beside it; a `no-diff` line re-dispatches once with the diff supplied, and a second `no-diff` stops the door and surfaces to the user.
   - Either lane stays scoped — never a whole-surface re-derivation; whole-surface coverage belongs to `/super-bootstrap:check-docs-consistency`.
   - **Stale candidates** → resolve together with the user, in one list with the harness rows below: each row carries its drafted edit and its proposed outcome (update / acknowledge-accurate / skip), and the list takes one ask — approve it whole, or name the rows to change — never a question per row; never silently fix, never silently skip. The rows below that offer a card or a pick (restatement, terminology, volatile ID or date, register) join the same list as rows with a proposed outcome, so the doc-sync result takes that one ask. Land approved doc edits (inline for bounded prose; dispatch by closure). Resolved docs join the §1 list and take a grain per §1 (a new doc gets `git add -N`).
   - **Harness** (§ Scan's `harness` output, either lane) → rows in that same list, each with its exact edit drafted. `co-change: yes` in harness this repo owns (not foreign-owned, below) → the row lands this round as a harness edit, through the audit the repo's harness requires for a harness edit, before the commit; the file joins the §1 list. An audit finding stops the door and surfaces; the commit waits until it is resolved. Foreign-owned harness — a copy another repo serves or vendors into this one (a `.served` marker in its skill directory, a `<file>.served` sidecar, or the provenance the repo's harness declares for its other classes, a folder declared served whole included) or a file in another repo — routes by the repo's own finding lanes, concern first and provenance second: this repo's concern → a card via `/super-bootstrap:log`, the copy untouched; the owner's concern → name the path and the owner's route. The row states which route it took, and the commit proceeds. `co-change: no` → its proposed outcome is a card via `/super-bootstrap:log` or none; the commit proceeds.
   - **Nothing stale, no harness row** → proceed.
   - **Restatements** (§ Scan step 6, either lane) → a row in the same list — fact, K, locations, home — whose proposed outcome is a card via `/super-bootstrap:log` or none; the list's one ask settles it, never a question of its own. Never edit for it; the commit proceeds whatever the answer. A stale copy among its locations still resolves as a stale candidate above.
   - **Terminology** (§ Scan step 7, either lane) → surface each substantive miss — doc, line, the word, and its action: a `term` miss reads "link `docs/terminology.md`", an `avoid` miss reads "use the registered term <Term>" — as a row in the same list, its proposed outcome a card via `/super-bootstrap:log` or none. A candidate the judgment drops (homonym, passing token, catalog, ephemeral doc) is not reported. Never edit for it, never block; the commit proceeds whatever the answer.
   - **Volatile IDs and dates** (§3's volatile-ID and date lanes, either lane) → a row per hit in that same list — path, line, the ID or date, its drafted edit (the present invariant stated, the provenance moved to the commit message) and its proposed outcome (update / skip). The hit is the diff's own added line, so an update edits that line in place; an updated harness line takes the audit the repo's harness requires for a harness edit before the commit; a hit in a foreign-owned copy takes the **Harness** row's foreign-owned route, the copy untouched. Never block; the commit proceeds whatever the answer.
   - **Register** (§ Scan step 8, either lane) → a row per item in that same list — the word, doc:line, the proposed entry verbatim, the why — with its proposed outcome (register / skip); the list's one ask settles each row, and nothing is written silently. Register → land the entry in `docs/terminology.md` and link the using line to `docs/terminology.md` (a second word: add it to the Term's `_Avoid_:` line, and the session's added line takes the registered Term); `docs/terminology.md` and the using doc join the §1 list and each takes a grain per §1. Skip → nothing is written; the commit proceeds either way.

5. **Message + commit** — draft a Conventional Commit (`<type>(<scope>): <subject>`, imperative ≤72 chars, body only when the why isn't in the diff, match `git log` style; one logical change per commit — a diff spanning two unrelated changes splits: partition the §1 list into one part per commit and run this step per part, where "§1 list", "session list" and `<session paths>` read that part; a path both changes touch puts both changes in one part (one commit), and its message names both). Explicit paths only — never `-A` / `.`, never secrets (`.env`, keys), and never stage content into the shared index (§1's intent-to-add excepted): the index is shared across sessions in one checkout, and a plain `git commit` from any of them takes every staged path. Any hunk-grain path puts the whole commit on the hunk lane. Each readback, the verify and the stamp is its own tool call, and the commit issues only after its result is read. Each call runs in a fresh shell, so name every index in its resolved form, written out in each call that uses it — `<priv>` is `"$(git rev-parse --git-dir)/index-<session>"` (a name unique to this session), `<tmpidx>` is `"$(git rev-parse --git-dir)/index-<role>-<session>"` — and carry a value one call reads into the next as a literal.
   - **File grain — `git commit -o -- <session paths>`.** A new file is already intent-to-add from §1, and `-o` commits it. `-o` commits HEAD plus those paths' worktree content, leaves every other shared-index entry as it was, and refreshes the named paths' entries to the new HEAD. **Readback:** `git diff HEAD --name-only -- <session paths>` equals the §1 list — a listed path missing from it carries no change: drop it, or recheck the list. Order: readback → staged-tree verify → stamp (seam below) → `git commit -o`.
   - **Hunk grain — a private index from HEAD.**
     1. Two calls: read `git rev-parse HEAD` and keep its sha as `<base>`, then `GIT_INDEX_FILE=<priv> git read-tree <base>` — the index and step 6's guard share one anchor.
        Any stop in steps 2–6 deletes the private index (`rm -f <priv>`).
     2. Per hunk-grain path: write `git diff HEAD -- <path>` to a patch file outside the worktree and keep its file header plus this session's **git hunks** whole — delete the rest. A git hunk that holds both writers' edits → **stop and surface** the path and the hunk: never split a hunk, never rebuild lines by hand. `GIT_INDEX_FILE=<priv> git apply --cached <kept patch>`. File-grain paths in the same commit: `GIT_INDEX_FILE=<priv> git add -- <paths>`.
     3. **Readback** under the private index: `GIT_INDEX_FILE=<priv> git diff --cached HEAD --name-only` equals the §1 list, and per hunk-grain path `GIT_INDEX_FILE=<priv> git diff --cached HEAD -- <path>` equals the kept patch line for line outside its `index` and `@@` header lines (the new blob and the dropped hunks shift those). Any difference → stop and surface.
     4. Staged-tree verify (below), before any commit.
     5. Stamp (seam below), where an audit stamp is installed — its own call, before step 6.
     6. Commit under the private index only while HEAD is still `<base>`, the check and the commit chained in one command: `[ "$(git rev-parse HEAD)" = "<base>" ] && GIT_INDEX_FILE=<priv> git commit …`, the prefix immediately before `git`. HEAD moved → rebuild from step 1 on the new HEAD. After: `git reset -q HEAD -- <committed paths>` on the shared index (index only — the other writer's hunks stay in the worktree), then `rm -f <priv>`.
   - **Staged-tree verify — declared command, differing tree; between readback and commit in both lanes.** The consumer may declare one in `docs/techstack.md` § Staged-Tree Verify; none declared → skip. Deferred mode → skip: the gateway runs the declared Staged-Tree Verify once on the integrated tree, before base moves (`merge/SKILL.md` § 5b). Otherwise it runs when the tree about to commit differs from the working tree: hunk grain always; file grain when `git status --porcelain` lists any path outside the session list. Materialize that tree into a temp dir outside the worktree — hunk grain: `GIT_INDEX_FILE=<priv> git checkout-index -a --prefix=<tmp>/`; file grain, with `<tmpidx>` of role `verify`: `GIT_INDEX_FILE=<tmpidx> git read-tree HEAD`, `GIT_INDEX_FILE=<tmpidx> git add -- <session paths>`, `GIT_INDEX_FILE=<tmpidx> git checkout-index -a --prefix=<tmp>/` — every call names the throwaway index, since a bare `git read-tree` overwrites the shared one. Run the command there, then delete the dir and `rm -f <tmpidx>`. Failure → stop and surface: a green working tree does not speak for the tree that commits.
   - **Harness-audit stamp seam — where an audit stamp is installed, stamp the set that commits.** Installed = `<hook>`, `~/.claude/hooks/harness-audit-pretool.sh`, exists; absent → skip the seam. It also needs an `audit-harness-edits` pass over these paths' current content, whose one-line verdict is `<verdict>`; no audit on record → skip the seam and name that with the commit. The stamp call itself (the verdict line, its exit codes) is `audit-harness-edits` step 5's; this door fixes its two lanes' forms, and its file-grain form stands in for step 5's `git add` first, since this door stages nothing into the shared index. File grain, with `<tmpidx>` of role `stamp`, in one call: `GIT_INDEX_FILE=<tmpidx> git read-tree HEAD && GIT_INDEX_FILE=<tmpidx> bash <hook> --stamp "<verdict>" $(git diff HEAD --name-only -- <session paths>); rc=$?; rm -f <tmpidx>; exit $rc` — an index from HEAD stages no session path, so the stamp hashes each path's worktree content, which `-o` commits. Write that commit as `git commit -o … -- <session paths>` with every path literal, no `cd` in the command, and an existing HEAD; any other form makes the gate judge the whole dirty tree. Hunk grain, step 5: `GIT_INDEX_FILE=<priv> bash <hook> --stamp "<verdict>" $(GIT_INDEX_FILE=<priv> git diff --cached --name-only)`; step 6's prefix lets the gate read the same index. Done when the `$(…)` is the lane's readback command verbatim and the stamp exits 0, or exits 3 (`nothing stamped`) on a set with no harness path; any other exit → stop and surface.
   - Commit with HEREDOC formatting; after, `git show --name-only --format= HEAD` equals the session list — prior dirty state is sacred, so a clean tree is not the check. Pre-commit hooks run; on failure fix the cause, never bypass. Always a new commit — amend only if asked.

6. **Report, then return** — report each commit in one line: short sha + subject, plus any integrity break the user acknowledged. Then return to the work in progress, or to the calling skill's next step — a commit closes a unit, not the session's work. Skipped when invoked by `/super-bootstrap:session-close` — its Output is the terminal output.

## Rules

- **Gateway-inline mechanics; two dispatches, each on its own gate.** The gateway holds the diff, session list, intent, and session reads → mechanics and a doc-sync judgment at or under the scope ceiling stay inline (the judgment's inputs are exactly what the gateway holds). The cold doc-sync scan dispatches above the scope ceiling; the premise-closure judge dispatches on a product-anchor hit.
- **Grep-gate is mechanical.** Term extraction is fixed-shape — at most one term per path, plus the symbol-shaped tokens on a demoted term's changed lines — never a judgment about which identifiers matter — a judgment gate gets omitted. The terminology lane reads only the entries `docs/terminology.md` declares — it never tokenizes prose for terms; finding a term the file lacks is the §4 judgment's register step, never a gate lane. Any lane hit triggers the doc-sync judgment (§4); conservative by design. A diff that touches no doc-surface file and hits no lane — a pure asset/binary diff with no narrated path — is the skippable class.
- **Session-isolated.** The session list decides; prior dirty state is sacred. Explicit paths, never `-A`, never a session path staged in the shared index (intent-to-add excepted) — file grain commits by pathspec (`-o`), hunk grain through a private index built from HEAD — and what commits is read back against that list before every commit, so another writer's staged or stale entries neither ride in nor get reverted.
- **Doc-sync round-trip, never bypass** — a `stale-docs` return goes through the user before commit.
- **Whole-diff-once.** Doc-sync runs at the integration boundary, on the whole diff, once. An autorun worktree defers it to merge, whose batch landing runs it as `range`; a session close runs it as `close-detect`, over the session's changes plus the drafts it will land; an implementer never owns doc-sync — a partial-slice view gives false confidence.
- **The door commits locally and never pushes** — no push step, no push question; a push is `/super-bootstrap:session-close`'s move, by repo shape. Committed work is safe locally.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.