본문으로 건너뛰기
cccskills
무료GitHub에 공개

docstring-generator

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md6.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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

InputTypeRequiredDescription
languagestringyes"typescript" or "rust"
file_pathstringyesPath of the file being edited
full_textstringyesEntire contents of the file
selection_rangeobjectno{ start_line, end_line } (1-based, inclusive)
modestringno"update_missing" (default) or "update_all"
public_onlybooleannoIf 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 struct and its pub fields
  • pub enum and its variants
  • pub trait and its method signatures
  • pub type and pub const items
  • pub 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_all mode, preserve explicit warnings, safety notes, panic documentation, and custom annotations.

TypeScript Rules

Comment style: Use /** ... */ TSDoc/JSDoc block comments immediately before the declaration.

Functions & methods:

  • First line: one-sentence summary of what the function does.
  • Then @param name - description for each parameter.
  • Then @returns with a short description if the function returns non-void.

Classes, interfaces, type aliases, enums:

  • Summarize the purpose and role of the type.
  • Prefer describing intent over implementation details.

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.

Rust Rules

Comment style: Use /// triple-slash line comments for item docs. Keep lines around 80 characters.

Structure:

  • First line: brief summary sentence.
  • Blank /// line, then details or examples as needed.
  • For fallible functions, add a # Errors section if the error conditions are clear from the signature.
  • Refer to types with backticks: `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 Behavior

  • If selection_range is provided: Only consider declarations that start within the selected line range. Do not modify docs for items outside the selection.
  • If a declaration spans multiple lines and the selection includes its start line, treat the entire declaration as in-scope.
  • If selection_range is omitted: Apply the chosen mode to the entire file, respecting public_only.

Edge Cases

  • Generic names: If a symbol name is extremely generic (e.g., doStuff, handle), use surrounding code and types to infer a better description, but stay conservative.
  • Insufficient context: If there isn't enough information to write a meaningful description, use a neutral description like "Performs the operation for this type" rather than fabricating details.
  • Rust generics: Do not over-specify type parameters. Describe the concept and constraints at a high level.
  • Selection mid-declaration: If the selection start line falls inside a multi-line declaration, still treat the entire declaration as in scope.

Output

Return these three values:

FieldTypeDescription
updated_textstringFull file text with updated doc comments
summarystring1-3 sentence summary of what was documented
touched_symbolsstring[]Names of functions/types that had docs added or updated

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Audit, generate, update, and lint AGENTS.md files across all projects. Use when asked to check project context files, scaffold AGENTS.md for new projects, update stale ones, or run a cross-project audit.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

espennilsen/pi1222026년 10월 12일 업데이트

blog-post

무료

Draft, edit, and publish blog posts for e9n.dev. Use when creating new posts, editing drafts, or refining existing content. Handles Eleventy frontmatter, Tailwind formatting, and Espen's authentic voice.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

espennilsen/pi1222026년 10월 12일 업데이트

Generate a full operational status report for the Aivena bot. Checks all subsystems: extensions, webserver, Telegram, chat bridge, heartbeat, cron, database, memory, CRM, calendar, task management, jobs/telemetry, and storage. **Triggers — use this skill when:** - User asks for "status", "bot status", "system status", "operational status" - User asks "is everything running?", "how's Aivena doing?" - User says "health check", "diagnostics", "systems check" - User asks "what's the state of the bot?"

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

espennilsen/pi1222026년 10월 12일 업데이트

Parse git history and produce or update a CHANGELOG.md following the Keep a Changelog convention. Supports Conventional Commits, basic prefix conventions, and unstructured commit messages. Intelligently categorizes changes, detects breaking changes, links to PRs/issues, and handles both initial generation and incremental updates. **Triggers — use this skill when:** - User asks to "generate", "create", "update", or "write" a changelog - User mentions "CHANGELOG", "changelog", "release notes" - User says "document changes", "what changed since last release" - User wants to "prepare a release" and needs a changelog entry - User asks to "clean up" or "reformat" an existing changelog **Covers:** Any git-based project. Handles Conventional Commits (feat/fix/chore), Angular convention, basic prefixes (Add/Fix/Remove), and freeform commit messages. Outputs Keep a Changelog format with optional Common Changelog enhancements.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

espennilsen/pi1222026년 10월 12일 업데이트

cmux

무료

Orchestrate cmux terminal panes — split terminals, run parallel processes, read output from other panes, and use the built-in browser. Use when working inside cmux and you need to run a dev server, watch tests, spawn sub-agents, or preview web pages.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

espennilsen/pi1222026년 10월 12일 업데이트

Review code for quality, security, performance, and maintainability. Use when reviewing PRs, auditing a codebase, or refactoring. Covers TypeScript, Node.js, infrastructure-as-code, and full-stack web apps.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

espennilsen/pi1222026년 10월 12일 업데이트

espennilsen의 스킬 모두 보기

이 스킬의 문제 신고