会话交接
- 作者仓库星标 31
- 作者仓库 dotfiles
- 领域
- 工程开发
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @hta218 · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
第 1 步:收集背景信息
并行运行这些命令以了解当前状态: `git status` — 查看所有跟踪/未跟踪文件和暂存状态 `git diff` — 查看未暂存的更改 `git log --oneline -10` — 最近提交以了解工作轨迹 `git branch --show-current` — 当前分支名称
第2步:确认保存位置
列出 `.specs/` 中的所有文件夹 将当前分支名称、修改的文件或最近提交消息与规范文件夹名称相匹配 使用 `AskUserQuestion` 与用户确认保存位置:如果找到可能的匹配项,建议将其作为推荐选项 始终包含其他规范文件夹作为替代方案
第三步:分析工作状态
已完成的工作 — 分析最近的 git 提交、审查已完成的待办事项、识别所做更改的模式 正在进行的工作 — 活动的待办事项、未提交的更改、当前正在修改的文件 剩余工作 — 待处理的待办事项、阻碍因素、依赖项、优先级 上下文 — 分支策略、重要决策、已知问题、带有行号的相关文件路径
第四步:编写交接文件
在确认的位置将文件另存为`handoff--{YYYY-MM-DD-HH-mm}--{brief-work-summary}.md`。使用 `date +"%Y-%m-%d-%H-%M"` 获取正确的本地时间戳 `{brief-work-summary}` 是对作品的简短描述(例如,`add-cart-api`、`fix-auth-redirect`、`refactor-review-section`) 使用以下结构:
第五步:报告
保存后,显示: 保存切换的完整文件路径 当前状态的简要摘要
Generate a comprehensive handoff document capturing the current state of work for seamless continuation by another agent or developer.
## Workflow
### Step 1: Gather Context
Run these commands in parallel to understand the current state:
- `git status` — see all tracked/untracked files and staging state
- `git diff` — see unstaged changes
- `git log --oneline -10` — recent commits to understand work trajectory
- `git branch --show-current` — current branch name
- `git remote get-url origin` — repository name (if available)
Also check for active todos in the todo system.
### Step 2: Confirm Save Location
1. List all folders in `.specs/`
2. Match the current branch name, modified files, or recent commit messages to spec folder names
3. Use `AskUserQuestion` to confirm the save location with the user:
- If a likely match is found, suggest it as the recommended option
- Always include other spec folders as alternatives
- Always allow the user to specify a custom path
4. Only proceed after the user confirms the location
### Step 3: Analyze Work State
1. **Work Completed** — analyze recent git commits, review completed todos, identify patterns in changes made
2. **Work In Progress** — active todo items, uncommitted changes, files currently being modified
3. **Work Remaining** — pending todo items, blockers, dependencies, priorities
4. **Context** — branch strategy, important decisions, known issues, relevant file paths with line numbers
### Step 4: Write the Handoff Document
Save the file as `handoff--{YYYY-MM-DD-HH-mm}--{brief-work-summary}.md` in the confirmed location.
- Use `date +"%Y-%m-%d-%H-%M"` to get the correct local timestamp
- `{brief-work-summary}` is a short kebab-case description of the work (e.g., `add-cart-api`, `fix-auth-redirect`, `refactor-review-section`)
Use this structure:
```markdown
# Handoff Context - {Date Time}
## Project
- Repository: {repo name if available}
- Branch: {current branch}
- Spec: {spec folder path if found}
- Last Updated: {timestamp}
## Current Status
### What's Been Done
{List completed work, recent commits, changes made}
### What's In Progress
{Current todo items, ongoing work}
### What's Next
{Pending tasks, blockers, priorities}
## Technical Context
### Modified Files
{List files changed with brief description}
### Key Decisions
{Important architectural or implementation decisions}
### Known Issues
{Bugs, blockers, or things to watch out for}
## Dependencies & Prerequisites
{External dependencies, required setup, environment notes}
## Additional Notes
{Any other relevant context for continuation}
```
### Step 5: Report
After saving, display:
- The full file path where the handoff was saved
- A brief summary of the current state
## User Arguments
$ARGUMENTS
## Important Notes
- Be concise but comprehensive — focus on actionable information
- Include specific file paths with line numbers where relevant
- Do NOT commit the handoff file automatically
- If the user provided notes via arguments, include them in the "Additional Notes" section
章节与文件索引
按说明文件中的顺序排列。
第 1 步:收集背景信息
第2步:确认保存位置
第三步:分析工作状态
第四步:编写交接文件
第五步:报告
文件/命令 -> git status · git diff · git log --oneline -10 · git branch --show-current · git remote get-url origin · .specs/ · AskUserQuestion · handoff--{YYYY-MM-DD-HH-mm}--{brief-work-summary}.md
内容校验值 -> 4f1a55bef1ca
设计思路
handoff是 mattpocock 的「session 交接」skill——给当前对话写一份新 agent 能直接续接的交接文档。设计极简但有几条硬纪律:用mktemp -t handoff-XXXXXX.md拿到唯一路径,写之前先 read(避免覆盖既有内容),不和 PRD / plan / ADR / issue / commit / diff 等已有载体重复——后者用路径或 URL 引用即可。工作流(按作者原文凝练)
mktemp -t handoff-XXXXXX.md生成临时路径writing-plans,因为 design 已经定了」)适合谁
不适合
context-save文件——本 skill 是更轻量的姊妹,重复配套
context-save(gstack 等价的更结构化版本)、landing-report(事件级总结报告)、pair-agent(同时协作的另一个 agent)。