Skip to content

Commit 3dc08c4

Browse files
committed
refactor: make map-codebase optional templates and flatten structure
- Output documents now go to .planning/ instead of .planning/codebase/ - Split 7 templates into 4 core + 3 optional - Core: STACK, ARCHITECTURE, STRUCTURE, CONVENTIONS (always generated) - Optional: TESTING, INTEGRATIONS, CONCERNS (generate as applicable) - Updated Process steps to ask which optional templates to generate - Clarify when to use each optional template - Reduce unnecessary documentation overhead for simple projects - Update Success Criteria to reflect optional documents
1 parent 96ac4c1 commit 3dc08c4

File tree

1 file changed

+58
-79
lines changed

1 file changed

+58
-79
lines changed

skills/map-codebase/SKILL.md

Lines changed: 58 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,19 @@ allowed-tools:
1313

1414
## Reference Files
1515

16-
Detailed workflow guidance and document templates:
16+
**Workflow & Process:**
17+
- [workflow.md](workflow.md) — Detailed orchestration and guidance
1718

18-
- [workflow.md](workflow.md) — Detailed workflow guidance and orchestration patterns
19-
- [templates/stack.md](templates/stack.md) — STACK.md template
20-
- [templates/architecture.md](templates/architecture.md) — ARCHITECTURE.md template
21-
- [templates/structure.md](templates/structure.md) — STRUCTURE.md template
22-
- [templates/conventions.md](templates/conventions.md) — CONVENTIONS.md template
23-
- [templates/testing.md](templates/testing.md) — TESTING.md template
24-
- [templates/integrations.md](templates/integrations.md) — INTEGRATIONS.md template
25-
- [templates/concerns.md](templates/concerns.md) — CONCERNS.md template
19+
**Core Templates** (always use):
20+
- [templates/stack.md](templates/stack.md) — STACK.md
21+
- [templates/architecture.md](templates/architecture.md) — ARCHITECTURE.md
22+
- [templates/structure.md](templates/structure.md) — STRUCTURE.md
23+
- [templates/conventions.md](templates/conventions.md) — CONVENTIONS.md
24+
25+
**Optional Templates** (use as applicable):
26+
- [templates/testing.md](templates/testing.md) — TESTING.md (if tests exist)
27+
- [templates/integrations.md](templates/integrations.md) — INTEGRATIONS.md (if external services)
28+
- [templates/concerns.md](templates/concerns.md) — CONCERNS.md (if complex project)
2629

2730
---
2831

@@ -32,17 +35,20 @@ Analyzes existing codebases using parallel Explore agents to produce structured
3235

3336
## Objective
3437

35-
This skill spawns multiple Explore agents to analyze different aspects of the codebase in parallel, each with fresh context. The result is 7 structured documents that provide a comprehensive map of the codebase state.
38+
Spawns multiple Explore agents to analyze different aspects of the codebase in parallel, each with fresh context. Results are structured documents in `.planning/` that provide a comprehensive map of the codebase state.
3639

37-
**Output:** `.planning/codebase/` folder with:
40+
**Core Output** (always generated):
3841

3942
- `STACK.md` — Languages, frameworks, key dependencies
4043
- `ARCHITECTURE.md` — System design, patterns, data flow
4144
- `STRUCTURE.md` — Directory layout, module organization
4245
- `CONVENTIONS.md` — Code style, naming, patterns
43-
- `TESTING.md` — Test structure, coverage, practices
44-
- `INTEGRATIONS.md` — APIs, databases, external services
45-
- `CONCERNS.md` — Technical debt, risks, issues
46+
47+
**Optional Output** (generate as applicable):
48+
49+
- `TESTING.md` — Test structure, coverage, practices (if tests exist)
50+
- `INTEGRATIONS.md` — APIs, databases, external services (if external dependencies exist)
51+
- `CONCERNS.md` — Technical debt, risks, issues (for complex/brownfield projects)
4652

4753
## When to Use
4854

@@ -61,24 +67,27 @@ This skill spawns multiple Explore agents to analyze different aspects of the co
6167

6268
## Process
6369

64-
### Step 1: Check Existing Documentation
70+
### Step 1: Check Existing Documents
6571

66-
Check if `.planning/codebase/` already exists:
72+
Check if codebase documents already exist in `.planning/`:
6773

6874
- If yes: Offer to refresh (overwrite) or skip
6975
- If no: Proceed with creation
7076

71-
### Step 2: Load Project Context
77+
### Step 2: Determine Template Set
7278

73-
Check for `.planning/STATE.md` to load existing project context if available. This helps agents understand project-specific terminology and patterns.
79+
Ask user which optional templates to generate (or use defaults):
7480

75-
### Step 3: Process Focus Area Argument
81+
- **Always**: STACK.md, ARCHITECTURE.md, STRUCTURE.md, CONVENTIONS.md
82+
- **Optional**: TESTING.md (if tests exist), INTEGRATIONS.md (if external services), CONCERNS.md (if complex project)
7683

77-
If user provided a focus area (e.g., "api" or "auth"), instruct agents to pay special attention to that subsystem while still providing holistic analysis.
84+
### Step 3: Load Project Context
7885

79-
### Step 4: Create Directory Structure
86+
Check for `.planning/STATE.md` to load existing project context if available. Helps agents understand project-specific terminology and patterns.
8087

81-
Create `.planning/codebase/` directory if it doesn't exist.
88+
### Step 4: Process Focus Area Argument
89+
90+
If user provided a focus area (e.g., "api" or "auth"), instruct agents to pay special attention to that subsystem while still providing holistic analysis.
8291

8392
### Step 5: Spawn Parallel Explore Agents
8493

@@ -104,72 +113,42 @@ Launch 4 Explore agents in parallel, each with "very thorough" exploration level
104113
- Focus: Issues, risks, technical debt, potential improvements
105114
- Outputs: Data for CONCERNS.md
106115

107-
### Step 6: Collect Agent Findings
108-
109-
Wait for all 4 agents to complete. Collect and organize their findings by document type.
110-
111-
### Step 7: Write Structured Documents
112-
113-
Using the collected findings, write 7 markdown documents following the template structure:
114-
115-
1. **STACK.md**
116-
- Programming languages and versions
117-
- Frameworks and libraries
118-
- Build tools and package managers
119-
- Key dependencies and their purposes
120-
121-
2. **ARCHITECTURE.md**
122-
- System design overview
123-
- Architectural patterns used
124-
- Component relationships
125-
- Data flow and processing
126-
127-
3. **STRUCTURE.md**
128-
- Top-level directory layout
129-
- Module organization
130-
- File naming patterns
131-
- Code organization principles
132-
133-
4. **CONVENTIONS.md**
134-
- Code style guidelines
135-
- Naming conventions
136-
- Common patterns and idioms
137-
- Documentation practices
138-
139-
5. **TESTING.md**
140-
- Test framework(s) used
141-
- Test structure and organization
142-
- Coverage approach
143-
- Testing best practices
144-
145-
6. **INTEGRATIONS.md**
146-
- External APIs and services
147-
- Database systems
148-
- Third-party integrations
149-
- Configuration management
150-
151-
7. **CONCERNS.md**
152-
- Technical debt items
153-
- Known issues and limitations
154-
- Security concerns
155-
- Performance bottlenecks
156-
- Recommendations for improvement
116+
### Step 5: Collect Agent Findings
117+
118+
Wait for all agents to complete. Collect and organize findings by document type.
119+
120+
### Step 6: Write Core Documents
121+
122+
Write 4 core markdown documents in `.planning/`:
123+
124+
**STACK.md**: Languages, versions, frameworks, build tools, key dependencies
125+
**ARCHITECTURE.md**: System design, patterns, component relationships, data flow
126+
**STRUCTURE.md**: Directory layout, modules, naming patterns, organization
127+
**CONVENTIONS.md**: Code style, naming conventions, patterns, documentation
128+
129+
### Step 7: Write Optional Documents (if selected)
130+
131+
Generate only selected optional documents:
132+
133+
**TESTING.md** (if applicable): Test frameworks, structure, coverage, practices
134+
**INTEGRATIONS.md** (if applicable): External APIs, databases, third-party services, config
135+
**CONCERNS.md** (if applicable): Tech debt, issues, security, performance, improvements
157136

158137
### Step 8: Provide Next Steps
159138

160-
Inform user that codebase mapping is complete and suggest next steps:
139+
Inform user codebase mapping is complete:
161140

162-
- Review the generated documents in `.planning/codebase/`
163-
- Use findings to inform refactoring or development plans
164-
- Update `STATE.md` if needed with new insights
141+
- Review generated documents in `.planning/`
142+
- Use findings to inform refactoring or development
143+
- Update `STATE.md` with new insights if needed
165144

166145
## Success Criteria
167146

168-
- [ ] `.planning/codebase/` directory created
169-
- [ ] All 7 codebase documents written with substantive content
147+
- [ ] 4 core documents created in `.planning/` (STACK, ARCHITECTURE, STRUCTURE, CONVENTIONS)
148+
- [ ] Optional documents created based on user selection
149+
- [ ] All documents have substantive, actionable content
170150
- [ ] Documents follow template structure
171151
- [ ] Parallel agents completed without errors
172-
- [ ] Findings are comprehensive and actionable
173152
- [ ] User informed of completion and next steps
174153

175154
## Integration Notes

0 commit comments

Comments
 (0)