Handoff

From MarceloClaro/OpenCode_Ecosystem · View interactive version

Handoff is an AI agent skill from the GitHub repository MarceloClaro/OpenCode_Ecosystem. Fresh-session handoff doc drafting. Produces a stable, single-file human-readable narrative state for the NEXT agent context (fresh session, after `/clear`, after persist iteration, after a tab close). The artifact lives at `docs/handoffs/YYYY-MM-DD-<arc>.md` and follows a stable shape: TL;DR + Stat

How to use this skill

Skill file

handoff — Fresh-session handoff doc skill

**Compress a substantive arc into a single resumable doc the next agent

loads cold.**

Why this skill exists

Across the 7-day window 2026-05-18 → 2026-05-24, **nine fresh-session

handoff docs** were drafted by hand. Six landed in docs/handoffs/

(Houston substrate completion, BRO-1208 streaming hang, Houston

advanced-settings wave, Life-Houston H1 runner refactor, Stage 1

fresh-session, etc.) and three landed in docs/conversations/HANDOFF-*

(substrate completion arc, BRO-1180 four pillars, Spec J real-Anthropic

smoke). All shared the same shape — the recurrence met rule-of-three

(P16) ~3× over.

Before this skill, the writer rebuilt the structure each time: which

sections appear, what order, what level of detail per section, which

git SHAs to cite, how to phrase the "first action". The skill captures

the canonical shape so subsequent handoffs are produced consistently

in a single pass.

What this skill provides

  1. Template (references/handoff-template.md) — the canonical

section structure, with annotations explaining each section's

purpose and stop condition.

  1. Anti-patterns below — what NOT to include (the failure modes

that produce unusable handoffs).

  1. Composition rules — when to use this skill alone vs. compose

with persist (P12), bookkeeping, or make-spec.

When to invoke

same user in a fresh context) will resume.

the user wants to break before continuing in a fresh context (this

is the handoff half of P12 — PROMPT.md is the state-replay half).

Stage 2 pattern that appeared 4× in the Houston/Life-Houston work).

agent inherits the arc's lessons and remaining loose ends.

Carve-outs (do not invoke)

The canonical shape (mirrors `references/handoff-template.md`)

# <Arc name> — <Stage / Phase>

**TL;DR.** <One-sentence summary of where we are; ends with the FIRST ACTION.>

## State of the world (P15 snapshot YYYY-MM-DD)

- **<Repo 1>** — <branch>, ahead N / behind M vs origin/main. Last commits …
- **<Repo 2>** — <branch>, last merged PRs with SHAs.
- **<Running services / dev daemons>** — STILL RUNNING / DEAD; restart command if dead.

## What <arc> delivered (so the next agent doesn't redo it)

| PR | Crate(s) / files | What it gave |
|----|------------------|--------------|
| #N | … | … |

## E2E proof (re-runnable any time the prereqs hold)

<exact command>

Expected: <observable output>


## First action

<The single next step the fresh agent should take, with the exact command
or file path. NO ambiguity. NO "consider X or Y" — pick one.>

## Pickup state (what's open)

- [ ] <open thread 1>
- [ ] <open thread 2>

## Related context

- Lessons doc: `docs/<...>.md`
- Linear: BRO-NNNN
- Prior handoff: `docs/handoffs/<earlier>.md`

The five anti-patterns this skill exists to prevent

| Anti-pattern | Failure mode | Fix |

|---|---|---|

| Missing P15 snapshot | Fresh agent reasons against stale state (last-seen instead of current); duplicates work or conflicts with unmerged work. | Always include git status + branch + ahead/behind + open PRs + daemon state. |

| No "first action" / vague "first action" | Fresh agent spends 10+ minutes triangulating where to start. | Pick ONE concrete next step with the exact command/file path. If ambiguous, pick anyway and document the alternative as "if blocked, try X". |

| PR table without SHAs | Fresh agent can't reproduce the substrate state; doesn't know whether a PR landed or just opened. | Always cite the merge SHA next to each delivered PR. |

| Lessons buried in prose | Lessons silently lost because no skim-reader will find them in paragraph 8. | Pull lessons into a labeled section OR link to a separate <arc>-lessons.md. |

| Aspirational scope | "Next we should also do A, B, C, D, E …" with no priority. Fresh agent thrashes. | List ONLY the next 1–3 actions. Defer A, B, C, D, E to Linear backlog or a separate planning doc. |

File placement

Filename slug should name the arc, not the date. The date is the

mtime, the slug is the identifier.

Composition rules

| Compose with | When |

|---|---|

| persist (P12) | When the handoff is the prelude to a fresh-context loop. The handoff is the human-readable narrative; PROMPT.md is the machine-readable state. Both exist; they're different artifacts. |

| bookkeeping | When the handoff cites lessons that should also live as entity pages (research/entities/pattern/<lesson>.md). File the lesson via bookkeeping file AFTER the handoff is written; reference the entity in the handoff's "Related context" section. |

| make-spec | When the handoff is dense enough that a separate HTML companion (spec / plan) is warranted. The handoff stays markdown; the companion is HTML. P18 audience rule: handoff is agent-loaded → markdown. |

| /p9 watch | If the handoff is being written mid-CI (after a push, before merge), include the watch command + PR number so the next agent doesn't restart the wait. |

Validation (handoff self-test)

A well-formed handoff passes all five checks:

References

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.