with one click
documentation-patterns
// Provides essential documentation standards for code, APIs, and projects including JSDoc/TSDoc, README structure, ADR format, and changelog best practices.
// Provides essential documentation standards for code, APIs, and projects including JSDoc/TSDoc, README structure, ADR format, and changelog best practices.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | documentation-patterns |
| description | Provides essential documentation standards for code, APIs, and projects including JSDoc/TSDoc, README structure, ADR format, and changelog best practices. |
Essential documentation standards for code, APIs, and projects. Covers JSDoc/TSDoc, README structure, ADR format, and changelog best practices.
Authoritative Sources:
Standard format for all functions:
/**
* Brief description (1 sentence).
*
* Longer explanation if needed (2-3 sentences).
*
* @param name - Description
* @returns What the function returns
* @throws {ErrorType} When this error occurs
*
* @example
* const result = functionName(arg);
* console.log(result); // expected output
*/
Key tags: @param, @returns, @throws, @example, @deprecated, @internal
For types/interfaces:
/**
* Brief description of what this represents.
*/
interface User {
/** Unique identifier */
id: string;
/** User's email (must be unique) */
email: string;
}
Minimal (required):
Extended:
For each endpoint:
Document in markdown or OpenAPI/Swagger. Use schema references for complex types.
Template format:
# ADR-[NUMBER]: [DECISION TITLE]
## Status
Accepted | Superseded | Deprecated
## Context
[Problem/requirements that prompted this decision]
## Options Considered
[List 2-3 alternatives with pros/cons]
## Decision
[What was decided and why]
## Consequences
[Impacts: positive and negative]
Store in: .adr/ or docs/adr/ directory. Number sequentially (ADR-001, ADR-002...).
DO:
DON'T:
// increment counter)Example:
// Exponential backoff per API throttling guidelines (RFC 6429)
// to avoid overwhelming the service after transient failures
const delay = Math.pow(2, attempt) * 1000;
File: CHANGELOG.md at project root
Sections per version:
Format:
## [VERSION] - YYYY-MM-DD
### Added
- Feature description (#123)
### Fixed
- Bug description
Semantic Versioning: MAJOR.MINOR.PATCH
Functions: JSDoc with @param, @returns, @example required if public
Complex logic: Single comment explaining "why" before block
Edge cases: Comment why handling is non-standard
Public APIs: Full TSDoc with examples