- Reframe must_haves truths to outcome-focused (scalability, UX) - Add instruction to fix outdated slug documentation (-- to -) - Add slug verification to task verify checklist Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
7.6 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | must_haves | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 05-subagent-codebase-analysis | 02 | execute | 2 |
|
|
false |
|
Purpose: Replace the current "batches of 10 via Task tool" approach with a single subagent spawn. The orchestrator selects files (Step 9.2) then spawns gsd-entity-generator with the file list. Subagent reads files, generates entities, writes to disk. This preserves orchestrator context for large codebases.
Output: Updated commands/gsd/analyze-codebase.md
<execution_context>
@/.claude/get-shit-done/workflows/execute-plan.md
@/.claude/get-shit-done/templates/summary.md
</execution_context>
Remove: Step 9.3 "Generate entities via Task tool batching" (the batch-of-10 pattern)
Replace with: Step 9.3 "Spawn entity generator subagent"
New Step 9.3 content:
### 9.3 Spawn entity generator subagent
Spawn `gsd-entity-generator` with the selected file list.
**Pass to subagent:**
- Total file count
- Output directory: `.planning/intel/entities/`
- Slug convention: `src/lib/db.ts` -> `src-lib-db` (replace / with -, remove extension, lowercase)
- Entity template (include full template)
- List of absolute file paths (one per line)
**Task tool invocation:**
```python
Task(
prompt=f"""Generate semantic entity documentation for key codebase files.
You are a GSD entity generator. Read source files and create semantic documentation that captures PURPOSE (what/why), not just syntax.
**Parameters:**
- Files to process: {len(selected_files)}
- Output directory: .planning/intel/entities/
- Date: {today}
**Slug convention:**
- src/lib/db.ts -> src-lib-db
- Replace / with -, remove extension, lowercase
**Entity template:**
[Include full template from gsd-entity-generator.md]
**Process:**
For each file path below:
1. Read file content using Read tool
2. Analyze purpose, exports, dependencies
3. Write entity to .planning/intel/entities/{{slug}}.md
4. PostToolUse hook syncs to graph.db automatically
**Files:**
{file_list}
**Return format:**
When complete, return ONLY statistics:
## ENTITY GENERATION COMPLETE
**Files processed:** {{N}}
**Entities created:** {{M}}
**Already existed:** {{K}}
**Errors:** {{E}}
Entities written to: .planning/intel/entities/
Do NOT include entity contents in your response.
""",
subagent_type="gsd-entity-generator"
)
Wait for completion: Task() blocks until subagent finishes.
Parse result: Extract entities_created count from response for final report.
**Update Step 9.4:** Rename from "Verify entity generation" to just verify count:
```markdown
### 9.4 Verify entity generation
Confirm entities written:
```bash
ls .planning/intel/entities/*.md 2>/dev/null | wc -l
**Update Step 9.5:** Keep "Report entity statistics" but update text:
```markdown
### 9.5 Report entity statistics
Entity Generation Complete
Entity files created: [N] (from subagent response) Location: .planning/intel/entities/ Graph database: Updated automatically via PostToolUse hook
Next: Intel hooks will continue incremental updates as you code.
Update context section (line ~32) - add subagent reference:
**Execution model (Step 9 - Entity Generation):**
- Orchestrator selects files for entity generation (up to 50 based on priority)
- Spawns `gsd-entity-generator` subagent with file list (paths only, not contents)
- Subagent reads files in fresh 200k context, generates entities, writes to disk
- PostToolUse hook automatically syncs entities to graph.db
- Subagent returns statistics only (not entity contents)
- This preserves orchestrator context for large codebases (500+ files)
Fix outdated slug documentation (around line 286): The entity filename convention example is outdated. Change:
- Example: src/utils/auth.js -> src--utils--auth-js.md
To:
- Example: src/utils/auth.js -> src-utils-auth-js.md
(Single hyphen, not double hyphen. The hook gsd-intel-index.js:generateSlug already uses single hyphen format.)
Important: Do NOT pass file contents to subagent. Pass file PATHS only. Subagent reads files itself (fresh context). Read updated commands/gsd/analyze-codebase.md and confirm:
- Step 9.3 spawns gsd-entity-generator via Task tool
- No batch-of-10 pattern remains
- File paths passed, not file contents
- Context section mentions subagent delegation
- Steps 9.4-9.5 updated for new flow
- Slug example at line ~286 uses single hyphen (src-utils-auth-js.md) analyze-codebase.md Step 9 refactored. Entity generation now delegates to gsd-entity-generator subagent instead of inline Task batching. Outdated slug documentation corrected.
<success_criteria> analyze-codebase refactored to use subagent delegation. Entity generation works end-to-end on a test project, with orchestrator context preserved and entities written correctly. </success_criteria>
After completion, create `.planning/phases/05-subagent-codebase-analysis/05-02-SUMMARY.md`