Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计通过

session-management会话管理

Agent Skill

session-management 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

489

周安装

21

GitHub Stars

315

下载量

171
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:session-management(会话管理)
来源仓库:https://github.com/codewithmukesh/dotnet-claude-kit
仓库路径:skills/session-management
安装命令:
npx skills add https://github.com/codewithmukesh/dotnet-claude-kit --skill session-management
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/codewithmukesh/dotnet-claude-kit --skill session-management

简介

用于会话上下文加载与知识延续机制设计。

  • 适用于 handoff.md、MEMORY.md 与 instincts.md 文件协同。
  • 可协助检测 .NET 解决方案并连接 MCP 工具链。
  • 强调会话结束必须捕获已完成、待办与所学三项内容。
  • 建议避免跨会话丢失关键上下文信息。session-management 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Session Management

Core Principles

  1. Sessions start with context, not from scratch — Every session begins by loading three files: .claude/handoff.md (pending work), MEMORY.md (permanent rules), and .claude/instincts.md (learned patterns). Then detect the.NET solution so MCP tools are connected. A session that starts blind wastes the first 10 minutes re-discovering what was already known.
  2. Sessions end with capture, never abruptly — When a session ends, three things are captured: what was DONE, what is PENDING, and what was LEARNED. This is non-negotiable. Context lost between sessions is context the user must re-provide, which wastes their time.
  3. Context preservation is a chain — Handoff files pass state session-to-session. MEMORY.md accumulates permanent rules. Instincts track emerging patterns. Git commits preserve code state. Together, these four mechanisms create continuity that no single mechanism can provide alone.
  4. Solution detection enables tooling —.NET MCP tools (get_diagnostics, find_symbol, get_project_graph) require a loaded solution. Detecting the .slnx/.sln file on session start ensures these tools are available from the first prompt, not discovered mid-conversation.
  5. Graceful degradation over hard failure — If no handoff file exists, start clean. If no MEMORY.md exists, offer to create one on first learning. If no solution file is found, work without MCP tools. Never block a session because a context file is missing.

Patterns

Session Start Protocol

Execute this sequence at the beginning of every session:

STEP 1: Load Handoff
  → Check for .claude/handoff.md
  → If found: read and summarize pending work
  → If not found: note "No handoff file — starting fresh"

STEP 2: Load Memory
  → Check for MEMORY.md (project root or .claude/)
  → If found: scan for rules relevant to the likely task
  → If not found: note "No memory file — will create on first learning"

STEP 3: Load Instincts
  → Check for .claude/instincts.md
  → If found: load instincts at 0.7+ into active context
  → If not found: note "No instincts file — will create on first observation"

STEP 4: Detect .NET Solution
  → Search for .slnx files in current directory
  → If not found, search for .sln files
  → If not found, search parent directories (up to 3 levels)
  → If not found, search child directories (1 level)
  → If found: confirm MCP tools are connected
  → If not found: warn "No solution detected — MCP tools unavailable"

STEP 5: Present Summary
  "Session context loaded:
   - Last session: [summary from handoff or 'no previous session']
   - Pending tasks: [list from handoff or 'none']
   - Active rules: [count from MEMORY.md]
   - Active instincts: [count at 0.7+]
   - Solution: [solution name and path, or 'not detected']
   Ready to continue. What would you like to work on?"

Session End Protocol

Execute this sequence when the session is ending:

STEP 1: Review Accomplishments
  → List everything completed this session with file paths
  → Include line numbers for significant changes

STEP 2: Check for Uncommitted Changes
  → Run git status
  → If uncommitted changes exist:
    "You have uncommitted changes. Want me to commit before wrapping up?"
  → If clean: note "All changes committed"

STEP 3: Write Handoff
  → Write .claude/handoff.md using the Handoff File Template (see below)

STEP 4: Extract Learnings
  → Review session for corrections from the user
  → Generalize corrections into rules (via self-correction-loop)
  → Write to MEMORY.md under appropriate category

STEP 5: Update Instincts
  → Review any new patterns observed during the session
  → Update confidence scores in .claude/instincts.md
  → Promote any instincts that reached 0.9 (via instinct-system)

STEP 6: Confirm
  "Session wrapped up:
   - Handoff written to .claude/handoff.md
   - [N] learnings added to MEMORY.md
   - [N] instincts updated
   Next session will pick up right where we left off."

Solution Detection Strategy

Find the.NET solution for MCP tool connectivity:

SEARCH ORDER:
1. Current directory: *.slnx, *.sln
2. Parent directory: *.slnx, *.sln (common in src/ subdirectory layouts)
3. Grandparent directory: *.slnx, *.sln (up to 3 levels)
4. Child directories: */**.slnx, */**.sln (1 level deep)

PREFERENCE:
- .slnx over .sln (modern format)
- If multiple solutions found, prefer the one matching the directory name
- If still ambiguous, list all and ask the user

AFTER DETECTION:
- Confirm MCP connection by running get_project_graph
- If MCP returns "loading", wait briefly and retry (solution may be initializing)
- Cache the solution path for the session — don't re-detect on every tool call

Context Preservation Architecture

Four mechanisms work together to prevent context loss:

FILE                    SCOPE       LIFETIME        PURPOSE
.claude/handoff.md      Session     Overwritten      Pass state between sessions
MEMORY.md               Project     Permanent        Store confirmed rules
.claude/instincts.md    Project     Evolving         Track emerging patterns
Git commits             Code        Permanent        Preserve code state

FLOW:
  Session N ends → writes handoff.md, updates MEMORY.md, updates instincts.md
  Session N+1 starts → reads handoff.md, MEMORY.md, instincts.md
  Result: zero context loss between sessions

Handoff File Template

The standard format for .claude/handoff.md:

# Session Handoff

> Generated: 2025-07-15 | Branch: feature/order-validation

## Completed
- [x] Added FluentValidation to CreateOrder command
  - File: `src/Orders/Features/CreateOrder.cs` (lines 15-35)
  - Validator: non-empty CustomerId, at least 1 item, positive quantities
- [x] Fixed N+1 query in GetOrderDetails
  - File: `src/Orders/Features/GetOrderDetails.cs` (line 28)
  - Added `.Include(o => o.Items)` to the query

## Pending
- [ ] Add validation to UpdateOrder command (same pattern as CreateOrder)
  - Start from: `src/Orders/Features/UpdateOrder.cs`
  - Reference: CreateOrder validator for the established pattern
- [ ] Run full test suite — last run had 2 unrelated failures in Catalog module

## Learned
- FluentValidation validators must be registered in the module's DI setup
- The N+1 in GetOrderDetails was hidden because test data seeds only 1 item per order

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

Resuming from Handoff

When a handoff file exists, present a clear summary and let the user decide:

SESSION RESUME FLOW:
1. Read .claude/handoff.md
2. Summarize concisely:
   "Last session (2025-07-15) on branch feature/order-validation:
    - Completed: CreateOrder validation, N+1 fix in GetOrderDetails
    - Pending: UpdateOrder validation, test suite failures
    Shall I continue with the UpdateOrder validation?"
3. Wait for user direction — never auto-start pending work
4. If the user wants something different, acknowledge and proceed
   "Got it, setting aside the pending tasks. What would you like to work on?"

First Session Bootstrap

When no context files exist (brand new project or first Claude session):

BOOTSTRAP PROTOCOL:
1. No handoff.md → "No previous session found. Starting fresh."
2. No MEMORY.md → "No project memory found. I'll create one when we discover
   project-specific rules."
3. No instincts.md → "No instincts file. I'll start tracking patterns
   as we work together."
4. Detect solution → Run full detection, report findings
5. Offer convention scan:
   "This is our first session. Want me to scan the codebase to learn
    the project's conventions? (Uses the convention-learner skill)"

Multi-Developer Handoff

When the handoff might be read by a different developer or Claude session:

ENHANCED HANDOFF (add when multiple developers use Claude on the project):

## Decisions Made
| Decision | Choice | Rationale |
|----------|--------|-----------|
| Validation library | FluentValidation | Already used in Catalog module |
| Error format | ProblemDetails | RFC 7807, consistent with API standard |

## Open Questions
- Should we validate product existence at command level or handler level?
  - Current: handler level (after DB lookup)
  - Trade-off: invalid product IDs return 500 instead of 400

## Dependencies
- Requires FluentValidation 11.x NuGet package (already referenced)
- No new infrastructure dependencies

Anti-patterns

Starting Blind

# BAD — ignoring existing context
*Session starts*
Claude: "How can I help you today?"
*User: "Continue the order validation work"*
Claude: "What order validation work? Can you tell me what files to look at?"
*User wastes 5 minutes re-explaining*

# GOOD — loading context automatically
*Session starts*
Claude: "Last session completed CreateOrder validation. Pending: UpdateOrder
         validation (start from src/Orders/Features/UpdateOrder.cs).
         Shall I continue with that?"

Ending Without Capture

# BAD — session ends, context evaporates
User: "Thanks, that's all for today!"
Claude: "You're welcome! Happy to help anytime."
*Next session starts from scratch*

# GOOD — capture before closing
User: "Thanks, that's all for today!"
Claude: "Before we wrap up, let me save our progress to .claude/handoff.md
         so the next session picks up right where we left off."
*Writes handoff, extracts learnings, updates instincts*

Overwriting Without Consent

# BAD — silently overwriting an existing handoff with different pending tasks
*Previous handoff has 3 pending tasks from another developer*
*This session worked on something different*
*Overwrites handoff, losing the other developer's pending tasks*

# GOOD — check before overwriting
"There's an existing handoff from [date] with pending tasks:
 - [task 1], [task 2], [task 3]
 These appear unrelated to our session. Should I:
 a) Merge our session with existing pending tasks
 b) Overwrite (their tasks are done or no longer relevant)
 c) Skip writing handoff this time"

Skipping Solution Detection

# BAD — trying to use MCP tools without a loaded solution
Claude: "Let me check diagnostics..." *tool fails*
Claude: "Let me find the symbol..." *tool fails*
Claude: "I'll just read the files manually" *misses project-wide context*

# GOOD — detect solution on start, verify MCP connectivity
*Session start*
Claude: "Detected solution at src/MyApp.slnx. MCP tools connected.
         Project graph shows 5 projects with 3 test projects."
*All MCP tools work throughout the session*

Bloated Handoffs

# BAD — handoff file is 500 lines with every detail
## Completed
- Changed line 15 in file A from X to Y because Z and also considered W...
*So long that the next session's context window is wasted on the handoff*

# GOOD — concise, actionable handoff
## Completed
- [x] Added CreateOrder validation (src/Orders/Features/CreateOrder.cs:15-35)
*Reference the diff or commit for full details, don't duplicate them*

Context File Sprawl

# BAD — multiple context files with overlapping purposes
.claude/
  handoff.md
  handoff-backup.md
  session-notes-july.md
  session-notes-august.md
  todo.md
  context.md
*6 files, unclear which is authoritative*

# GOOD — exactly 3 context files, each with a clear purpose
.claude/
  handoff.md       ← session-to-session state (overwritten each time)
  instincts.md     ← emerging patterns (evolving)
MEMORY.md          ← permanent rules (append-only, audited)

Decision Guide

ScenarioAction
Starting a new sessionRun full Session Start Protocol (5 steps)
User says "wrap up" / "done" / "that's all"Run full Session End Protocol (6 steps)
No handoff.md existsStart clean, create on first session end
No MEMORY.md existsOffer to create on first correction or learning
No solution file foundWarn user, work without MCP tools, suggest creating one
Multiple solution files foundList all, ask user which to use
Handoff has pending tasks from another devAsk before overwriting: merge, overwrite, or skip
User wants to resume pending workSummarize and confirm before starting
User wants something different from handoffAcknowledge, proceed with new task, update handoff at end
Session had user correctionsExtract to MEMORY.md before ending
Session discovered new patternsUpdate instincts.md before ending
First-ever session on a projectRun bootstrap protocol, offer convention scan
Solution is still loading (MCP returns "loading")Wait 5 seconds, retry once, then proceed without MCP
Mid-session context getting largeOffload research to subagents, keep main context focused
User asks "what were we working on?"Read handoff.md and summarize

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.29%
按下载量换算57

Claude

30.83%
按下载量换算53

Cursor

18.93%
按下载量换算32

Gemini CLI

10.24%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills