一键导入
ts-docblocks
Add missing JSDoc docblocks to exported symbols in TypeScript projects. Use when writing new exports or when code is missing documentation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add missing JSDoc docblocks to exported symbols in TypeScript projects. Use when writing new exports or when code is missing documentation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate a changeset file with a changelog entry for package releases. Use when a PR introduces user-facing changes that should trigger a version bump.
Shipping workflow using standard Git and GitHub CLI. Provides guidance for committing, branching, and creating PRs.
Shipping workflow using Graphite CLI. Provides guidance for committing, branching, and creating PRs with Graphite's single-commit-per-branch model.
Guidelines for writing developer-friendly READMEs for TypeScript libraries. Use when creating a new package, changing a public API, or updating documentation.
| name | ts-docblocks |
| description | Add missing JSDoc docblocks to exported symbols in TypeScript projects. Use when writing new exports or when code is missing documentation. |
| argument-hint | [path] [--all] |
Scan the specified path (or entire repository if no path given) and add missing docblocks to all exported functions, classes, interfaces, types, and constants.
/**, use * prefix for each line, end with */ — each on its own line.@param, @typeParam, @return, @throws, and at least one @example when helpful.{@link ...} to reference related items. Add @see tags at the end for related APIs.Use JSDoc format with the following conventions:
/** on its own line.* prefix for each line.*/ on its own line.@summary tag needed).@param tags for all parameters.@typeParam tags for all type parameters. Use @typeParam, not @template.@return tag briefly describing the return value.@throws for functions that may throw errors and list these errors.@example section whenever usage examples would be helpful. If the file is a TypeScript file, use TypeScript syntax in examples. Try to make the examples realistic but concise and pleasant to read. They must illustrate the concepts clearly at first glance. When more than one example is preferred, use multiple @example tags and keep the first one as simple as possible to illustrate the basic usage. Never use any type in examples. Display the import statements required for the example to work when imports from multiple libraries are required. It is acceptable to use placeholder variable names like myUser or even /* ... */ for parts that are not relevant to the example. When multiple example sections are provided, add a brief description before each code block to quickly explain what the example illustrates.@remarks tag to add this extra information after any example sections. These remarks can include longer explanations and even additional code blocks if necessary.@deprecated tag with a brief explanation and, if applicable, suggest an alternative.{@link ...} tags to reference other items in the codebase when relevant.@see tags at the very end when applicable to point to other related items or documentation. Use @see {@link ...} format when linking to other code items./**
* Creates a retry wrapper around an async function.
*
* Retries the given function up to `maxRetries` times with exponential
* backoff between attempts.
*
* @param fn - The async function to retry.
* @param maxRetries - Maximum number of retry attempts.
* @param baseDelay - Base delay in milliseconds between retries.
* @return A wrapped version of `fn` that retries on failure.
* @throws Throws the last error if all retry attempts are exhausted.
*
* @example
* ```ts
* const fetchWithRetry = withRetry(fetchData, 3, 1000);
* const data = await fetchWithRetry('/api/users');
* ```
*
* @example
* Custom retry configuration for flaky network calls.
* ```ts
* const resilientFetch = withRetry(
* () => fetch('https://api.example.com/data'),
* 5,
* 500,
* );
* ```
*/
export function withRetry<T>(
fn: (...args: unknown[]) => Promise<T>,
maxRetries: number,
baseDelay: number,
): (...args: unknown[]) => Promise<T>;
/**
* Fixes a `Uint8Array` to the specified length.
*
* If the array is longer than the specified length, it is truncated.
* If the array is shorter than the specified length, it is padded with zeroes.
*
* @param bytes - The byte array to truncate or pad.
* @param length - The desired length of the byte array.
* @return The byte array truncated or padded to the desired length.
*
* @example
* Truncates the byte array to the desired length.
* ```ts
* const bytes = new Uint8Array([0x01, 0x02, 0x03, 0x04]);
* const fixedBytes = fixBytes(bytes, 2);
* // ^ [0x01, 0x02]
* ```
*
* @example
* Adds zeroes to the end of the byte array to reach the desired length.
* ```ts
* const bytes = new Uint8Array([0x01, 0x02]);
* const fixedBytes = fixBytes(bytes, 4);
* // ^ [0x01, 0x02, 0x00, 0x00]
* ```
*/
export const fixBytes = (
bytes: ReadonlyUint8Array | Uint8Array,
length: number,
): ReadonlyUint8Array | Uint8Array;
/**
* A tree structure representing a set of instructions with execution constraints.
*
* Supports parallel execution, sequential execution, and combinations of both
* through recursive composition of plan nodes.
*
* @example
* ```ts
* const plan: InstructionPlan = parallelPlan([
* sequentialPlan([instructionA, instructionB]),
* instructionC,
* instructionD,
* ]);
* ```
*
* @see {@link SingleInstructionPlan}
* @see {@link ParallelInstructionPlan}
* @see {@link SequentialInstructionPlan}
*/
export type InstructionPlan =
| ParallelInstructionPlan
| SequentialInstructionPlan
| SingleInstructionPlan;
When invoked as a command, follow these steps:
[path] (optional): Narrow the scan to a specific path (e.g. src/utils or packages/my-lib/src).[--all] (optional): Also scan non-exported items..ts, .tsx, .js, .jsx).export functionexport classexport interfaceexport typeexport const (for constants and arrow functions)--all is passed, also identify non-exported items.