Coding Agent
mastra-ai/mastra
Authoring playbook for building agents that write, edit, review, or refactor code.
Generate and update language-idiomatic doc comments for TypeScript (TSDoc/JSDoc) and Rust (Rustdoc).
$ npx skills add espennilsen/pi --skill docstring-generator -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install espennilsen/pi docstring-generator --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/espennilsen/pi.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/docstring-generator .claude/skills/docstring-generator && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "docstring-generator" agent skill from https://github.com/espennilsen/pi/tree/main/skills/docstring-generator into .claude/skills/docstring-generator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "docstring-generator", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/espennilsen/pi/tree/main/skills/docstring-generatorType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add espennilsen/pi --skill docstring-generator -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install espennilsen/pi docstring-generator --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/espennilsen/pi.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/docstring-generator .agents/skills/docstring-generator && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "docstring-generator" agent skill from https://github.com/espennilsen/pi/tree/main/skills/docstring-generator into .agents/skills/docstring-generator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "docstring-generator", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add espennilsen/pi --skill docstring-generator -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install espennilsen/pi docstring-generator --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/espennilsen/pi.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/docstring-generator .cursor/skills/docstring-generator && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "docstring-generator" agent skill from https://github.com/espennilsen/pi/tree/main/skills/docstring-generator into .cursor/skills/docstring-generator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "docstring-generator", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/espennilsen/pi.git --path skills/docstring-generator--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add espennilsen/pi --skill docstring-generator -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install espennilsen/pi docstring-generator --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/espennilsen/pi.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/docstring-generator .gemini/skills/docstring-generator && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "docstring-generator" agent skill from https://github.com/espennilsen/pi/tree/main/skills/docstring-generator into .gemini/skills/docstring-generator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "docstring-generator", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install espennilsen/pi docstring-generatorInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add espennilsen/pi --skill docstring-generator -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/espennilsen/pi.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/docstring-generator .github/skills/docstring-generator && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "docstring-generator" agent skill from https://github.com/espennilsen/pi/tree/main/skills/docstring-generator into .github/skills/docstring-generator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "docstring-generator", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add espennilsen/pi --skill docstring-generator -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install espennilsen/pi docstring-generator --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/espennilsen/pi.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/docstring-generator .opencode/skills/docstring-generator && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "docstring-generator" agent skill from https://github.com/espennilsen/pi/tree/main/skills/docstring-generator into .opencode/skills/docstring-generator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "docstring-generator", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
docstring-generatorGenerate and update language-idiomatic doc comments for TypeScript (TSDoc/JSDoc) and Rust (Rustdoc).
Docstring Generator is an agent skill from espennilsen/pi. 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.
Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Development, covering Technical documentation and Refactoring. It works with Rust and TypeScript. The licence is MIT.
3 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 79d019b. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript and rust).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Docstring Generator loads about 1.6k tokens when it runs. Until then it costs about 127 tokens; SKILL.md has 690 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from espennilsen/pi at commit 79d019b, republished under its MIT licence (© espennilsen). 690 words, ~1,623 tokens.
.claude/skills/docstring-generator/SKILL.md (or your agent's skills folder).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:
pub fn (free functions and methods)pub struct and its pub fieldspub enum and its variantspub trait and its method signaturespub type and pub const itemspub mod (public modules)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.
update_all mode, preserve explicit warnings,
safety notes, panic documentation, and custom annotations.Comment style: Use /** ... */ TSDoc/JSDoc block comments immediately
before the declaration.
Functions & methods:
@param name - description for each parameter.@returns with a short description if the function returns non-void.Classes, interfaces, type aliases, enums:
Mode behavior:
update_missing: Do not rewrite existing comments unless they are obviously
placeholder (e.g., TODO, fix, FIXME, @todo).update_all: Improve unclear comments but preserve any explicit developer
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:
/// line, then details or examples as needed.# Errors section if the error conditions are
clear from the signature.`SomeType`.Scope: Only document public API by default (pub fn, pub struct,
pub enum, pub trait, pub methods on pub types).
Mode behavior:
update_missing: Only add docs to items without existing /// comments.update_all: Refine awkward wording but preserve explicit notes like
# 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> {
// ...
}selection_range is provided: Only consider declarations that start
within the selected line range. Do not modify docs for items outside the
selection.selection_range is omitted: Apply the chosen mode to the entire file,
respecting public_only.doStuff,
handle), use surrounding code and types to infer a better description, but
stay conservative.Return these three values:
| Field | Type | Description |
|---|---|---|
updated_text | string | Full file text with updated doc comments |
summary | string | 1-3 sentence summary of what was documented |
touched_symbols | string[] | Names of functions/types that had docs added or updated |
© espennilsen, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/docstring-generator of espennilsen/pi.
Open the folder on GitHubat commit 79d019b
Docstring Generator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Docstring Generator this skillespennilsen/pi | 122 | — | ~1.6k | Automated safety check: Pass | MIT | |
| Coding Agentmastra-ai/mastra | 29k | — | ~2.3k | Automated safety check: Pass | Custom licence | |
| Enforce Rules For Typescriptmoeru-ai/airi | 50k | — | ~3.4k | Automated safety check: Pass | MIT | |
| Rust Architectsergigp/yarrtube | 133 | — | ~6.1k | Automated safety check: Pass | MIT | |
| New Pattern Authoring WorkflowTotoro-jam/battle-tested-patterns | 344 | — | ~1.5k | Automated safety check: Pass | MIT | |
| Maintainability Reviewpmndrs/glyph | 393 | — | ~1.7k | Automated safety check: Pass | MIT |
mastra-ai/mastra
Authoring playbook for building agents that write, edit, review, or refactor code.
moeru-ai/airi
Enforce AIRI's TypeScript and Vue source rules for imports, naming, comments, JSDoc, fallbacks, stateful and protocol code, and module design.
sergigp/yarrtube
Architecture, naming, and testing conventions guidelines for architecting Rust codebases.
Totoro-jam/battle-tested-patterns
Step-by-step workflow for adding a new pattern to the battle-tested-patterns repo: validate the topic, verify sources, write the doc, code and exercises.
pmndrs/glyph
Audit and improve repository code milestone by milestone for correctness, clarity, local reasoning, DRY design, explicit state modeling, panic resistance, and trustworthy TypeScript boundaries.
Mathews-Tom/armory
Deep code simplification and refactoring preserving behavior across Python, Go, TypeScript, Rust.
espennilsen/pi
Interact with GitHub repos, PRs, issues, CI, and notifications via the pi-github extension commands and gh CLI.
espennilsen/pi
Create, review, and improve skills for Pi agents. An agent skill from espennilsen/pi.
espennilsen/pi
Perform a comprehensive DRY (Don't Repeat Yourself) code review on a codebase.
espennilsen/pi
Reverse-engineer a design system from a live website (public URL or localhost).
espennilsen/pi
A skill your agent uses when inspecting or operating Herdr sessions, workspaces, tabs, panes, agents, terminal output, agent messaging, or waits.
espennilsen/pi
Read and extract content from PDF files — text, tables, metadata, and images.
Works with
Categories
Generate and update language-idiomatic doc comments for TypeScript (TSDoc/JSDoc) and Rust (Rustdoc). Docstring Generator is an agent skill from espennilsen/pi. Generate and update language-idiomatic doc comments for TypeScript (TSDoc/JSDoc) and Rust (Rustdoc).
Docstring Generator fits situations like: asked to add docs; document this file; generate docstrings; working with TypeScript.
Run `npx skills add espennilsen/pi --skill docstring-generator -a claude-code`. Or copy the skill folder (skills/docstring-generator in espennilsen/pi) into .claude/skills/docstring-generator in your project. Claude Code loads it when a task matches its description.
Run `npx skills add espennilsen/pi --skill docstring-generator -a codex`. Or copy the skill folder (skills/docstring-generator in espennilsen/pi) into .agents/skills/docstring-generator in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add espennilsen/pi --skill docstring-generator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/docstring-generator, .gemini/skills/docstring-generator, .github/skills/docstring-generator and .opencode/skills/docstring-generator in your project.
SKILL.md names no scripts, command-line tools or credentials: Docstring Generator is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Docstring Generator is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.6k tokens (SKILL.md is roughly 6.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Docstring Generator: Coding Agent (mastra-ai/mastra, 29k stars), Enforce Rules For Typescript (moeru-ai/airi, 50k stars), Rust Architect (sergigp/yarrtube, 133 stars) and New Pattern Authoring Workflow (Totoro-jam/battle-tested-patterns, 344 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
espennilsen (a GitHub user) maintains it in espennilsen/pi, which has 122 GitHub stars. The repository holds 36 skills in this directory. The repository was last updated on September 21, 2026.
Source: espennilsen/pi on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.