Skip to content
Back to skills

Document Public Api

ASecurity

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.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 26, 2026
ai-agentspythonrustgojavac#refactoringapidocumentation

Works with

  • api

Security analysis

A100/100

Scanned November 26, 2026

npx -y skills add hermes-hq/hodios-dist --skill document-public-api --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Document Public Api?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Document Public Api
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hermes-hq-document-public-api/badge)](https://www.skillsdirectory.com/skills/hermes-hq-document-public-api)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: document-public-api
description: 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.
license: CC0-1.0
arguments:
  - target
  - format
argument-hint: <target> [format]
disable-model-invocation: true
metadata:
  version: 1.0.1
  kind: prompt
  category: docs
  source: https://hermes-ide.com/prompts/document-public-api
  catalog: 2026.1014.1
---

# Document a public API

## Inputs

- `target` (required): The module, package, file, class or set of endpoints to document.
- `format` (optional; one of: inline, reference; default: inline): Where the docs go. inline writes doc comments in the code; reference writes a separate Markdown reference page.

Arguments fill these in order. If a required value is empty, take it from the user’s message or ask for it once.

<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.
</context>

<task>
Document the public API of $target as $format 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.
4. 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.
</task>

<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.
</constraints>

<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.
</output_format>

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.