/active-skills:close-sessionfrom active-skills
Use when a work session is ending — updates project documentation, commits, and pushes safely to GitHub. Triggers on "close session", "wrap up", "end session", "done for now", "save my work", "let's commit everything and push", or finishing a block of work with no further tasks planned. Make sure to use this skill whenever a session of real work is ending, even if the user only says they are done. For a bare pull, push, or rebase against the remote with no session to close, use git-sync instead.
Ships in active-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
End-of-session ritual: triage → update docs → classify → commit → merge related branches to main → push or hold.
Core principle: Every session ends with accurate documentation and a clean, safe git state. Two things MUST NEVER push: breaking changes before the related work is complete, and secrets or internal identifiers — the first because callers break, the second because a push to a public repo is permanent. Either hold is lifted only by the user explicitly overriding.
Announce at start: "I'm using the close-session skill to wrap up this session."
Run this first, before anything expensive:
git fetch --quiet # know where the remote actually is before deciding anything
git status -sb # branch, upstream, ahead/behind, and working tree in one shot
git diff --stat HEAD # what this session touched
Then write down what this session changed OUTSIDE the working tree, before routing. Cloud resources created, deleted or reconfigured; a server flag or unit file edited over SSH; a deploy, a scaled replica, an IAM grant, a schema or bucket setting; a model or endpoint swapped. Each is a change the repo may describe and git diff cannot see.
For every such change, grep the repo for the thing you changed — the resource name, and both the old and the new value:
grep -rn "<resource-or-old-value>" --include="*.md" --include="*.py" --include="*.yaml" .
This costs one grep per mutation and is the only step that catches the largest class of doc staleness: prose that was true until you changed the world. A session that edits no files can still invalidate ARCH.md, a runbook, a vendored config capture, a lifecycle rule, or an alert filter — and every diff-scoped review will pass it. If a value now lives in the repo AND somewhere you just changed, that is a duplicate: fix the doc now, and note whether a test could have linked them.
Route on the result:
| Triage result | Route |
|---|---|
| Clean tree, in sync, and no out-of-repo changes | Report clean state and stop |
| Clean tree, but the session changed something outside the repo | Continue to Step 2, carrying the grep hits — this is a documentation session even though nothing was edited |
| Clean tree, commits ahead of upstream | Skip to Step 3 — classify the unpushed commits, then merge and push |
| Behind upstream | Reconcile before anything else: git pull --rebase. If it conflicts, hand off to git-sync and stop |
| Dirty tree | Continue to Step 2, carrying the file list from git diff --stat |
Triage costs one round trip and decides whether the rest of the skill runs at all. Step 2 is the expensive step — do not pay for it before knowing there is anything to document. git fetch belongs here and not later because the most common close is a session on main with no branches, and that path otherwise reaches git push having never looked at the remote.
Scope the pass to what Step 1 showed changed:
managing-agent-instructions skill.managing-agent-instructions; there is nothing for it to reconcile, and it is a multi-phase pass that costs far more than the check."Confirming docs are accurate" is not reading them. A stale claim was true when written and still reads as plausible — that is what makes it stale rather than wrong. You cannot detect one by re-reading, only by re-deriving the fact, and nobody re-derives a whole ARCH.md per session. So a read-and-judge pass reliably degrades into a plausibility check, and stale-but-plausible is precisely what survives it.
Report the check as what it actually was:
gcloud … returned X, GET /v1/models reports Y, test_… pins it).When it does run, focus on changes this session introduced:
AGENTS.md / GEMINI.md / CLAUDE.mdARCH.mdAGENTS.md.agents/TODO.md (with [P1] or [P2]).agents/TODO.md.agents/wiki/, not a TODO item (see below)DESIGN.md and run npx @google/design.md lint DESIGN.md (the file argument is required)A follow-up task is work still to do → .agents/TODO.md. A lesson learned is a finding that cost investigation to establish and is not derivable from the code → a concept in .agents/wiki/, version-pinned to what it was verified against.
The trap this exists to prevent: a completed TODO carries the resolution note that explains why the fix was what it was, and pruning the task deletes that evidence. Before pruning any completed item, ask whether its resolution passes the scope test — if so, mint the concept first, then prune.
If the project has no bundle, say so and offer it as a follow-up — do not scaffold one mid-close. /llm-wiki:init creates a directory tree and rewrites all three briefing files to wire discovery, which is more than a session close should do unprompted, and it fails outright if the llm-wiki plugin isn't installed.
When a bundle does exist, regenerate and validate after adding concepts (/llm-wiki:index, /llm-wiki:validate) so the index committed in Step 4 is current — index also re-syncs the catalog inlined in AGENTS.md/GEMINI.md, which goes stale silently because agy reads those files but never expands an @ import. Full model: managing-agent-instructions Phase 6.
Note that this doc pass usually dirties the tree. Re-check git status before Step 4 so the doc edits are staged with everything else.
Read the change once and check it against both hold conditions:
git diff HEAD # uncommitted work
git log -p @{u}.. # or, when the commits already exist
NOT NULL columns without a defaultNot breaking — safe to push: new functions, exports, or CLI commands (additive); bug fixes that leave the public interface intact; new optional config fields; documentation-only changes; new skill files added to a skills repo; refactoring with an identical external interface; test additions or changes.
When ambiguous, classify as breaking and note why. A conservative hold is recoverable; an accidental push of broken interfaces is not.
BEGIN ... PRIVATE KEY headers, .env contents, connection strings carrying a passwordgoogle3, blaze, /google/bin, go/ shortlinks, internal proto pathsThis outranks every other check: a broken interface is fixed by the next commit, but a leak is in the history permanently, and in a public repo it is world-readable the moment the push lands. Reverting the commit does not remove it.
Stage all changes and commit:
git add <specific files> # prefer explicit over git add -A
git commit -m "<message>"
Commit message convention:
feat: new capabilityfix: bug fixdocs: documentation onlyrefactor: restructure, no behavior changechore: maintenanceBREAKING CHANGE: <description> in the commit footer when applicableIf commits already exist but are unpushed, skip the commit step — just classify and push or hold.
Once changes are committed and classified as not breaking and not leaking, integrate this session's work into main.
Identify the branches related to this session: the current working branch if it is not main, plus any feature branches created during the session for this work. If the current branch is main and no other session branches exist, skip to Step 6.
If Step 3 flagged anything, do NOT merge. Leave the work on its branch and go to Step 6 (hold) — merging into main defeats the purpose of the hold.
For each related branch:
git checkout main
git pull --ff-only # sync main before merging
git merge --no-ff <branch> # bring the session branch into main
git branch -d <branch>.When it is unclear which branches belong to this session, ask the user rather than merging everything.
Push main (now holding the merged work):
git push
If the push is rejected, the remote moved after Step 1's fetch — usually another machine committing to the same repo. Run git pull --rebase and push once more. If the rebase conflicts, stop and hand off to git-sync; never resolve a rejection by force-pushing, which discards whatever landed on the remote.
Report: "Session closed. Related branches merged to main and pushed to GitHub."
Do NOT merge to main and do NOT push. Leave the work on its branch.
Add a [P0] item to .agents/TODO.md:
- [ ] **[P0]** Push held changes from session YYYY-MM-DD — [what is breaking or leaking, and what must happen first]
Commit this TODO update if not already included, then report:
Session closed locally on branch <branch>. NOT merged to main, NOT pushed.
Held because:
- [specific change 1]
- [specific change 2]
Added [P0] to .agents/TODO.md.
Merge to main and push when:
1. All related work is complete (or the leak is removed from the change), OR
2. You say "push anyway"
A leak hold has one extra requirement: removing the offending line is not enough if it was already committed locally. The commit must be amended or the history rewritten before the push, or the secret ships anyway.
If the user explicitly says "push anyway", "force push", or similar — merge the related branches to main (Step 5) and push immediately without further checks. Record nothing in TODO.
| Excuse | Reality |
|---|---|
| "I'll update the docs first, then check git" | The doc pass is the expensive step and triage is one round trip. A clean, in-sync tree ends the session before Step 2 ever loads. |
"I'm on main, so there's nothing to pull" | main is exactly where an unfetched push rejects — other machines and automation commit here too. Fetch in Step 1, always. |
| "The push was rejected, I'll just force it" | A rejection means someone else's work is on the remote. Rebase and retry once; if that conflicts, stop and use git-sync. |
| "Small change, probably not breaking" | Impact is what matters, not size. Rename a single export and every caller breaks. Classify by effect. |
| "The breaking change is intentional, so it's fine" | Intent doesn't unbreak callers. Hold until downstream work lands. |
| "No secrets in this diff, it's just docs" | Prose leaks too — an unreleased service name in a research doc reads like an ordinary product name and no path scan catches it. Read the prose. |
| "I removed the secret, so it's safe to push" | If it was already committed locally, the secret is in the history. Amend or rewrite before pushing. |
| "I'll push the docs update even if the code is breaking" | All staged changes travel in the same push. Hold everything or push everything. |
| "Nothing to commit, nothing to do" | A session that edited no files can still have invalidated the docs by changing the world — restarting a server, deleting a resource, swapping a model. Enumerate out-of-repo changes in Step 1 and grep for each. |
| "I already know what the docs say" | Knowing what they say is the problem, not the remedy — a stale claim reads exactly like a current one. Verify the claim against the system, or report it as unverified. |
| "I read the docs and they look fine" | "Looks fine" is a plausibility check, and stale-but-plausible is what survives plausibility checks. Name the claim and the command that verified it, or it is unverified. |
| "The task is done, so I'll just delete it from TODO.md" | A completed item's resolution note is often the only record of why. Mint the concept in .agents/wiki/ first, then prune. |
| "I'll write the lesson as a TODO so it's not lost" | TODOs are work to do; a closed finding sits there forever looking actionable. Lessons are evidence — they belong in the bundle. |
Follows:
Invokes:
managing-agent-instructions (Step 2, conditionally) — updates the briefing files, .agents/TODO.md, DESIGN.md, and the .agents/wiki/ bundlegit-sync (Steps 1 and 6) — when reconciling with the remote conflictsScope boundary: this skill handles session hygiene — docs, commit, a straightforward merge of this session's branches to main, and a safe push. It does not deliberate integration strategy. When how the work should land is an actual decision (open a PR instead of merging, stack it on another branch, discard it), Step 5 stops and asks rather than merging by default.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mlarkin00/plugins --plugin active-skills17 skills in this plugin
/agent-eval-designDesign an evaluation strategy for a GCP AI agent before writing any eval code — choose metrics across outcome, trajectory, operational, and safety dimensions; pick scorer types (code-based rules, LLM-as-judge, human review); and plan a golden dataset with adversarial coverage. Use when the user asks how to evaluate an ADK, Vertex AI, Agent Engine, or Gemini Enterprise agent, what metrics to use, how to build a golden or test dataset for an agent, or wants an eval plan or eval strategy for an AI agent. Not for evaluating Claude Code skills (use skill-creator-enhanced), writing agent eval code (use agent-eval-implement), or executing agent evals (use agent-eval-run)./agent-eval-implementBuild the runnable eval assets for an AI agent on GCP — ADK evalset files, pytest eval wiring, Gen AI evaluation service code for trajectory and final-response metrics, custom LLM-as-judge rubrics and scorers, and ground-truth eval datasets in Cloud Storage or BigQuery. Use when the user wants to write, build, create, or add agent evals, an evalset or eval test file, a custom judge or scorer for agent output, or an eval/ground-truth dataset — for an ADK, Vertex AI, Agent Engine, Gemini Enterprise, LangGraph, or LangChain agent. Works from an eval plan produced by agent-eval-design, or standalone when the user names just one asset. Not for choosing which metrics to measure (use agent-eval-design), executing eval runs or CI/CD gating (use agent-eval-run), or creating Claude Code skills (use skill-creator-enhanced).Other plugins' skills for the same job