skills/session-close-report/SKILL.md
Generate or update the structured technical handoff report at session close. Prefer one same-day SSOT report: update the latest report for today when it exists, otherwise run `xt report generate`, then fill every `<!-- FILL -->` section from orchestrator context.
npx skillsauth add jaggerxtrm/jaggers-agent-tools session-close-reportInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Invoke this skill at the end of a productive session — after issues are closed, code is committed, but before final push. It produces the handoff report that the next agent reads to start cold without losing context.
Prefer a single same-day SSOT handoff report.
Before generating anything, check existing reports:
xt report list
ls -t .xtrm/reports/*.md 2>/dev/null | head
Decision:
xt report generate and fill the
new skeleton.When updating an existing report, preserve prior orchestrator content. Append, merge, or revise sections so the file remains one coherent handoff package — do not overwrite earlier waves, issue context, problems, or decisions unless they are factually superseded.
A report on a dirty session is misleading. Before selecting or generating any report, verify and clean up everything this session opened. The report must reflect a clean terminal state.
# 0a. Worktrees opened during the session
git worktree list # any feature/fix/chore worktrees still here?
# Remove every worktree this session created (or that a stopped specialist left):
git worktree remove <path> # for each stale entry
git branch -D <branch> # only after confirming merged or abandoned
git worktree prune # drop stale metadata
# 0b. Specialist jobs still running or waiting
sp ps # MUST be empty (or only intentionally kept-alive jobs)
sp stop <job-id> # for any leftover running/waiting job
# After every sp stop, re-check sp ps and git worktree list — sp stop should
# clean its worktree, but verify.
# 0c. Stale background processes from the session
ps -ef | grep -E '(serena|gitnexus|specialists|sp-serve|sp-script|pi[ -]|claude)' | grep -v grep
# Kill anything you launched that is still running and no longer needed.
# Be especially careful with:
# - serena MCP servers (often leak when an MCP host crashes)
# - gitnexus index processes (`npx gitnexus analyze` can outlive its terminal)
# - sp-serve / sp-script tmux sessions
# - orphaned `pi` or `claude` processes from interactive sessions
tmux ls 2>/dev/null # any sp-* or xt-* tmux sessions left?
tmux kill-session -t <name> # for each stale session
# 0d. Tmp dirs the session created (only if large or sensitive)
ls -la /tmp/sp-serve-* /tmp/sp-script-* 2>/dev/null
Do not skip any sub-step. If a process refuses to stop cleanly, document it in the Problems Encountered section of the report so the next agent knows.
A clean session ends with:
git worktree list showing only the main worktree (plus any intentional ones)sp ps showing 0 jobs (or only intentional keep-alive)serena / gitnexus / specialists / sp-serve / sp-script
processes from this sessionsp-* or xt-*For same-day update:
REPORT=$(ls -t .xtrm/reports/$(date +%F)-*.md 2>/dev/null | head -1)
If $REPORT is non-empty, read and update it.
If no same-day report exists:
xt report generate
This collects data from git log, bd, .specialists/jobs/ and writes a skeleton
to .xtrm/reports/<date>-<hash>.md with YAML frontmatter and pre-filled tables.
Read the chosen report completely enough to understand existing content.
Skeleton reports have <!-- FILL --> markers in every section that needs your
input. Existing same-day reports may already be partially filled; update those
sections with the new session context and remove any now-stale placeholders.
You are the orchestrator. You have the full session context. The CLI only collected raw data — you provide the meaning.
When updating an existing same-day report:
For each section, here is exactly what to write:
One dense paragraph. What was accomplished, key decisions made, discoveries, outcomes. Technical prose — no filler, no "in this session we...". Lead with the most important result. For same-day updates, summarize the whole day’s SSOT state, including earlier orchestrators and your additions.
The skeleton has a flat table. Restructure it:
Add every issue you created this session. The Why column is mandatory — explain the rationale for filing, not just what the issue says.
Update the issues_filed count in frontmatter.
If specialists were dispatched:
specialist_dispatches and models_used in frontmatterIf no specialists were used and the report has no prior specialist dispatches, delete this section. If prior dispatches exist, keep and extend them.
Every problem hit during the session. Root Cause and Resolution columns are mandatory. Include: bugs discovered, wrong approaches tried, blockers hit, tooling failures, and any cleanup-step failures from Step 0 above. If no problems exist anywhere in the same-day report, delete this section entirely.
The skeleton lists files. Add narrative:
List doc changes, skill updates, memory saves, CHANGELOG entries (see Step 5 — due-diligence sweep — and Step 6 — CHANGELOG sync). Delete if no doc work happened.
This is the most valuable handoff section. For each open issue:
List all bd remember calls made this session. If the skeleton missed any,
add them. If none were saved, note why (nothing novel, or deferred).
Ordered list of 1-4 items with rationale for each. Based on:
For same-day updates, make this the next priority from the final state of the whole day, not from an earlier partial state.
Ensure all frontmatter counts are accurate after filling/updating:
issues_filed — actual count represented in the reportspecialist_dispatches — actual count represented in the reportmodels_used — list of models that did work represented in the reportissues_closed — actual closed issue count represented in the reportcommits — commit count represented in the report, if knownStep 0 cleaned the process state. This step audits the content state. Cleanup work the orchestrator usually forgets at session close, ranked by how often it gets missed:
.claude/skills/service-registry.json (or equivalent
registry)? If yes, the service skill's SKILL.md or diagnostic scripts
are likely drifted. Run /updating-service-skills (or
service-skills-sync specialist) and let it scan. If no registry exists,
skip — but check whether the project keeps service skills under
.xtrm/skills/user/packs/<service>/ and treat them the same./sync-docs (or the
sync-docs specialist) for any drifted doc. Skip if changes are
pure-internal (refactors with no observable surface change).bd close should have triggered a memory-gate ack.
Run bd memories <topic> to confirm anything genuinely novel landed.
If you saw a real surprise but acked "nothing novel" out of haste,
go back and bd remember it now.scripts/outputs/,
docs/review/, etc.)? Confirm they are committed; otherwise either
commit them or document in the report why they were not kept.bd decision if the project uses it, otherwise note in the report.discovered-from:<impl-id>) before closing — do not
let untested behavior leave the session silent..xtrm/skills/): did you edit a skill in this
project? If the canonical version lives in xtrm-tools, mirror the edit
there too (or note that xt update will overwrite the local mirror on
next sync, which makes the local edit ephemeral).bd list --status=open --created-by=me (or equivalent)
and confirm none are floating without a parent or follow-up note.If any item above turns up real work, do it now or file a follow-up bead
linked discovered-from:<this-session-root> so the next agent picks it up.
A clean session means none of these were forgotten — the report should be
able to honestly claim "due-diligence sweep clean."
The session report is for the next agent; CHANGELOG.md is for downstream consumers. Both must stay in sync — the report alone is not enough.
ls CHANGELOG.md 2>/dev/null # confirm the project keeps one
git tag --sort=-v:refname | head -3 # last release tag
git log <last-tag>..HEAD --oneline # what is missing
Decision tree:
/releasing or
changelog-keeper): the new version section already exists. Verify it
contains every user-facing change from the session and that
[Unreleased] is empty. Stop — release flow owns CHANGELOG.[Unreleased] block at the top of CHANGELOG.md. Use
Keep a Changelog categories: ### Added / ### Changed / ### Deprecated
/ ### Removed / ### Fixed / ### Security. One bullet per change,
lead with the affected subsystem or symbol, include the bead ID(s) when
available — same prose density as prior [Unreleased] entries.[Unreleased] with internal noise. Note
the skip in the Documentation Updates section so it is auditable.What counts as user-facing for [Unreleased]:
What does NOT belong in [Unreleased]:
If the project has no CHANGELOG.md, skip silently — do not create one without operator direction.
Reports are versioned handoff artifacts and should be tracked. If Step 5
modified CHANGELOG.md, fold it into the same commit so the report and
changelog ship together.
git add .xtrm/reports/ CHANGELOG.md # CHANGELOG.md only if changed
git commit -m "session report: <date>"
If you updated an existing same-day report after an earlier report commit, commit that update with the same message style or fold it into the current final commit before push.
After committing, re-run the Step 0 checks one more time:
git worktree list
sp ps
ps -ef | grep -E '(serena|gitnexus|specialists|sp-serve|sp-script)' | grep -v grep
tmux ls 2>/dev/null
If any of these show session-leaked artifacts, stop them now or document them in the report. Do not consider the session "closed" until this verification is clean.
The reference is ~/projects/specialists/.xtrm/reports/2026-03-30-orchestration-session.md.
Every report must match that level of detail. Specifically:
<!-- FILL --> markers left in the final output| Command | Purpose |
|---------|---------|
| xt report generate | Collect data, write skeleton when no suitable report exists |
| xt report show [target] | Display latest or specified report |
| xt report list | List all reports with frontmatter summary |
| xt report diff <a> <b> | Compare two reports |
development
Operational service-knowledge system for a project's services. One skill that creates, discovers, activates, updates, and scopes per-service expert skill packages (SKILL.md + diagnostic scripts + references), kept in sync with the code via a GitNexus-aware drift engine. Use when onboarding to a service, routing a task to the right expert, scaffolding a missing skill, or syncing a skill after the implementation drifted. Triggers: /service-skills, /creating-service-skills, /using-service-skills, /updating-service-skills, /scope, or any task that touches a registered service territory.
development
Bootstrap a complete security pipeline (Dependabot + OSV + Semgrep + gitleaks + pre-commit hooks + Codex review) on any GitHub repo. Designed for free user-private repos where GitHub Advanced Security is unavailable. Reusable across Python/TypeScript/Go/Rust stacks.
testing
Merges queued PRs from xt worktree sessions in the correct order (FIFO), maintaining linear history by rebasing remaining PRs after each merge. Use this skill whenever the user has multiple open PRs from xt worktrees, asks to "merge my PRs", "process the PR queue", "drain the queue", "merge worktree branches", or says "what PRs do I have open". Also activate after any xt-end completion when other PRs are already open, or when the user asks "can I merge yet" or "is CI green". Handles the full sequence: list → sort → CI check → merge oldest → rebase cascade → repeat until queue is empty.
testing
Autonomous session close flow for xt worktree sessions. Use this skill whenever the user says "done", "finished", "wrap up", "close session", "ship it", "I'm done", "ready to merge", or similar. Also activate when all beads issues in the session are closed, or when the user explicitly runs /xt-end. This skill is designed for headless/specialist use: it must make deterministic decisions, auto-remediate common anomalies, and avoid clarification questions unless execution is truly blocked.