zebbern/claude-code-guide / skills/code-documenter
code-documenter
UnverifiedUse when adding docstrings, creating API documentation, or building documentation sites. Invoke for OpenAPI/Swagger specs, JSDoc, doc portals, tutorials, user guides.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.0 KB |
| references/api-docs-fastapi-django.md | markdown | 4.2 KB |
| references/api-docs-nestjs-express.md | markdown | 5.0 KB |
| references/coverage-reports.md | markdown | 3.2 KB |
| references/documentation-systems.md | markdown | 6.2 KB |
| references/interactive-api-docs.md | markdown | 10.1 KB |
| references/python-docstrings.md | markdown | 3.1 KB |
| references/typescript-jsdoc.md | markdown | 3.3 KB |
| references/user-guides-tutorials.md | markdown | 11.0 KB |
references/python-docstrings.md
View on GitHub# Python Docstrings
## Google Style (Recommended)
```python
def calculate_total(items: list[Item], tax_rate: float = 0.0) -> float:
"""Calculate total cost including tax.
Args:
items: List of items to calculate total for.
tax_rate: Tax rate as decimal (e.g., 0.08 for 8%).
Returns:
Total cost including tax.
Raises:
ValueError: If tax_rate is negative or items is empty.
Example:
>>> calculate_total([Item(10), Item(20)], 0.1)
33.0
"""
```
## NumPy Style
```python
def calculate_total(items: list[Item], tax_rate: float = 0.0) -> float:
"""
Calculate total cost including tax.
Parameters
----------
items : list[Item]
List of items to calculate total for.
tax_rate : float, optional
Tax rate as decimal (e.g., 0.08 for 8%). Default is 0.0.
Returns
-------
float
Total cost including tax.
Raises
------
ValueError
If tax_rate is negative or items is empty.
Examples
--------
>>> calculate_total([Item(10), Item(20)], 0.1)
33.0
"""
```
## Sphinx Style
```python
def calculate_total(items: list[Item], tax_rate: float = 0.0) -> float:
"""Calculate total cost including tax.
:param items: List of items to calculate total for.
:type items: list[Item]
:param tax_rate: Tax rate as decimal (e.g., 0.08 for 8%).
:type tax_rate: float
:returns: Total cost including tax.
:rtype: float
:raises ValueError: If tax_rate is negative or items is empty.
.. code-block:: python
>>> calculate_total([Item(10), Item(20)], 0.1)
33.0
"""
```
## Class Documentation
```python
class UserService:
"""Service for managing user operations.
This service handles CRUD operations for users and
integrates with the authentication system.
Attributes:
db: Database session for queries.
cache: Redis client for caching.
Example:
>>> service = UserService(db, cache)
>>> user = await service.create_user(data)
"""
def __init__(self, db: AsyncSession, cache: Redis) -> None:
"""Initialize UserService.
Args:
db: Database session for queries.
cache: Redis client for caching.
"""
```
## Quick Reference
| Style | Args Format | Returns Format |
| ------ | -------------------- | ----------------- |
| Google | `Args:` block | `Returns:` block |
| NumPy | `Parameters` section | `Returns` section |
| Sphinx | `:param name:` | `:returns:` |
## Sections Available
| Section | Google | NumPy | Sphinx |
| ---------- | ------------- | ------------ | ----------------- |
| Parameters | `Args:` | `Parameters` | `:param:` |
| Returns | `Returns:` | `Returns` | `:returns:` |
| Raises | `Raises:` | `Raises` | `:raises:` |
| Examples | `Example:` | `Examples` | `.. code-block::` |
| Notes | `Note:` | `Notes` | `.. note::` |
| Attributes | `Attributes:` | `Attributes` | `:ivar:` |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization. | Stars: 463k | Updated | Claude CodeCodex | Verified | Install |
| academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content. | Stars: 195k | Updated | Claude CodeCodex | Verified | Install |
| claude-apianthropics/skillsReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file). | Stars: 195k | Updated | Claude CodeCodex | Unverified | Install |
| doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks. | Stars: 195k | Updated | Claude CodeCodex | Verified | Install |