Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

code-documenter

БесплатноБез исполняемых скриптовНе проверен

Generate comprehensive documentation for undocumented or poorly documented codebases. Use when a user asks to document code, add JSDoc/docstrings, create…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

Code Documenter

Overview

Analyzes source code to generate accurate, context-aware documentation at multiple levels: inline comments for complex logic, function/class docstrings, module-level overviews, architecture documents, and onboarding guides. Understands control flow, data transformations, side effects, and cross-module dependencies.

Instructions

When asked to document code:

  1. Determine the documentation level needed:

    • Inline: Function/method docstrings, JSDoc, Python docstrings, Go doc comments
    • Module: README or header comment explaining the module's purpose and exports
    • Architecture: High-level document showing how modules interact, data flows, key design decisions
    • Onboarding: Getting-started guide for new team members
  2. For function/method documentation, extract:

    • Purpose: What does this function do? (one sentence)
    • Parameters: name, type, description, default values, constraints
    • Return value: type, description, possible values
    • Side effects: database writes, API calls, file I/O, state mutations, cache invalidation
    • Exceptions/errors: what can go wrong, when, and what error types
    • Example usage: realistic call with realistic data
  3. For complex logic, add inline comments explaining:

    • WHY, not WHAT — explain the reasoning, not the obvious operation
    • Business rules embedded in conditionals
    • Performance-critical sections and why they're written a certain way
    • Workarounds with links to issues/bugs if available in git history
    • Non-obvious algorithm choices
  4. For architecture documentation:

    • Map module dependencies (imports/requires graph)
    • Identify entry points (API handlers, CLI commands, event listeners)
    • Trace key data flows through the system (e.g., "user signup" flow)
    • Document configuration and environment variables
    • List external service dependencies (databases, APIs, queues)
    • Note design patterns used (repository pattern, event sourcing, CQRS, etc.)
  5. Language-specific format:

    • JavaScript: JSDoc with @param {type}, @returns, @throws, @example
    • TypeScript: TSDoc (/** */ with @param name - text, @returns, @throws, @example); leave types out, the signature already has them
    • Python: follow the project's existing docstring style (Google, NumPy or Sphinx); if none, Google-style with Args, Returns, Raises. Keep type hints in the signature (PEP 484)
    • Go: a comment directly above each exported name that starts with that name ("Parse reads ..."); one package comment per package
    • Java: Javadoc with @param, @return, @throws
    • Rust: /// for items and //! for modules; sections # Examples, # Errors, # Panics, # Safety (for unsafe); examples run as doctests with cargo test
  6. Verify: run the project's doc tooling after writing (for example cargo test --doc or cargo doc, go vet ./..., python -m doctest -v module.py, npx tsc --noEmit) so examples and syntax are checked, not assumed. Keep documentation in the existing style of the repository.

  7. Quality rules:

    • Never state the obvious ("Increments counter by 1")
    • Document the contract, not the implementation (what, not how — unless the how is surprising)
    • Use realistic example values taken from the domain (real-looking IDs, amounts, names)
    • Describe only what the code does today; if behavior is unclear, say so rather than guess
    • Flag functions that are too complex and suggest refactoring before documenting
    • Note when documentation reveals a likely bug (e.g., unhandled null case)

Examples

Example 1: Document a Python function

Input:

def process_payment(user_id, amount, currency, idempotency_key=None):
    user = db.users.find(user_id)
    if not user:
        raise ValueError("User not found")
    if user.balance < amount and not user.credit_enabled:
        return {"status": "declined", "reason": "insufficient_funds"}
    intent = stripe_client.v1.payment_intents.create(
        params={
            "amount": int(amount * 100),
            "currency": currency,
            "customer": user.stripe_id,
            "payment_method": user.default_payment_method,
            "confirm": True,
            "off_session": True,
        },
        options={"idempotency_key": idempotency_key},
    )
    db.transactions.insert({
        "user_id": user_id, "amount": amount,
        "payment_intent_id": intent.id, "created_at": datetime.now(timezone.utc)
    })
    if user.balance < amount:
        user.balance = user.balance - amount
        db.users.update(user)
    return {"status": "success", "payment_intent_id": intent.id}

Output:

def process_payment(user_id, amount, currency, idempotency_key=None):
    """Process a payment by charging the user's saved Stripe payment method.

    Validates the user's balance (unless credit is enabled), creates and confirms
    a Stripe PaymentIntent,
Полный SKILL.md на GitHub

Установить code-documenter в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл code-documenter?

Generate comprehensive documentation for undocumented or poorly documented codebases. Use when a user asks to document code, add JSDoc/docstrings, create README files, generate architecture docs, explain what a codebase does, produce onboarding guides, or document internal APIs. Works with any language.

Как установить скилл code-documenter?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл code-documenter запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить code-documenter с