$npx -y skills add One-Man-Company/Skills-ContextManager --skill documentation-templatesDocumentation templates and structure guidelines. README, API docs, code comments, and AI-friendly documentation.
| 1 | # Documentation Templates |
| 2 | |
| 3 | > Templates and structure guidelines for common documentation types. |
| 4 | |
| 5 | --- |
| 6 | |
| 7 | ## 1. README Structure |
| 8 | |
| 9 | ### Essential Sections (Priority Order) |
| 10 | |
| 11 | | Section | Purpose | |
| 12 | |---------|---------| |
| 13 | | **Title + One-liner** | What is this? | |
| 14 | | **Quick Start** | Running in <5 min | |
| 15 | | **Features** | What can I do? | |
| 16 | | **Configuration** | How to customize | |
| 17 | | **API Reference** | Link to detailed docs | |
| 18 | | **Contributing** | How to help | |
| 19 | | **License** | Legal | |
| 20 | |
| 21 | ### README Template |
| 22 | |
| 23 | ```markdown |
| 24 | # Project Name |
| 25 | |
| 26 | Brief one-line description. |
| 27 | |
| 28 | ## Quick Start |
| 29 | |
| 30 | [Minimum steps to run] |
| 31 | |
| 32 | ## Features |
| 33 | |
| 34 | - Feature 1 |
| 35 | - Feature 2 |
| 36 | |
| 37 | ## Configuration |
| 38 | |
| 39 | | Variable | Description | Default | |
| 40 | |----------|-------------|---------| |
| 41 | | PORT | Server port | 3000 | |
| 42 | |
| 43 | ## Documentation |
| 44 | |
| 45 | - [API Reference](./docs/api.md) |
| 46 | - [Architecture](./docs/architecture.md) |
| 47 | |
| 48 | ## License |
| 49 | |
| 50 | MIT |
| 51 | ``` |
| 52 | |
| 53 | --- |
| 54 | |
| 55 | ## 2. API Documentation Structure |
| 56 | |
| 57 | ### Per-Endpoint Template |
| 58 | |
| 59 | ```markdown |
| 60 | ## GET /users/:id |
| 61 | |
| 62 | Get a user by ID. |
| 63 | |
| 64 | **Parameters:** |
| 65 | | Name | Type | Required | Description | |
| 66 | |------|------|----------|-------------| |
| 67 | | id | string | Yes | User ID | |
| 68 | |
| 69 | **Response:** |
| 70 | - 200: User object |
| 71 | - 404: User not found |
| 72 | |
| 73 | **Example:** |
| 74 | [Request and response example] |
| 75 | ``` |
| 76 | |
| 77 | --- |
| 78 | |
| 79 | ## 3. Code Comment Guidelines |
| 80 | |
| 81 | ### JSDoc/TSDoc Template |
| 82 | |
| 83 | ```typescript |
| 84 | /** |
| 85 | * Brief description of what the function does. |
| 86 | * |
| 87 | * @param paramName - Description of parameter |
| 88 | * @returns Description of return value |
| 89 | * @throws ErrorType - When this error occurs |
| 90 | * |
| 91 | * @example |
| 92 | * const result = functionName(input); |
| 93 | */ |
| 94 | ``` |
| 95 | |
| 96 | ### When to Comment |
| 97 | |
| 98 | | ✅ Comment | ❌ Don't Comment | |
| 99 | |-----------|-----------------| |
| 100 | | Why (business logic) | What (obvious) | |
| 101 | | Complex algorithms | Every line | |
| 102 | | Non-obvious behavior | Self-explanatory code | |
| 103 | | API contracts | Implementation details | |
| 104 | |
| 105 | --- |
| 106 | |
| 107 | ## 4. Changelog Template (Keep a Changelog) |
| 108 | |
| 109 | ```markdown |
| 110 | # Changelog |
| 111 | |
| 112 | ## [Unreleased] |
| 113 | ### Added |
| 114 | - New feature |
| 115 | |
| 116 | ## [1.0.0] - 2025-01-01 |
| 117 | ### Added |
| 118 | - Initial release |
| 119 | ### Changed |
| 120 | - Updated dependency |
| 121 | ### Fixed |
| 122 | - Bug fix |
| 123 | ``` |
| 124 | |
| 125 | --- |
| 126 | |
| 127 | ## 5. Architecture Decision Record (ADR) |
| 128 | |
| 129 | ```markdown |
| 130 | # ADR-001: [Title] |
| 131 | |
| 132 | ## Status |
| 133 | Accepted / Deprecated / Superseded |
| 134 | |
| 135 | ## Context |
| 136 | Why are we making this decision? |
| 137 | |
| 138 | ## Decision |
| 139 | What did we decide? |
| 140 | |
| 141 | ## Consequences |
| 142 | What are the trade-offs? |
| 143 | ``` |
| 144 | |
| 145 | --- |
| 146 | |
| 147 | ## 6. AI-Friendly Documentation (2025) |
| 148 | |
| 149 | ### llms.txt Template |
| 150 | |
| 151 | For AI crawlers and agents: |
| 152 | |
| 153 | ```markdown |
| 154 | # Project Name |
| 155 | > One-line objective. |
| 156 | |
| 157 | ## Core Files |
| 158 | - [src/index.ts]: Main entry |
| 159 | - [src/api/]: API routes |
| 160 | - [docs/]: Documentation |
| 161 | |
| 162 | ## Key Concepts |
| 163 | - Concept 1: Brief explanation |
| 164 | - Concept 2: Brief explanation |
| 165 | ``` |
| 166 | |
| 167 | ### MCP-Ready Documentation |
| 168 | |
| 169 | For RAG indexing: |
| 170 | - Clear H1-H3 hierarchy |
| 171 | - JSON/YAML examples for data structures |
| 172 | - Mermaid diagrams for flows |
| 173 | - Self-contained sections |
| 174 | |
| 175 | --- |
| 176 | |
| 177 | ## 7. Structure Principles |
| 178 | |
| 179 | | Principle | Why | |
| 180 | |-----------|-----| |
| 181 | | **Scannable** | Headers, lists, tables | |
| 182 | | **Examples first** | Show, don't just tell | |
| 183 | | **Progressive detail** | Simple → Complex | |
| 184 | | **Up to date** | Outdated = misleading | |
| 185 | |
| 186 | --- |
| 187 | |
| 188 | > **Remember:** Templates are starting points. Adapt to your project's needs. |