|
| 1 | +# Skill: Documentation Consistency |
| 2 | + |
| 3 | +<!-- trigger: docs consistency, cross-file consistency, performance claims, time estimates | When writing or reviewing documentation | Core --> |
| 4 | + |
| 5 | +**Trigger**: When writing or reviewing documentation across multiple files (root README, docs readme, docs index, etc.) |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## When to Use |
| 10 | + |
| 11 | +This skill applies when creating or modifying documentation that appears in multiple locations or makes claims that must be consistent across the codebase. |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## When NOT to Use |
| 16 | + |
| 17 | +This skill is NOT needed for: |
| 18 | + |
| 19 | +- **Single-file documentation changes** — No cross-file consistency to maintain |
| 20 | +- **Internal code comments** — Not user-facing, no consistency requirement |
| 21 | +- **Test files or examples** — Isolated documentation, doesn't need to match other files |
| 22 | +- **CHANGELOG entries** — Already have their own format rules (see [update-documentation](./update-documentation.md)) |
| 23 | +- **XML documentation comments** — Per-member docs, not cross-file claims |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +## Key Principles |
| 28 | + |
| 29 | +### 1. Performance Claims Must Be Consistent |
| 30 | + |
| 31 | +Performance numbers MUST match across all documentation files. If a benchmark shows a range, use the same range everywhere. |
| 32 | + |
| 33 | +| ❌ Inconsistent | ✅ Consistent | |
| 34 | +| -------------------------------------------------------- | ---------------------------------------------------------- | |
| 35 | +| README says "100x faster", docs/readme says "12x faster" | All files say "10-100x faster (varies by operation)" | |
| 36 | +| One file says "up to 15x", another says "10-15x" | All files use the same phrasing: "10-15x faster" | |
| 37 | +| Vague claim without context | Specific claim with context: "~12x for method invocations" | |
| 38 | + |
| 39 | +**Best Practice**: When performance varies by scenario, document the range AND explain what affects it: |
| 40 | + |
| 41 | +```markdown |
| 42 | +<!-- ✅ GOOD: Clear, consistent, explains variance --> |
| 43 | + |
| 44 | +Cached delegates are 10-100x faster than raw `System.Reflection` |
| 45 | +(method invocations ~12x; boxed scenarios up to 100x) |
| 46 | + |
| 47 | +<!-- ❌ BAD: Inconsistent claims in different files --> |
| 48 | + |
| 49 | +File A: "100x faster than System.Reflection" |
| 50 | +File B: "up to 12x faster than System.Reflection" |
| 51 | +``` |
| 52 | + |
| 53 | +### 2. Time Estimates Use Tilde (~) Prefix |
| 54 | + |
| 55 | +All time estimates should use the tilde (~) prefix to indicate approximation. |
| 56 | + |
| 57 | +| ❌ Without tilde | ✅ With tilde | |
| 58 | +| ---------------- | ------------- | |
| 59 | +| 2 minutes | ~2 minutes | |
| 60 | +| 5 minutes | ~5 minutes | |
| 61 | +| 10 minutes | ~10 minutes | |
| 62 | +| 1 minute | ~1 minute | |
| 63 | + |
| 64 | +**Example table**: |
| 65 | + |
| 66 | +```markdown |
| 67 | +| Task | Time to Value | |
| 68 | +| ----------------------- | ------------- | |
| 69 | +| Inspector Tooling setup | ~2 minutes | |
| 70 | +| Component wiring | ~2 minutes | |
| 71 | +| Effects system | ~5 minutes | |
| 72 | +``` |
| 73 | + |
| 74 | +### 3. Avoid Run-On Sentences |
| 75 | + |
| 76 | +Don't combine multiple distinct claims in a single sentence. Break them into clear, scannable points. |
| 77 | + |
| 78 | +```markdown |
| 79 | +<!-- ❌ BAD: Run-on sentence combining multiple claims --> |
| 80 | + |
| 81 | +Random generation is 10-15x faster than Unity.Random (see benchmarks), |
| 82 | +spatial queries use O(log n) algorithms for efficient large dataset handling, |
| 83 | +and declarative inspector attributes can reduce custom editor code. |
| 84 | + |
| 85 | +<!-- ✅ GOOD: Separated into clear points --> |
| 86 | + |
| 87 | +Key performance highlights: |
| 88 | + |
| 89 | +- 10-15x faster random generation than Unity.Random (see benchmarks) |
| 90 | +- O(log n) spatial queries for efficient large dataset handling |
| 91 | +- Declarative inspector attributes to reduce custom editor code |
| 92 | +``` |
| 93 | + |
| 94 | +### 4. Eliminate Redundancy |
| 95 | + |
| 96 | +Don't repeat the same concept with different wording in the same section. |
| 97 | + |
| 98 | +```markdown |
| 99 | +<!-- ❌ BAD: Redundant statements --> |
| 100 | + |
| 101 | +### Schema Evolution |
| 102 | + |
| 103 | +Schema evolution support for backward-compatible serialization. |
| 104 | +Forward and backward compatible serialization. |
| 105 | + |
| 106 | +<!-- ✅ GOOD: Single clear statement --> |
| 107 | + |
| 108 | +### Schema Evolution |
| 109 | + |
| 110 | +Forward and backward compatible serialization — add new fields |
| 111 | +without breaking existing saves. |
| 112 | +``` |
| 113 | + |
| 114 | +### 5. Use Clear, Unambiguous Phrasing |
| 115 | + |
| 116 | +Avoid phrasing that could be misread or misunderstood. |
| 117 | + |
| 118 | +```markdown |
| 119 | +<!-- ❌ BAD: Awkward, could be misread --> |
| 120 | + |
| 121 | +Benchmarks show 10-15x faster random generation than Unity.Random |
| 122 | + |
| 123 | +<!-- ✅ GOOD: Clear comparison structure --> |
| 124 | + |
| 125 | +Benchmarks demonstrate 10-15x faster random generation compared to Unity.Random |
| 126 | +``` |
| 127 | + |
| 128 | +### 6. Dependency Claims Must Be Accurate |
| 129 | + |
| 130 | +Dependency descriptions must accurately reflect the package structure. |
| 131 | + |
| 132 | +| Scenario | Correct Description | |
| 133 | +| ---------------------------------- | ------------------------------------------------ | |
| 134 | +| Dependency is bundled with package | "Zero external dependencies — [name] is bundled" | |
| 135 | +| Dependency must be installed | "Requires [name] for [feature]" | |
| 136 | +| Optional dependency | "Optional: [name] for [feature]" | |
| 137 | + |
| 138 | +```markdown |
| 139 | +<!-- ✅ GOOD: Accurate for bundled dependency --> |
| 140 | + |
| 141 | +- ✅ **Zero external dependencies** — protobuf-net is bundled for binary serialization |
| 142 | + |
| 143 | +<!-- ❌ BAD: Confusing/contradictory --> |
| 144 | + |
| 145 | +- ✅ **Minimal external dependencies** - depends on protobuf-net for binary serialization |
| 146 | +``` |
| 147 | + |
| 148 | +--- |
| 149 | + |
| 150 | +## Cross-File Consistency Checklist |
| 151 | + |
| 152 | +When updating documentation, verify these items are consistent across ALL documentation files: |
| 153 | + |
| 154 | +### Performance Claims |
| 155 | + |
| 156 | +- [ ] Random generation speed (e.g., "10-15x faster than Unity.Random") |
| 157 | +- [ ] Reflection speedup (e.g., "10-100x faster, varies by operation") |
| 158 | +- [ ] Spatial query complexity (e.g., "O(log n)") |
| 159 | +- [ ] Test count (e.g., "8,000+ tests") |
| 160 | + |
| 161 | +### Feature Descriptions |
| 162 | + |
| 163 | +- [ ] Dependency status (zero/bundled/external) |
| 164 | +- [ ] Platform support claims (IL2CPP, WebGL, etc.) |
| 165 | +- [ ] Compatibility statements (Unity versions) |
| 166 | + |
| 167 | +### Formatting |
| 168 | + |
| 169 | +- [ ] Time estimates use tilde (~) prefix |
| 170 | +- [ ] Consistent use of bold/emphasis |
| 171 | +- [ ] Consistent bullet point style |
| 172 | + |
| 173 | +--- |
| 174 | + |
| 175 | +## Files to Cross-Reference |
| 176 | + |
| 177 | +When making documentation changes, check these files for consistency: |
| 178 | + |
| 179 | +| File | Purpose | |
| 180 | +| ----------------------------------------------------------------------- | --------------------------- | |
| 181 | +| [README](../../README.md) | Root project readme | |
| 182 | +| [docs/readme](../../docs/readme.md) | Detailed documentation | |
| 183 | +| [docs/index](../../docs/index.md) | Documentation site homepage | |
| 184 | +| [docs/overview/getting-started](../../docs/overview/getting-started.md) | Onboarding guide | |
| 185 | +| [llms.txt](../../llms.txt) | LLM-friendly summary | |
| 186 | + |
| 187 | +--- |
| 188 | + |
| 189 | +## Common Mistakes |
| 190 | + |
| 191 | +| Mistake | Impact | Fix | |
| 192 | +| -------------------------------------- | ------------------------------------ | ------------------------------------------- | |
| 193 | +| Different performance numbers in files | Undermines credibility | Use exact same numbers everywhere | |
| 194 | +| Missing tilde on time estimates | Implies false precision | Add ~ prefix to all estimates | |
| 195 | +| Run-on sentences with multiple claims | Hard to scan, reduces comprehension | Break into bullet points or short sentences | |
| 196 | +| Redundant statements | Wastes reader time, looks unpolished | Consolidate to single clear statement | |
| 197 | +| Contradictory dependency claims | Confuses users about requirements | Clarify bundled vs external status | |
| 198 | + |
| 199 | +--- |
| 200 | + |
| 201 | +## Related Skills |
| 202 | + |
| 203 | +- [update-documentation](./update-documentation.md) — When and how to update docs |
| 204 | +- [markdown-reference](./markdown-reference.md) — Markdown formatting rules |
| 205 | +- [validate-before-commit](./validate-before-commit.md) — Pre-commit validation |
0 commit comments