Agent skill

Google Style Code Docs

by jjmartres in jjmartres/opencode

Applies Google Style documentation to Python docstrings, Go comments and Terraform descriptions, for writing new docs or reviewing existing ones.

MITAuto-check passedDevelopment

Install Google Style Code Docs

skills CLI
$ npx skills add jjmartres/opencode --skill code-docs -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jjmartres/opencode code-docs --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jjmartres/opencode.git skills-src && mkdir -p .claude/skills && cp -r skills-src/opencode/skills/code-docs .claude/skills/code-docs && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
code-docs
GitHub stars
133
Token cost
~1.9k tokens
SKILL.md length
684 words
Files
4 (incl. references)
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Applies Google Style documentation to Python docstrings, Go comments and Terraform descriptions, for writing new docs or reviewing existing ones.

  • Works in 5 steps: Detect Language → Apply Appropriate Standard → Document Code Elements → …
  • Adding docstrings to Python modules and classes
  • SKILL.md covers When to Apply This Skill, Core Principles, Workflow and Documentation Coverage, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The agent detects the language from file extensions and keywords, reads the matching reference file for Python, Go or Terraform, and documents the appropriate elements: modules, classes and functions for Python, package, type and function comments for Go, and variable, output, resource and module descriptions for Terraform.

Five principles guide the work: clarity, completeness for all public APIs with parameters, returns and exceptions, consistency with each language's Google Style conventions, conciseness without redundancy, and usage examples for complex functionality. Before finishing, the agent checks that public APIs are documented, formatting follows the style exactly, and no obvious or redundant text remains.

In review mode, the skill points out missing documentation, suggests improvements to existing text, supplies corrected examples and explains why the documentation matters. It applies when writing new functions, classes or packages, refactoring undocumented code, or when you mention Google Style or ask to document code.

When your agent uses it

  • Adding docstrings to Python modules and classes
  • Writing Go package, type and function comments
  • Reviewing Terraform variable and output descriptions

Example prompts

  • “Add Google Style docstrings to every public function in utils/dates.py.”
  • “Document the Terraform variables and outputs in modules/network.”
  • “Review this Go package for missing or unclear comments.”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Detect Language
  2. Apply Appropriate Standard
  3. Document Code Elements
  4. Quality Checks
  5. Provide Feedback

What it can do on your machine

Read from SKILL.md and the folder at commit 28dc323. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python and go).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Google Style Code Docs loads about 1.9k tokens when it runs, and up to ~14k if it reads all its reference files. Until then it costs about 105 tokens; SKILL.md has 684 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~105
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~14k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jjmartres/opencode at commit 28dc323, republished under its MIT licence (© jjmartres). 684 words, ~1,948 tokens.

Download SKILL.mdSave it as .claude/skills/code-docs/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
code-docs
description
Apply Google Style documentation standards to Python, Go, and Terraform code. Use when writing or reviewing code that needs docstrings/comments, when asked to "document this code", "add docstrings", "follow Google Style", or when improving code documentation quality. Supports Python docstrings, Go comments, and Terraform variable/output descriptions. Enforces consistent, professional documentation standards.

Code Documentation Standards

Apply Google Style documentation standards to Python (docstrings), Go (comments), and Terraform (descriptions). Ensures consistent, professional, and comprehensive code documentation across multiple languages.

When to Apply This Skill

Use this skill when:

  • Writing new functions, classes, or packages
  • Reviewing code for documentation quality
  • User requests "document this code" or "add docstrings"
  • User mentions "Google Style" or documentation standards
  • Refactoring code that lacks proper documentation
  • Creating code examples that should be well-documented

Core Principles

  1. Clarity: Documentation should be immediately understandable
  2. Completeness: Document all public APIs, parameters, returns, exceptions
  3. Consistency: Follow language-specific Google Style conventions
  4. Conciseness: Be thorough but avoid redundancy
  5. Examples: Include usage examples for complex functionality

Workflow

1. Detect Language

Identify the programming language:

  • Python: Look for .py files, def, class keywords, type hints
  • Go: Look for .go files, func, type, package keywords
  • Terraform: Look for .tf files, resource, variable, module keywords
2. Apply Appropriate Standard

Read the corresponding reference file:

  • Python: Read references/python_google_style.md for complete docstring standards
  • Go: Read references/go_google_style.md for complete comment standards
  • Terraform: Read references/terraform_style.md for complete description standards
3. Document Code Elements

Apply documentation to all appropriate code elements:

Python:

  • Module-level docstrings
  • Class docstrings
  • Method/function docstrings
  • Important variables/constants

Go:

  • Package comments
  • Type comments
  • Function comments
  • Important constants/variables

Terraform:

  • Variable descriptions
  • Output descriptions
  • Resource comments
  • Module descriptions
4. Quality Checks

Before finalizing, verify:

  • All public APIs are documented
  • Parameters and returns are described
  • Exceptions/errors are documented
  • Examples are provided for complex functions
  • Formatting follows Google Style exactly
  • No redundant or obvious documentation
5. Provide Feedback

When reviewing code:

  • Point out missing documentation
  • Suggest improvements to existing docs
  • Provide corrected examples
  • Explain why certain documentation is important

Documentation Coverage

Python - What to Document

Always Document:

  • Public modules (module-level docstring)
  • Public classes (class docstring)
  • Public methods and functions (method docstring)
  • __init__ methods (explain parameters)

Consider Documenting:

  • Complex private functions (with leading underscore)
  • Non-obvious class attributes
  • Module-level constants

Don't Document:

  • Self-explanatory code (e.g., simple getters/setters)
  • Override methods that just call super() without changes
  • Trivial one-liner functions with obvious behavior
Go - What to Document

Always Document:

  • Package (package comment before package declaration)
  • Exported types (structs, interfaces)
  • Exported functions and methods
  • Exported constants and variables

Consider Documenting:

  • Complex unexported functions
  • Non-obvious implementation details
  • Important internal structures

Don't Document:

  • Trivial getters/setters
  • Self-explanatory code
  • Override methods without new behavior
Terraform - What to Document

Always Document:

  • All variables (description field)
  • All outputs (description field)
  • Module purpose (README.md)
  • Complex resources (inline comments)

Consider Documenting:

  • Data sources with complex filters
  • Non-obvious resource dependencies
  • Conditional resource creation logic

Don't Document:

  • Self-explanatory variable names
  • Simple pass-through outputs
  • Standard resource configurations
Show full SKILL.md (255 more words)Show less

Special Cases

Python Type Hints

When using type hints, docstrings can be more concise:

python
def add(a: int, b: int) -> int:
    """Add two integers.

    Args:
        a: First integer.
        b: Second integer.

    Returns:
        The sum of a and b.
    """
    return a + b

Type information is already in the signature, so Args and Returns can be brief.

Go Error Returns

Always document what errors a function can return:

go
// ReadConfig reads and parses the configuration file.
//
// Returns an error if the file cannot be read or contains invalid YAML.
func ReadConfig(path string) (*Config, error) {
    // implementation
}
Complex Algorithms

For complex logic, add inline comments AND comprehensive function documentation:

python
def dijkstra(graph: Graph, start: Node) -> dict[Node, float]:
    """Find shortest paths using Dijkstra's algorithm.

    Implements Dijkstra's single-source shortest path algorithm
    using a priority queue for O((V + E) log V) complexity.

    Args:
        graph: Weighted graph with non-negative edge weights.
        start: Starting node for path calculations.

    Returns:
        Dictionary mapping each node to its shortest distance from start.
        Unreachable nodes are not included in the result.

    Raises:
        ValueError: If graph contains negative edge weights.

    Example:
        >>> graph = Graph()
        >>> graph.add_edge("A", "B", 4)
        >>> graph.add_edge("A", "C", 2)
        >>> distances = dijkstra(graph, "A")
        >>> distances["B"]
        4
    """
    # Implementation with inline comments for complex parts

Output Format

When adding documentation to code:

  1. Present the documented code with proper formatting
  2. Explain what was added if the changes are significant
  3. Highlight any decisions made about what to document or not document

Avoid

  • Generic or placeholder documentation ("This function does stuff")
  • Redundant documentation that just repeats the code ("This adds a and b")
  • Over-documentation of obvious code
  • Inconsistent formatting within the same file
  • Missing critical information (parameters, exceptions, edge cases)
  • Documentation that becomes outdated as code changes
references/terraform_style.md

Complete Terraform documentation standard with:

  • Variable description format
  • Output description format
  • Module documentation structure
  • Inline comments for complex resources
  • Examples for common patterns
  • terraform-docs integration

Resources

references/python_google_style.md

Complete Python docstring standard with:

  • Module, class, and function docstring formats
  • Args, Returns, Raises, Yields sections
  • Type hint integration
  • Examples for common patterns
  • Edge cases and best practices
references/go_google_style.md

Complete Go comment standard with:

  • Package comment format
  • Function and method comment format
  • Type comment format
  • Documentation for errors
  • Examples for common patterns
  • godoc integration notes

Quality Standards

All code documentation must:

  • Start with a concise one-line summary
  • Use proper grammar and punctuation
  • Follow language-specific formatting (indentation, delimiters)
  • Include examples for non-trivial public APIs
  • Document all parameters, returns, and errors/exceptions
  • Be maintained when code changes

© jjmartres, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in opencode/skills/code-docs of jjmartres/opencode.

  • SKILL.md
  • references/go_google_style.md
  • references/python_google_style.md
  • references/terraform_style.md

Open the folder on GitHubat commit 28dc323

Compare with similar skills

Google Style Code Docs next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Google Style Code Docs compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Google Style Code Docs this skilljjmartres/opencode133—~1.9kAutomated safety check: PassMIT
Clean Commentsertugrul-dmr/clean-code-skills195—~422Automated safety check: PassMIT
Kitaru Docszenml-io/kitaru300—~936Automated safety check: PassApache-2.0
Flowfile Config and Flags CatalogEdwardvaneechoud/Flowfile370—~12kAutomated safety check: NotesMIT
Genie API Service Docsqualcomm/qai-appbuilder246—~840Automated safety check: PassCustom licence
Draw.io Diagram StudioAgents365-ai/drawio-skill10k—~2.4kAutomated safety check: NotesMIT

Similar skills

  • Clean Comments

    ertugrul-dmr/clean-code-skills

    A skill your agent uses when writing, fixing, editing, or reviewing Python comments and docstrings.

    195 GitHub stars~422 tokensUpdated 5 mo ago
    DevelopmentAuto-check passed
  • Kitaru Docs

    zenml-io/kitaru

    Kitaru documentation surfaces, link rules, and accuracy rules.

    300 GitHub stars~936 tokensUpdated today
    DevelopmentAuto-check passed
  • Flowfile Config and Flags Catalog

    Edwardvaneechoud/Flowfile

    Catalog of Flowfile's environment variables and runtime flags: what each does, where the code reads it, its default, and where the docs disagree with the code.

    370 GitHub stars~12k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Genie API Service Docs

    qualcomm/qai-appbuilder

    GenieAPIService technical documentation retrieval. An agent skill from qualcomm/qai-appbuilder.

    246 GitHub stars~840 tokensUpdated today
    DevelopmentAuto-check passed
  • Draw.io Diagram Studio

    Agents365-ai/drawio-skill

    Creates and edits editable draw.io diagrams from descriptions, code, infrastructure files, SQL and API schemas, with sync, review, test and export tools.

    10k GitHub stars~2.4k tokensUpdated 5 days ago
    DevelopmentAuto-check: notes
  • Dignified Python Standards

    docling-project/docling

    Applies opinionated production Python conventions chosen by the project's Python version: modern type syntax, pathlib, explicit checks and interface guidance.

    68k GitHub stars~1.5k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from jjmartres/opencode

All 11 skills in this repo
  • Mermaid Diagrams

    jjmartres/opencode

    Helps an agent pick the right Mermaid diagram type and write the syntax for class, sequence, flow, ER, C4, state and other software diagrams.

    133 GitHub starsUsed in 6 repos~1.9k tokens
    Auto-check passed
  • Marp Slide Creator

    jjmartres/opencode

    Builds Marp slide decks in one of seven ready-made themes, using bundled templates plus syntax, image and style references to keep slides short and readable.

    133 GitHub starsUsed in 3 repos~2.2k tokens
    Auto-check passed
  • Lets an agent view, create, update and transition Jira issues in natural language, automatically choosing between the jira CLI and Atlassian MCP tools.

    133 GitHub starsUsed in 3 repos~1.7k tokens
    Auto-check passed
  • Guides use of Worktrunk (wt), a CLI that makes git worktrees as easy as branches so several AI agents can work in parallel on isolated branches.

    133 GitHub stars~1.9k tokensUpdated 5 mo ago
    Auto-check: notes
  • A skill your agent uses when writing prose humans will read—documentation, commit messages, error messages, explanations, reports, or UI text.

    133 GitHub starsUsed in 6 repos~1k tokens
    Auto-check passed
  • Asdf

    jjmartres/opencode

    A skill your agent uses whenever the user wants to install, configure, or use asdf (asdf-vm), the universal version manager.

    133 GitHub stars~2.1k tokensUpdated 5 mo ago
    Auto-check: notes

Works with

Questions about Google Style Code Docs

What does Google Style Code Docs do?

Applies Google Style documentation to Python docstrings, Go comments and Terraform descriptions, for writing new docs or reviewing existing ones. The agent detects the language from file extensions and keywords, reads the matching reference file for Python, Go or Terraform, and documents the appropriate elements: modules, classes and functions for Python, package, type and function comments for Go, and variable, output, resource and module descriptions for Terraform.

When should I use Google Style Code Docs?

Google Style Code Docs fits situations like: adding docstrings to Python modules and classes; writing Go package, type and function comments; reviewing Terraform variable and output descriptions.

How do I install Google Style Code Docs in Claude Code?

Run `npx skills add jjmartres/opencode --skill code-docs -a claude-code`. Or copy the skill folder (opencode/skills/code-docs in jjmartres/opencode) into .claude/skills/code-docs in your project. Claude Code loads it when a task matches its description.

How do I install Google Style Code Docs in Codex?

Run `npx skills add jjmartres/opencode --skill code-docs -a codex`. Or copy the skill folder (opencode/skills/code-docs in jjmartres/opencode) into .agents/skills/code-docs in your project. Codex loads it when a task matches its description.

Can I use Google Style Code Docs in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jjmartres/opencode --skill code-docs -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-docs, .gemini/skills/code-docs, .github/skills/code-docs and .opencode/skills/code-docs in your project.

What does Google Style Code Docs need to run?

SKILL.md names no scripts, command-line tools or credentials: Google Style Code Docs is instructions for the agent only.

Does Google Style Code Docs access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Google Style Code Docs safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Google Style Code Docs use?

Google Style Code Docs is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Google Style Code Docs use?

About 1.9k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 12k tokens, read only when the agent opens those files.

What are the alternatives to Google Style Code Docs?

Skills that share tags, products or a category with Google Style Code Docs: Clean Comments (ertugrul-dmr/clean-code-skills, 195 stars), Kitaru Docs (zenml-io/kitaru, 300 stars), Flowfile Config and Flags Catalog (Edwardvaneechoud/Flowfile, 370 stars) and Genie API Service Docs (qualcomm/qai-appbuilder, 246 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Google Style Code Docs?

jjmartres (a GitHub user) maintains it in jjmartres/opencode, which has 133 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on April 20, 2026.

Source: jjmartres/opencode on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.