360 Secure SkillHub
360 安全技能中心

wrap-up

把一次编码会话的已完成事项、待办事项和经验教训整理进 .claude/handoff.md,并将值得长期保留的经验沉淀到 MEMORY.md 与 .claude/instincts.md;下次会话开始时读取这些文件并给出续接摘要。checkpoint 模式会提交当前改动并写下简短交接,但不推送。

分类:知识
codewithmukesh
热度 21.34
最近更新 2026-11-29 11:18:16

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add codewithmukesh/dotnet-agent-kit/wrap-up
兼容性
Claude Code 专属
联网要求
不联网
数据出网
数据不出本机
Metadata
name
wrap-up
description
End-of-session handoff to .claude/handoff.md and MEMORY.md, and loading it next session. `/wrap-up checkpoint` commits and saves a note mid-session.
disable-model-invocation
true

/wrap-up

What

The session continuity ritual. Sessions are ephemeral; knowledge is permanent. Wrap-up bridges sessions in both directions:

  • Session END — capture exactly three things: what was DONE, what is PENDING, and what was LEARNED. Write them to .claude/handoff.md and flow durable learnings into MEMORY.md.
  • Session START — load the handoff, memory, and instincts, then present a resume summary so no session starts blind.
  • Checkpoint (/wrap-up checkpoint) — a mid-session save: commit plus a brief handoff note, then keep working. The full wrap-up adds learning extraction.

When

  • End of a working session — "done for today", "that's all", "signing off"
  • Before switching projects or after a major milestone
  • Implicit endings — "thanks" after completed tasks, "good enough for now": offer the handoff, don't just say goodbye
  • Start of a session — "start session", "load handoff", "what were we working on"
  • Mid-session, without ending: /wrap-up checkpoint (before a risky refactor, when switching tasks, after a logical unit of work, "save progress", "pause here")

How

Session End

  1. Review the session — From git status/diff and the conversation: files touched, tasks completed vs unfinished, decisions made and why, user corrections observed.
  2. Check uncommitted changes — If any exist, offer to commit before wrapping.
  3. Write the handoff — .claude/handoff.md, using the format below. Single file, always overwritten — only the current state matters. If the existing handoff has pending tasks from someone else, ask before overwriting: merge, overwrite, or skip.
  4. Extract learnings — Corrections and discoveries worth keeping go to MEMORY.md (via instinct-system); emerging patterns update .claude/instincts.md (via instinct-system). The handoff's Learned section is the trigger, not the destination — handoffs are ephemeral.
  5. Confirm — Summarize the handoff and learnings captured for the user.

Handoff File Format (.claude/handoff.md)

Write it for a stranger with zero context — file paths, rationale, specific next steps. "Continue the refactor" is useless; "Refactor src/Orders/CreateOrder.cs to the Result pattern — see Catalog for the established pattern" is actionable.

# Session Handoff

> Generated: 2026-06-12 | Branch: feature/order-validation

## Completed
- [x] Added FluentValidation to CreateOrder (src/Orders/Features/CreateOrder.cs:15-35)
- [x] Fixed N+1 in GetOrderDetails (src/Orders/Features/GetOrderDetails.cs:28)

## Pending
- [ ] Add validation to UpdateOrder (src/Orders/Features/UpdateOrder.cs)
  - Reference: CreateOrder validator for the established pattern
- [ ] Full test run — 2 pre-existing Catalog failures, not from today

## Learned
- FluentValidation validators must be registered in the module's DI setup
- Test fixture seeds 1 item per order, which hides N+1 queries

## Context
- Branch: feature/order-validation | Last commit: "Add CreateOrder validation"
- Uncommitted changes: no | Solution: src/MyApp.slnx

When multiple developers share the project, add a ## Decisions Made table (Decision | Choice | Rationale) and ## Open Questions.

Learning Extraction Checklist

  1. Did the user correct anything? → MEMORY.md via instinct-system
  2. Did we discover something non-obvious? → Learned section
  3. Did we decide something with rationale? → document the "why"
  4. Did a tool/approach fail? → note it so the next session doesn't retry it

Good learning: "EF compiled queries don't work with Include()". Bad learning: "Worked on Orders module" (vague) or "Used TimeProvider" (already a rule).

Mid-Session Checkpoint (/wrap-up checkpoint)

Bank the known-good state, then keep working. Never push, force-push, or amend; a checkpoint is a new commit you can return to. Never commit secrets.

  1. Assess — git status and git diff for staged and unstaged changes.
  2. Stage — specific files only, never git add -A; exclude build artifacts and secrets (.env, credentials).
  3. Commit — descriptive message in the repo's style (feat:, fix:, refactor:). Nothing to commit? Skip to step 4.
  4. Brief handoff — overwrite .claude/handoff.md in the same format as above, abbreviated: Completed, Pending (specific next steps), Learned (only if non-obvious), Context (branch + commit hash).
  5. Confirm — report the commit hash and handoff summary, then resume work.

Session Start

  1. Load context — Read .claude/handoff.md (pending work), MEMORY.md (permanent rules), .claude/instincts.md (patterns at 0.7+ confidence). Missing files are fine: note it and start clean — never block on them.
  2. Detect the solution — Find .slnx/.sln (current dir, then parents, then children) so Roslyn MCP tools work from the first prompt.
  3. Present a resume summary — Last session's work, pending tasks, active rules/instincts count, detected solution. Then ask what to work on — never auto-start pending work.

Example

User: /wrap-up

Claude: Wrapping up session...

## Session Summary
- Implemented OrderService with validation pipeline
- Fixed N+1 query in GetOrdersByCustomer

## Pending
- [ ] Add retry logic to payment gateway calls (OrderService.cs:42)

## Learnings Captured
- User prefers explicit mapping over AutoMapper → MEMORY.md

Written to .claude/handoff.md. See you next session.

User: /wrap-up checkpoint — about to try the split-query refactor
Claude: Commit a1b2c3d "feat: add CreateOrder validation". Handoff updated
  (.claude/handoff.md). Safe to proceed with the refactor.

Related

  • instinct-system — Routes session learnings: patterns become instincts, user corrections become permanent MEMORY.md rules
  • /build-fix — Get the build green before checkpointing