docstring-generator-skill

docstring-generator-skill is a skill for OpenCode from darellchua2/opencode-config-template. It costs 40 tokens per session (4,506 once invoked), scanned A, original, Apache-2.0.

A generator for standard documentation comments, called docstrings, in C#, Java, Python, and TypeScript. It detects the code language and existing style, then writes comments for functions, classes, methods, and other public code.

In plain words
What is it for?
Use it when adding or updating public code documentation, creating APIs, refactoring, or preparing code for review.
Why use it?
It reduces the manual work of documenting APIs and helps keep comments consistent with language conventions such as Javadoc, JSDoc, XML documentation, and PEP 257.

Skill for OpenCode

Written for OpenCode: installed under .opencode/. Also seen: mentions OpenCode.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/darellchua2/opencode-config-template/docstring-generator-skill
Any agent
npx skills add darellchua2/opencode-config-template --skill docstring-generator-skill
Clone the repo
git clone --depth 1 https://github.com/darellchua2/opencode-config-template

Made for: OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for docstring-generator-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/docstring-generator-skill.svg)](https://agentmods.dev/skills/darellchua2/opencode-config-template/docstring-generator-skill)
Your own site
<a href="https://agentmods.dev/skills/darellchua2/opencode-config-template/docstring-generator-skill"><img src="https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/docstring-generator-skill.svg" alt="Measured on agentmods" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,506 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.04506
Opus 5 $0.00020 $0.02253
Sonnet 5 $0.00008 $0.00901
Haiku 4.5 $0.00004 $0.00451

Measured 2d ago against content hash 9139478ff608, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

docstring-generator-skill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

opencode_app/.opencode/skills/docstring-generator-skill/SKILL.md · 740 lines

How it starts

The opening of the file, as written. The whole thing — 740 lines — stays where its author put it; the contents beside it link to each section on GitHub.

What I do

I generate language-specific docstrings and documentation following industry standards:

  1. Detect Language: Analyze file extension and project structure to determine language
  2. Detect Docstring Style: Identify existing docstring conventions in codebase
  3. Generate Docstrings: Create appropriate docstrings following language conventions
  4. Support Multiple Formats:
    • Python: PEP 257 (Google, NumPy, Sphinx/reST styles)
    • Java: Javadoc format with @param, @return, @throws
    • TypeScript: JSDoc/TSDoc format with @param, @returns, @throws
    • C#: XML documentation comments with , , ,
  5. Handle Various Types: Functions, methods, classes, interfaces, properties, exceptions
  6. Enforce Documentation: Ensure docstrings are added during PR workflow

When to use me

Use this workflow when:

  • Implementing new functions, classes, or methods in Python, Java, TypeScript, or C#
  • Refactoring code and updating documentation
  • Creating new APIs or public interfaces
  • Following documentation best practices and industry standards
  • Need to ensure all public code has proper docstrings
  • Preparing code for code review and maintainability

Integration: This skill integrates with pr-creation-workflow and linting-workflow to enforce docstring presence as part of quality checks.

Prerequisites

  • Source code files (.py, .java, .ts, .tsx, .cs, .csx)
  • File permissions to read and write files
  • Knowledge of preferred docstring style (optional, can auto-detect)
  • For workflow integration: Git repository initialized

Supported Languages and Standards

Python

Standard: PEP 257 compliant Supported Styles:

  • Google Style (recommended for most projects)
  • NumPy Style (for scientific computing)
  • Sphinx/reST Style (for documentation generation)

Features:

  • Type hints support (Python 3.5+)
  • Exception documentation with Raises section
  • Parameter documentation with Args section
  • Return value documentation with Returns section
  • Example code blocks in docstrings

Read the full file on GitHub · 740 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 740 lines · 40 tokens per session scan A 9139478ff608

Subscribe to this mod's changes

docstring-generator-skill is a skill published in the GitHub repository darellchua2/opencode-config-template (6 stars, last pushed 5d ago), licensed Apache-2.0. It adds 40 tokens to every session and 4,506 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

langgraph-docs

Fetches and references LangGraph Python documentation to build stateful agents, create multi-agent workflows, and implement human-in-the-loop patterns. Use when the user asks about LangGraph, graph agents, state machines, agent orchestration, LangGraph API, or needs LangGraph implementation guidance.

langchain-ai/deepagents · 62 tokens

stripe-projects

Use after E2B sandbox/API access has been provisioned through Stripe Projects and the user needs to use the resulting E2B API key with the E2B CLI, JavaScript SDK, Python SDK, or Code Interpreter SDK.

e2b-dev/E2B · 51 tokens

dd-code-generation

Use pup CLI for immediate Datadog operations or generate code for integration into applications.

DataDog/pup · 16 tokens

claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

hashgraph-online/awesome-codex-plugins · 53 tokens

gjc-sdk-author

Author trusted-local TypeScript and Python scripts that operate GJC sessions through the broker-bound CLI.

Yeachan-Heo/gajae-code · 24 tokens

adding-personhog-rpc

Guide for adding a new RPC to personhog-replica and personhog-router. Covers eligibility checks, proto definition, code generation for Python and Node.js clients, Rust implementation (storage trait, postgres queries, service handler, router wiring), and index compatibility validation. Use when adding a new gRPC…

PostHog/posthog · 88 tokens