hermes

Document a public API

Writes reference docs for a module's exported functions, classes or endpoints in the native doc-comment format, covering real behaviour, errors and edge cases. Use before a release.

context

API reference is read by someone about to call the code. They need what the signature cannot say: what each parameter means and which values are valid, what comes back in each case, what can fail and how, and what the call changes besides its return value. Restating the type signature in prose wastes their time; describing the behaviour the author intended instead of the behaviour the code has misleads them.

task

Document the public API of as docs.

  1. Find the public surface: exported symbols, __all__, pub items, capitalised Go identifiers, public classes and methods, or routes in the router or OpenAPI spec. Skip private and internal helpers.
  2. For each symbol, read its implementation, its callers and its tests before writing. Check the existing doc comments for conventions.
  3. Document, for each symbol:
  • a one-line summary that says what it does, starting with a verb;
  • each parameter: meaning, valid range or format, units, default and what happens with null, empty or out-of-range values;
  • the return value in each case, including empty results;
  • errors, exceptions or error codes, and the condition for each;
  • side effects (I/O, mutation of arguments, global state, network, caching), concurrency or async behaviour, and notable cost;
  • a short example taken or adapted from the tests, when the usage is not obvious.
  1. Use the native format for the language: TSDoc or JSDoc, Python docstrings in the style the project already uses (Google, NumPy or reST), rustdoc, Go doc comments, Javadoc or KDoc, XML docs for C#, or OpenAPI descriptions for HTTP endpoints. For reference, write one Markdown page grouped by module with the same content.
constraints
  • Describe what the code does, not what the name suggests. If they differ, or the behaviour looks like a bug, document the actual behaviour and list it under "Behaviour worth reviewing". Do not change the code.
  • Never invent parameters, defaults, error types or examples. If behaviour depends on code you cannot see, say so in "Questions for the author".
  • Do not repeat information the type system already states (do not write "@param name - the name, a string").
  • Edit only doc comments or the reference page. No reformatting, renaming or refactoring.
  • Read the relevant code before making a claim about it. Do not guess what a file, function or config contains.
  • If the information you need is not available, say what is missing and how to get it instead of inventing it.
output format

Apply the documentation edits. Then reply with:

Changes

The symbols you documented, one line each.

Questions for the author

Behaviour you could not determine from the code, as questions.

Behaviour worth reviewing

Places where the code's behaviour looks surprising or inconsistent with its name, each with path:line. Write "None" if there are none.

1 required value still a placeholder; the assistant will ask for it.

details

kind
Prompt: a task you run by name to get one finished thing back
domain
Software engineering
category
Documentation
level
Intermediate
made for
Software engineer, Open-source maintainer, Technical writer
needs
repo-read, file-write
risk
edits-files
version
v1.0.0 · experimental
reviewed
2026-10-02
works in
Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md

Edit on GitHubReport a problem

use in

Hodios CLI
npx @hermes-hq/hodios install document-public-api --target claude-code
Agent Skills
npx skills add hermes-hq/hodios-dist --skill document-public-api -a claude-code
Add the Hodios marketplace (once)
claude plugin marketplace add hermes-hq/hodios-dist
Install the software-engineering plugin
claude plugin install hodios-software-engineering@hodios

The plugin brings every entry in this domain at once.

pairs well with

All of Documentation
PersonaDocumentation

Technical writer

Writes and edits developer documentation that is accurate to the code, task-oriented and easy to scan. Use as the voice for READMEs, API references, guides and changelogs.

technical-writer
PromptDocumentation

Write a changelog entry

Turns the commits and pull requests in a release range into a user-facing changelog entry in Keep a Changelog format, with breaking changes first. Use when cutting a release.

write-changelog
PromptDocumentation

Write a migration guide

Writes an upgrade guide for a breaking release that lists each breaking change with how to find affected code, before-and-after examples and a way to verify. Use when shipping a major version.

write-migration-guide
PromptDocumentation

Write a README

Writes or improves a project README from what the code actually does, with an install and quick start that work when copied. Use for a new project or a README that has drifted.

write-readme
PromptDocumentation

Audit a documentation set

Audits documentation for accuracy against the code, gaps in the user journey, stale pages, duplication and findability, and returns a prioritised fix list. Use before a docs overhaul or release.

audit-documentation
PersonaDocumentation

Open-source maintainer

Acts as an experienced open-source maintainer who protects project scope, writes welcoming but firm replies, reviews contributions and keeps releases sustainable.

open-source-maintainer