|
1 | 1 | --- |
2 | 2 | description: 'Guidelines for writing accurate, well-structured documentation' |
3 | | -globs: ['**/docs/**/*.md', '**/README.md', '**/*.mdc'] |
| 3 | +globs: ['**/docs/**/*.md', '**/README.md'] |
4 | 4 | alwaysApply: false |
5 | 5 | --- |
6 | 6 |
|
7 | 7 | # Documentation Writing Rules |
8 | 8 |
|
9 | | -## Core Principle: Source Code First |
| 9 | +## Source Code First |
10 | 10 |
|
11 | | -**NEVER use guesswork or assumptions when writing documentation.** |
| 11 | +**Never write documentation based on assumptions or guesswork.** |
12 | 12 |
|
13 | | -### Mandatory Process |
| 13 | +Always read and understand the actual source code before writing documentation: |
14 | 14 |
|
15 | | -1. **Read the Source Code**: Always read and understand the actual implementation before writing any documentation |
16 | | -2. **Verify Examples**: All code examples must be based on real, working code from the codebase |
17 | | -3. **Check API Usage**: Verify method signatures, parameter types, and return values from the actual source |
18 | | -4. **Test Assumptions**: If unsure about any behavior, examine the code rather than guessing |
19 | | - |
20 | | -### What to Read |
21 | | - |
22 | | -- **Main API functions**: Understand how they work internally |
23 | | -- **Type definitions**: Get accurate parameter and return types |
24 | | -- **Example files**: Use patterns from existing examples in the codebase |
25 | | -- **Plugin implementations**: Understand actual plugin architecture |
26 | | -- **Test files**: See real usage patterns and edge cases |
27 | | - |
28 | | -### Prohibited Practices |
29 | | - |
30 | | -- ❌ Writing documentation based on common framework patterns |
31 | | -- ❌ Assuming API behavior without checking source code |
32 | | -- ❌ Copying examples from similar frameworks |
33 | | -- ❌ Guessing method signatures or parameter types |
34 | | -- ❌ Making up configuration options that don't exist |
35 | | - |
36 | | -### Required Practices |
37 | | - |
38 | | -- ✅ Read the actual source code before writing |
39 | | -- ✅ Base all examples on real code from the repository |
40 | | -- ✅ Verify all API calls against the implementation |
41 | | -- ✅ Check type definitions for accuracy |
42 | | -- ✅ Test examples against the actual codebase |
43 | | - |
44 | | -### When in Doubt |
45 | | - |
46 | | -- Read more source code |
47 | | -- Look for existing examples in the codebase |
| 15 | +- Read main API functions, type definitions, and existing examples |
| 16 | +- Verify all code examples work with the actual implementation |
| 17 | +- Base method signatures and behaviors on real source code |
48 | 18 | - Check test files for usage patterns |
49 | | -- Never guess - always verify |
50 | | - |
51 | | -## Writing Style Guidelines |
52 | 19 |
|
53 | | -### Clear Structure Over Bold Text |
| 20 | +Never guess API behavior, copy from other frameworks, or make up configuration options. |
54 | 21 |
|
55 | | -**Write documents that convey importance through structure, not formatting.** |
| 22 | +## Writing Style |
56 | 23 |
|
57 | | -### Mandatory Practices |
| 24 | +### Structure Over Formatting |
58 | 25 |
|
59 | | -- ✅ Use heading hierarchy (h1, h2, h3) to show importance and organization |
60 | | -- ✅ Write complete, flowing sentences instead of bullet-pointed fragments |
61 | | -- ✅ Let content organization and natural language convey emphasis |
62 | | -- ✅ Use section structure to guide readers through logical progression |
| 26 | +Use clear heading hierarchy and natural prose instead of bold text for emphasis: |
63 | 27 |
|
64 | | -### Prohibited Practices |
| 28 | +- ✅ Descriptive subheadings and logical organization |
| 29 | +- ✅ Complete sentences that flow naturally |
| 30 | +- ❌ Bold text for emphasis (except critical warnings) |
65 | 31 |
|
66 | | -- ❌ Using bold text (**text**) to emphasize importance |
67 | | -- ❌ Relying on formatting instead of clear writing to convey meaning |
68 | | -- ❌ Creating bullet lists where prose would be more natural |
69 | | -- ❌ Bold text in navigation links and call-to-action elements |
| 32 | +### Simple and Direct |
70 | 33 |
|
71 | | -### Writing Approach |
| 34 | +- Start with the simplest working example |
| 35 | +- Focus on essential value proposition |
| 36 | +- Let code examples do the explaining |
| 37 | +- Keep explanatory text concise |
72 | 38 |
|
73 | | -- Use descriptive subheadings instead of bold keywords |
74 | | -- Write cohesive paragraphs that flow naturally |
75 | | -- Let the information hierarchy speak for itself |
76 | | -- Make important points clear through placement and context, not bold formatting |
| 39 | +### Honest Tone |
77 | 40 |
|
78 | | -### Exception |
79 | | - |
80 | | -Bold text may be used sparingly for: |
81 | | - |
82 | | -- ✅ True emphasis within technical explanations (very rare) |
83 | | -- ✅ Highlighting critical warnings or errors |
| 41 | +- State capabilities factually without overselling |
| 42 | +- Avoid negative comparisons with other frameworks |
| 43 | +- Never fabricate testimonials or quotes |
| 44 | +- Be positive but realistic about limitations |
84 | 45 |
|
85 | 46 | ## Remember |
86 | 47 |
|
87 | | -Documentation that contains incorrect information is worse than no documentation at all. Accuracy is paramount. |
88 | | - |
89 | | -Quality documentation guides readers through natural flow and clear structure, not visual emphasis. |
| 48 | +Inaccurate documentation is worse than no documentation. Always verify against source code. |
0 commit comments