Well-placed documentation saves time for every future reader — including future task agents. Poorly placed documentation is noise. This skill guides you to the right balance.
Code explains what it does. Comments explain why it does it. Delete comments that restate the code.
typescript
// Bad: restates the code// Add 1 to countcount += 1;// Good: explains non-obvious intent// Increment before the request so duplicate submissions during the await are rejectedcount += 1;await submitForm();
Every exported function, class, type, and constant in a shared package should have a JSDoc comment:
typescript
/** * Formats a monetary value for display with the tenant's configured currency. * * @param amount - Value in cents (integer) * @param currency - ISO 4217 currency code (e.g., "USD") * @returns Localized string, e.g. "$1,234.56" * @throws {RangeError} if amount is negative */export function formatCurrency(amount: number, currency: string): string { ... }
Required tags for exported functions: @param, @returns. Add @throws if the function can throw. Add @deprecated with a migration note when retiring a symbol.
Doc & Comment Hygiene
Well-placed documentation saves time for every future reader — including future task agents. Poorly placed documentation is noise. This skill guides you to the right balance.
The Rule: Comment Why, Not What
Code explains what it does. Comments explain why it does it. Delete comments that restate the code.
JSDoc for Exported Symbols
Every exported function, class, type, and constant in a shared package should have a JSDoc comment:
Required tags for exported functions:
@param,@returns. Add@throwsif the function can throw. Add@deprecatedwith a migration note when retiring a symbol.What Needs a Comment
What Does NOT Need a Comment
const isLoading = true)useState,useEffectwith obvious deps)README Health
Every package in
packages/and every artifact inartifacts/should have aREADME.mdwith:.env.exampleAudit Process
docs(<scope>): <description>.