skills/session-handoff-audit/SKILL.md
Use when wrapping up a long multi-commit session, handing off to a new session, or the user asks to "audit what we've done", "verify implementation state", "check for drift", "防止幻觉", or "跨会话交接". Generates a self-contained prompt that a fresh, context-free session uses to independently verify the work against design specs. Generates the prompt only — does not perform the audit itself.
npx skillsauth add sipengxie2024/superpower-planning session-handoff-auditInstall 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.
A self-contained prompt text that the user copies into a fresh Claude session. That fresh session — with no memory of the prior conversation — reads the current codebase and independently verifies what has been implemented, detects drift from design specs, and returns an evidence-based report citing file_path:line_number for every claim.
The goal is to catch hallucinations. The current session has accumulated summaries, claims, and memory entries that may diverge from ground truth (the code). A fresh session reading source directly can expose those gaps.
If the session only produced a trivial change (one commit, small diff), this skill is overkill — just summarize normally.
Every generated prompt must enforce these, otherwise the audit loses its value:
Explore subagents that run in a single message. Sequential reads are slow and allow early findings to bias later ones.file_path:line_number. Statements without line refs are rejected by the report reviewer.Use AskUserQuestion to collect:
git branch --show-current..planning/design.md + .planning/design/*.md, docs/design/, spec/, DESIGN.md, CLAUDE.md. Ask user to pick the authoritative one.~/.claude/projects/<encoded-path>/memory/*.md, .planning/findings.md, .planning/progress.md, NOTES.md. Mark these as "hints, not authority" in the generated prompt.If the prior conversation already contains these facts (repo mentioned, branch visible in gitStatus, phase markers in use), extract them and just confirm with a single summary question rather than asking each separately.
Read assets/audit_prompt_template.md. Substitute the collected fields into the {{PLACEHOLDER}} slots. If that file is missing or unreadable, fall back to the embedded minimal template below. The template is designed to stand alone — do not prune its sections, they each carry weight:
If the project has no design docs (pure code, just CLAUDE.md, or just a README), adapt:
CLAUDE.md + README as the closest specassets/audit_prompt_template.md is missing)You are auditing the implementation state of {{REPO_PATH}} on branch {{BRANCH}}. Ground truth is source code; design docs and memory files are hints, not facts.
Design spec: {{SPEC_PATH}}
Progress notes (hints only): {{PROGRESS_PATH}}, {{MEMORY_PATH}}
Audit scope: {{SCOPE}}
Method: dispatch {{N_SUBAGENTS}} Explore subagents IN PARALLEL in a single message. Each must return file:line citations for every claim. No claim without a citation. Flag uncertainty as "UNCERTAIN: <reason>" — do not guess.
{{SUBAGENT_TASK_BREAKDOWN}}
Required output:
1. Implementation inventory — what exists and is wired in (cite file:line per item).
2. Parameter defaults — every literal value in code vs the spec (or "drop this axis" for bench-only / no-spec projects).
3. Drift — code that contradicts spec, or additions the spec never mentioned.
4. Uncertainty list — anything that needs runtime observation to verify.
Do not propose fixes. Do not import claims from prior conversations. Do not summarize what was "already done".
Substitute the fields collected in Step 1. The {{SUBAGENT_TASK_BREAKDOWN}} slot is where customization patterns (multi-phase / monorepo / bench-only) get applied.
Before presenting the prompt to the user, scan the filled template for completeness:
{{PLACEHOLDER}} slots remain. Grep the prompt text for {{; if any matches, the field was missed in Step 1 — return to gather it before proceeding.If any check fails, fix before Step 3. The audit's value is determined by these gates — a sloppy prompt produces a sloppy report.
Output the filled prompt inside a single fenced code block (```), ready to copy. Below the block, 2-3 sentences on:
Do not include multiple code blocks. A single block is easier to copy reliably.
Multi-phase projects (Phase 0/1/2/...): ask which phases to audit. The generated prompt then scopes each subagent to a phase.
Monorepo: suggest one subagent per crate group or package.
Design split across chapter files: add a line in the generated prompt: "read the design index first, then pull specific chapters as needed — do not load all chapters upfront".
Test-heavy projects: add a dedicated test-coverage axis to the output format.
Bench-only projects (no production target, like research code): replace "wired to production path" with "exercised by a benchmark or test binary"; list the benchmark entry points.
Session A's progress.md wrote: "Implemented parse_block_with_retries at parser.rs, retries 3× with exponential backoff, wired into executor::run_block:142."
Session B (audit) returned: function exists at parser.rs:88 ✓; retry count is 5 not 3 (parser.rs:91); backoff is linear not exponential (parser.rs:103-107); wired at executor.rs:178 not 142 — line 142 is unrelated. Three concrete claims each subtly wrong; none would be caught by re-reading the summary, only by independent code read with file:line evidence.
The main deliverable is the fenced prompt. Keep any commentary around it minimal and factual. Do not add motivational framing or preamble — the user has already decided to run the audit.
development
Use when a spec or requirements exist for a multi-step task and an implementation plan needs to be written before touching code
data-ai
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs.
data-ai
Use when executing implementation plans with parallel task groups or individual tasks too heavy for subagent context limits.
development
Use when implementing any feature or bugfix, before writing implementation code