session-wrap

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Session Wrap Skill

Session Wrap Skill

Comprehensive session wrap-up workflow with multi-agent analysis.
这是一套包含多Agent分析的全面会话收尾工作流。

Execution Flow

执行流程

┌─────────────────────────────────────────────────────┐
│  1. Check Git Status                                │
├─────────────────────────────────────────────────────┤
│  2. Phase 1: 4 Analysis Agents (Parallel)           │
│     ┌─────────────────┬─────────────────┐           │
│     │  doc-updater    │  automation-    │           │
│     │  (docs update)  │  scout          │           │
│     ├─────────────────┼─────────────────┤           │
│     │  learning-      │  followup-      │           │
│     │  extractor      │  suggester      │           │
│     └─────────────────┴─────────────────┘           │
├─────────────────────────────────────────────────────┤
│  3. Phase 2: Validation Agent (Sequential)          │
│     ┌───────────────────────────────────┐           │
│     │       duplicate-checker           │           │
│     │  (Validate Phase 1 proposals)     │           │
│     └───────────────────────────────────┘           │
├─────────────────────────────────────────────────────┤
│  4. Integrate Results & AskUserQuestion             │
├─────────────────────────────────────────────────────┤
│  5. Execute Selected Actions                        │
└─────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────┐
│  1. Check Git Status                                │
├─────────────────────────────────────────────────────┤
│  2. Phase 1: 4 Analysis Agents (Parallel)           │
│     ┌─────────────────┬─────────────────┐           │
│     │  doc-updater    │  automation-    │           │
│     │  (docs update)  │  scout          │           │
│     ├─────────────────┼─────────────────┤           │
│     │  learning-      │  followup-      │           │
│     │  extractor      │  suggester      │           │
│     └─────────────────┴─────────────────┘           │
├─────────────────────────────────────────────────────┤
│  3. Phase 2: Validation Agent (Sequential)          │
│     ┌───────────────────────────────────┐           │
│     │       duplicate-checker           │           │
│     │  (Validate Phase 1 proposals)     │           │
│     └───────────────────────────────────┘           │
├─────────────────────────────────────────────────────┤
│  4. Integrate Results & AskUserQuestion             │
├─────────────────────────────────────────────────────┤
│  5. Execute Selected Actions                        │
└─────────────────────────────────────────────────────┘

Step 1: Check Git Status

步骤1:检查Git状态

bash
git status --short
git diff --stat HEAD~3 2>/dev/null || git diff --stat
bash
git status --short
git diff --stat HEAD~3 2>/dev/null || git diff --stat

Step 2: Phase 1 - Analysis Agents (Parallel)

步骤2:第一阶段 - 分析Agent(并行执行)

Execute 4 agents in parallel (single message with 4 Task calls).
并行执行4个Agent(通过单条消息发起4个Task调用)。

Session Summary (Provide to all agents)

会话摘要(提供给所有Agent)

Session Summary:
- Work: [Main tasks performed in session]
- Files: [Created/modified files]
- Decisions: [Key decisions made]
Session Summary:
- Work: [Main tasks performed in session]
- Files: [Created/modified files]
- Decisions: [Key decisions made]

Parallel Execution

并行执行

Task(
    subagent_type="doc-updater",
    description="Document update analysis",
    prompt="[Session Summary]\n\nAnalyze if CLAUDE.md, context.md need updates."
)

Task(
    subagent_type="automation-scout",
    description="Automation pattern analysis",
    prompt="[Session Summary]\n\nAnalyze repetitive patterns or automation opportunities."
)

Task(
    subagent_type="learning-extractor",
    description="Learning points extraction",
    prompt="[Session Summary]\n\nExtract learnings, mistakes, and new discoveries."
)

Task(
    subagent_type="followup-suggester",
    description="Follow-up task suggestions",
    prompt="[Session Summary]\n\nSuggest incomplete tasks and next session priorities."
)
Task(
    subagent_type="doc-updater",
    description="Document update analysis",
    prompt="[Session Summary]\n\nAnalyze if CLAUDE.md, context.md need updates."
)

Task(
    subagent_type="automation-scout",
    description="Automation pattern analysis",
    prompt="[Session Summary]\n\nAnalyze repetitive patterns or automation opportunities."
)

Task(
    subagent_type="learning-extractor",
    description="Learning points extraction",
    prompt="[Session Summary]\n\nExtract learnings, mistakes, and new discoveries."
)

Task(
    subagent_type="followup-suggester",
    description="Follow-up task suggestions",
    prompt="[Session Summary]\n\nSuggest incomplete tasks and next session priorities."
)

Agent Roles

Agent角色

AgentRoleOutput
doc-updaterAnalyze CLAUDE.md/context.md updatesSpecific content to add
automation-scoutDetect automation patternsskill/command/agent suggestions
learning-extractorExtract learning pointsTIL format summary
followup-suggesterSuggest follow-up tasksPrioritized task list
Agent角色输出内容
doc-updater分析CLAUDE.md/context.md是否需要更新需添加的具体内容
automation-scout检测可自动化的模式Skill/命令/Agent建议
learning-extractor提取学习要点TIL格式的总结
followup-suggester建议后续任务优先级排序的任务列表

Step 3: Phase 2 - Validation Agent (Sequential)

步骤3:第二阶段 - 验证Agent(顺序执行)

Run after Phase 1 completes (dependency on Phase 1 results).
Task(
    subagent_type="duplicate-checker",
    description="Phase 1 proposal validation",
    prompt="""
Validate Phase 1 analysis results.
需在第一阶段完成后运行(依赖第一阶段的结果)。
Task(
    subagent_type="duplicate-checker",
    description="Phase 1 proposal validation",
    prompt="""
Validate Phase 1 analysis results.

doc-updater proposals:

doc-updater proposals:

[doc-updater results]
[doc-updater results]

automation-scout proposals:

automation-scout proposals:

[automation-scout results]
Check if proposals duplicate existing docs/automation:
  1. Complete duplicate: Recommend skip
  2. Partial duplicate: Suggest merge approach
  3. No duplicate: Approve for addition """ )
undefined
[automation-scout results]
Check if proposals duplicate existing docs/automation:
  1. Complete duplicate: Recommend skip
  2. Partial duplicate: Suggest merge approach
  3. No duplicate: Approve for addition """ )
undefined

Step 4: Integrate Results

步骤4:整合结果

markdown
undefined
markdown
undefined

Wrap Analysis Results

会话收尾分析结果

Documentation Updates

文档更新

[doc-updater summary]
  • Duplicate check: [duplicate-checker feedback]
[doc-updater摘要]
  • 重复项检查:[duplicate-checker反馈]

Automation Suggestions

自动化建议

[automation-scout summary]
  • Duplicate check: [duplicate-checker feedback]
[automation-scout摘要]
  • 重复项检查:[duplicate-checker反馈]

Learning Points

学习要点

[learning-extractor summary]
[learning-extractor摘要]

Follow-up Tasks

后续任务

[followup-suggester summary]
undefined
[followup-suggester摘要]
undefined

Step 5: Action Selection

步骤5:选择操作

AskUserQuestion(
    questions=[{
        "question": "Which actions would you like to perform?",
        "header": "Wrap Options",
        "multiSelect": true,
        "options": [
            {"label": "Create commit (Recommended)", "description": "Commit changes"},
            {"label": "Update CLAUDE.md", "description": "Document new knowledge/workflows"},
            {"label": "Create automation", "description": "Generate skill/command/agent"},
            {"label": "Skip", "description": "End without action"}
        ]
    }]
)
AskUserQuestion(
    questions=[{
        "question": "Which actions would you like to perform?",
        "header": "Wrap Options",
        "multiSelect": true,
        "options": [
            {"label": "Create commit (Recommended)", "description": "Commit changes"},
            {"label": "Update CLAUDE.md", "description": "Document new knowledge/workflows"},
            {"label": "Create automation", "description": "Generate skill/command/agent"},
            {"label": "Skip", "description": "End without action"}
        ]
    }]
)

Step 6: Execute Selected Actions

步骤6:执行选中的操作

Execute only the actions selected by user.

仅执行用户选中的操作。

Quick Reference

快速参考

When to Use

使用场景

  • End of significant work session
  • Before switching to different project
  • After completing a feature or fixing a bug
  • 重要工作会话结束时
  • 切换到其他项目之前
  • 完成功能开发或修复Bug之后

When to Skip

无需使用的场景

  • Very short session with trivial changes
  • Only reading/exploring code
  • Quick one-off question answered
  • 仅包含微小改动的极短会话
  • 仅进行代码阅读/探索的会话
  • 快速解答单个问题的会话

Arguments

参数说明

  • Empty: Proceed interactively (full workflow)
  • Message provided: Use as commit message and commit directly
  • 无参数:以交互模式执行完整工作流
  • 传入消息:将消息作为提交信息直接执行提交操作

Additional Resources

额外资源

See
references/multi-agent-patterns.md
for detailed orchestration patterns.
如需详细的编排模式,请参阅
references/multi-agent-patterns.md