memory-manage
npx skills add https://github.com/catlog22/claude-code-workflow --skill memory-manage
Agent 安装分布
Skill 文档
Memory Management Skill
Unified entry point for project memory (CLAUDE.md) updates and documentation (API.md/README.md) generation. Routes to specialized sub-commands via arguments or interactive needs assessment.
Architecture Overview
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â Memory Manage (Router) â
â â Parse input â Detect mode â Route to phase â
âââââââââââââââââ¬âââââââââââââââââââââââââââââââââââââââ
â
âââââââââ´ââââââââ
â â
âââââââââââââ âââââââââââââ
â CLAUDE.md â â Docs â
â 管ç â â çæ â
âââââââ¬ââââââ âââââââ¬ââââââ
â â
ââââââ¼âââââ ââââââ´âââââ
â â â â â
Full Related Single Full Related
å
¨é å¢é 忍¡å å
¨é å¢é
Execution Flow
Step 1: Parse Input & Route
Detect execution mode from user input:
Auto-Route Rules (priority order):
| Signal | Route | Examples |
|---|---|---|
| Explicit sub-command token | â Direct dispatch | update-full --tool qwen |
| Keyword: full, å ¨é, all, entire + update/claude | â update-full | “å ¨éæ´æ°claude” |
| Keyword: related, changed, å¢é, diff + update/claude | â update-related | “æ´æ°åæ´æ¨¡å” |
| Keyword: single, module, 忍¡å + path-like token | â update-single | “æ´æ° src/auth æ¨¡å” |
| Keyword: docs, documentation, ææ¡£ + full/all/å ¨é | â docs-full | “å ¨éçæææ¡£” |
| Keyword: docs, documentation, ææ¡£ + related/changed/å¢é | â docs-related | “å¢éçæææ¡£” |
| Ambiguous or no arguments | â AskUserQuestion | /memory-manage |
Valid sub-command tokens: update-full, update-related, update-single, docs-full, docs-related
Direct dispatch examples:
input = "update-full --tool qwen"
â subcommand = "update-full", remainingArgs = "--tool qwen"
â Read phases/01-update-full.md, execute
input = "update-single src/auth --tool gemini"
â subcommand = "update-single", remainingArgs = "src/auth --tool gemini"
â Read phases/03-update-single.md, execute
When ambiguous or no arguments, proceed to Step 2.
Step 2: Interactive Needs Assessment
Q1 â ç¡®å®å 容类å«:
AskUserQuestion({
questions: [{
question: "ä½ è¦ç®¡çåªç±»å
容ï¼",
header: "ç±»å«",
multiSelect: false,
options: [
{
label: "CLAUDE.md (项ç®è®°å¿)",
description: "æ´æ°æ¨¡åæä»¤æä»¶ï¼å¸®å©Claudeç解代ç åºç»æå约å®"
},
{
label: "é¡¹ç®ææ¡£ (API+README)",
description: "çæAPI.mdåREADME.mdå°.workflow/docs/ç®å½"
}
]
}]
})
Q2a â CLAUDE.md 管çèå´ (ç¨æ·éäº CLAUDE.md):
AskUserQuestion({
questions: [{
question: "CLAUDE.md æ´æ°èå´ï¼",
header: "èå´",
multiSelect: false,
options: [
{
label: "å¢éæ´æ° (Recommended)",
description: "ä»
æ´æ°gitåæ´æ¨¡ååå
¶ç¶çº§ï¼æ¥å¸¸å¼åé¦é"
},
{
label: "å
¨éæ´æ°",
description: "æ´æ°æææ¨¡åï¼3屿¶æbottom-upï¼éåé大éæå"
},
{
label: "忍¡åæ´æ°",
description: "æå®ä¸ä¸ªæ¨¡åï¼Explore深度åæåçæè¯´æä¹¦å¼ææ¡£"
}
]
}]
})
Route mapping:
- “å¢éæ´æ°” â
update-relatedâ Ref: phases/02-update-related.md - “å
¨éæ´æ°” â
update-fullâ Ref: phases/01-update-full.md - “忍¡åæ´æ°” â
update-singleâ continue to Q3
Q2b â ææ¡£çæèå´ (ç¨æ·éäºé¡¹ç®ææ¡£):
AskUserQuestion({
questions: [{
question: "ææ¡£çæèå´ï¼",
header: "èå´",
multiSelect: false,
options: [
{
label: "å¢éçæ (Recommended)",
description: "ä»
为gitåæ´æ¨¡åçæ/æ´æ°ææ¡£ï¼æ¥å¸¸å¼åé¦é"
},
{
label: "å
¨éçæ",
description: "æææ¨¡å+项ç®çº§ææ¡£(ARCHITECTURE.mdç)ï¼éååå§å"
}
]
}]
})
Route mapping:
- “å¢éçæ” â
docs-relatedâ Ref: phases/05-docs-related.md - “å
¨éçæ” â
docs-fullâ Ref: phases/04-docs-full.md
Q3 â è¡¥å è·¯å¾ (ä» update-single éè¦ï¼ä¸æ è·¯å¾åæ°æ¶):
AskUserQuestion({
questions: [{
question: "请æå®è¦æ´æ°ç模åè·¯å¾ï¼",
header: "è·¯å¾",
multiSelect: false,
options: [
{
label: "src",
description: "src ç®å½"
},
{
label: ".",
description: "é¡¹ç®æ ¹ç®å½"
}
]
}]
})
ç¨æ·å¯é “Other” è¾å ¥èªå®ä¹è·¯å¾ã
Step 3: Execute Selected Phase
Based on routing result, read and execute the corresponding phase:
Phase Reference Documents (read on-demand when phase executes):
| Mode | Document | Purpose |
|---|---|---|
| update-full | phases/01-update-full.md | Full CLAUDE.md update, 3-layer architecture, batched agents |
| update-related | phases/02-update-related.md | Git-changed CLAUDE.md update, depth-first |
| update-single | phases/03-update-single.md | Single module CLAUDE.md, Explore + handbook style |
| docs-full | phases/04-docs-full.md | Full API.md + README.md generation |
| docs-related | phases/05-docs-related.md | Git-changed docs generation, incremental |
Shared Configuration
Tool Fallback Hierarchy
All sub-commands share the same fallback:
--tool gemini â [gemini, qwen, codex] // default
--tool qwen â [qwen, gemini, codex]
--tool codex â [codex, gemini, qwen]
Common Parameters
| Parameter | Description | Default | Used By |
|---|---|---|---|
--tool <gemini|qwen|codex> |
Primary CLI tool | gemini | All |
--path <dir> |
Target directory | . | update-full, docs-full |
<path> (positional) |
Module path | (required) | update-single |
Batching Thresholds
| Sub-Command | Direct Execution | Agent Batch | Batch Size |
|---|---|---|---|
| update-full | <20 modules | â¥20 modules | 4/agent |
| update-related | <15 modules | â¥15 modules | 4/agent |
| update-single | always single | N/A | 1 |
| docs-full | <20 modules | â¥20 modules | 4/agent |
| docs-related | <15 modules | â¥15 modules | 4/agent |
Core Rules
- Route before execute: Determine sub-command before any execution
- Phase doc is truth: All execution logic lives in phase docs, router only dispatches
- Read on-demand: Only read the selected phase doc, never load all
- Pass arguments through: Forward remaining args unchanged to sub-command
- User confirmation: Each sub-command handles its own plan presentation and y/n confirmation
Error Handling
| Error | Resolution |
|---|---|
| Unknown sub-command | Fall through to interactive flow |
| Phase doc not found | Abort with file path error |
| Missing path for update-single | Prompt via Q3 |
| Sub-command execution fails | Follow phase doc’s own error handling |