Documentation Preparation Skill (Automated Workflow - Step 1)
Overview
This skill prepares complete documentation requirements for automated generation. It:
- Discovers all sources - Core sources + related files (tests, types, examples)
- Defines document structure - Based on doc type and project templates
- Builds content map - What to document from where
- Saves requirements file - Complete specification for write-docs skill
When to use this skill:
- User says "문서 준비해줘" or "prepare documentation"
- Starting automated documentation workflow
- User wants hands-off doc generation after initial setup
⚠️ IMPORTANT - Automated Workflow:
- Interactive setup - Steps 1-3 ask user questions to define scope
- Automated discovery - Step 4 automatically finds related sources and builds content map
- Saves requirements to file - Always outputs
docs/doc-requirements.md
Workflow: 5-Step Preparation Process
Step 1: Collect Source Links
Questions to ask:
"어떤 소스를 분석할까요?" (What sources should I analyze?)
- GitHub repositories (URLs or local paths)
- Web pages (documentation sites, blog posts)
- Local files (code files, markdown docs, PDFs)
- Google Drive documents (check for MCP server)
- Notion pages (check for MCP server)
"중점적으로 분석할 키워드나 토픽이 있나요?" (Any specific keywords or topics to focus on?)
Step 2: Select Document Type
Ask: "어떤 문서를 만들까요?" (What type of documentation should I create?)
Options:
API Reference
- Audience: Developers integrating with the code
- Focus: Functions, classes, parameters, return values, examples
- Structure: Organized by module/class/function
System Overview
- Audience: Engineers understanding architecture
- Focus: Components, data flow, design principles, communication patterns
- Structure: Top-down from high-level to implementation details
Tutorial
- Audience: Users learning how to use the system
- Focus: Step-by-step instructions, practical examples, common pitfalls
- Structure: Sequential steps with verification checkpoints
Custom
- User specifies their own document type and purpose
Step 3: Define Document Structure
Based on document type selected in Step 2, present default sections and ask user to customize.
Workflow:
Show default sections for selected document type (see below)
Ask user: "기본 구조에서 제외할 항목이 있나요?" (Any sections to remove from default structure?)
- User can specify sections to exclude
- Example: "Performance Characteristics 제외"
Ask user: "추가로 포함할 항목이 있나요?" (Any additional sections to include?)
- User can add custom sections
- Examples: Migration Guide, Troubleshooting, FAQ, Benchmarks, Comparison with Alternatives
Confirm final structure - Show final section list before proceeding to Step 4
Note: If user mentions a project template, use that instead of default structure.
Default sections by document type:
For API Reference:
For System Overview:
For Tutorial:
Note: Order sections logically (general → specific) in final structure.
Step 4: Content Discovery and Source Expansion
Purpose: Start from core sources and actively discover all related sources needed for comprehensive documentation.
Workflow:
Analyze core sources (from Step 1)
- Identify documentable items: functions, types, classes, concepts
- Note primary information available
For each item, discover related sources:
For Functions/Methods:
- ✅ Test files (usage examples, edge cases)
- ✅ Type definitions (parameter types, return types)
- ✅ Related functions (callers, callees)
- ✅ Documentation comments (inline docs)
- ✅ Error handling (related error types)
For Types/Classes:
- ✅ Constructors and factory functions
- ✅ Methods and properties
- ✅ Usage examples in tests
- ✅ Related types (inheritance, composition)
- ✅ Serialization/deserialization code
For Concepts/Modules:
- ✅ Design documents (docs/, wiki, ADRs)
- ✅ README files
- ✅ Example code (examples/, demos/)
- ✅ Related modules (imports, dependencies)
Build content map:
## Content Map
### Function: parse()
**Primary source:** src/parser.rs:45-60
**Related sources found:**
- tests/parser_test.rs:100-150 (usage examples, edge cases)
- src/types.rs:10-25 (Token type definition)
- docs/design.md:30-45 (recursive descent explanation)
- examples/basic_usage.rs:20-35 (real-world example)
**Coverage:** ✅ Complete (signature, behavior, examples, design rationale)
### Type: Token
**Primary source:** src/types.rs:10-25
**Related sources found:**
- src/lexer.rs:80-120 (Token creation)
- tests/token_test.rs:50-80 (all variants tested)
**Coverage:** ✅ Complete (definition, creation, usage)
### Concept: Error Recovery
**Primary source:** src/parser.rs:300-350
**Related sources found:**
- (none found in tests/)
- (no design docs found)
**Coverage:** ⚠️ Partial (implementation exists, no design rationale or examples)
Example Workflow:
User provides: src/parser.rs
Claude discovers:
1. Functions: parse(), tokenize(), validate()
2. For parse():
→ Search tests/ for "parse" → Found tests/parser_test.rs
→ Check imports in test file → Found src/types.rs (Token definition)
→ Search docs/ for "parse" → Found docs/design.md
→ Check examples/ → Found examples/basic_usage.rs
3. For Token type:
→ Search for "Token" in codebase → Found src/lexer.rs (creation)
→ Found tests/token_test.rs (all variants)
4. For validate():
→ Search tests/ for "validate" → Found tests/validator_test.rs
...
Result: Comprehensive source list discovered automatically
⚠️ Trust all sources - Don't judge quality or note contradictions. If contradictions exist, write-docs will handle them during generation.
Step 5: Save Requirements File
Always save to: docs/doc-requirements.md
File contains:
- Document type and target audience
- All discovered sources (core + related)
- Document structure with sections
- Content map (what to document from where)
File format:
# Documentation Requirements
**Created**: 2025-10-22
**Document Type**: API Reference
**Target Audience**: Developers integrating the parser
## Discovered Sources
### Core Sources (user-provided):
- src/parser.rs
### Related Sources (discovered):
- tests/parser_test.rs (usage examples)
- src/types.rs (type definitions)
- docs/design.md (design rationale)
- examples/basic_usage.rs (real-world usage)
- src/lexer.rs (related functionality)
- tests/token_test.rs (type examples)
Total: 7 sources
## Document Structure
- [ ] Introduction
- [ ] Core Concepts
- [ ] Functions (parse, tokenize, validate)
- [ ] Types (Token, AST, ParseError)
- [ ] Usage Patterns
- [ ] Limitations
## Content Map
### Function: parse()
**Primary source:** src/parser.rs:45-60
**Related sources:**
- tests/parser_test.rs:100-150 (usage examples)
- src/types.rs:10-25 (Token type)
- docs/design.md:30-45 (design rationale)
### Type: Token
**Primary source:** src/types.rs:10-25
**Related sources:**
- src/lexer.rs:80-120 (construction)
- tests/token_test.rs:50-80 (examples)
After saving, confirm to user:
"문서 요구사항을 docs/doc-requirements.md에 저장했습니다. 'write-docs 실행해줘'를 입력하면 자동으로 문서를 생성합니다."
Tips for Effective Preparation
- Ask before assuming - If user's intent is unclear during initial setup, ask clarifying questions
- Suggest recommendations - "parser 모듈이니까 API Reference가 적합해 보입니다"
- Document discovery thoroughly - Build comprehensive content map showing all discovered sources for each documentable item
Conclusion
After completing this preparation workflow, you should have:
✅ All sources discovered (core + related)
✅ Document type and structure defined
✅ Content map showing what to document from where
✅ Requirements file saved to docs/doc-requirements.md
1---2name: prepare-docs3description: Use when user requests automated documentation preparation. Triggers include: - Korean: "문서 준비해줘", "문서화 준비", "문서 요구사항 작성", "자동 문서화 준비" - English: "prepare documentation", "setup doc requirements", "prepare for automated docs" - Context: User wants to prepare all requirements for automated documentation generation This skill discovers sources, defines structure, and saves complete requirements to file for use with write-docs skill (automated generation).4---5
6# Documentation Preparation Skill (Automated Workflow - Step 1)
7
8## Overview
9
10This skill prepares complete documentation requirements for automated generation. It:
11
121. **Discovers all sources** - Core sources + related files (tests, types, examples)
132. **Defines document structure** - Based on doc type and project templates
143. **Builds content map** - What to document from where
154. **Saves requirements file** - Complete specification for write-docs skill
16
17**When to use this skill:**
18- User says "문서 준비해줘" or "prepare documentation"
19- Starting automated documentation workflow
20- User wants hands-off doc generation after initial setup
21
22**⚠️ IMPORTANT - Automated Workflow:**
23- **Interactive setup** - Steps 1-3 ask user questions to define scope
24- **Automated discovery** - Step 4 automatically finds related sources and builds content map
25- **Saves requirements to file** - Always outputs `docs/doc-requirements.md`
26
27---
28
29## Workflow: 5-Step Preparation Process
30
31### Step 1: Collect Source Links
32
33**Questions to ask:**
34
351. "어떤 소스를 분석할까요?" (What sources should I analyze?)
36 - GitHub repositories (URLs or local paths)
37 - Web pages (documentation sites, blog posts)
38 - Local files (code files, markdown docs, PDFs)
39 - Google Drive documents (check for MCP server)
40 - Notion pages (check for MCP server)
41
422. "중점적으로 분석할 키워드나 토픽이 있나요?" (Any specific keywords or topics to focus on?)
43
44---
45
46### Step 2: Select Document Type
47
48Ask: "어떤 문서를 만들까요?" (What type of documentation should I create?)
49
50**Options:**
51
521. **API Reference**
53 - Audience: Developers integrating with the code
54 - Focus: Functions, classes, parameters, return values, examples
55 - Structure: Organized by module/class/function
56
572. **System Overview**
58 - Audience: Engineers understanding architecture
59 - Focus: Components, data flow, design principles, communication patterns
60 - Structure: Top-down from high-level to implementation details
61
623. **Tutorial**
63 - Audience: Users learning how to use the system
64 - Focus: Step-by-step instructions, practical examples, common pitfalls
65 - Structure: Sequential steps with verification checkpoints
66
674. **Custom**
68 - User specifies their own document type and purpose
69
70---
71
72### Step 3: Define Document Structure
73
74Based on document type selected in Step 2, **present default sections and ask user to customize**.
75
76**Workflow:**
77
781. **Show default sections** for selected document type (see below)
79
802. **Ask user**: "기본 구조에서 제외할 항목이 있나요?" (Any sections to remove from default structure?)
81 - User can specify sections to exclude
82 - Example: "Performance Characteristics 제외"
83
843. **Ask user**: "추가로 포함할 항목이 있나요?" (Any additional sections to include?)
85 - User can add custom sections
86 - Examples: Migration Guide, Troubleshooting, FAQ, Benchmarks, Comparison with Alternatives
87
884. **Confirm final structure** - Show final section list before proceeding to Step 4
89
90**Note**: If user mentions a project template, use that instead of default structure.
91
92---
93
94**Default sections by document type:**
95
96**For API Reference:**
97- [ ] Overview (purpose of this module/API)
98- [ ] Core Concepts (key abstractions)
99- [ ] Functions (organized by category)
100- [ ] Types (data structures)
101- [ ] Constants
102- [ ] Usage Patterns
103- [ ] Limitations
104- [ ] Related APIs
105
106**For System Overview:**
107- [ ] Introduction (purpose, use cases)
108- [ ] Architecture (high-level design)
109- [ ] Components (individual parts + responsibilities)
110- [ ] Data Flow (how information moves)
111- [ ] State Management
112- [ ] Communication Patterns
113- [ ] Configuration
114- [ ] Error Handling
115- [ ] Performance Characteristics
116
117**For Tutorial:**
118- [ ] Introduction (what you'll learn, time estimate)
119- [ ] Prerequisites (required knowledge, tools)
120- [ ] Step 1, 2, 3... (sequential instructions)
121- [ ] Testing Your Implementation
122- [ ] Common Pitfalls
123- [ ] Next Steps
124
125**Note**: Order sections logically (general → specific) in final structure.
126
127---
128
129### Step 4: Content Discovery and Source Expansion
130
131**Purpose:** Start from core sources and actively discover all related sources needed for comprehensive documentation.
132
133**Workflow:**
134
1351. **Analyze core sources** (from Step 1)
136 - Identify documentable items: functions, types, classes, concepts
137 - Note primary information available
138
1392. **For each item, discover related sources**:
140
141 **For Functions/Methods:**
142 - ✅ Test files (usage examples, edge cases)
143 - ✅ Type definitions (parameter types, return types)
144 - ✅ Related functions (callers, callees)
145 - ✅ Documentation comments (inline docs)
146 - ✅ Error handling (related error types)
147
148 **For Types/Classes:**
149 - ✅ Constructors and factory functions
150 - ✅ Methods and properties
151 - ✅ Usage examples in tests
152 - ✅ Related types (inheritance, composition)
153 - ✅ Serialization/deserialization code
154
155 **For Concepts/Modules:**
156 - ✅ Design documents (docs/, wiki, ADRs)
157 - ✅ README files
158 - ✅ Example code (examples/, demos/)
159 - ✅ Related modules (imports, dependencies)
160
1613. **Build content map**:
162
163 ```
164 ## Content Map
165
166 ### Function: parse()
167 **Primary source:** src/parser.rs:45-60
168 **Related sources found:**
169 - tests/parser_test.rs:100-150 (usage examples, edge cases)
170 - src/types.rs:10-25 (Token type definition)
171 - docs/design.md:30-45 (recursive descent explanation)
172 - examples/basic_usage.rs:20-35 (real-world example)
173
174 **Coverage:** ✅ Complete (signature, behavior, examples, design rationale)
175
176 ### Type: Token
177 **Primary source:** src/types.rs:10-25
178 **Related sources found:**
179 - src/lexer.rs:80-120 (Token creation)
180 - tests/token_test.rs:50-80 (all variants tested)
181
182 **Coverage:** ✅ Complete (definition, creation, usage)
183
184 ### Concept: Error Recovery
185 **Primary source:** src/parser.rs:300-350
186 **Related sources found:**
187 - (none found in tests/)
188 - (no design docs found)
189
190 **Coverage:** ⚠️ Partial (implementation exists, no design rationale or examples)
191 ```
192
193**Example Workflow:**
194
195```
196User provides: src/parser.rs
197
198Claude discovers:
1991. Functions: parse(), tokenize(), validate()
2002. For parse():
201 → Search tests/ for "parse" → Found tests/parser_test.rs
202 → Check imports in test file → Found src/types.rs (Token definition)
203 → Search docs/ for "parse" → Found docs/design.md
204 → Check examples/ → Found examples/basic_usage.rs
2053. For Token type:
206 → Search for "Token" in codebase → Found src/lexer.rs (creation)
207 → Found tests/token_test.rs (all variants)
2084. For validate():
209 → Search tests/ for "validate" → Found tests/validator_test.rs
210 ...
211
212Result: Comprehensive source list discovered automatically
213```
214
215**⚠️ Trust all sources** - Don't judge quality or note contradictions. If contradictions exist, write-docs will handle them during generation.
216
217---
218
219### Step 5: Save Requirements File
220
221**Always save to:** `docs/doc-requirements.md`
222
223**File contains:**
224- Document type and target audience
225- All discovered sources (core + related)
226- Document structure with sections
227- Content map (what to document from where)
228
229**File format:**
230```markdown
231# Documentation Requirements
232
233**Created**: 2025-10-22
234**Document Type**: API Reference
235**Target Audience**: Developers integrating the parser
236
237## Discovered Sources
238
239### Core Sources (user-provided):
240- src/parser.rs
241
242### Related Sources (discovered):
243- tests/parser_test.rs (usage examples)
244- src/types.rs (type definitions)
245- docs/design.md (design rationale)
246- examples/basic_usage.rs (real-world usage)
247- src/lexer.rs (related functionality)
248- tests/token_test.rs (type examples)
249
250Total: 7 sources
251
252## Document Structure
253
254- [ ] Introduction
255- [ ] Core Concepts
256- [ ] Functions (parse, tokenize, validate)
257- [ ] Types (Token, AST, ParseError)
258- [ ] Usage Patterns
259- [ ] Limitations
260
261## Content Map
262
263### Function: parse()
264**Primary source:** src/parser.rs:45-60
265**Related sources:**
266- tests/parser_test.rs:100-150 (usage examples)
267- src/types.rs:10-25 (Token type)
268- docs/design.md:30-45 (design rationale)
269
270### Type: Token
271**Primary source:** src/types.rs:10-25
272**Related sources:**
273- src/lexer.rs:80-120 (construction)
274- tests/token_test.rs:50-80 (examples)
275
276```
277
278After saving, confirm to user:
279> "문서 요구사항을 docs/doc-requirements.md에 저장했습니다. 'write-docs 실행해줘'를 입력하면 자동으로 문서를 생성합니다."
280
281---
282
283## Tips for Effective Preparation
284
2851. **Ask before assuming** - If user's intent is unclear during initial setup, ask clarifying questions
2862. **Suggest recommendations** - "parser 모듈이니까 API Reference가 적합해 보입니다"
2873. **Document discovery thoroughly** - Build comprehensive content map showing all discovered sources for each documentable item
288
289---
290
291## Conclusion
292
293After completing this preparation workflow, you should have:
294
295✅ All sources discovered (core + related)
296✅ Document type and structure defined
297✅ Content map showing what to document from where
298✅ Requirements file saved to `docs/doc-requirements.md`
299