Session Brief
Produce a concise current-state report during an active conversation. Do not modify files.
Core Rules
- Treat handoff as an index, not source of truth.
- Resolve the shared project handoff root before reading. Prefer the main repo/worktree root, then
.session/handoff/,.handoff/,handoff/, ordocs/handoff/. - Read project instructions if they affect interpretation. Follow the
Project Instruction Reading Boundaryinsession-handoff/schema/handoff.md; do not read.claude/settings.jsonby default. - Verify actionable next-work suggestions against current sources when available.
- Mark unverified handoff-only claims inline.
- Do not invent progress-source paths.
- Historical handoff files are read-only. Follow the
Historical Handoff Reading Boundaryinsession-handoff/schema/handoff.md; read older handoffs only on demand. - Use Board-first, Log-on-demand loading: the Board is the resume index; Session Log is supporting context only.
- Do not place the full Session Log into context. For active/resume context, extract only the latest Session Log entry for the relevant Active Work Slot. Follow the
Cold Start Reading BoundaryandRelated Docs Scopeinsession-handoff/schema/handoff.mdfor Related Docs and Spectra artifacts; treat Related Docs as documentation sync metadata, not as implementation context.
Handoff Root Resolution
Follow ## Handoff Root Resolution in session-handoff/schema/handoff.md. As a reader skill: read from the shared root and report a divergent worktree-local handoff directory as a migration/mismatch warning.
Quote-Trace Discipline
Follow ## Quote-Trace Discipline in session-handoff/schema/handoff.md.
Spectra Discovery
Spectra is optional, but detection is required. Follow ## Spectra Discovery
in session-handoff/schema/handoff.md (including the session-brief delta
there). The collector output's spectra section covers the detection steps —
do not re-run them manually unless the collector failed; report a non-null
spectra.error as a CLI failure, not as "Spectra absent".
Slot-Scoped Session Log Extraction
Reuse session-handoff/scripts/extract_relevant_log.py from the resolved session-handoff skill directory (the shared-script hub, next to schema/handoff.md) when Slot-specific log context is needed. Do not hard-code .agents or .claude absolute paths because this skill may be mirrored across both locations. The helper reads the handoff file internally, but prints only one relevant log entry so brief mode does not ingest the full append-only history.
python <session-handoff-skill-dir>/scripts/extract_relevant_log.py <handoff-file> --slot S4
Rules:
- Prefer the Slot from a resume-candidate
## Active Workrow. - If multiple entries match the Slot, use the latest one.
- If no Slot is selected, use
--latest --title-onlyfor the compact Last session line only. - If no matching Slot log exists, report the absence; do not scan or summarize all Session Log entries manually.
Workflow
Run the deterministic collector first:
python <session-handoff-skill-dir>/scripts/collect_briefing.py
(cwd = project root, or pass the root as the first argument). One JSON blob
covers: latest handoff path + Board content (cut before Session Log),
git status/log/worktree list, Spectra detection + active/parked lists +
.spectra.yaml worktree setting, and an ideas-backlog summary (titles grouped
by section; pass --full-backlog only if per-item metadata is needed).
Per-section failures appear as <error: ...> values — report them;
fall back to manual collection only if the script itself fails to run.
Then classify Active Work occupancy using the Workspace/Branch schema. If an active/resume Slot needs log context, run the slot-scoped extraction helper and read only that output. Read only the current sources needed to verify the first claimable item, active conflicts, blockers, or likely next step. Summarize the ideas backlog from the collector's ideas_backlog section; include entry titles grouped by phase/section, not entry bodies.
Output
Respond in Traditional Chinese unless the user explicitly requests another language.
Use this compact structure:
## Brief
**Last session**: [title or one sentence from slot-scoped extraction; `linked: Sm` if matched, else `ad-hoc` / `handoff-only`; do not summarize full Session Log]
**Git**: `[branch]` - [clean / N changed files]
**Active Work**: [count and status summary, including resume/occupied/isolated/stale labels]
**Remaining**: [count and first 3 notable items]
**Open Questions**: [count or notable unresolved items]
**Blockers**: [count or notable active blockers]
**Spectra**: [not detected / no active or parked changes / change status; include `.spectra.yaml worktree` setting when present, plus `parked total: N` from `spectra list --parked` so the operator knows how many parked changes exist beyond Board-listed ones]
**Docs Sync**: [count or key documentation/planning paths from Related Docs; note invalid source/test/generated entries only if found]
**Ideas Backlog**: [entry titles grouped by phase/section from `.knowledge/ideas-backlog.md`; if file missing or empty, say so]
[Board mismatch or doc sync note, only if found.]
**Next**: [final recommended next action; this must be the last line so the bottom of the chat ends on the actionable next step. If the recommendation involves a git operation (commit, push, merge, etc.), it must be derived from actual `git status` output — never copied from handoff Session Log.]
Next-action decision logic: evaluate in order, pick the first match. Output must be an exact command or status — no abstract suggestions.
- Active Spectra change has unfinished executable tasks AND is listed as an unfinished row in
## Active Work:/spectra-apply <change>. - Active Spectra change has unfinished executable tasks BUT is not listed in
## Active Work:/session-claim <change>. - Parked Spectra change is the next Board item:
/session-claim <change>. - Phase Plan names a planned change that does not exist in Spectra:
/spectra-propose <change>. - Phase Plan or Open Questions show unclear requirements:
/spectra-discuss. - No Spectra change exists but Board has Remaining items:
/session-claim <highest-priority-remaining-item>. - Board has active Open Questions or Blockers:
resolve OQ: "<exact question text>"orresolve Blocker: "<exact blocker text>". - Board is clean and git is clean:
no queued work.