agentleFS
bakaschwarzbakaschwarz/agent-skills/skills/handoff/SKILL.md

handoff

Skill0 starsChanged 6 months agoMITView on GitHub

Create a structured handoff document at context/handoff.md at the end of a session so the next agent can onboard without prior context. Uses git to discover modified files, filters out ephemeral subagent work artifacts under context/, enforces a strict format, and validates the result with a lint script. The handoff is the single source of truth for the next session. Use whenever a session ends, a task is paused, or work is being passed to another agent.

191 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use decision-mapping, setup-ts-deep-modules 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.
  • FabienDehopreSkill

    decision-mapping

    Turn a loose idea into a sequenced map of investigation tickets, then drive them to resolution one at a time.

    Also in 8 projects that use this

  • liufeng1976Skill

    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 42 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 93 projects that use this

  • GoogleSkill

    ask-matt

    Ask which skill or flow fits your situation. A router over the skills in this repo.

    Also in 87 projects that use this

  • RoentekSkill

    loop-me

    Grill me about specs for the workflows I want to build, within this workspace.

    Also in 51 projects that use this

  • LesaniSkill

    writing-beats

    Shape an article as a journey of beats, choose-your-own-adventure style. The user picks a starting beat from the raw material, you write only that beat, then offer options for where to pivot next, beat by beat, until the article reaches a natural end. Use when the user has raw material and wants to assemble it as a narrative rather than an argument.

    Also in 54 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 172 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If a subagent produced a long artifact (e.g.

    line 21
  2. Distinctive:

    Do not use this skill for trivial one-off tasks where there is nothing meaningful to hand off.

    line 32
  3. Distinctive:

    Before writing the document, collect the following.

    line 36
  4. Very specific:

    Ephemeral subagent artifacts to distill: read every file under context/ (except context/handoff*.md), extract the durable content, and fold …

    line 46
  5. Very specific:

    Gitignored files: run git check-ignore -v <path> for each candidate.

    line 58
  6. Distinctive:

    If you are uncertain whether a file is real work or a work artifact, keep it visible to the user.

    line 62
  7. Very specific:

    Read TEMPLATE.md from this skill directory.

    line 66
  8. Very specific:

    Before filling sections, read all context/*.md files that aren't handoffs and absorb their content.

    line 67
  9. Distinctive:

    Keep the section order and heading text exactly as in the template.

    line 69
  10. Very specific:

    Write the result to <project-root>/context/handoff.md.

    line 70
  11. Distinctive:

    Do not commit the handoff.

    line 71
  12. Very specific:

    Do not delete the ephemeral context/* files yourself.

    line 72
  13. Distinctive:

    After writing the file, run the linter:

    line 76
  14. Distinctive:

    Write in English regardless of the conversation language.

    line 88
  15. Distinctive:

    Prefer lists over prose for files, commits, steps, and risks.

    line 90
  16. Distinctive:

    Never invent commits, files, or test results.

    line 92

“Common” is measured: kept by at least 6 in 10 of the 172 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

This skill produces a single, self-contained Markdown document that lets a fresh agent (or human) pick up the work without needing prior context, conversation history, or this skill itself loaded.

The output is always written to context/handoff.md relative to the project root.

The source-of-truth rule

context/handoff.md is the only durable artifact this skill produces. Everything else under context/ — context/plan.md, context/research.md, context/notes.md, inter-subagent coordination files, intermediate task lists — is ephemeral. It belongs to the current session, may be wiped between sessions, and must not be relied on by the next agent.

Consequences for how you write the handoff:

  • Do not link or reference ephemeral context/* files as if the next agent could open them. They may not exist.
  • Distill the useful parts of those files (key findings from research, surviving items from the plan, decisions taken, dead ends explored) directly into the relevant sections of the handoff.
  • The only files under context/ that may be referenced are other handoffs (context/handoff*.md), because those follow the same persistence contract.
  • If a subagent produced a long artifact (e.g. a survey of 12 libraries) and inlining all of it would bloat the handoff, summarize the conclusion and the rejected options with one-line reasons. Do not write "see context/research.md".

The linter warns on context/*.md references that aren't handoffs. Treat the warning as a smell, not a false positive.

When to use

  • A session is ending and work is not finished.
  • A task is being paused and may be resumed later by a different agent.
  • A long-running task is reaching a natural checkpoint and the context window is getting tight.
  • The user explicitly asks for a handoff.

Do not use this skill for trivial one-off tasks where there is nothing meaningful to hand off.

Inputs you must gather

Before writing the document, collect the following. Do not guess. If something is unknown, mark it explicitly in the document.

  1. Project root: git rev-parse --show-toplevel. Abort with an explanation if not inside a git repo.
  2. Current branch and HEAD: git rev-parse --abbrev-ref HEAD and git rev-parse --short HEAD.
  3. Commits created during the session: list new commits on the current branch that did not exist at the session start. If you do not have a reliable session start ref, ask the user for one or fall back to commits authored today by the current user (git log --since="$(date -I) 00:00" --author="$(git config user.email)" --pretty=format:'%h %s'). State explicitly which strategy you used.
  4. Modified files (full picture, including work done by sub-agents):
    • Staged + unstaged: git status --porcelain
    • Committed in session: git diff --name-status <session-start-ref>..HEAD
    • Untracked: included in git status --porcelain as ??
    • Merge the three lists, deduplicate by path, keep the most relevant status per file.
  5. Ephemeral subagent artifacts to distill: read every file under context/ (except context/handoff*.md), extract the durable content, and fold it into the appropriate handoff sections (Context & Background, Decisions & Rationale, Open Points, Problems & Caveats, References). Then ignore those files for the "Edited Files" listing.
  6. Task summary, status, open points, problems, next steps: derive from the session itself. Be precise. No filler.
  7. Skills the next agent should load: list by skill name, with one sentence per skill explaining why it is relevant.

Filtering work/helper files

Sub-agents and orchestration produce throwaway files (plans, scratchpads, inter-agent messages, research dumps). These must not appear under "Edited Files". Apply this filter in order:

  1. Hard ignore by path pattern (always treated as ephemeral, never listed):
    • Everything under context/ except context/handoff*.md — this is where pi-subagents drop their session-local state.
    • .work/, work/, scratch/, .scratch/, tmp/, .tmp/, .agent/, agent-comm/, .handoff-tmp/
    • Files matching *.scratch.md, *.tmp, *.work.md, *.agent.md
  2. Gitignored files: run git check-ignore -v <path> for each candidate. If ignored, treat as ephemeral unless it is a handoff file.
  3. Heuristic by filename at repo root or top-level docs: PLAN.md, TODO.md, NOTES.md, AGENT_NOTES.md, subagent-*.md, coordination.md. Treat as ephemeral unless they were already tracked in git before the session started (git log --oneline -- <path> returns commits older than session start).
  4. Ambiguous cases (real work that just looks like a helper): list them under "Possible work artifacts (please confirm)" inside "Edited Files" instead of silently dropping them. Never delete files. Never git add or git rm anything as part of the handoff.

If you are uncertain whether a file is real work or a work artifact, keep it visible to the user. Silent omission is worse than a noisy entry.

Producing the document

  1. Read TEMPLATE.md from this skill directory.
  2. Before filling sections, read all context/*.md files that aren't handoffs and absorb their content. Then act as if those files no longer exist.
  3. Fill in every section. If a section legitimately has no content, write _None._ (with the underscores) so the linter can distinguish "empty on purpose" from "forgotten".
  4. Keep the section order and heading text exactly as in the template. The linter is strict about this.
  5. Write the result to <project-root>/context/handoff.md. Create the context/ directory if it does not exist.
  6. Do not commit the handoff. Leave that decision to the user.
  7. Do not delete the ephemeral context/* files yourself. The harness/user manages their lifecycle.

Validation

After writing the file, run the linter:

bash <skill-dir>/lint.sh <project-root>/context/handoff.md

Exit code 0 means valid. Any non-zero exit means the document must be fixed before ending the session. Do not silently ignore lint errors. If a rule is wrong for the situation, explain it in the handoff and to the user; do not paper over it.

Warnings are not failures but should be addressed. In particular, a warning about context/*.md references almost always means you forgot to distill an ephemeral artifact.

Style rules for the handoff content

  • Write in English regardless of the conversation language.
  • Be specific. Replace vague phrases ("did some refactoring") with concrete ones ("extracted parseConfig from cli.ts into config/parse.ts, kept behavior identical, added 4 unit tests").
  • Prefer lists over prose for files, commits, steps, and risks.
  • Quote exact commands, file paths, env vars, and error messages verbatim in backticks.
  • Never invent commits, files, or test results. If you did not verify something, say so.
  • The document must make sense to an agent that has never heard of this skill. Do not reference "the handoff skill" inside the document.

Self-contained output

The handoff document is the contract. Anything the next agent needs to continue must be either in the document or reachable via a path/link the document provides — and that link must point to something that will still exist (committed code, tracked docs, external URLs, prior handoffs). Assume zero prior context and zero ephemeral state.

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.