generate-docstrings

Create docstrings for functions and classes. Use when documenting code APIs.

16 stars

Best use case

generate-docstrings is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Create docstrings for functions and classes. Use when documenting code APIs.

Teams using generate-docstrings should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/generate-docstrings/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/documentation/generate-docstrings/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/generate-docstrings/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How generate-docstrings Compares

Feature / Agentgenerate-docstringsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Create docstrings for functions and classes. Use when documenting code APIs.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Generate Docstrings

Write comprehensive docstrings for functions and classes following standard formats (Google, NumPy, reStructuredText).

## When to Use

- Adding documentation to undocumented functions
- Improving code documentation completeness
- Ensuring consistent docstring format
- Supporting API documentation generation

## Quick Reference

```python
# Google-style docstring format
def matrix_multiply(a: ExTensor, b: ExTensor) -> ExTensor:
    """Multiply two matrices using optimized Mojo kernels.

    Args:
        a: First matrix (shape: m x n)
        b: Second matrix (shape: n x k)

    Returns:
        Product matrix (shape: m x k)

    Raises:
        ValueError: If matrix dimensions don't align for multiplication

    Example:
        ```mojo
        >> a = ExTensor([[1, 2], [3, 4]], DType.float32)
        >>> b = ExTensor([[1, 0], [0, 1]], DType.float32)
        >>> c = matrix_multiply(a, b)
        ```
    """
    ...
```

## Workflow

1. **Analyze function**: Understand purpose, parameters, return value
2. **Choose format**: Select docstring style (Google is recommended)
3. **Write summary**: Clear one-line description
4. **Document parameters**: Type, description, constraints
5. **Document return**: Type and description of return value
6. **Add examples**: Practical usage examples

## Output Format

Docstring structure:

- One-line summary
- Extended description (if needed)
- Args section (parameter documentation)
- Returns section (return value documentation)
- Raises section (exceptions)
- Examples section (usage examples)

## References

- See `generate-api-docs` skill for API documentation generation
- See Google Python Style Guide for docstring conventions
- See PEP 257 for Python docstring conventions

Related Skills

readme-generate

16
from diegosouzapw/awesome-omni-skill

Generate comprehensive README files from code analysis

generate-agent-docs

16
from diegosouzapw/awesome-omni-skill

Generates documentation and usage guides for agents, skills, prompts, and instructions. Works with GitHub Copilot, Claude Code, Codex, OpenCode, and other providers. Use when onboarding team members, creating README files for your customizations, or generating usage examples for existing agents.

documentation-generation-doc-generate

16
from diegosouzapw/awesome-omni-skill

You are a documentation expert specializing in creating comprehensive, maintainable documentation from code. Generate API docs, architecture diagrams, user guides, and technical references using AI...

code-documentation-doc-generate

16
from diegosouzapw/awesome-omni-skill

You are a documentation expert specializing in creating comprehensive, maintainable documentation from code. Generate API docs, architecture diagrams, user guides, and technical references using AI...

generate-status-report

16
from diegosouzapw/awesome-omni-skill

Comprehensive system status report with services, infrastructure, performance metrics, and recommendations

generate-qr-code-natively

16
from diegosouzapw/awesome-omni-skill

Generate QR codes locally without external APIs using native CLI and runtime libraries in Bash and Node.js.

generate-knowledge-base

16
from diegosouzapw/awesome-omni-skill

Generate a product knowledge base from a codebase. Analyzes source code to create an Obsidian vault with architecture docs, API references, domain logic, data models, and infrastructure documentation. Use when the user asks to document a codebase, create a knowledge base, or generate product docs.

generate-instructions

16
from diegosouzapw/awesome-omni-skill

Analyze a directory and generate consolidated Cursor rules.

e2e-generate

16
from diegosouzapw/awesome-omni-skill

Generate end-to-end tests with Playwright browser automation

config-generate

16
from diegosouzapw/awesome-omni-skill

Generate configuration files for development tools

api-test-generate

16
from diegosouzapw/awesome-omni-skill

Auto-generate comprehensive API tests for REST and GraphQL endpoints with request/response validation

generate_quiz_batch

16
from diegosouzapw/awesome-omni-skill

Generates batches of high quality quizzes in JSON format for the BlindsidedGames pool, categorised and rated by difficulty.