with one click
write-api-docs
// Write or audit public API docs for Remix packages. Use when adding or tightening JSDoc on exported functions, classes, interfaces, type aliases, or option objects.
// Write or audit public API docs for Remix packages. Use when adding or tightening JSDoc on exported functions, classes, interfaces, type aliases, or option objects.
| name | write-api-docs |
| description | Write or audit public API docs for Remix packages. Use when adding or tightening JSDoc on exported functions, classes, interfaces, type aliases, or option objects. |
Use this skill when documenting public APIs in Remix packages.
The goal is to document the API users can actually import, not every helper in src/lib.
Work from the package exports outward, add concise JSDoc to the public declarations, and make sure the result passes the repo's ESLint JSDoc rules.
src entry files that back those exports.src/lib.pnpm run lint.The source of truth is the package's package.json.
package.json exports.src/.src/*.ts entry files define the public surface by re-exporting symbols from src/lib.src/lib is public only if it is re-exported by one of those public src/*.ts entry files.Rules:
src/lib is public.src/lib.For public API, add JSDoc to:
For public interfaces:
For public object-shaped type aliases:
interface when you are introducing a new public object shapeFor overloads:
Keep comments short, factual, and user-facing.
@param / @returns docs as needed.@returns for non-void functions and include a real description.@param, include descriptions and do not add a hyphen before the description.@param default values in parenthesis at the end of the comment, do not use @default tags@example code block when it helps to show a use-case or pattern. Skip @example for simple getters, trivial constructors, or APIs whose usage is self-evident.{@link API} to link to related Remix APIs when it adds value. Don't link every related API — use discretion to avoid noise.Good:
/**
* Creates an {@link AuthProvider} for direct credentials-based authentication.
*
* @param options Parsing and verification hooks for submitted credentials.
* @returns A provider that can be passed to `createAuthLoginRequestHandler()`.
*/
export function createCredentialsAuthProvider(...) {}
Avoid:
/**
* @param {CredentialsAuthProviderOptions} options - options
* @returns {CredentialsAuthProvider}
*/
The relevant rules live in eslint.config.js.
For packages/**/*.{ts,tsx} (excluding tests), ESLint enforces JSDoc on callable declarations such as:
Important enforced details:
jsdoc/require-paramjsdoc/require-param-namejsdoc/require-param-descriptionjsdoc/require-returnsjsdoc/require-returns-descriptionjsdoc/no-typesjsdoc/check-param-namesjsdoc/check-typesjsdoc/check-alignmentPractical implication:
package.json exports instead of guessing from src/lib?src/*.ts entry file?@param and @returns where required?pnpm run lint pass?[HINT] Download the complete skill directory including SKILL.md and all related files