Api doc comments

From axone-protocol/contracts · View interactive version

Api doc comments is an AI agent skill from the GitHub repository axone-protocol/contracts. Guide for writing Rust doc comments that produce accurate generated contract documentation. Use when editing Instantiate/Execute/Query/Response types or any public schema-facing API.

How to use this skill

Skill file

API Doc Comments

Core Rule

The generated documentation is only as good as the Rust doc comments on schema-facing types.

Write the comments on the source types first, then regenerate docs with the doc-generation workflow.

What must be documented

Document all schema-facing public items:

Writing Style

Prefer comments that are:

Avoid comments that are:

What good API comments should explain

Semantics

Explain what the message or field means in the protocol, not only its Rust type.

Preconditions and invariants

Document constraints such as:

Encoded representations

When the public API intentionally uses String or Binary, document the encoded format explicitly.

Examples from this repository include:

Domain examples

Use short examples when the payload format is not self-evident, especially for:

Repo-Specific Guidance

For Axone contracts, strong API comments often need to explain:

These semantics matter more than low-level implementation detail.

Recommended Comment Shapes

Top-level message types

Enum variants

Fields

Examples of useful details

Good details to include:

Weak details to avoid:

Relationship with other skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.