swain-teardown

Installation
SKILL.md

Session Teardown

Single entry point for ending a session. Runs the full shutdown sequence: digest, retro, merge, cleanup, close, commit. Replaces the former swain-session close handler (ADR-023).

REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
bash "$REPO_ROOT/.agents/bin/swain-session-check.sh" 2>/dev/null

If session-chain is NOT passed and the JSON output has "status" other than "active", inform the operator: "No active session to tear down." Exit cleanly with code 0.


What this skill does

Session teardown runs a sequence of hygiene checks before a session closes:

  1. Orphan worktree detection — finds worktrees with no corresponding session bookmark (SPEC-233: actionable with safety checks)
  2. Git dirty-state check — surfaces uncommitted changes before the operator leaves
Related skills

More from cristoslc/swain

Installs
33
Repository
cristoslc/swain
GitHub Stars
2
First Seen
Apr 3, 2026