Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/espennilsen/pi/docstring-generatornpx skills add espennilsen/pi --skill docstring-generatorgit clone --depth 1 https://github.com/espennilsen/piWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00118 | $0.01514 |
| Opus 5 | $0.00059 | $0.00757 |
| Sonnet 5 | $0.00024 | $0.00303 |
| Haiku 4.5 | $0.00012 | $0.00151 |
Grade A, and why
docstring-generator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 176 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Docstring Generator
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.
Inputs
| 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 |
Workflow
Step 1: Parse declarations
Mentally parse full_text to find all declarations relevant to the language,
public_only, and selection_range settings.
TypeScript declarations to document:
- Exported functions, async functions, and generators
- Exported classes and their public/protected methods
- Exported interfaces and type aliases
- Exported enums
- Exported const/let/var at module level (when they hold complex types)
Rust declarations to document:
pub fn(free functions and methods)pub structand itspubfieldspub enumand its variantspub traitand its method signaturespub typeandpub constitemspub mod(public modules)
Step 2: Generate doc comments
For each target declaration, follow the language-specific rules below.
Step 3: Merge into file
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.
Behavior & Style Rules
General Rules (all languages)
- Preserve everything: Do not change code semantics, identifiers, formatting, or indentation. Only touch doc comment lines.
- No speculation: If unsure about behavior, write neutral high-level descriptions instead of guessing.
- Present tense, concise: Describe what the item does, not what it is. Avoid restating obvious type information unless it aids clarity.
- Idempotent: Running the skill twice on the same file should produce the same result.
- Respect developer notes: In
update_allmode, preserve explicit warnings, safety notes, panic documentation, and custom annotations.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 176 lines · 118 tokens per session scan A 02427e549140
docstring-generator is a skill published in the GitHub repository espennilsen/pi (117 stars, last pushed 9d ago), licensed MIT. It adds 118 tokens to every session and 1,514 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
chat-pet-sprite-creation
Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…
babysit-pr
Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…
imagegen
Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…