$npx -y skills add huangjia2019/claude-code-engineering --skill doc-writingGenerate API documentation from a route manifest. Use when you have a list of discovered routes and need to produce markdown documentation.
| 1 | # Doc Writing Skill |
| 2 | |
| 3 | Generate structured API documentation from a route manifest. |
| 4 | |
| 5 | ## Input |
| 6 | |
| 7 | You will receive a route manifest (JSON array) from the previous pipeline stage. |
| 8 | Each entry contains: method, path, file, line, middleware, type. |
| 9 | |
| 10 | ## Process |
| 11 | |
| 12 | ### Step 1: Read Source Code |
| 13 | |
| 14 | For each route in the manifest, read the source file to understand: |
| 15 | - Request parameters (path, query, body) |
| 16 | - Response format |
| 17 | - Error handling |
| 18 | - Business logic summary |
| 19 | |
| 20 | ### Step 2: Generate Documentation |
| 21 | |
| 22 | Use the template at `templates/endpoint-doc.md` for each route group. |
| 23 | |
| 24 | Group routes by their source file (e.g., all product routes together). |
| 25 | |
| 26 | ### Step 3: Write Files |
| 27 | |
| 28 | Write one markdown file per route group to the `docs/` directory: |
| 29 | - `docs/products-api.md` |
| 30 | - `docs/categories-api.md` |
| 31 | - etc. |
| 32 | |
| 33 | ## Output |
| 34 | |
| 35 | Return a manifest of generated documentation files: |
| 36 | |
| 37 | ```json |
| 38 | { |
| 39 | "files_generated": ["docs/products-api.md", "docs/categories-api.md"], |
| 40 | "routes_documented": 8, |
| 41 | "routes_skipped": [], |
| 42 | "warnings": [] |
| 43 | } |
| 44 | ``` |
| 45 | |
| 46 | This manifest will be consumed by the next pipeline stage (quality-checking). |