Handoff

From mikeprasad/aria-knowledge · View interactive version

Handoff is an AI agent skill from the GitHub repository mikeprasad/aria-knowledge. Passoff package — for future-you (restart) or a coworker (brief mode). Default/auto emit a next-session opener + PROGRESS/CLAUDE/memory + a commit message + "/aria-cowork:extract"; brief = 80-150 word coworker prose; snap defers /extract via a snapshot. Done-with-no-passoff → "/aria-cowork:wrapup".

How to use this skill

Skill file

/handoff — Express Session Handoff (cowork variant)

Four modes covering two distinct handoff shapes:

Cowork variant of aria-knowledge's /handoff. Behavior is byte-aligned where Cowork's runtime permits; three divergences shared with /aria-cowork:wrapup:

Brief mode template (/handoff brief) imports from aria-knowledge v2.17.0 schema — same 80-150 word coworker-brief format, same [coworker] literal placeholder convention, same 4 section headers (What happened / Key decisions / What's next / Where to pick up). Schema-identical regardless of which plugin generated it.

Runtime Gate (per ADR-094)

Canonical resolution: This is the Claude Cowork variant — namespaced-only. When both plugin-claude-code and plugin-claude-cowork are loaded in the same session (most common in Claude Desktop), bare /handoff resolves to aria-knowledge's variant — Code is the canonical owner of all 24 dual-port skills per ADR-094 §Part 1. To reach this skill, use the namespaced form: /aria-cowork:handoff. Do NOT match bare /handoff — that belongs to aria-knowledge.

Before Step 0 — runtime self-correction. Check whether the Bash tool is available in this session. If Bash IS available (you are running in Claude Code or another runtime with shell access), this invocation reached the wrong variant for the runtime. Do not ask — redirect. Announce it in one line, then use the Skill tool to invoke handoff with the same arguments the user provided, and do not run this skill's steps:

↪️ Redirecting to /handoff — you invoked the aria-cowork variant, but you are running in Claude Code or another runtime with shell access.

This variant emits a copy-paste commit message because Cowork has no shell access — but you appear to be running in Claude Code, where git status / git commit would work directly. The runtime-appropriate variant is /handoff (the aria-knowledge canonical), which runs git directly.

⛔ The redirect is unconditional — every mode including auto, and no opt-out. Reaching this variant under that condition is always a mis-invocation, so there is nothing for the user to decide. Design record: docs/superpowers/specs/2026-08-28-runtime-gate-auto-redirect-design.md (D2 auto-redirect, D3 no escape hatch, D6 announce-don't-swap-silently).

If Bash is NOT available (normal Cowork runtime), proceed to Step 0.

Four modes:

Coverage matches /aria-cowork:wrapup for default + auto + snap modes. Brief mode is a different shape — handoff to a person, not to a session.

snap is auto plus one swap. snap follows auto's behavior exactly (silent, implicit-yes, apply all drafts, emit the opener) — wherever a step below applies to auto, it applies identically to snap. The single difference is the capture step (Step 6): snap runs /aria-cowork:snapshot (archive for later) while auto runs /aria-cowork:extract (synthesize now). Nothing else differs. (snap is NOT brief — it produces the full next-session package, not a coworker prose block.)

Step 0: Resolve Config and Parse Mode

Read <knowledge_folder>/aria-config.md and extract knowledge_folder. If missing, stop: "aria-knowledge is not configured. Run /aria-setup to get started."

Parse the argument:

Use {knowledge_folder} as the base path for all file operations.

Step 1: Identify Project Context

Same logic as /wrapup Step 1 — detect:

Additionally, determine the project marker for the next-session opener (Step 9):

If no PROGRESS.md or CLAUDE.md is found, note this — proceed with the steps that apply.

Step 2: Synthesize Session Work (silent)

Build the session synthesis internally — do NOT print it yet:

  1. Files changed — list files created/modified/deleted during this session (from conversation context, not git)
  2. Key decisions — architectural choices, approach selections
  3. Current state — what's working, in-progress, blocked
  4. Next steps — what the user indicated should happen next, or what logically follows
  5. Open threads — anything explicitly deferred or flagged for later

This synthesis feeds every subsequent step.

Mode branch: If mode = brief, jump to Step 2B (Brief Output) and stop there. Skip Steps 3-8 entirely. Otherwise continue to Step 3.

Step 2B: Brief Output (brief mode only)

Skip this step entirely if mode != brief.

Brief mode produces a single copy/paste artifact — a coworker-facing prose brief. No PROGRESS update, no CLAUDE.md edit, no memory write, no commit, no /extract call. Just the prose, formatted for paste into Slack / email / chat.

2B.1: Build the brief from Step 2 synthesis

Compose an 80-150 word prose block following this template (cap at 200 words). Fill placeholders from the Step 2 synthesis; if a section has no relevant content for this session, omit the section line entirely (don't leave empty bullets).

Hey [coworker] —

Quick brief on {topic from synthesis} from {YYYY-MM-DD}:

**What happened:** {2-3 sentence summary drawn from synthesis "Current state" + "Files changed"}

**Key decisions:**
- {decision 1 from synthesis "Key decisions"}
- {decision 2}
- {decision 3 if relevant — cap at 4 bullets}

**What's next:** {1-2 sentences from synthesis "Next steps" + "Open threads"}

**Where to pick up:** {file path, PR link, ticket ref, or doc link — omit this whole line if N/A}

Let me know if you want me to walk through any of this.

Notes for filling the template:

2B.2: Emit the brief

Emit the brief inside a code fence so it copies cleanly. Format:

## Coworker Brief — {YYYY-MM-DD}

Paste this directly into Slack / email / chat:

{full brief from 2B.1}


That's it — no further handoff steps run in brief mode. If you also want to update PROGRESS.md, memory, or run /extract, invoke `/handoff` (default) or `/handoff auto` separately.

Exit after emission. Do not run any subsequent steps.

Step 3: Draft All Updates (silent)

In parallel, draft every artifact this handoff might write. Do NOT apply anything yet.

3a: PROGRESS.md entry

If PROGRESS.md exists: draft a new session entry matching the existing format (heading style, date format, structure). If today's entry already exists, draft an append-to-existing delta instead of a duplicate entry.

3b: CLAUDE.md updates

If CLAUDE.md exists: check if anything from this session contradicts, outdates, or is missing from it. If updates are needed, draft the specific edits (show old → new diffs). If nothing needs updating, mark as current — do NOT force updates for the sake of updating.

3c: Memory updates

Check ~/.claude/projects/.../memory/project_*.md files matching the current project path. Compare against the session synthesis. If memory is stale, draft an update (specific old → new lines). If no update needed, mark as current.

3d: Commit message(s)

For each git repository with conversation-detected file changes: draft a conventional-commit message based on the session synthesis. List specific files to stage (NOT git add -A). Skip repos with no detected changes. Cowork emits the message as a copy-paste block in Step 5 — does NOT shell out to git.

3e: Next-session opener (the always-on artifact)

Build a fenced block intended for paste into the next session. Format:

{project-marker}
Resume {project-name} from {YYYY-MM-DD} handoff.

Read first:
- {PROGRESS.md path} (latest entry)
- {primary CLAUDE.md path}
- {any relevant memory file paths}

Where we left off:
- {1-3 bullets summarizing current state}

Open threads:
- {bulleted list from synthesis "Open threads"}

First action:
- {derived from synthesis "Next steps", phrased as an imperative}

The opener is always produced, even when the session was short or no other artifacts changed — it's the headline deliverable.

3f: SESSION.md (handoff state) — SKIPPED in cowork

(SKIPPED in cowork per ADR-005 — the SESSION.md producer is not ported; the CHANGELOG records this.) aria-knowledge's /handoff Step 3f writes {project_root}/SESSION.md and maintains its multi-session ledger under ## Pending handoffs: an at-ordering guard so an older session never overwrites a newer one's state, a full-fidelity demote of any prior prompt into the ledger before the rewrite, a prune of entries already marked consumed, and a provenance token (aria-handoff: <project>/<sid>@<at>) as the opener's first line. Cowork produces none of it, for three runtime reasons:

So this variant never reads, writes, demotes or prunes SESSION.md, and its opener carries no provenance token (a token naming no stored prompt would make a Code session report that it names no prompt in the project). The canonical pre-write reads go with it: the shell-bypass ledger has no writer in Cowork, and the pending-handoff count needs the ledger. The 3e opener printed in Step 8 is the only copy of the handoff — tell the user it is not stored in SESSION.md. Canonical text: plugin-claude-code/skills/handoff/SKILL.md Step 3f.

Step 4: Single Combined-Go Review (default mode only)

Skip this step entirely if mode = auto or mode = snap. (Both run silently with implicit-yes — no review gate.)

In default mode, present all drafts together in one scroll under clear section headers, then ask once:

## Handoff Review — combined-go

[3a: PROGRESS.md entry draft]
[3b: CLAUDE.md updates draft, or "no changes needed"]
[3c: Memory updates draft, or "no changes needed"]
[3d: Commit messages + staged file lists per repo, or "no uncommitted changes"]
[3e: Next-session opener]

---

**Apply all of the above?**
- `yes` — apply all drafts, run /extract, emit final report
- `edit {section}` — let user revise a specific section before applying (3a, 3b, 3c, 3d, or 3e)
- `skip {section}` — apply everything except the named section
- `abort` — apply nothing, exit cleanly

Wait for explicit response. Allow multiple edit / skip directives in sequence (re-show the scroll after each revision). The final action is yes or abort.

Step 5: Apply Drafts

Apply approved drafts in order. For auto and snap modes, this runs immediately after Step 3 with no review gate.

  1. 3a: Append the PROGRESS.md entry (or merge into today's existing entry)
  2. 3b: Edit CLAUDE.md per the diffs
  3. 3c: Edit memory file(s) per the diffs
  4. 3d: For each git repo: emit a copy-paste commit-command block for the user to run in their terminal (cowork has no shell access — Q-4 Option B). Do NOT attempt to shell git. Format:

```

## Commit message — copy/paste to run in your terminal

Files to stage:

git add path/to/file1.md path/to/file2.md

Commit:

git commit -m "type(scope): description

Body lines here."

```

If a non-git step fails (e.g., file write error on PROGRESS.md), surface the failure inline and stop — do not silently continue. Commit-message emission can't fail (it's just text output).

Step 6: Capture Session Knowledge

If mode = snap: Do NOT run /aria-cowork:extract. Instead invoke the /aria-cowork:snapshot skill to archive the conversation to intake/pre-compact-captures/ for later extraction. This is snap mode's defining difference: capture is deferred, not synthesized now. Like auto's "extract always runs" invariant, the snapshot ALWAYS runs — there is no skip path. The snapshot is the deferred-extraction handoff: a later /aria-cowork:extract, or the next /aria-cowork:audit-knowledge digest pass (which reads intake/pre-compact-captures/ automatically), synthesizes knowledge from it when context isn't a constraint. Capture /aria-cowork:snapshot's output (the snapshot path) for inclusion in Step 8. Use snap when context is high and running /aria-cowork:extract now would risk compaction mid-synthesis. (Cowork's /snapshot uses 3-path source acquisition — no shell access needed.)

Otherwise (default + auto modes): ALWAYS invoke /aria-cowork:extract programmatically. This applies to default mode (after the user has approved the combined-go review in Step 4) AND auto mode unconditionally. No judgment-skip allowed — even if the session feels short, conversational, or seems to have nothing new to extract, run /aria-cowork:extract anyway. The handoff skill must not pre-judge whether extraction is worthwhile; /extract has its own dedup logic (per its Rules section: "Never ask for confirmation — scan and dump") that correctly handles the "nothing to add" case by reporting No uncaptured knowledge found. Auto mode's "implicit-yes on all gates" rule converts to "extract always runs" here — there is no skip path. Capture /extract's summary report for inclusion in Step 8.

(Brief mode never reaches Step 6 — it exits at Step 2B before any handoff side-effects, per the Rules section.)

Step 7: Verify Handoff Readiness

Run the same checklist /wrapup Step 7 uses:

## Handoff Checklist

- PROGRESS.md — [updated / already current / not found / skipped]
- CLAUDE.md — [current / updated / not found / skipped]
- Memory — [updated / already current / not found / skipped]
- Git — [commit message emitted / no changes detected / skipped]
- /extract — [run / nothing new / deferred: snapshotted for later extraction (snap mode)]
- Next-session opener — [emitted below]

Tracked artifacts check — SKIPPED in cowork per ADR-005 + D5: aria-knowledge's /handoff Step 7 stats CODEMAP.md + STITCH.md against staleness thresholds and surfaces them in the checklist. Cowork excludes /codemap + /stitch skills (per ADR-005), so no tracked artifacts to check. The checklist row is omitted entirely (replaced above with the cowork-relevant Git commit-message + /extract rows).

Flag any gaps but don't block — the user may have skipped sections intentionally.

Step 8: Final Report

Emit the closing report. The next-session opener is the headline artifact — surface it prominently and inside a code fence so it copies cleanly.

## Handoff Complete — {default | auto | snap} mode

[Handoff Checklist from Step 7]

[/extract summary, 1-2 lines]

---

### Next-session opener — paste this to resume

{full opener from Step 3e}

Read on resume: {primary CLAUDE.md path} for current state.


The `Read on resume:` line MUST sit INSIDE the opener fence (the last line of the pasteable block), never after the closing ```` ``` ````. It is part of the artifact the user pastes into the next session — if it lands outside the fence it is silently dropped on paste.

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.