jjmartres/code-docs
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.
npx skills add https://github.com/jjmartres/opencode --skill code-docs
Apply Google Style documentation standards to Python (docstrings), Go (comments), and Terraform (descriptions). Ensures consistent, professional, and comprehensive code documentation across multiple languages.
Use this skill when:
Identify the programming language:
.py files, def, class keywords, type hints.go files, func, type, package keywords.tf files, resource, variable, module keywordsRead the corresponding reference file:
references/python_google_style.md for complete docstring standardsreferences/go_google_style.md for complete comment standardsreferences/terraform_style.md for complete description standardsApply documentation to all appropriate code elements:
Python:
Go:
Terraform:
Before finalizing, verify:
When reviewing code:
Always Document:
__init__ methods (explain parameters)Consider Documenting:
Don't Document:
Always Document:
Consider Documenting:
Don't Document:
Always Document:
Consider Documenting:
Don't Document:
When using type hints, docstrings can be more concise:
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.
Always document what errors a function can return:
// 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
}
For complex logic, add inline comments AND comprehensive function documentation:
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
When adding documentation to code:
Complete Terraform documentation standard with:
Complete Python docstring standard with:
Complete Go comment standard with:
All code documentation must:
Take jjmartres/code-docs from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.