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.
npx skills add gg-mo/repo-hygiene --skill writing-docstringsgit clone --depth 1 https://github.com/gg-mo/repo-hygieneWrote 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.
[](https://agentmods.dev/skills/gg-mo/repo-hygiene/writing-docstrings)<a href="https://agentmods.dev/skills/gg-mo/repo-hygiene/writing-docstrings"><img src="https://agentmods.dev/badge/skills/gg-mo/repo-hygiene/writing-docstrings/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/gg-mo/repo-hygiene/writing-docstrings"><img src="https://agentmods.dev/badge/skills/gg-mo/repo-hygiene/writing-docstrings.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00053 | $0.01034 |
| Opus 5 | $0.00026 | $0.00517 |
| Sonnet 5 | $0.00011 | $0.00207 |
| Haiku 4.5 | $0.00005 | $0.00103 |
Grade A, and why
writing-docstrings 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 10d 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.
How it starts
The opening of the file, as written. The whole thing — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Writing Docstrings
Overview
In a repo using repo-hygiene, docstrings on functions/classes and headers on source files are required. This OVERRIDES the default "no comments unless WHY is non-obvious" stance. The override exists because docstrings ARE the API contract — a future reader (human or agent) shouldn't have to read the body to know what to expect.
Core principle: A docstring earns its place by telling the reader something the signature does NOT tell them.
When To Use
- Writing a new function, method, or class
- Modifying a function's signature, return type, or contract
- Creating a new source file (write a header)
- Reviewing your own code before commit
What Earns a Docstring Its Place
A good docstring covers what the signature CAN'T:
- Contract — one-sentence promise, present tense
- Parameters — only those whose meaning isn't obvious from type/name
- Returns — only if non-obvious from the return type
- Raises / errors — failure modes the caller must handle
- Caveats — non-obvious behavior, side effects, performance, thread-safety
Skip anything the signature already conveys. The goal is information, not ceremony.
Before / After
❌ Restates the signature (worthless):
def parse_date(raw: str) -> datetime:
"""Parse a string and return a datetime."""
return datetime.strptime(raw, "%Y-%m-%d")
❌ Empty ceremony:
def parse_date(raw: str) -> datetime:
"""
:param raw: the raw string
:returns: the parsed datetime
"""
✅ Pins what the signature can't:
def parse_date(raw: str) -> datetime:
"""Parse a YYYY-MM-DD date. Raises ValueError on any other format."""
return datetime.strptime(raw, "%Y-%m-%d")
File Headers
Every source file gets a header explaining its role. A header that just paraphrases the filename is worse than no header.
❌ Paraphrases filename:
"""user_repository.py — the user repository."""
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.
- 10d ago First seen · 117 lines · 53 tokens per session scan A 303116aa0700
writing-docstrings is a skill published in the GitHub repository gg-mo/repo-hygiene (3 stars, last pushed 4mo ago), licensed MIT. It adds 53 tokens to every session and 1,034 once invoked, about $0.0003 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-08-31.
Other skills, from other repositories
new-skill
Scaffold a new brooks-lint analysis skill so it passes npm run validate and npm run evals on the first try — generates skills/{name}/SKILL.md (with the mandatory "Do NOT trigger for:" clause and a Process section citing guide step ranges) plus skills/{name}/{name}-guide.md (sequentially numbered steps), then appends…
brooks-sweep
Full-sweep mode: runs a unified analysis across all quality dimensions — code decay, architecture, tech debt, and test quality — then applies fixes directly to the codebase. Safe changes are auto-applied; risky changes are confirmed before execution. Drawing on twelve classic engineering books. Triggers when: user…
chief-strategy-officer
Owns where the business plays and how it wins over a multi-year horizon — portfolio choices, corporate development, strategic partnerships, and planning under uncertainty. Use this for a decision about which markets or businesses to be in, whether to build, buy, or partner, how to allocate capital across business…
chief-revenue-officer
Owns the revenue engine end to end: sales, monetization, pricing, customer success, retention, and partnerships. Use this for pricing and packaging decisions, sales strategy and coverage, forecast and pipeline health, churn and expansion, partner and channel strategy, or when marketing-sourced demand is not…
ai-ml-governance
Governs models and AI systems in production — intended use, evaluation, monitoring, human oversight, documentation, and the decision to deploy or retire. Use this before deploying a model or AI feature, when defining evaluation criteria, when a model's behavior has drifted, when assessing AI risk or regulatory…
paid-advertising
Plans, runs, and optimizes paid acquisition across search, social, and display — account structure, targeting, creative, bidding, budget, and the analysis that says whether to scale or stop. Use this to set up or restructure campaigns, write and iterate ad creative, diagnose rising costs or falling performance, decide…