checkpoint
Review work in subagents before it is reported done or ready to commit. Use when about to say work is done or ready to commit, or when the user asks for a checkpoint or pre-commit review.
- License 许可
- GPL-3.0
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- checkpoint
- description
- Review work in subagents before it is reported done or ready to commit. Use when about to say work is done or ready to commit, or when the user asks for a checkpoint or pre-commit review.
02 资源文件 9
- 参考文档references/BRANCH.md1.2 KB
- 参考文档references/DELTA.md959 B
- 参考文档references/HEAD-EXPORT.md1.1 KB
- 参考文档references/LOG.md1.5 KB
- 参考文档references/PLAN-GATE.md626 B
- 参考文档references/PLAN.md1.9 KB
- 参考文档reviewers/bugs.md4.4 KB
- 参考文档reviewers/conventions-prose.md7.2 KB
- 参考文档reviewers/spec.md2.6 KB
03 SKILL.md 正文
The session that wrote the code does not review it. It knows what every line was meant to do, so it reads the diff as confirmation and finds what it intended rather than what is there. Reviews run in subagents that have seen only the brief.
Every review runs fresh: no pass is credited from earlier in the session, except
for a tree §1 finds covered or a delta of 0 changed.
1. Scope
Per repository the change touches, first:
ele checkpoint check <root>
Covered in every repository: the last checkpoint reviewed these exact bytes, and staging or committing part of them since does not change that. Say so, repeat its commit commands if its report is in view, and stop. Run anyway only when the user asks for a fresh review — the record does not see a changed convention file or ticket — or for a branch review, which the record never covers.
Otherwise:
git -C <root> status --porcelain --untracked-files=all
git -C <root> diff HEAD --stat
Read the two status columns:
Uin either, orAA/DD— unmerged paths, from a merge, rebase, cherry-pick, revert or conflicted stash. Stop and say so; this is not a checkpoint.- First column
M,A,R,CorT, secondM,DorT— the staged copy differs from the working tree; list these paths for the brief and for §9.
List any rename by both its old and new path.
Nothing uncommitted and nothing untracked: say so and stop, this is not a checkpoint — unless commits sit unpushed, in which case offer a branch review (below), or the caller named a branch-scope base. A clean tree alone is not that — files outside git, in a symlinked or unversioned directory, hold work git will never report, reviewed against a saved copy of what they replaced, or against the file itself where there is none.
Branch scope, when the user asks for a review of the branch or accepts the
offer, or /ele:plan pickup runs it over work already committed with a base it
names: read references/BRANCH.md first; it changes what the sections
below mean.
Build the change list: every tracked file in the diff, every untracked file from
that status, every changed file outside git. git diff HEAD does not show
untracked files, and a review given only the diff reviews none of them — the
files a change adds usually carry its logic. Without --untracked-files=all a
new directory is one ?? dir/ line, which the freeze refuses. Uncommitted work unrelated to this
change stays off the list.
Run the repository's formatter over the paths on the change list, so work off
the list keeps its bytes. Run its linter over the packages (or directories)
holding them — a Go linter given single files cannot see their siblings and
reports names it cannot resolve — with no fix flag, since a fixing run over a
package rewrites siblings off the list (golangci-lint: --new-from-rev=HEAD).
Fix by hand what it reports on lines the change touched; anything else is
pre-existing, left, and named in §10. What these catch never reaches a reviewer
as a finding. Then re-read git status --porcelain for those paths: a staged
file the formatter rewrote now differs from its staged copy, and joins the
staged-differently list for the brief and §9.
Freeze each repository's diff into the session scratchpad directory, naming every path on the change list as its own argument, relative to the root. Leave off any path the formatter returned to HEAD; it leaves the change list too:
ele checkpoint freeze <root> <scratchpad> [--base <base>] --start -- <path> <path> ...
The command writes checkpoint-<repo>.diff and the fingerprint
checkpoint-<repo>.hash for §8, <repo> being the basename of git's root for
it. It refuses a path with no change and prints the line count and the mode this
root alone implies.
The run. This freeze opens the run, and the Stop hook treats this session's
checkpoint as in progress while it is open. Only this freeze passes --start:
it starts the clock, which an earlier abandoned run would otherwise keep; a
later freeze, one after record included, keeps it until §12's log unless two
hours passed since the last. Never chain this freeze with log, which times it
0. Each freeze keeps the run open for two hours; record or close ends it.
Another session's checkpoint of the same repository neither ends nor times it.
record refuses without an open run of this session: none frozen, closed, a
last freeze over two hours old, or CLAUDE_CODE_SESSION_ID unset.
Delta scope: when the freeze prints changed since the last checkpoint,
read references/DELTA.md; it can end the checkpoint here.
§1 is done when every repository the change touches is frozen, its freeze naming every path on the change list, and the staged-differently and rename lists exist or are stated empty.
2. Gather
Work out the gate §4 starts: what CI runs. Read the CI config —
.gitlab-ci.yml, .github/workflows/, and the task targets they call — and list
its checks: typecheck and build, lint, tests with their coverage thresholds,
generated-code drift. The repository's local gate is often narrower, and as of
2026-10-15 that gap was the commonest way a defect got past a checkpoint. A check
that cannot run here is reported as unverified, never as passing.
With a file under .documentation/plans/ on the change list, read
references/PLAN-GATE.md; it adds to the gate.
Gather what is settled, for the brief:
- The project's live notes — decisions, dated facts and open questions — and
earlier sessions on the area the change touches, per the
ele:recallskill's Project context section,<name>being the repository's basename and<topic>the area. Where that skill is not listed, runele recall --project <name> "<topic>", thenele context --project <name>. A failure there goes in the brief. - Rulings the user made this session.
- Findings an earlier round left on purpose, with the reason.
- Failures already known to happen at HEAD, each proved in a HEAD export
(
references/HEAD-EXPORT.md), not assumed.
Gather the paths of every set of conventions in force over the changed files — paths only, the reviewer reads them:
- The user's
CLAUDE.md, under$CLAUDE_CONFIG_DIRwhen set, else~/.claude, with every file it imports or says to read for the changed code. - The repo root
CLAUDE.md/AGENTS.md, plus any in a directory containing a changed file. - Whatever those point at:
PATTERNS.md,CONTRIBUTING.md, an architecture doc, an ADR index, a style guide. - Linter, formatter and
.editorconfigsettings, so no reviewer duplicates what the gate enforces.
If the work came from a ticket, fetch it; from a plan item, read it from the
plan file; from a done-when the user confirmed, with their task and chosen design,
or /ele:dev's mini plan less its inbox. A checkpoint that cannot say what was
asked cannot say whether it was delivered.
§2 is done when the CI check list exists and every brief field it gathers has a value or is stated empty.
3. Brief
One brief, shared by every reviewer, every path absolute:
- Each repository root and its frozen diff.
- The scope. Delta: as
references/DELTA.mdsays. - The change list, untracked and outside-git files marked as such.
- The paths §1 found staged differently from the working tree.
- The convention file paths.
- What was asked — the ticket, or the user's request in their words. An item
is quoted whole: a plan item's line and body, a fetched ticket's body and
comments, or a confirmed done-when with the task in the user's words and the
chosen design, without which every file the design touches reads as unasked;
/ele:dev's mini plan holds all three and the user's answers. Say which of its requirements this change sets out to deliver, where it delivers only some. - Observed: with a quoted item, what was run or measured toward it — a real-session run, a measurement — and where its output is. This is evidence, not the author's case, and the spec reviewer has no other way to see it.
- Settled — do not re-raise: what §2 gathered, each with its reason. Settled items are context: a reviewer contradicting one reports it only as a question carrying evidence the reason did not have.
- Report only: reviewers edit nothing and run no gate, test suite or build.
The parent runs the gate; its log is at
<path>, finished once it ends ingate exit. - Errors:
<absolute path of the plugin root's reference/errors.md>, read when a call fails. - Attack surfaces: what the author is least sure of. State combinations that were never enumerated, paths never exercised, what a user sees when the new error fires, a trap the codebase documents. Specific beats thorough — "every combination of these four fields present or absent, against where each resumes" finds what "check edge cases" does not.
The brief carries facts, quotes and doubts; the reviewer builds its own case for the code.
§3 is done when every field above has a value or is stated empty, every path is absolute, and Attack surfaces names at least one specific input, state or path.
4. Review
Mode. The freeze prints the mode each root alone implies. A second
repository or any file outside git makes the change full, whatever each freeze
printed. Small runs one fresh general-purpose reviewer that reads the reviewer
files and reports under each of their labels; full runs one reviewer per file.
Spec. The spec reviewer runs only when the brief quotes a plan item, a
fetched ticket, a confirmed done-when or /ele:dev's mini plan: in full mode as a third reviewer,
launched with the other two; in small mode its file, reviewers/spec.md,
joins the single reviewer's, which then also reports under §10's Spec reviewer
label.
Launch. Full mode: launch them all in one message so they run in parallel,
each as the subagent type below. Each prompt is the brief plus one line: read
the reviewer file below, by absolute path, first and follow it. The reviewer
files are under reviewers/ beside this file.
| Reviewer | Subagent type | Instructions |
|---|---|---|
| Bugs | general-purpose |
reviewers/bugs.md |
| Conventions and prose | ele:checkpoint-reviewer |
reviewers/conventions-prose.md |
| Spec | ele:checkpoint-reviewer |
reviewers/spec.md |
Where ele:checkpoint-reviewer is not listed, use general-purpose.
Without an Agent tool — when this skill itself runs in a subagent, for instance — run every review in this file inline, one after another, each from its reviewer file, and say in the report that the author reviewed its own work.
Gate. Start it in the background as the reviewers launch: the checks §2
listed, against the tree the reviewers read. Edits wait for gate exit: a fix
or a mutation they read fails them spuriously, or passes them on bytes nobody
shipped. Capture to a file with the exit status as its last line:
S=<scratchpad>; { <gate command>; echo "gate exit $?"; } > "$S/gate.log" 2>&1
grep -nE 'FAIL|panic|Error|timed out|gate exit' "$S/gate.log"
§4 is done when every reviewer the mode and the spec rule call for has reported — bugs and conventions-prose each with a Verdicts list naming every file on the change list, spec with a verdict per requirement — and the gate log exists.
5. Verify
Before fixing a bugs finding, check it against the code: trace the input it names to the wrong output, or reproduce it. A prose or conventions finding needs only the cited line read — as of 2026-10-15 under 3% of them were refuted. A not-reused finding also needs the existing code it names read. A spec finding is checked against the item's quoted words and the diff: a missing requirement by a search of the code for it, or of the brief's Observed field where it needs something observed; an unasked change by naming the requirement that needed it, if any.
Give each finding one of these verdicts:
deliberate— confirmed, and a missing or partial requirement the brief says this change does not set out to deliver: left to §7'snext:line, or with no plan to §10's deliberately-left list.fixed— confirmed, and fixed below.open— neither confirmed nor refuted: reported as a question. A confirmed unasked change, or a finding against a settled item, goes to the user and staysopenuntil they rule: fixing an unasked change means reverting work they may want kept, and a settled item is not overturned on a reviewer's word.refuted— listed in the report with the reason.
Reviewers overlap. Merge a finding two of them raised before verifying it, and log it once.
Keep a running list for §12 of every finding — from a reviewer, the gate, a
mutation or the user — with the fields §12 logs, their values in
references/LOG.md. A finding counts once, at the first stage that caught it.
Then, in the parent, once the gate has finished, fix the confirmed findings. As of 2026-10-15 three in four re-review findings were something a fix broke, mostly comments and ordering, so:
- A rewritten comment or doc passes
reviewers/conventions-prose.md's per-comment tests, and the same claim is searched for elsewhere in the change. - An appended entry goes where the ordering puts it.
- The formatter and linter run as §1 runs them.
Then:
- Every new or changed test goes red once, in this run. Mutate the code it covers, watch it go red for the stated reason, restore. A mutation run before the checkpoint does not count. Confirm the mutation landed before reading a non-failure — an anchor that did not match leaves the code untouched, and the passing test then looks exactly like one that cannot fail.
- A red test is fixed in the code. Never rewrite an expected value to what the code returns, weaken an assertion, widen a tolerance, or skip or delete a case to make it pass. What a test asserts changes only for a behaviour change this change sets out to make, which §10 names; a rename or signature change edits a test without changing what it asserts.
- Every scripted edit landed. Grep for the new string, not the old one.
§5 is done when every finding on the running list has a verdict, every confirmed one is fixed or routed as above, every new or changed test has gone red in this run, every test whose assertions changed follows a behaviour change this change sets out to make, and every scripted edit's new string is found.
6. Gate
Run §4's gate again, captured the same way, once §5's fixes and mutations are done, unless nothing changed since it started. Say so if skipped.
A red check is pre-existing only once it fails the same way at HEAD: read
references/HEAD-EXPORT.md for the export and for when such a check
counts as green. A test this change turns red is fixed in the code, as §5 says;
its assertions change only if this change sets out to change what it covers.
Any check that neither passes nor counts as green, and is not being fixed in
this run: see Stopping early.
§6 is done when the latest gate log ends in gate exit and every §2 check is
passing, counted green per references/HEAD-EXPORT.md, unverified, or handed to
Stopping early.
7. Plan
Per repository the change touches, ele plan list --project <name> names its
active plans; if it fails, say so and go on. (cd <root> && ele plan show <path>)
gives each one's next item, <path> as the listing prints it — ele plan show
refuses a path outside the cwd's checkout. Read the item the change worked on
from the plan file itself: usually the next one, never assumed to be. No active
plan, or none the change worked on: say so and go on. A plan in a repository the
change does not touch is out of scope: name it, write nothing.
When the change worked on an active plan's item: read references/PLAN.md;
it proposes the item's tick or progress line, writes it on approval, and
makes the write a fix §8 re-reviews. An item already ticked gets no proposal;
where this change holds its tick line, that is a held tick, and §8 re-reviews
it the same way.
§7 is done when each touched repository's plan state is reported — no active
plan, no item worked on, the item with a proposed tick or progress line, or the
item already ticked — and any approved write is in the file, with ele plan check and any CI check reading .documentation/ run since and no warning on
its line left open.
8. Re-review the fixes
This step gates the report. Compare each repository's fingerprint with the one §1 saved:
S=<scratchpad>; ele checkpoint hash <root> | cmp -s - "$S/checkpoint-<repo>.hash"; echo $?
0 in every repository, no file outside git touched since §1, and no held tick
from §7: skip to §9. Anything else runs this step — a different fingerprint
whatever moved it, a missing saved one, an edit to a file outside git, which the
fingerprint cannot see, or a held tick, which no fix moves. With no fix made,
the second freeze below repeats the first and only the Spec bullet applies.
Freeze again, into a second directory so the first freeze survives; git cannot
diff the fixes alone without a stash or commit. Create the directory first. Name
the change list plus every file a fix created, less any path a fix returned to
HEAD and any untracked file it deleted — the freeze refuses a path with nothing
to diff. Launch one fresh ele:checkpoint-reviewer, Bugs included on purpose,
or general-purpose where that type is not listed, with both frozen diffs, the
files the fixes touched, the findings they fixed, the brief's Settled, Report
only and Errors fields and, when the spec reviewer ran, §7 wrote a line or held
a tick, the item quoted whole as the brief quotes it, with what the change sets
out to deliver and the brief's Observed field; for a held tick, also the commits
holding its work, where any are committed. It reads the reviewer files that apply, scoped to
what the fixes changed:
- Bugs, if any code changed: what did the fixes break or fail to close?
- Conventions, if anything was renamed, moved or reordered, or a fix closed a Shape finding.
- Prose, if any comment, string or doc changed.
- Spec, if a fix closed a spec finding or touched what the item names, §7 wrote a line or held a tick: does each requirement it reached still hold? For §7's line or held tick: does each claim it makes hold against the item's done-when, the diff, those commits and the Observed field?
One round: anything it finds is verified and then fixed or reported.
§8 is done when every fingerprint matched with no held tick, or the re-reviewer reported on each reviewer file that applied and each finding has a verdict, and a gate run since the last fix to a file a §2 check reads ends as §6 requires.
9. Commit message
One line, subject only, in the repo's own style. More than one commit where the change splits cleanly, and say why it splits.
Print the exact commands for the user to run. Per commit: an add of that
commit's untracked paths, each file by name as §1's status lists it, unquoted,
then a commit naming that commit's paths after --, a rename by both its old
and new path. A commit given paths takes their
working-tree copies and leaves anything else staged where it is, so the
staged-differently paths from §1 ship as reviewed and work the user staged for
another commit stays out.
§9 is done when every path on the change list appears in exactly one printed
commit: both sides of each rename, and each untracked path also in an add.
10. Report
Label sections by reviewer — Bugs reviewer, Conventions reviewer, Prose reviewer, the last two splitting the merged reviewer's report, and Spec reviewer when it ran. Keep the labels: the Stop hook matches the Bugs and Prose ones when the skill call has scrolled out of its view.
- The mode, small or full, the scope, and how many reviewers §4 launched.
- Per reviewer: findings confirmed and fixed, refuted with reason, left open.
- Which files each reviewer gave a verdict on, and spec's verdict per requirement. A file on the change list with no verdict was not reviewed, and is named as such.
- Convention violations, naming the rule and the file it came from.
- Any file marked denser than its peers whose comments were not swept.
- Tests mutated, and whether each failed.
- Tests whose assertions changed, each with the behaviour change it follows.
- Re-review: what it found, or that it did not run.
- Plan: §7's plan state, and any line it wrote or held, as it stands after §8's re-review.
- What was deliberately left, and why, linter findings off the change's lines included.
- The gate result, per CI check, naming any that could not run here, any not run
because the change list is plan files alone, and any red only on failures
proven at HEAD;
ele plan checkwarnings with no line, or off the change's lines.
§10 is done when every file on the change list carries a verdict from the bugs and conventions-prose reviewers, or is named unreviewed, every requirement the brief quotes carries one from the spec reviewer when it ran, and every entry on §5's running list appears in the report, under its reviewer's label where a reviewer raised it.
11. Record
Once every check passes or counts as green under §6, §8 has run or found the fingerprint unmoved with no held tick, and every finding is fixed or reported, per repository:
ele checkpoint record <root>
A record taken before the fixes marks unreviewed bytes as reviewed, and the next checkpoint stops on it.
It refuses without an open run of this session (§1, The run). Check §8's fingerprint first, since a new freeze overwrites it; then freeze again, naming §8's second freeze's paths, or the change list if §8 skipped, and record.
§11 is done when record prints recorded: <root> for every repository.
12. Log
Log the run, once per checkpoint, against the repository the change is
mostly in. /ele:checkpoint-stats tunes this skill from the log, so a finding
left out is a gap the stats cannot show:
ele checkpoint log <root> <<'EOF'
{"change": {"files": 4, "lines": 120},
"findings": [{"also_raised_by": ["bugs"], "category": "stale-comment", "origin": "fix",
"severity": "quality", "source": "prose", "stage": "rereview",
"summary": "Comment still names the old flag.", "verdict": "fixed"}],
"mode": "full",
"mutations": {"failed": 6, "inconclusive": 1, "run": 7},
"rereview": "ran",
"scope": "uncommitted"}
EOF
Each field's values are in references/LOG.md.
ele checkpoint log adds duration, seconds since the freeze that opened the
run, when a freeze recorded one, and refuses a record the stats would misread,
naming the field.
§12 is done when ele checkpoint log prints logged: <root> with one finding
per entry on the running list.
Errors
When a call fails, follow reference/errors.md in the plugin root, the
directory holding skills/, with the rows below added; stop and report in the
running conversation. A red gate check or mutated test is a result, not an
error here: §5, §6 and Stopping early handle it.
| Error contains | Class | One fix |
|---|---|---|
<path> is a directory, is inside the repository at or is neither tracked nor a file from freeze |
A directory, or an untracked path missing | Replace a directory with its files from §1's status, checkpointing a submodule or clone as its own repository; drop a missing one |
Agent type '…checkpoint-reviewer' not found |
Plugin agent not loaded | Launch general-purpose with the same prompt |
command not found: <tool> in a §2 check |
The check cannot run here | Report it unverified; no retry |
have the change re-reviewed from record |
An edit after the last freeze, or a run with no saved fingerprint, unreviewed | Re-review it per §8, then freeze and record; never freeze and record alone |
holds the checkpoint files of from freeze |
Two repositories share a basename | Freeze this one into its own subdirectory of the scratchpad, and use that directory for its §8 hash |
not covered: <root> has changed… from check, exit 1 |
Expected answer, not a failure | Go on with §1's status; never rerun |
Stopping early
A checkpoint that stops without a record — a red check §6 does not count as green, the user calling it off — ends the run (§1, The run):
ele checkpoint close <root>
When the user says this work needs no checkpoint, exempt its paths for the
session. It refuses a glob matching an arbitrary path, such as * or **, or
over half the repository's paths:
ele checkpoint optout <root> "<glob>" ...
Stopping early is done when close prints closed: <root> per repository.
04 同仓库更多 Skills
wrap
Wrap up a session by asking what to keep as notes, plan inbox items, progress lines or a recipe, which due reminders to close, and whether to hand off. Use when the user asks to wrap up or end a session, or asks "anything to remember or hand off?"; never start one unasked.
ticket-audit
Audit a tracker's ticket map against the code for stale premises and contradictions. Use when about to pick up a ticket or close a map, or when asked for a ticket audit; for ele plans, use ele:plan-audit.
setup
Set up ele after installing it, or in a directory no owner covers, by proposing the ele owner commands that map it and running them once the user approves. Use when the user asks to set up or configure ele, when the start block says no owner covers the directory, or when ele status names no owner here.
review
Review a merge request or pull request, a local branch or a commit with checkpoint's reviewers, and walk through its major findings, then any minor ones you pick, to publish, copy or skip. Uncommitted work is checkpoint's.
remember
Save a decision, an open question, a dated fact or a reminder for a later date so later sessions start with it. Use when the user says "remember this", "we decided…" or "remind me on…", or a skill or ele's Stop hook asks for notes.
recipe
Propose a reusable multi-step procedure this session ran as a user skill, and write it once the user approves; with audit, check the user's skills for commands, flags and versions that no longer exist. Use when the user asks to save a procedure as a recipe or skill, or to audit their skills for stale commands; /ele:wrap offers a recipe too; never start one unasked.