skills/development-workflows/handoff/SKILL.md
Use when the user wants to compact context before auto-compaction kicks in, hand off an unfinished task to a fresh session, switch topics mid-stream and preserve state, or pick up yesterday's work in a new conversation. Produces a single handoff.md that captures completed work, blocked items with what was already tried, next concrete steps, and the minimum context needed to resume cold. Use proactively when context usage is high, a long-running task hits a natural break, or the user signals a session switch. Triggers include 上下文压缩, 交接文档, handoff, 续接会话, 主题切换, 接力, 明早接着干, context handoff, compact before, fresh session, continue tomorrow. Do NOT use for single-file fixes that finish in one commit (put it in the commit body), Q&A or pure investigation sessions, or end-of-session retrospectives meant for human review (those are different artifacts).
npx skillsauth add bahayonghang/my-claude-code-settings handoffInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
让一份 handoff.md 成为"下一会话 AI 接力的入口文档"。在上下文被动压缩之前主动产出,让新会话不依赖回忆、只读这一份文件就能继续工作。
Claude Code 的自动压缩按字符预算丢弃内容,不知道哪些是判断逻辑、哪些是失败方案、哪些是接下来要做的第一步。被动压缩之后再接力,成本极高:新会话只能从代码和 git log 倒推意图,而失败过的路径、被否决的方案、当前 mental model — 这些代码里都没有。
handoff 是手动压缩。在你最理解当前状态的时刻,把"下一会话拿到这份文档就能立刻干活"所需的最小信息固化下来。它不是会话日记,不是给人复盘看的;目标读者是另一个 LLM 会话(包括明早的你 + 明早的 Claude)。
任何一个信号出现就该写:
写了之后发现工作太小,把文件删了。空的 handoff 比没有更糟。
默认 handoff.md 放仓库根目录。
并行多个未完成任务时改放 .handoff/<slug>.md,每任务一份,避免互相覆盖。
是否入 git:默认 gitignored(加到 .gitignore)。理由:handoff 频繁变化、是会话级状态,不该污染提交历史。任务跨多人、需要 review 时手工豁免,让 handoff 跟 PR 一起走。
每节回答的问题不同,不要混淆。每条目一到三句话,引用路径、行号、commit SHA。
确实跑通、有验证证据的事。不要把"打算做"或"做了一半"写进来。
POST /auth/register 通过 6 个测试。bcrypt rounds 设为 12,见 api/auth.ts:34。"正在做、还没收敛的事。必须包含:卡在哪、已经试过什么、为什么不行。这是 handoff 区别于"列 TODO"的关键。
jsonwebtoken 的 verify + 重签名,会有 race condition(两个并发请求拿到同一旧 token 都通过校验)。下一步考虑用 Redis 单 key 锁,见 auth/refresh.ts:88 的 TODO。"新会话第一动作。按优先级排,每条具体到"打开哪个文件做什么"。
auth/refresh.ts 加 Redis 锁。2) 写 race condition 测试覆盖并发。3) 跑 pnpm test auth 确认绿。"新会话不知道、从代码也看不出来的事。包括环境状态、关键决策的 why、被显式否决的方案、外部依赖的怪癖。
.env 的 JWT_SECRET(不要从 process.env.SECRET 拿,那是另一个东西)。Passport.js 试过但配置太复杂,统一用 jsonwebtoken + 自写中间件。"auth.ts 加了 validateToken" — diff 已经写了。handoff 写"为什么是 validateToken 而不是 checkToken",或"为什么先校验过期再校验签名"。| 反模式 | 反制 |
|---|---|
| 时间线流水账("先做 A 然后做 B 然后做 C") | 改成结构化的"已完成 / 卡住 / 下一步",时间不重要 |
| 复制 git log 当 handoff 正文 | git log 自己就在仓库里,handoff 写 git log 没写的"why" |
| 把背景写成长文(项目历史、技术栈介绍) | 只写下次接力者不读不行的事,假设对方会读 README |
| 把决策塞到正文段落,不分节 | 决策、上下文、下一步分开放,新会话好定位 |
| 维护多个 handoff 文件互相 cross-ref | 一个任务一份 handoff,超过就拆 .handoff/<slug>.md |
session 中 handoff 增加 0 条是正常的 — 没做出真决策、没碰到卡点的会话不需要写。强行填充比留空更糟。
新会话第一动作(无论 user 是不是开口要求):
handoff.md 和 .handoff/ 目录如果 handoff 看起来过时(git log 比 handoff 新很多),先 git log -10 对一下,把不一致处问用户而不是猜。
implementation-notes:实施一份 spec 时记录决策、偏离、未决问题。handoff 处理跨会话状态,implementation-notes 处理单 spec 的判断细节。两者并存 — handoff 的 "Context" 节可引用 implementation-notes 的具体条目。git-commit:已完成且已提交的事,commit body 写"why",handoff 只留一句指针。变更记录别在两处重复。# Handoff — <task slug>
**Last updated**: <YYYY-MM-DD HH:MM>
**Branch**: <branch>
**Spec / Plan**: <link or path>
## Completed
- (nothing yet)
## Blocked
- (nothing yet)
## Next steps
1. (first concrete action)
## Context
- (anything the new session can't get from code or git)
四节标题即使为空也保留 — 空标题是给自己的提问。
新会话开始接力前,handoff 必须满足:
tools
文献深度解读助手,像研究生导师一样交互式解读 Zotero 库中的学术论文,面向计算机科学、深度学习、自动化等方向(个人向)。当用户提供文献题目、DOI、PDF 或要求解读某篇论文时触发,通过 Zotero MCP 优先获取全文,并根据用户意图自动选择快速筛选、导师深读或研究复盘模式。完整深读时先完成叙事类型判断、阅读前预检、novelty 校准和作者思考路径重建,再整体概览,并基于图例、正文和表格逐图详细解读(Zotero MCP 无法提取 PDF 图片,解读基于文字信息,必要时提醒上传图片)。适用于:(1)快速判断文献是否值得深读 (2)深入理解某篇论文 (3)学习文章中的方法和技术 (4)批判性分析研究设计 (5)寻找研究灵感。需要多篇论文综合、对比或找研究空白,或 arXiv/DOI 批量规范化时,改用 paper-workbench。
development
Review Codex, Claude, OpenAI, or other agent skill directories as reusable capability packages. Use when asked to audit, review, improve, score, rewrite, debrand, package, or document a SKILL.md, skill package, marketplace skill, or agent skill directory, especially when the user wants a comprehensive findings-first report with concrete patch recommendations and validation steps.
development
Turn vague or complex Codex tasks into strong `/goal` commands with outcome, verification, constraints, boundaries, iteration policy, completion evidence, and pause/block conditions. Use when the user asks for Codex goal instructions, Goal 指令, 目标指令, `/goal` prompts, 中文 Goal 模板, plan-to-goal interviews, success criteria, verification commands, or bounded agent work definitions.
tools
Write, debug, and validate ast-grep structural code search rules. Use this skill when the user needs syntax-aware code search, AST pattern matching, structural refactor discovery, language-construct queries, or searches that plain text tools like rg can miss, such as finding functions with particular descendants, calls inside specific contexts, missing error handling, React hook shapes, decorators, or other Tree-sitter-backed code structures.