skills: add /end-session — session-end checklist (work pushed + status ledgers written) (#1047)
A repo skill that runs before wrapping up a session. Two gates: (A) all work committed/pushed/PR'd — tasks, working trees, worktrees, unpushed commits, open PRs; (B) the three PER-SESSION status.elevenmessenger.com ledgers are written — the SSH access why-entry (required if the session touched a fleet box, else the page renders "no summary recorded"), the carbon tally, and the prompt registry — each via its docs/status.md procedure. Checks and reports first; completes the mechanical parts only with the user's OK, and never merges, deploys, publishes, echoes secrets, or dirties the shared main checkout.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 file changed,
+101
−0
.claude/skills/end-session/SKILL.md+101 −0
diff --git a/.claude/skills/end-session/SKILL.md b/.claude/skills/end-session/SKILL.md| new file mode 100644 |
| index 0000000..b922b58 |
| --- /dev/null |
| +++ b/.claude/skills/end-session/SKILL.md |
| @@ -0,0 +1,101 @@ |
| +--- |
| +name: end-session |
| +description: End-of-session checklist — confirm all work is committed/pushed/PR'd and that the per-session status.elevenmessenger.com ledgers (SSH access, carbon tally, prompt registry) are written before wrapping up. |
| +--- |
| + |
| +# 🤖 end-session — leave nothing owed |
| + |
| +Run this before wrapping up a working session. Two gates: **(A)** the work is |
| +finished and pushed, **(B)** the public status ledgers this session touched are |
| +written. **Check and report first; complete the mechanical parts only with the |
| +user's OK** — never auto-merge, auto-deploy, or auto-publish (those stay the |
| +user's call). Never echo secrets or capability/invite links (transcripts are |
| +public — [[transcripts-are-public]]). |
| + |
| +Work through both gates, then end with the owed/clear summary at the bottom. |
| + |
| +## A. Work finished & pushed |
| + |
| +1. **Tasks.** If a task list is in use, `TaskList` — any `in_progress` / `pending` |
| + left? Finish them, or state which are intentionally deferred and why. |
| +2. **Working trees.** `git status` in the main checkout, and `git worktree list` |
| + then `git -C <wt> status` for every open worktree. Uncommitted changes → |
| + commit (area-prefixed: `web:`/`server:`/`docs:`…) or explain why they're left. |
| +3. **Unpushed commits.** `git log --branches --not --remotes --oneline` — anything |
| + printed is local-only. Push it (feature branches, never straight to `main`). |
| +4. **Open PRs.** `gh pr list --author @me --state open` — for each, either it's |
| + ready (offer to `gh pr merge <n> --squash --delete-branch`) or say what it's |
| + waiting on. After a squash-merge, delete the remote branch + `git worktree |
| + remove` the merged worktree (gh may fail the local step when `main` is a |
| + sibling worktree — that's cosmetic; the server-side merge still lands). |
| +5. **Leftover worktrees** from already-merged branches → `git worktree remove`. |
| +6. **Shared `main` checkout** is shared with other sessions — don't force-pull or |
| + mutate it; just report if it's behind after a merge. |
| + |
| +## B. Status ledgers (status.elevenmessenger.com) |
| + |
| +Authoritative procedures: **`docs/status.md`**. Three ledgers are **per-session** |
| +(below). The rest — books / economics / contributors / security / milestones — |
| +are periodic, not session-gated; mention one only if this session changed its |
| +inputs. |
| + |
| +### B1. SSH access ledger — REQUIRED if this session touched a fleet box |
| +Did this session `ssh`/`scp` to the router box (`elevenbox`, `89.167.122.227`, |
| +or any `*.11ch.at` / fleet box) — e.g. a canary deploy, a teardown, a box |
| +inspection? If yes there **must** be a why-entry, or the public page renders the |
| +session as **"no summary recorded"** (that state IS the enforcement). |
| + |
| +- **Check:** is there a `web/status/ssh/<today>-*.json` covering this session's |
| + window? (`ls web/status/ssh/`.) |
| +- **If missing, write** `web/status/ssh/YYYY-MM-DD-<slug>.json`: |
| + ```json |
| + { "date": "YYYY-MM-DD", "operator": "Full Name", "window": "HH:MM–HH:MM UTC (approx)", "why": "terse what-not-how summary", "refs": ["https://github.com/elevenmessenger/messenger/pull/NNN"] } |
| + ``` |
| + - `operator` **must** match a handle in `web/status/ssh-operators.json`, or the |
| + join misses. |
| + - `why` is *what, not how* — never a command, credential, token, host token, or |
| + email. A security-sensitive session publishes as `"why": "(withheld: security)"` |
| + rather than vanishing. Redaction bar: `web/status/ssh/README.md`. |
| + - `date` + `window` are UTC and approximate; one entry may cover several |
| + sessions in the same working window. |
| +- The entry rides a normal commit/PR. It only reaches the page once scp'd to the |
| + box (`web/status/ssh/*.json` → `/opt/lchat/status-pages/ssh/`), which happens on |
| + a status publish — so if this session is *already* publishing to the box, copy |
| + it too; otherwise the committed entry is enough and the next publish carries it. |
| + |
| +### B2. Carbon tally |
| +- Run `node tools/carbon-tally.mjs check`. **Silent → nothing owed.** If it says |
| + accrue (this machine's newest entry is >3 days old — its transcripts prune after |
| + ~a week, so a missed week is lost): |
| + 1. `node tools/carbon-tally.mjs --write` (per-source cutoffs; safe to re-run), |
| + 2. commit `web/status/carbon.json` as a **tiny standalone PR merged promptly** |
| + (two branches accruing the same window is the one race the cutoffs can't |
| + see; the contract test catches it on main), |
| + 3. copy `web/status/carbon.json` to the box's `/opt/lchat/status-pages/`. |
| +- `docs/status.md § Keeping the carbon tally accruing`. The check nags; the |
| + accrual is a judgment call you run. |
| + |
| +### B3. Prompt registry |
| +- Run `node tools/prompt-registry.mjs check`. **Silent / "no corpus at …" → |
| + nothing owed** (publishing is opt-in; the nudge follows that choice). If it |
| + nags (corpus >3 days old *and* transcripts touched since), accrue per |
| + `docs/status.md § The prompt registry`: build (`--out <dir>`), **summarise the |
| + new sessions with haiku subagents over the REDACTED build output only** (never |
| + raw transcripts), re-build (fail-closed re-scan), upload the corpus, and commit |
| + the hash-ledger entry. It's heavy and judgment-bound — surface it clearly and |
| + do it deliberately, don't half-run it. |
| + |
| +## What this skill does NOT do |
| +- Merge / deploy / publish without the user's OK — fleet publishes, box scps, and |
| + PR merges are surfaced as offers, never taken silently. |
| +- Touch the secrets vault, echo any secret, or print an invite/capability link. |
| +- Force-update or dirty the shared `main` checkout. |
| + |
| +## Report |
| +End with a tight table — each item **✅ clear** / **⚠️ owed** (with the single |
| +action that closes it) / **— n/a this session**: |
| + |
| +``` |
| +A1 tasks · A2 working trees · A3 unpushed · A4 open PRs · A5 worktrees · A6 main |
| +B1 ssh ledger · B2 carbon · B3 prompt registry |
| +``` |