Skip to content

Commit bcebd22

Browse files
author
catlog22
committed
feat: update SKILL.md generation process with intelligent description extraction and streamlined file handling
1 parent 528c5ef commit bcebd22

File tree

1 file changed

+25
-90
lines changed

1 file changed

+25
-90
lines changed

.claude/commands/memory/skill-memory.md

Lines changed: 25 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -164,114 +164,49 @@ SlashCommand(command="/workflow:execute")
164164

165165
### Phase 4: Generate SKILL.md Index
166166

167-
**Goal**: Create SKILL.md at `.claude/skills/{project_name}/SKILL.md`
167+
**Step 1: Read Key Files** (Use Read tool)
168+
- `.workflow/docs/{project_name}/README.md` (required)
169+
- `.workflow/docs/{project_name}/ARCHITECTURE.md` (optional)
168170

169-
**Step 1: Load Project README**
171+
**Step 2: Discover Structure**
170172
```bash
171-
# Read README for project description (replace project_name)
172-
bash(cat .workflow/docs/my_project/README.md 2>/dev/null | head -50 || echo "No README found")
173+
bash(find .workflow/docs/{project_name} -name "*.md" | sed 's|.workflow/docs/{project_name}/||' | awk -F'/' '{if(NF>=2) print $1"/"$2}' | sort -u)
173174
```
174175

175-
**Step 2: Discover All Documentation Files**
176-
```bash
177-
# List all documentation files (replace project_name)
178-
bash(find .workflow/docs/my_project -name "*.md" 2>/dev/null | sort)
179-
```
176+
**Step 3: Generate Intelligent Description**
180177

181-
**Output**:
182-
```
183-
.workflow/docs/my_project/README.md
184-
.workflow/docs/my_project/ARCHITECTURE.md
185-
.workflow/docs/my_project/src/modules/auth/API.md
186-
.workflow/docs/my_project/src/modules/auth/README.md
187-
```
178+
Extract from README + structure: Function (capabilities), Modules (names), Keywords (API/CLI/auth/etc.)
188179

189-
**Step 3: Count Documentation Files**
190-
```bash
191-
# Count total docs (replace project_name)
192-
bash(find .workflow/docs/my_project -name "*.md" 2>/dev/null | wc -l)
193-
```
180+
**Format**: `{Function}. Use when {trigger conditions}.`
181+
**Example**: "Workflow management with CLI tools. Use when working with workflow orchestration or docs generation."
194182

195-
**Output**: `12` files
196-
197-
**Step 4: Extract Module Directories**
183+
**Step 4: Write SKILL.md** (Use Write tool)
198184
```bash
199-
# Find module directories (1-2 levels deep, replace project_name)
200-
bash(find .workflow/docs/my_project -mindepth 1 -maxdepth 2 -type d 2>/dev/null | sed 's|.workflow/docs/my_project/||' | sort -u)
185+
bash(mkdir -p .claude/skills/{project_name})
201186
```
202187

203-
**Output**:
204-
```
205-
src
206-
src/modules
207-
src/utils
208-
lib
209-
lib/core
210-
```
211-
212-
**Step 5: Count Module Directories**
213-
```bash
214-
# Count modules (replace project_name)
215-
bash(find .workflow/docs/my_project -mindepth 1 -maxdepth 2 -type d 2>/dev/null | wc -l)
216-
```
217-
218-
**Output**: `5` modules
219-
220-
**Step 6: Create Skills Directory**
221-
```bash
222-
# Create directory for SKILL.md (replace project_name)
223-
bash(mkdir -p .claude/skills/my_project)
224-
```
225-
226-
**Step 7: Generate SKILL.md**
227-
228-
Use the `Write` tool to create `.claude/skills/my_project/SKILL.md` with:
229-
- YAML frontmatter (name, description from README)
230-
- Progressive loading guide (Level 0-3)
231-
- Module index with relative paths to `../../.workflow/docs/my_project/`
232-
233-
**SKILL.md Structure**:
234-
```markdown
188+
`.claude/skills/{project_name}/SKILL.md`:
189+
```yaml
235190
---
236191
name: {project_name}
237-
description: {extracted from README}
192+
description: {intelligent description from Step 3}
238193
version: 1.0.0
239194
---
240-
241195
# {Project Name} SKILL Package
242196

243-
Progressive documentation loading guide.
244-
245-
## Documentation Location
246-
247-
All documentation: `../../.workflow/docs/{project_name}/`
248-
249-
## Progressive Loading Guide
250-
251-
### Level 0: Quick Start (Minimal Context ~2K tokens)
252-
- [Project Overview](../../.workflow/docs/{project_name}/README.md#overview)
253-
- [Getting Started](../../.workflow/docs/{project_name}/README.md#getting-started)
254-
255-
### Level 1: Core Modules (Essential Context ~8K tokens)
256-
- [Module 1](../../.workflow/docs/{project_name}/path/to/module1/README.md)
257-
- [Module 2](../../.workflow/docs/{project_name}/path/to/module2/README.md)
258-
259-
### Level 2: Complete (Full Context ~25K tokens)
260-
- All modules + [Architecture](../../.workflow/docs/{project_name}/ARCHITECTURE.md)
261-
262-
### Level 3: Deep Dive (Maximum Context ~40K tokens)
263-
- All docs + [Examples](../../.workflow/docs/{project_name}/EXAMPLES.md)
264-
265-
## Module Index
266-
267-
{Generated from discovered structure}
197+
## Documentation: `../../.workflow/docs/{project_name}/`
198+
199+
## Progressive Loading
200+
### Level 0: Quick Start (~2K)
201+
- [README](../../.workflow/docs/{project_name}/README.md)
202+
### Level 1: Core Modules (~8K)
203+
{Module READMEs}
204+
### Level 2: Complete (~25K)
205+
All modules + [Architecture](../../.workflow/docs/{project_name}/ARCHITECTURE.md)
206+
### Level 3: Deep Dive (~40K)
207+
Everything + [Examples](../../.workflow/docs/{project_name}/EXAMPLES.md)
268208
```
269209

270-
**Validation**:
271-
- SKILL.md created at `.claude/skills/{project_name}/SKILL.md`
272-
- File contains valid YAML frontmatter
273-
- All links reference correct paths
274-
275210
**TodoWrite**: Mark phase 4 completed
276211

277212
**Return to User**:

0 commit comments

Comments
 (0)