Add a status line, a Left Behind table (agents, worktrees, processes), and a Work Lanes table with file ownership, dependencies, model choice, and done checks. Tag next actions as you or dispatch. Fix the output path mismatch in the after-writing steps and drop em dashes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
129 lines
6.5 KiB
Markdown
129 lines
6.5 KiB
Markdown
---
|
|
name: sitrep
|
|
description: Generate a comprehensive session-handoff resume written to /tmp and opened in VS Code, structured so the next agent can orchestrate subagents from it. Use when the requester asks for /sitrep, handoff notes, resume context, or a transfer summary with current state, in-flight agents, parallel work lanes, next actions, verification steps, and blockers.
|
|
---
|
|
|
|
Generate a comprehensive resume prompt for session handoff.
|
|
|
|
You are creating handoff documentation for the next agent. Speak directly to them in second person ("You are …"). Never address the user. Refer to the original requester as "the requester".
|
|
|
|
Goal: the next agent must know **where the plans are**, **what the current situation is**, and **which work it can hand to subagents**, in minimal tokens. Point at plan/spec/work-order files and leave their contents there; the next agent reads them in full. Git detail is a one-liner.
|
|
|
|
The next agent may be an orchestrator that dispatches subagents. Subagents, Monitors, and background shells from this session die with it. Their worktrees, branches, and output files survive, so record those.
|
|
|
|
The deliverable is a FILE in /tmp opened in VS Code. Keep the sitrep body out of the terminal.
|
|
|
|
## Pre-Generation Checks (minimal: assume you are low on context)
|
|
|
|
1) Workspace + branch: `pwd`; if a git repo, `git status -sb | head -3` (branch + dirty/clean is all you need) and `git worktree list` (worktrees left by subagents).
|
|
|
|
2) Find the governing docs. Check in order, note every hit:
|
|
- `docs/superpowers/plans/`: the active plan (newest, or the one this session worked from)
|
|
- `docs/superpowers/specs/`: governing spec, if any
|
|
- `works/` or `docs/works/`: active work orders: `grep -rl 'TODO\|IN PROGRESS' --include='WO-*.md' works/ docs/works/ 2>/dev/null | head -3`, then unchecked tasks in the active WO: `grep -n '\[ \]' <wo-file> | head -10`
|
|
- Legacy fallbacks: `./plans/`, `~/.claude/plans/`
|
|
- If nothing: "Ad-hoc work, no plan file"
|
|
|
|
Grep plan/WO files for phase markers and unchecked items only. Skip reading them whole.
|
|
|
|
3) From the conversation, extract only what the docs cannot know: intent, decisions made this session, what is verified working vs broken right now, failures to avoid.
|
|
|
|
4) From the conversation, list everything still running or left behind: subagents/workflows (name, task, worktree/branch, last known status), background shells and dev servers (command, port), and scratch output files. Check that listed ports are still live with `ss -ltnp 2>/dev/null | grep -E ':(<port>)\b'`.
|
|
|
|
5) Split the remaining work into lanes. A lane is parallel-safe when its file set is disjoint from every other parallel lane and its dependencies are done. Everything touching shared state (merges, migrations, commits, lockfiles, shared config) goes in the serial lane the orchestrator runs itself.
|
|
|
|
## Output
|
|
|
|
Write this exact structure (raw markdown, no surrounding code fence) to `/tmp/sitrep-<project>--<work-tag>.md`, where `<project>` is the basename of the workspace root and `<work-tag>` is a short tag for the work being done (e.g. `/tmp/sitrep-blockninja--error-handling.md`). Overwrite any previous sitrep for the same project work.
|
|
|
|
```markdown
|
|
# Resume: [Feature Name]
|
|
|
|
Status: [in-progress | blocked | ready-for-review | done] · Lanes: [N parallel-ready, M serial] · Live agents: [N or 0]
|
|
|
|
You are a [specific expert role] continuing the requester's intent: [one sentence].
|
|
|
|
## Read These First
|
|
|
|
1. [path to active plan]: start at [phase/section]
|
|
2. [path to active WO]: [N] unchecked tasks remain
|
|
3. [governing spec or essential doc, if any]
|
|
|
|
(Omit lines that don't apply. If none at all: "Ad-hoc work, no plan file.")
|
|
|
|
## Task Intent
|
|
|
|
- [Outcome the requester wants]
|
|
- [Hard constraint]
|
|
- [What must not change]
|
|
|
|
## Current Situation
|
|
|
|
- Workspace: `[absolute/path]` on `[branch]` ([clean / N files uncommitted])
|
|
- Just happened: [the 1-3 things this session did that the docs don't yet record]
|
|
- Working (verified): [fact, and how it was verified] OR None
|
|
- Broken / in flight: [path:line: current state → intended end state] OR None
|
|
- Assumptions: confirmed: [bullet]; unverified: [bullet] OR None
|
|
|
|
## Left Behind
|
|
|
|
| Kind | Name / command | Location (worktree, branch, port, file) | Last status | Action for you |
|
|
|------|----------------|------------------------------------------|-------------|----------------|
|
|
| agent | [name]: [task] | [worktree path / branch] | [done, unreviewed / partial / failed] | [review + merge / re-dispatch lane X / discard] |
|
|
| process | [command] | [port / PID] | [live / dead] | [keep / restart with: cmd / kill] |
|
|
|
|
(If nothing: "None. No agents, worktrees, or background processes remain.")
|
|
|
|
## Work Lanes
|
|
|
|
| Lane | Goal | Files owned | Depends on | Model | Done when |
|
|
|------|------|-------------|------------|-------|-----------|
|
|
| A | [one line; cite WO task IDs] | [paths/globs] | [none / lane X] | [Sonnet: mechanical / Opus: design, debugging] | [observable check] |
|
|
| S | Serial: [merges, migrations, commits, integration] | [shared files] | [A, B] | you | [check] |
|
|
|
|
(Parallel lanes have disjoint "Files owned". If the work is single-threaded: "Serial only: [reason]".)
|
|
|
|
## Next Actions
|
|
|
|
1) [you | dispatch lane X] [exact next step]
|
|
2) [you | dispatch lane X] [exact next step]
|
|
3) [you | dispatch lane X] [exact next step]
|
|
|
|
## Verify
|
|
|
|
- Commands: [exact command(s); include check-safety for cms / plugins/* / sites/* / themes/* repos]
|
|
- Expected: [one line]
|
|
- Last actual: [one line] OR Unknown (not run)
|
|
|
|
## Failed Approaches
|
|
|
|
- [approach] → [failure] → avoid [pitfall]
|
|
- If none: None
|
|
|
|
## Blocker
|
|
|
|
- [blocker]: unblock requires [specific info/decision/command] OR None
|
|
|
|
## Notes
|
|
|
|
- Contracts to preserve (APIs/flags/env/schemas that must not break): [bullets] OR None
|
|
- Risky areas touched (migrations/auth/billing/prod config): [bullets] OR None
|
|
```
|
|
|
|
## After Writing the File
|
|
|
|
1. Open it for the requester: `code /tmp/sitrep-<project>--<work-tag>.md`
|
|
2. Reply in the terminal with ONLY:
|
|
- `Sitrep: /tmp/sitrep-<project>--<work-tag>.md (opened in VS Code)`
|
|
- the `# Resume:` title line and the `Status:` line
|
|
- `Resume with: claude --dangerously-skip-permissions --chrome "$(cat /tmp/sitrep-<project>--<work-tag>.md)"`
|
|
|
|
Keep the sitrep body out of the terminal reply.
|
|
|
|
## Rules
|
|
|
|
- Point at files. Task lists live in the plan/WO; lanes cite their task IDs.
|
|
- Every status claim is either verified (say how) or explicitly unverified.
|
|
- Every lane names its files and a checkable "Done when", so a subagent brief can be built from the row plus the cited WO tasks.
|
|
- Full absolute paths. Terse bullets. No narrative.
|