pi-heartbeat
Configure periodic health checks via HEARTBEAT.md and the /heartbeat command.
Generate and update language-idiomatic doc comments for TypeScript (TSDoc/JSDoc) and Rust (Rustdoc). Use when asked to "add docs", "document this file", "generate docstrings", "add JSDoc", "add Rustdoc", "write TSDoc", or when working with TypeScript or Rust source files that
$ npx -y skills add espennilsen/pi --skill docstring-generator --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/docstring-generatorContext preview
The summary Claude sees to decide when to auto-load this skill.
Generate and update language-idiomatic doc comments for TypeScript (TSDoc/JSDoc) and Rust (Rustdoc). Use when asked to "add docs", "document this file", "generate docstrings", "add JSDoc", "add Rustdoc", "write TSDoc", or when working with TypeScript or Rust source files that
name: docstring-generator description: > Generate and update language-idiomatic doc comments for TypeScript (TSDoc/JSDoc) and Rust (Rustdoc). Use when asked to "add docs", "document this file", "generate docstrings", "add JSDoc", "add Rustdoc", "write TSDoc", or when working with TypeScript or Rust source files that need documentation comments. Supports file-level and selection-level operations. Deterministic and idempotent — safe to run repeatedly on the same code. Does NOT change behavior, rename symbols, or refactor code.
Generates or updates doc comments for TypeScript and Rust source files. The skill analyzes the public API surface (functions, methods, classes/structs, traits/interfaces, enums) and produces language-idiomatic documentation.
| Input | Type | Required | Description | |---|---|---|---| | `language` | string | yes | `"typescript"` or `"rust"` | | `file_path` | string | yes | Path of the file being edited | | `full_text` | string | yes | Entire contents of the file | | `selection_range` | object | no | `{ start_line, end_line }` (1-based, inclusive) | | `mode` | string | no | `"update_missing"` (default) or `"update_all"` | | `public_only` | boolean | no | If true (default), only document exported/public items |
Mentally parse `full_text` to find all declarations relevant to the language, `public_only`, and `selection_range` settings.
**TypeScript declarations to document:**
**Rust declarations to document:**
For each target declaration, follow the language-specific rules below.
Insert or update the doc comment immediately before the declaration, preserving all existing formatting, indentation, and code. Return the full `updated_text` with only doc comment lines changed.
formatting, or indentation. Only touch doc comment lines.
descriptions instead of guessing.
Avoid restating obvious type information unless it aids clarity.
same result.
safety notes, panic documentation, and custom annotations.
**Comment style**: Use `/** ... */` TSDoc/JSDoc block comments immediately before the declaration.
**Functions & methods:**
**Classes, interfaces, type aliases, enums:**
**Mode behavior:**
placeholder (e.g., `TODO`, `fix`, `FIXME`, `@todo`).
notes or warnings.
**Example:**
/** Loads a user by id from the primary data store.
* @param id - Unique identifier of the user.
* @returns The user if found, otherwise null.
*/
async function getUserById(id: string): Promise<User | null> {
// ...
}**Overloaded/union-heavy functions:** Describe the general behavior rather than each possible overload or union variant.
**Comment style**: Use `///` triple-slash line comments for item docs. Keep lines around 80 characters.
**Structure:**
clear from the signature.
**Scope**: Only document public API by default (`pub fn`, `pub struct`, `pub enum`, `pub trait`, pub methods on pub types).
**Mode behavior:**
`# Panics` or `# Safety`.
**Example:**
/// Calculates the checksum for the given buffer.
///
/// # Errors
///
/// Returns an error if the buffer length exceeds the supported maximum.
pub fn checksum(buf: &[u8]) -> Result<u32, ChecksumError> {
// ...
}within the selected line range. Do not modify docs for items outside the selection.
line, treat the entire declaration as in-scope.
respecting `public_only`.
`handle`), use surrounding code and types to infer a better description, but stay conservative.
meaningful description, use a neutral description like "Performs the operation for this type" rather than fabricating details.
and const
This repository is my Pi coding agent home directory. I keep it under version control and symlink it to ~/.pi/agent so Pi loads configuration, extensions, skills, and runtime state from here.
Configure periodic health checks via HEARTBEAT.md and the /heartbeat command.
Manage persistent memory across sessions. Use when asked to remember, recall, forget, or review what was stored. Covers long-term…
Track and manage projects with git status via dashboard and tool.
Delegate tasks to specialized subagents for parallel or sequential execution.
Audit, generate, update, and lint AGENTS.md files across all projects. Use when asked to check project context files, scaffold…