documenting
Installation
SKILL.md
Documenting
Documentation Types
| Type | Audience | Content |
|---|---|---|
| README | New users | Quick start, installation, usage |
| API docs | Developers | Endpoints, parameters, responses |
| Code docs | Contributors | Architecture, patterns, decisions |
| Comments | Code readers | Why, not what |
README Structure
# Project Name
Brief description (1-2 sentences).
## Quick Start
\`\`\`bash
npm install project-name
\`\`\`
## Usage
\`\`\`typescript
import { feature } from 'project-name';
// Minimal working example
\`\`\`
## API Reference
Link to detailed docs or brief overview.
## Contributing
How to contribute, run tests, submit PRs.
## License
License type and link.
Code Comments
// Good - explains WHY
// Cache invalidated after 5 minutes to balance freshness vs API rate limits
const CACHE_TTL = 300_000;
// Bad - explains WHAT (obvious from code)
// Set cache TTL to 300000
const CACHE_TTL = 300_000;
JSDoc Format
/**
* Calculates the total price including tax.
*
* @param items - Cart items to calculate
* @param region - Tax region (affects rate)
* @returns Total price in cents
* @throws {ValidationError} If items array is empty
*
* @example
* const total = calculateTotal([{ price: 1000 }], 'EU');
* // Returns: 1210 (with 21% VAT)
*/
function calculateTotal(items: Item[], region: Region): number {
Principles
- Audience-first: Write for the reader, not yourself
- Examples over explanation: Show, don't just tell
- Keep current: Outdated docs are worse than none
- DRY: Link to existing docs, don't duplicate
- Scannable: Use headings, lists, tables
Related skills
More from mrwogu/promptscript
promptscript
>-
12committing
Creates well-structured git commits following conventional commit format. Use when committing changes, preparing commits, or when asked to commit code.
1refactoring
Improves code structure without changing behavior. Use when cleaning up code, reducing complexity, or when asked to refactor.
1pull-requesting
Creates well-structured pull requests with clear descriptions. Use when creating PRs, preparing changes for review, or when asked to open a pull request.
1code-reviewing
Reviews code for bugs, security issues, and quality improvements. Use when reviewing pull requests, checking code quality, or when asked to review changes.
1testing-code
Writes comprehensive tests following AAA pattern. Use for unit and integration tests.
1