memory-capture
21
总安装量
21
周安装量
#17157
全站排名
安装命令
npx skills add https://github.com/catlog22/claude-code-workflow --skill memory-capture
Agent 安装分布
gemini-cli
21
opencode
21
codebuddy
21
github-copilot
21
codex
21
kimi-cli
21
Skill 文档
Memory Capture Skill
Unified memory capture skill that routes to two execution modes:
- Compact: Compress full session memory into structured text for recovery
- Tips: Quick note-taking for ideas, snippets, and insights
Architecture Overview
âââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â Memory Capture (Router) â
â â Parse input â Detect mode â Route to phase â
âââââââââââââââââ¬ââââââââââââââââââââââââââââââââââââââ
â
âââââââââ´ââââââââ
â â
âââââââââââââ âââââââââââââ
â Compact â â Tips â
â (Phase1) â â (Phase2) â
â Full â â Quick â
â Session â â Note â
âââââââ¬ââââââ âââââââ¬ââââââ
â â
âââââââââ¬ââââââââ
â
âââââââââââââââââ
â core_memory â
â (import) â
âââââââââââââââââ
Execution Flow
Step 1: Parse Input & Route
Detect execution mode from user input:
Auto-Route Rules (priority order):
| Signal | Route | Examples |
|---|---|---|
| Keyword: compact, session, å缩, recovery, ä¿åä¼è¯ | â Compact | “compact current session” |
| Keyword: tip, note, è®°å½, å¿«é | â Tips | “è®°å½ä¸ä¸ªæ³æ³” |
Has --tag or --context flags |
â Tips | "note content" --tag bug |
| Short text (<100 chars) + no session keywords | â Tips | “Remember to use Redis” |
| Ambiguous or no arguments | â AskUserQuestion | /memory-capture |
When ambiguous, use AskUserQuestion:
Question: "éæ©è®°å¿æè·æ¨¡å¼"
Options:
1. Compact - å缩å½å宿´ä¼è¯è®°å¿ï¼ç¨äºä¼è¯æ¢å¤ï¼
2. Tips - å¿«éè®°å½ä¸æ¡ç¬è®°/æ³æ³/æç¤º
Step 2: Execute Selected Phase
Based on routing result, read and execute the corresponding phase:
- Compact mode â Ref: phases/01-compact.md
- Tips mode â Ref: phases/02-tips.md
Phase Reference Documents (read on-demand when phase executes):
| Mode | Document | Purpose |
|---|---|---|
| Compact | phases/01-compact.md | Full session memory compression and structured export |
| Tips | phases/02-tips.md | Quick note-taking with tags and context |
Step 3: Save via core_memory
Both phases converge on the same storage mechanism:
mcp__ccw-tools__core_memory({
operation: "import",
text: structuredText // Generated by the selected phase
})
Core Rules
- Single Phase Execution: Only ONE phase executes per invocation – never both
- Content Faithful: Phase files contain full execution detail – follow them verbatim
- Absolute Paths: All file paths in output must be absolute
- No Summarization: Compact mode preserves complete plan verbatim – never abbreviate
- Speed Priority: Tips mode should be fast – minimal analysis overhead
Input Processing
Compact Mode Input
- Optional:
"session description"as supplementary context - Example:
/memory-capture compactor/memory-capture "completed auth module"
Tips Mode Input
- Required:
<note content>– the tip/note text - Optional:
--tag <tag1,tag2>for categorization - Optional:
--context <context>for related code/feature reference - Example:
/memory-capture tip "Use Redis for rate limiting" --tag config
Data Flow
User Input
â
ââ [compact detected] â Read phases/01-compact.md
â â Analyze session â Generate structured text
â â core_memory import â Report Recovery ID
â
ââ [tips detected] â Read phases/02-tips.md
â Parse args â Gather context â Generate tip text
â core_memory import â Confirm with ID + tags
Error Handling
| Error | Action |
|---|---|
| core_memory import fails | Retry once, then report error with structured text for manual save |
| No session context (compact) | Warn user, generate with available info |
| Empty note content (tips) | Ask user to provide content via AskUserQuestion |
| Ambiguous routing | Default to AskUserQuestion – never guess |