diff --git a/.claude/commands/memory/docs.md b/.claude/commands/memory/docs.md index 5808a46e..85846c47 100644 --- a/.claude/commands/memory/docs.md +++ b/.claude/commands/memory/docs.md @@ -11,9 +11,9 @@ Lightweight planner that analyzes project structure, decomposes documentation wo **Execution Strategy**: - **Dynamic Task Grouping**: Level 1 tasks grouped by top-level directories with document count limit - - **Primary constraint**: Each task generates ≤7 documents (API.md + README.md count) + - **Primary constraint**: Each task generates ≤10 documents (API.md + README.md count) - **Optimization goal**: Prefer grouping 2 top-level directories per task for context sharing - - **Conflict resolution**: If 2 dirs exceed 7 docs, reduce to 1 dir/task; if 1 dir exceeds 7 docs, split by subdirectories + - **Conflict resolution**: If 2 dirs exceed 10 docs, reduce to 1 dir/task; if 1 dir exceeds 10 docs, split by subdirectories - **Context benefit**: Same-task directories analyzed together via single Gemini call - **Parallel Execution**: Multiple Level 1 tasks execute concurrently for faster completion - **Pre-computed Analysis**: Phase 2 performs unified analysis once, stored in `.process/` for reuse @@ -140,42 +140,42 @@ bash(cat .workflow/WFS-docs-{timestamp}/.process/phase2-analysis.json | jq '.exi **Task Hierarchy** (Dynamic based on document count): ``` -Small Projects (total ≤7 docs): +Small Projects (total ≤10 docs): Level 1: IMPL-001 (all directories in single task, shared context) Level 2: IMPL-002 (README, full mode only) Level 3: IMPL-003 (ARCHITECTURE+EXAMPLES), IMPL-004 (HTTP API, optional) -Medium Projects (Example: 7 top-level dirs, 12 total docs): +Medium Projects (Example: 7 top-level dirs, 18 total docs): Step 1: Count docs per top-level dir - ├─ dir1: 2 docs, dir2: 3 docs → Group 1 (5 docs) - ├─ dir3: 4 docs, dir4: 2 docs → Group 2 (6 docs) - ├─ dir5: 1 doc → Group 3 (1 doc, can add more) + ├─ dir1: 3 docs, dir2: 4 docs → Group 1 (7 docs) + ├─ dir3: 5 docs, dir4: 3 docs → Group 2 (8 docs) + ├─ dir5: 2 docs → Group 3 (2 docs, can add more) - Step 2: Create tasks with ≤7 docs constraint + Step 2: Create tasks with ≤10 docs constraint Level 1: IMPL-001 to IMPL-003 (parallel groups) - ├─ IMPL-001: Group 1 (dir1 + dir2, 5 docs, shared context) - ├─ IMPL-002: Group 2 (dir3 + dir4, 6 docs, shared context) - └─ IMPL-003: Group 3 (remaining dirs, ≤7 docs) + ├─ IMPL-001: Group 1 (dir1 + dir2, 7 docs, shared context) + ├─ IMPL-002: Group 2 (dir3 + dir4, 8 docs, shared context) + └─ IMPL-003: Group 3 (remaining dirs, ≤10 docs) Level 2: IMPL-004 (README, depends on Level 1, full mode only) Level 3: IMPL-005 (ARCHITECTURE+EXAMPLES), IMPL-006 (HTTP API, optional) -Large Projects (single dir >7 docs): +Large Projects (single dir >10 docs): Step 1: Detect oversized directory - └─ src/modules/: 12 subdirs → 24 docs (exceeds limit) + └─ src/modules/: 15 subdirs → 30 docs (exceeds limit) Step 2: Split by subdirectories - Level 1: IMPL-001 to IMPL-004 (split oversized dir) - ├─ IMPL-001: src/modules/ subdirs 1-3 (6 docs) - ├─ IMPL-002: src/modules/ subdirs 4-6 (6 docs) - └─ IMPL-003: src/modules/ subdirs 7-12 (12 docs) → further split + Level 1: IMPL-001 to IMPL-003 (split oversized dir) + ├─ IMPL-001: src/modules/ subdirs 1-5 (10 docs) + ├─ IMPL-002: src/modules/ subdirs 6-10 (10 docs) + └─ IMPL-003: src/modules/ subdirs 11-15 (10 docs) ``` **Grouping Algorithm**: 1. Count total docs for each top-level directory 2. Try grouping 2 directories (optimization for context sharing) -3. If group exceeds 7 docs, split to 1 dir/task -4. If single dir exceeds 7 docs, split by subdirectories -5. Create parallel Level 1 tasks with ≤7 docs each +3. If group exceeds 10 docs, split to 1 dir/task +4. If single dir exceeds 10 docs, split by subdirectories +5. Create parallel Level 1 tasks with ≤10 docs each **Benefits**: Parallel execution, failure isolation, progress visibility, context sharing, document count control. @@ -196,11 +196,11 @@ bash(grep -r "router\.|@Get\|@Post" src/ 2>/dev/null && echo "API_FOUND" || echo 1. Count documents for each top-level directory (from folder_analysis): - Code folders: 2 docs each (API.md + README.md) - Navigation folders: 1 doc each (README.md only) -2. Apply grouping algorithm with ≤7 docs constraint: +2. Apply grouping algorithm with ≤10 docs constraint: - Try grouping 2 directories, calculate total docs - - If total ≤7 docs: create group - - If total >7 docs: split to 1 dir/group or subdivide - - If single dir >7 docs: split by subdirectories + - If total ≤10 docs: create group + - If total >10 docs: split to 1 dir/group or subdivide + - If single dir >10 docs: split by subdirectories 3. Use **Edit tool** to update `phase2-analysis.json` adding groups field: ```json "groups": {