11---
22name : skill-memory
33description : Generate SKILL package index from project documentation
4- argument-hint : " [path] [--tool <gemini|qwen|codex>] [--update ] [--mode <full|partial>] [--cli-execute]"
4+ argument-hint : " [path] [--tool <gemini|qwen|codex>] [--regenerate ] [--mode <full|partial>] [--cli-execute]"
55allowed-tools : SlashCommand(*), TodoWrite(*), Bash(*), Read(*), Write(*)
66---
77
@@ -70,7 +70,7 @@ bash(git rev-parse --show-toplevel 2>/dev/null || pwd)
7070# Default values (use these unless user specifies otherwise):
7171# - tool: "gemini"
7272# - mode: "full"
73- # - update : false (no --update flag)
73+ # - regenerate : false (no --regenerate flag)
7474# - cli_execute: false (no --cli-execute flag)
7575```
7676
@@ -87,13 +87,24 @@ bash(find .workflow/docs/my_project -name "*.md" 2>/dev/null | wc -l || echo 0)
8787- ` docs_exists ` : ` exists ` or ` not_exists `
8888- ` existing_docs ` : ` 5 ` (or ` 0 ` if no docs)
8989
90- ** Step 4: Handle --update Flag (If Specified)**
91- ``` bash
92- # If user specified --update, delete existing docs directory
93- bash(rm -rf .workflow/docs/my_project 2> /dev/null || true)
90+ ** Step 4: Determine Execution Path**
9491
95- # Verify deletion
96- bash(test -d .workflow/docs/my_project && echo " still_exists" || echo " deleted" )
92+ ** Decision Logic** :
93+ ``` javascript
94+ if (existing_docs > 0 && ! regenerate_flag) {
95+ // Documentation exists and no regenerate flag
96+ SKIP_DOCS_GENERATION = true
97+ message = " Documentation already exists, skipping Phase 2 and Phase 3. Use --regenerate to force regeneration."
98+ } else if (regenerate_flag) {
99+ // Force regeneration: delete existing docs
100+ bash (rm - rf .workflow / docs/ my_project 2 > / dev/ null || true )
101+ SKIP_DOCS_GENERATION = false
102+ message = " Regenerating documentation from scratch."
103+ } else {
104+ // No existing docs
105+ SKIP_DOCS_GENERATION = false
106+ message = " No existing documentation found, generating new documentation."
107+ }
97108```
98109
99110** Summary** :
@@ -103,23 +114,31 @@ bash(test -d .workflow/docs/my_project && echo "still_exists" || echo "deleted")
103114- ` TOOL ` : ` gemini ` (default) or user-specified
104115- ` MODE ` : ` full ` (default) or user-specified
105116- ` CLI_EXECUTE ` : ` false ` (default) or ` true ` if --cli-execute flag
106- - ` UPDATE ` : ` false ` (default) or ` true ` if --update flag
107- - ` EXISTING_DOCS ` : ` 0 ` (after update) or actual count
117+ - ` REGENERATE ` : ` false ` (default) or ` true ` if --regenerate flag
118+ - ` EXISTING_DOCS ` : Count of existing documentation files
119+ - ` SKIP_DOCS_GENERATION ` : ` true ` if skipping Phase 2/3, ` false ` otherwise
108120
109121** Completion Criteria** :
110122- All parameters extracted and validated
111123- Project name and paths confirmed
112- - Existing docs count retrieved (or 0 after regenerate)
124+ - Existing docs count retrieved
125+ - Skip decision determined (SKIP_DOCS_GENERATION)
113126- Default values set for unspecified parameters
114127
115- ** TodoWrite** : Mark phase 1 completed, phase 2 in_progress
128+ ** TodoWrite** :
129+ - If ` SKIP_DOCS_GENERATION = true ` : Mark phase 1 completed, phase 4 in_progress (skip phase 2 and 3)
130+ - If ` SKIP_DOCS_GENERATION = false ` : Mark phase 1 completed, phase 2 in_progress
116131
117- ** After Phase 1** : Display preparation results → ** Automatically continue to Phase 2** (no user input required)
132+ ** After Phase 1** :
133+ - If skipping: Display skip message → ** Jump to Phase 4** (SKILL.md generation)
134+ - If not skipping: Display preparation results → ** Continue to Phase 2** (documentation planning)
118135
119136---
120137
121138### Phase 2: Call /memory: docs
122139
140+ ** Note** : This phase is ** skipped if SKIP_DOCS_GENERATION = true** (documentation already exists without --regenerate flag)
141+
123142** Goal** : Trigger documentation generation workflow
124143
125144** Command** :
@@ -133,7 +152,7 @@ SlashCommand(command="/memory:docs [targetPath] --tool [tool] --mode [mode] [--c
133152/memory:docs /d/my_app --tool gemini --mode full --cli-execute
134153```
135154
136- ** Note** : The ` --update ` flag is handled in Phase 1 by deleting existing documentation. This command always calls ` /memory:docs ` without the update flag, relying on docs.md's built-in update detection.
155+ ** Note** : The ` --regenerate ` flag is handled in Phase 1 by deleting existing documentation. This command always calls ` /memory:docs ` without the regenerate flag, relying on docs.md's built-in update detection.
137156
138157** Input** :
139158- ` targetPath ` from Phase 1
@@ -160,6 +179,8 @@ SlashCommand(command="/memory:docs [targetPath] --tool [tool] --mode [mode] [--c
160179
161180### Phase 3: Execute Documentation Generation
162181
182+ ** Note** : This phase is ** skipped if SKIP_DOCS_GENERATION = true** (documentation already exists without --regenerate flag)
183+
163184** Goal** : Execute documentation generation tasks
164185
165186** Command** :
@@ -274,6 +295,12 @@ Usage:
274295
275296** Auto-Continue Logic** : After updating TodoWrite at end of each phase, immediately check for next pending task and execute it.
276297
298+ ** Two Execution Paths** :
299+ 1 . ** Full Path** : All 4 phases (no existing docs or --regenerate specified)
300+ 2 . ** Skip Path** : Phase 1 → Phase 4 (existing docs found, no --regenerate)
301+
302+ ### Full Path (SKIP_DOCS_GENERATION = false)
303+
277304``` javascript
278305// Initialize (before Phase 1)
279306// FIRST ACTION: Create TodoList with all 4 phases
@@ -285,7 +312,7 @@ TodoWrite({todos: [
285312]})
286313// SECOND ACTION: Execute Phase 1 immediately
287314
288- // After Phase 1 completes
315+ // After Phase 1 completes (SKIP_DOCS_GENERATION = false)
289316// Update TodoWrite: Mark Phase 1 completed, Phase 2 in_progress
290317TodoWrite ({todos: [
291318 {" content" : " Parse arguments and prepare" , " status" : " completed" , " activeForm" : " Parsing arguments" },
@@ -326,6 +353,43 @@ TodoWrite({todos: [
326353// FINAL ACTION: Report completion summary to user
327354```
328355
356+ ### Skip Path (SKIP_DOCS_GENERATION = true)
357+
358+ ** Note** : Phase 4 (SKILL.md generation) is ** NEVER skipped** - it always runs to generate or update the SKILL index.
359+
360+ ``` javascript
361+ // Initialize (before Phase 1)
362+ // FIRST ACTION: Create TodoList with all 4 phases (same as Full Path)
363+ TodoWrite ({todos: [
364+ {" content" : " Parse arguments and prepare" , " status" : " in_progress" , " activeForm" : " Parsing arguments" },
365+ {" content" : " Call /memory:docs to plan documentation" , " status" : " pending" , " activeForm" : " Calling /memory:docs" },
366+ {" content" : " Execute documentation generation" , " status" : " pending" , " activeForm" : " Executing documentation" },
367+ {" content" : " Generate SKILL.md index" , " status" : " pending" , " activeForm" : " Generating SKILL.md" }
368+ ]})
369+ // SECOND ACTION: Execute Phase 1 immediately
370+
371+ // After Phase 1 completes (SKIP_DOCS_GENERATION = true)
372+ // Update TodoWrite: Mark Phase 1 completed, Phase 2&3 skipped, Phase 4 in_progress
373+ TodoWrite ({todos: [
374+ {" content" : " Parse arguments and prepare" , " status" : " completed" , " activeForm" : " Parsing arguments" },
375+ {" content" : " Call /memory:docs to plan documentation" , " status" : " completed" , " activeForm" : " Calling /memory:docs" },
376+ {" content" : " Execute documentation generation" , " status" : " completed" , " activeForm" : " Executing documentation" },
377+ {" content" : " Generate SKILL.md index" , " status" : " in_progress" , " activeForm" : " Generating SKILL.md" }
378+ ]})
379+ // Display skip message: "Documentation already exists, skipping Phase 2 and Phase 3. Use --regenerate to force regeneration."
380+ // NEXT ACTION: Jump directly to Phase 4 (generate SKILL.md)
381+
382+ // After Phase 4 completes
383+ // Update TodoWrite: Mark Phase 4 completed
384+ TodoWrite ({todos: [
385+ {" content" : " Parse arguments and prepare" , " status" : " completed" , " activeForm" : " Parsing arguments" },
386+ {" content" : " Call /memory:docs to plan documentation" , " status" : " completed" , " activeForm" : " Calling /memory:docs" },
387+ {" content" : " Execute documentation generation" , " status" : " completed" , " activeForm" : " Executing documentation" },
388+ {" content" : " Generate SKILL.md index" , " status" : " completed" , " activeForm" : " Generating SKILL.md" }
389+ ]})
390+ // FINAL ACTION: Report completion summary to user
391+ ```
392+
329393## Auto-Continue Execution Flow
330394
331395** Critical Implementation Rules** :
@@ -341,6 +405,8 @@ TodoWrite({todos: [
341405 ```
342406
343407** Execution Sequence** :
408+
409+ ** Full Path** (no existing docs OR --regenerate specified):
344410```
345411User triggers command
346412 ↓
@@ -365,6 +431,27 @@ User triggers command
365431[Report] Display completion summary
366432```
367433
434+ ** Skip Path** (existing docs found AND no --regenerate flag):
435+ ```
436+ User triggers command
437+ ↓
438+ [TodoWrite] Initialize 4 phases (Phase 1 = in_progress)
439+ ↓
440+ [Execute] Phase 1: Parse arguments, detect existing docs
441+ ↓
442+ [TodoWrite] Phase 1 = completed, Phase 2&3 = completed (skipped), Phase 4 = in_progress
443+ ↓
444+ [Display] Skip message: "Documentation already exists, skipping Phase 2 and Phase 3"
445+ ↓
446+ [Execute] Phase 4: Generate SKILL.md (always runs)
447+ ↓
448+ [TodoWrite] Phase 4 = completed
449+ ↓
450+ [Report] Display completion summary
451+ ```
452+
453+ ** Note** : Phase 4 (SKILL.md generation) is ** NEVER skipped** - it always executes to generate or update the index file.
454+
368455** Error Handling** :
369456- If any phase fails, mark it as "in_progress" (not completed)
370457- Report error details to user
@@ -375,15 +462,15 @@ User triggers command
375462## Parameters
376463
377464``` bash
378- /memory:skill-memory [path] [--tool < gemini| qwen| codex> ] [--update ] [--mode < full| partial> ] [--cli-execute]
465+ /memory:skill-memory [path] [--tool < gemini| qwen| codex> ] [--regenerate ] [--mode < full| partial> ] [--cli-execute]
379466```
380467
381468- ** path** : Target directory (default: current directory)
382469- ** --tool** : CLI tool for documentation (default: gemini)
383470 - ` gemini ` : Comprehensive documentation
384471 - ` qwen ` : Architecture analysis
385472 - ` codex ` : Implementation validation
386- - ** --update ** : Force update all documentation
473+ - ** --regenerate ** : Force regenerate all documentation
387474 - When enabled: Deletes existing ` .workflow/docs/{project_name}/ ` before regeneration
388475 - Ensures fresh documentation from source code
389476- ** --mode** : Documentation mode (default: full)
@@ -407,16 +494,16 @@ User triggers command
4074943 . Phase 3: Executes documentation generation via ` /workflow:execute `
4084954 . Phase 4: Generates SKILL.md at ` .claude/skills/{project_name}/SKILL.md `
409496
410- ### Example 2: Update with Qwen
497+ ### Example 2: Regenerate with Qwen
411498
412499``` bash
413- /memory:skill-memory /d/my_app --tool qwen --update
500+ /memory:skill-memory /d/my_app --tool qwen --regenerate
414501```
415502
416503** Workflow** :
417- 1 . Phase 1: Parses target path, detects update flag
418- 2 . Phase 2: Calls ` /memory:docs /d/my_app --tool qwen --mode full ` (update handled in Phase 1)
419- 3 . Phase 3: Executes documentation update
504+ 1 . Phase 1: Parses target path, detects regenerate flag, deletes existing docs
505+ 2 . Phase 2: Calls ` /memory:docs /d/my_app --tool qwen --mode full `
506+ 3 . Phase 3: Executes documentation regeneration
4205074 . Phase 4: Generates updated SKILL.md
421508
422509### Example 3: Partial Mode (Modules Only)
0 commit comments