agentleFS
jcottamjcottam/agent-resources/skills/productivity/handoff/SKILL.md

handoff

Skill29 starsChanged 6 months agoMITView on GitHub

Compact a chat session or task into a curated markdown handoff file under ~/.agents/handoffs/ for continuation in a new agent turn or chat. References existing plans and PRDs by path instead of duplicating them; optional next-session focus via arguments. Use when the user says handoff, compact context, resume handoff, continue session, carry over context, checkpoint, or start fresh with prior work. Not the content-wireframe implementer handoff.

  • Reads credentials

195 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use which-skill, wait-what and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • risadamsSkill

    which-skill

    Router over this pack's skills and flows. Ask it "which skill fits X" when you don't remember what's available.

    Also in 5 projects that use this

  • AWSSkill

    wait-what

    Stop. That last message did not land: re-pitch it.

    Also in 51 projects that use this

  • AWSSkill

    to-questionnaire

    Turn a decision you can't fully answer into a questionnaire for someone else to fill in.

    Also in 41 projects that use this

  • loulanyueSkill

    setup-ts-deep-modules

    Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.

    Also in 15 projects that use this

  • RoentekSkill

    writing-beats

    Writing, exploit — assemble raw material into a journey of beats, grounding each term before a beat leans on it.

    Also in 20 projects that use this

  • RoentekSkill

    writing-fragments

    Writing, explore — mine raw fragments, no structure yet.

    Also in 20 projects that use this

  • +5 more from aws
  • +1 more from Roentek

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. 0 are common, 7 are distinctive, and 9 are very specific to this project.

  • 0

    Common

    Most of the 167 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If ambiguous, ask once which mode they want.

    line 37
  2. Very specific:

    Run $SCRIPTS/workspace-id.sh and parse JSON (workspace_path, workspace_id, git_head)

    line 60
  3. Distinctive:

    If git repo: git status -sb, git diff --stat (and branch name)

    line 62
  4. Distinctive:

    Timestamps and filename: Do not invent times. Run bash before writing:

    line 75
  5. Very specific:

    If partial-reconstruction, add this block immediately after the # Handoff: heading (before TL;DR):

    line 92
  6. Distinctive:

    Never present reconstructed content as verified fact — move uncertain items to

    line 101
  7. Distinctive:

    Deduplication: Do not duplicate content already captured in workspace artifacts (PRDs, specs, plans, ADRs, issues, commit messages, or …

    line 104
  8. Distinctive:

    Never paste plan bodies, issue threads, or diff hunks into the handoff.

    line 107
  9. Very specific:

    Paths: Use the real timestamp from date in the filename:

    line 109
  10. Very specific:

    Create $HANDOFFS_ROOT/<workspace_id>/ if missing.

    line 118
  11. Very specific:

    Redaction (before write): Remove API keys, tokens, .env values, passwords, and personally identifiable information.

    line 124
  12. Very specific:

    If the user @ a specific .md file, read that file

    line 242
  13. Very specific:

    If latest.md is missing, list $HANDOFFS_ROOT/<workspace_id>/ and ask which file to use

    line 245
  14. Very specific:

    If git_head is set and the repo has git: compare to current git rev-parse HEAD.

    line 253
  15. Very specific:

    If frontmatter fidelity is partial-reconstruction, treat Verified facts skeptically and re-verify before acting on them

    line 256
  16. Distinctive:

    If Suggested skills lists skills, read and follow those skill files when their scope matches the current task — do not invoke them blindly …

    line 267

“Common” is measured: kept by at least 6 in 10 of the 167 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Handoff

Editorially compress session context into a small markdown checkpoint an agent can load in a new turn. Raw transcripts live under Cursor project folders; handoffs are curated, short, and decision-dense.

SCRIPTS refers to the scripts/ directory next to this file. HANDOFFS_ROOT is ~/.agents/handoffs/.

This skill is not the content-wireframe "Handoff" (approved copy → implementer). It is session/task continuity across chats or agents.

Choose mode

User intentMode
handoff, compact, checkpoint, save context, done for todayCreate
resume handoff, continue from handoff, load handoff, @ handoff fileResume

If ambiguous, ask once which mode they want.


Create

Phase 0 — Eligibility

Skip creating a handoff (tell the user why) if all are true:

  • The task is fully done with nothing left to continue
  • There are no decisions, partial state, or open questions worth preserving
  • A PR/commit message or one sentence is enough (ship may be better)

Phase 1 — Gather inputs

Collect signal in this order. Do not paste tool dumps or transcript chunks into the handoff file.

  1. User goal and latest instructions
  2. Next session focus — if the user passed slash/command arguments or stated what the next chat is for, treat that as the primary lens for Next steps and Suggested skills
  3. Run $SCRIPTS/workspace-id.sh and parse JSON (workspace_path, workspace_id, git_head)
  4. If git repo: git status -sb, git diff --stat (and branch name)
  5. Files the user @ mentioned or the agent edited this session
  6. Explicit decisions and reversals from the conversation
  7. Open questions, blockers, and failed approaches (do not redo)
  8. Existing artifacts — scan for PRDs, specs, plans, ADRs, issues, open PRs, and large on-disk docs. Note paths only; do not copy their contents into the handoff (see deduplication below)
  9. Session activity — condensed outcomes from tool use this session (files written, commands run and key results, PRs opened, tests pass/fail counts). Outcomes only; no raw stdout or play-by-play

Phase 2 — Write

Timestamps and filename: Do not invent times. Run bash before writing:

date +%Y-%m-%dT%H:%M:%S%z    # created_at in frontmatter
date +%Y-%m-%d                  # date in frontmatter
date +%H:%M                     # time in frontmatter

Slug: from user input, next session focus, or 3–5 words from the goal (kebab-case). Sanitize for filenames — omit : / \ # ^ [ ] | and spaces.

Fidelity: Set frontmatter fidelity:

  • full — handoff built from complete session context in the current turn
  • partial-reconstruction — earliest chat context was compacted or missing; some sections are reconstructed from inference, not verbatim memory

If partial-reconstruction, add this block immediately after the # Handoff: heading (before TL;DR):

> **Context warning:** Portions of this handoff were reconstructed from
> compacted or missing session context. Treat **Assumptions** and uncited claims
> as unverified until confirmed in the repo or artifacts.

Never present reconstructed content as verified fact — move uncertain items to Assumptions.

Deduplication: Do not duplicate content already captured in workspace artifacts (PRDs, specs, plans, ADRs, issues, commit messages, or large diffs). Reference by path or URL; at most one line summarizing why that artifact matters. Never paste plan bodies, issue threads, or diff hunks into the handoff.

Paths: Use the real timestamp from date in the filename:

$HANDOFFS_ROOT/<workspace_id>/<YYYY-MM-DD>T<HHMMSS>-<slug>.md
$HANDOFFS_ROOT/<workspace_id>/latest.md   # copy of the same content

Example: 2026-06-02T143022-ship-handoff.md

Create $HANDOFFS_ROOT/<workspace_id>/ if missing.

Budget: ≤120 lines (~2,500 words). Cut exploration narrative first, then session activity detail, then artifact detail. Never cut TL;DR, Next steps, or Do not redo.

Redaction (before write): Remove API keys, tokens, .env values, passwords, and personally identifiable information. Use [REDACTED]. When unsure, omit the line.

Use this template:

---
handoff_version: 2
title: Short Title
date: 2026-06-02
time: "14:30"
created_at: 2026-06-02T14:30:22-0400
workspace_path: /absolute/path/to/project
workspace_id: agent-resources-a3f9c2e1b4d0
git_head: abc123def456789...
fidelity: full
source: cursor-chat
tags: [handoff, topic-one, topic-two]
supersedes: null
---

# Handoff: [short title]

## TL;DR

[3–4 sentences max: what this session was about, what was decided or produced,
and open loops. Write so a future search reveals whether this is the right
handoff. Do not duplicate **Next steps** verbatim.]

## Goal

[One sentence]

## Next session focus

[What the next chat is for — from user args or conversation. Omit this section
if not provided.]

## Current state

- Branch: ...
- Status: [what is done / in progress]
- Key changes: [files or areas touched]

## Session activity (condensed)

[Outcomes-only digest of meaningful tool/session work — not a transcript.
Bullet list: files created/edited, commands and key results, PRs/issues touched,
tests run and pass/fail counts. Omit raw stdout. Omit section if nothing
concrete happened beyond conversation.]

## Decisions

| Decision | Rationale |
|----------|-----------|
| ... | ... |

## Verified facts

- [Things confirmed in repo, docs, or commands]

## Assumptions

- [Guesses not yet verified — label clearly]

## Constraints

- [User rules, repo conventions, explicit "do not"]

## Do not redo

- [Approach X failed because Y — do not retry unless user asks]

## Open questions

- [ ] ...

## Next steps

1. ...
2. ...

## Suggested skills

[List 0–3 installed skills the next agent should consider invoking, each with
one line why. Only skills that match **Next session focus** or **Next steps**.
Use skill `name` from frontmatter (e.g. `ship`, `review-pr`). Omit section if
none apply.]

## Artifacts

- `path/to/file` — why it matters (reference only; no duplicated content)
- PR/issue URL if any
- **Quantifiable facts** not stored in linked files: version numbers, error
  codes, test counts, env var names, config keys, metric values

Set supersedes to the prior handoff path when continuing a multi-session task. Set tags to 2–5 lowercase hyphenated topics for search (always include handoff). Set title to match the # Handoff: heading.

Phase 3 — Verify and report

  1. Count lines; trim if over budget
  2. Copy the file to latest.md in the same workspace_id folder
  3. Tell the user:
    • Absolute path to the timestamped file
    • That latest.md was updated
    • To attach with @ or say resume handoff in the next chat
  4. Note: handoffs are not auto-deleted; prune old files manually if needed

Resume

Phase 1 — Load

  1. If the user @ a specific .md file, read that file
  2. Else run $SCRIPTS/workspace-id.sh, then read: $HANDOFFS_ROOT/<workspace_id>/latest.md
  3. If latest.md is missing, list $HANDOFFS_ROOT/<workspace_id>/ and ask which file to use

Phase 2 — Validate

  1. Compare workspace_path in frontmatter to $SCRIPTS/workspace-id.sh output. If they differ, warn and ask whether to trust the handoff or re-audit the repo
  2. If git_head is set and the repo has git: compare to current git rev-parse HEAD. If they differ, say the repo moved on and ask whether to trust handoff state or re-gather git status
  3. If frontmatter fidelity is partial-reconstruction, treat Verified facts skeptically and re-verify before acting on them
  4. This handoff does not replace AGENTS.md, .cursor/rules/, or user rules — read those before implementing code if relevant

Phase 3 — Continue

In one short message: restate TL;DR or Goal (and Next session focus if present) and Next step 1, then execute. Do not parrot the entire file. Work from Next steps in order; respect Do not redo and Constraints.

If Suggested skills lists skills, read and follow those skill files when their scope matches the current task — do not invoke them blindly if the work has diverged.


Utility script

workspace-id.sh — stable paths for handoff storage:

$SCRIPTS/workspace-id.sh
$SCRIPTS/workspace-id.sh /path/to/workspace

Example output:

{
  "workspace_path": "/Users/me/apps/agent-resources",
  "workspace_id": "agent-resources-a3f9c2e1b4d0",
  "git_head": "abc123..."
}

git_head is null when not inside a git repository.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.