AGENT SKILL

context-handoff

Summarize critical context (decisions, forks, pitfalls) into a handoff file for the next agent. Use before a context reset (invoked by context-reset), when explicitly asked to save current context, or before delegating work to a sub-agent that needs background.

License 许可
MIT
所属仓库
muratovv/ai-hats
最近更新
2026-11-05
Stars
★ 3
Forks
1

01 前言 Front Matter

name
context-handoff
license
MIT
description
Summarize critical context (decisions, forks, pitfalls) into a handoff file for the next agent. Use before a context reset (invoked by context-reset), when explicitly asked to save current context, or before delegating work to a sub-agent that needs background.

03 SKILL.md 正文

Context Handoff

Summarize critical context and write a handoff file for the next agent or session.

When to Use

Don't reach for this standalone during a full context reset — context-reset calls it as its handoff-writing step. Invoke directly only when you need a handoff without a reset: briefing a sub-agent you're about to delegate to, or an explicit "save where we are" with no intent to clear context. For the backward-looking "what was done" record of a finished task (not a forward brief), use task-summary instead.

Procedure

  1. Identify the handoff path:

    • Session-scoped: <ai_hats_dir>/sessions/handoffs/YYYY-MM-DD-<title>.md
    • Task-scoped: write it OUTSIDE the tracker (/tmp/<ID>-handoff.md), then bring it in with rack transition <ID> --attach /tmp/<ID>-handoff.md:handoff.md. A direct write under tracker/backlog/tasks/<ID>/ is denied by backlog_write_gate.py — plan.md is the one carve-out.
  2. Collect only what matters. Ignore routine actions. Focus on:

    • Architectural decisions — what was chosen and WHY (not just what)
    • Decision forks — alternatives considered, why rejected
    • Pitfalls & gotchas — traps the next agent will hit without warning
    • Current state — what is done, what is in progress, what is blocked
    • Open questions — unresolved ambiguities that need supervisor input
  3. Write the handoff file using the format below.

  4. Verify the file is written and readable.

Format

# Handoff: <task or session title>

Date: YYYY-MM-DD
Previous agent context: <brief identifier>

## Current State

<What is done. What is in progress. What is blocked.>

## Key Decisions

| Decision | Alternatives Considered | Why This Way |
| -------- | ----------------------- | ------------ |
| ...      | ...                     | ...          |

## Pitfalls

- <Trap 1> — <why it's dangerous>
- <Trap 2> — <why it's dangerous>

## Open Questions

- <Question that needs supervisor or further research>

## Next Steps

1. <Concrete next action>
2. ...

What NOT to Include

  • Play-by-play of every command run
  • Routine git operations or file reads
  • Information derivable from code or git history
  • Full error logs (reference the file path instead)

Completion

  • Handoff file written to the correct path
  • File contains at least: Current State, Key Decisions, Next Steps
  • No routine noise — only decision-critical context

Anti-Patterns

  • Dumping full conversation history — the point is compression, not transcription
  • Omitting the WHY behind decisions — facts without reasoning are useless for handoff
  • Including information the next agent can get from git log or reading code

04 同仓库更多 Skills

muratovv
muratovv/ai-hats

tool-evaluation-protocol

Time-bounded protocol for evaluating new tools, libraries, or methodologies before adoption. Use when evaluating a candidate dependency for the project, researching a methodology (e.g. ML/LLM frameworks, testing approaches), or following up on a hype-driven recommendation.

★ 3
muratovv
muratovv/ai-hats

systematic-debugging

4-phase bug-fix protocol (evidence, pattern, hypothesis, verify). Use when investigating any error, failure, or unexpected behavior, handling bug reports from users or monitoring, or diagnosing test failures with non-obvious causes.

★ 3
muratovv
muratovv/ai-hats

skill-template

Canonical template and validation guide for ai-hats skills. Use when creating a new skill, reviewing an existing one for structural compliance, or deciding which pattern fits a new behavior.

Skill与智能体开发
★ 3
muratovv
muratovv/ai-hats

skill-optimization

Audit and refactor library components to eliminate redundancy and staleness. Use during periodic library maintenance, after adding multiple new skills or rules, when a role's token budget is too high, or after retrospectives identify component issues.

Skill与智能体开发
★ 3
muratovv
muratovv/ai-hats

silent-fallback-gate

PreToolUse hook — refuses an Edit or Write that adds an inert broad except. Use when a Python edit was blocked for a silent fallback.

★ 3
muratovv
muratovv/ai-hats

retro-to-framework

Convert an observation about agent behavior — from a retrospective or from a single incident — into a framework-level change (hook, rule, skill, skill update). Use after a retrospective identifies problems that are not project-specific, after an incident where an agent misapplied a component it had read, when CLAUDE.md band-aids accumulate (more than 3 per-project rules that could be generic), or when the same problem recurs across multiple projects.

Skill与智能体开发
★ 3