AgentSkillsCN

session-handoff

当用户说“交接会话”“交接”“会话总结”或“结束会话”时触发。该功能会自动生成高效的会话交接文档,其中包含对话摘要、已做出的变更以及后续步骤。文档同时保存于用户级与项目级的交接目录中。

SKILL.md
--- frontmatter
name: session-handoff
description: Invoked when user says "handoff session", "handoff", "session summary", or "end session". Creates efficient session handoff documentation with conversation summary, changes made, and next steps. Saves to both user-level and project-level handoff directories.
allowed-tools: [Read, Write, Bash, Glob, Grep]

Session Handoff Skill

This skill creates comprehensive session handoff documentation when users wrap up a coding session.

When to Invoke

Activate this skill when the user says:

  • "handoff session"
  • "handoff"
  • "session summary"
  • "end session"
  • "wrap up session"

Task Requirements

  1. Determine session number: Check existing handoffs in .claude/handoffs/ to increment session number

  2. Generate filename: Format as session-{number}-{YYYY-MM-DD}-{commit-style-summary}.md

    • Example: session-1-2025-10-22-implement-user-authentication.md
  3. Create handoff content with these sections:

    • Session Summary: 2-3 sentence overview of what was accomplished
    • Changes Made: Bulleted list of files modified/created with brief description
    • Decisions & Context: Important architectural decisions or trade-offs
    • Next Steps: Recommended tasks for next session
    • Outstanding Issues: Any blockers, questions, or TODOs
  4. Save to BOTH locations:

    • Project level: .claude/handoffs/{filename}
    • User level: ~/.claude/handoffs/{filename}

Content Format

markdown
# Session {number} - {Date} - {Summary}

**Duration**: Approximate time spent
**Status**: Completed/Partial/Blocked

## Summary
{2-3 sentence overview}

## Changes Made
- `path/to/file.ext` - Brief description of changes
- `path/to/another.ext` - Brief description

## Key Decisions
- Decision made and rationale
- Architectural choices

## Next Steps
1. Immediate next task
2. Follow-up tasks
3. Future considerations

## Outstanding Issues
- Any blockers or questions
- TODOs that need attention

## Files Modified
{Quick git status summary if in git repo}

Implementation Steps

  1. Check if .claude/handoffs/ exists in current project, create if needed
  2. Count existing session files to determine next session number
  3. Scan conversation history for:
    • File operations (Read, Write, Edit operations)
    • Git operations (commits, branches)
    • Key decisions and discussions
  4. Generate commit-style summary (kebab-case, 3-5 words max)
  5. Create handoff document with all sections
  6. Write to both locations
  7. Provide user with:
    • Confirmation message
    • File paths where saved
    • Quick summary for user review

Best Practices

  • Keep summary concise and actionable
  • Focus on "why" decisions were made, not just "what"
  • Be honest about incomplete work or blockers
  • Format for easy scanning (use bullets and headers)
  • Include specific file paths with line numbers when relevant
  • Make next steps specific and prioritized