Agent skill

API Design

by axone-protocol in axone-protocol/contracts

Best practices for designing CosmWasm smart contract APIs. An agent skill from axone-protocol/contracts.

BSD-3-ClauseAuto-check passedBackend & APIs

Install API Design

skills CLI
$ npx skills add axone-protocol/contracts --skill api-design -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install axone-protocol/contracts api-design --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/axone-protocol/contracts.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/api-design .claude/skills/api-design && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
api-design
GitHub stars
123
Token cost
~1.1k tokens
SKILL.md length
190 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

Best practices for designing CosmWasm smart contract APIs. An agent skill from axone-protocol/contracts.

  • Works in 4 steps: Minimalism - Include only what's… → Clarity - Names should be self-documenting → Consistency - Follow established… → …
  • Defining message types
  • SKILL.md covers Core Principles, Message Type Patterns, Abstract SDK Integration and Documentation Standards, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

API Design is an agent skill from axone-protocol/contracts. Best practices for designing CosmWasm smart contract APIs. Use when defining message types, designing execute/query interfaces, or optimizing API ergonomics.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering API design and Smart contracts. It works with Rust. The repository describes itself as: 📜 Smart contracts for the Axone protocol. The licence is BSD-3-Clause.

When your agent uses it

  • Defining message types
  • Designing execute/query interfaces
  • Optimizing API ergonomics

Example prompts

  • “/api-design”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Minimalism - Include only what's necessary; avoid bloated APIs
  2. Clarity - Names should be self-documenting
  3. Consistency - Follow established patterns across all contracts
  4. Documentation - Every public type and field must have doc comments

What it can do on your machine

Read from SKILL.md and the folder at commit 02724f3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are rust).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

API Design loads about 1.1k tokens when it runs. Until then it costs about 42 tokens; SKILL.md has 190 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~42
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from axone-protocol/contracts at commit 02724f3, republished under its BSD-3-Clause licence (© axone-protocol). 190 words, ~1,094 tokens.

Download SKILL.mdSave it as .claude/skills/api-design/SKILL.md (or your agent's skills folder).
name
api-design
description
Best practices for designing CosmWasm smart contract APIs. Use when defining message types, designing execute/query interfaces, or optimizing API ergonomics.
license
BSD-3-Clause
metadata.author
axone.xyz
metadata.version
1.0

CosmWasm API Design Best Practices

Core Principles

  1. Minimalism - Include only what's necessary; avoid bloated APIs
  2. Clarity - Names should be self-documenting
  3. Consistency - Follow established patterns across all contracts
  4. Documentation - Every public type and field must have doc comments

Message Type Patterns

InstantiateMsg
rust
/// Contract instantiation message
#[cosmwasm_schema::cw_serde]
#[derive(Default)]
pub struct MyContractInstantiateMsg {
    /// Optional configuration parameter with sensible default
    #[serde(default)]
    pub some_config: Option<String>,
}

Guidelines:

  • Derive Default when possible for easier testing
  • Use #[serde(default)] for optional fields
  • Keep required fields minimal
  • Document each field
ExecuteMsg
rust
/// Contract execute messages
#[cosmwasm_schema::cw_serde]
#[derive(cw_orch::ExecuteFns)]
pub enum MyContractExecuteMsg {
    /// Update the contract configuration
    UpdateConfig {
        /// New admin address (optional)
        new_admin: Option<String>,
    },
    /// Process an action with the given parameters
    ProcessAction {
        /// Unique identifier for the action
        action_id: String,
        /// Amount to process
        amount: Uint128,
    },
}

Guidelines:

  • Use verb-based names (Update, Process, Create, Remove)
  • Group related parameters in structs if >3 fields
  • Document each variant AND each field
  • Derive ExecuteFns for cw-orch integration
QueryMsg
rust
/// Contract query messages
#[cosmwasm_schema::cw_serde]
#[derive(cw_orch::QueryFns, QueryResponses)]
pub enum MyContractQueryMsg {
    /// Get the current configuration
    #[returns(ConfigResponse)]
    Config {},
    
    /// Get item by ID
    #[returns(ItemResponse)]
    Item {
        /// The item identifier
        id: String,
    },
    
    /// List all items with pagination
    #[returns(ItemsResponse)]
    Items {
        /// Start after this ID for pagination
        start_after: Option<String>,
        /// Maximum number of items to return
        limit: Option<u32>,
    },
}

Guidelines:

  • Always include #[returns(ResponseType)] attribute
  • Use noun-based names for queries
  • Include pagination for list queries (start_after, limit)
  • Derive QueryFns and QueryResponses
Response Types
rust
#[cosmwasm_schema::cw_serde]
pub struct ConfigResponse {
    /// Current admin address
    pub admin: Addr,
    /// Whether the contract is paused
    pub paused: bool,
}

#[cosmwasm_schema::cw_serde]
pub struct ItemsResponse {
    /// List of items
    pub items: Vec<ItemInfo>,
}

Guidelines:

  • Response types should mirror what clients need
  • Use specific types (Addr, Uint128) not strings
  • Document all fields

Abstract SDK Integration

Use the app_msg_types! macro to generate wrapper types:

rust
use crate::contract::MyContract;
use cosmwasm_schema::QueryResponses;

// Generates ExecuteMsg, QueryMsg, InstantiateMsg wrappers
abstract_app::app_msg_types!(MyContract, MyContractExecuteMsg, MyContractQueryMsg);

Documentation Standards

Rust Doc Comments
rust
/// Brief one-line description of the variant.
/// 
/// Optional longer description that explains:
/// - When to use this
/// - Side effects
/// - Related messages
/// 
/// # Errors
/// 
/// Returns `ContractError::Unauthorized` if caller is not admin.
Field Documentation

Every field must have a doc comment:

  • Describe what the field represents
  • Mention default values if applicable
  • Note any constraints (min/max values, format)

Serde Patterns

Optional Fields with Defaults
rust
#[serde(default)]
pub optional_field: Option<String>,

#[serde(default = "default_limit")]
pub limit: u32,

fn default_limit() -> u32 {
    10
}
Flatten for Nested Configs
rust
#[cosmwasm_schema::cw_serde]
pub struct InstantiateMsg {
    #[serde(flatten)]
    pub base_config: BaseConfig,
    pub custom_field: String,
}
Rename for JSON Clarity
rust
#[serde(rename = "owner")]
pub owner_addr: Addr,

© axone-protocol, BSD-3-Clause. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/api-design of axone-protocol/contracts.

Open the folder on GitHubat commit 02724f3

Compare with similar skills

API Design next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

API Design compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
API Design this skillaxone-protocol/contracts123—~1.1kAutomated safety check: PassBSD-3-Clause
Feynman Auditor0xiehnnkta/nemesis-auditor2441 repos~11kAutomated safety check: PassMIT
RadarAuditware/radar154—~2.1kAutomated safety check: PassGPL-3.0
Safe Solana BuilderFrankcastleauditor/safe-solana-builder145—~3.6kAutomated safety check: PassNone
Wiremock TestOpenZeppelin/openzeppelin-relayer153—~1.6kAutomated safety check: NotesAGPL-3.0
Stellar DevVelaPayments/vela-payments131—~1.8kAutomated safety check: PassMIT

Similar skills

  • Feynman Auditor

    0xiehnnkta/nemesis-auditor

    Deep business logic bug finder using the Feynman technique. An agent skill from 0xiehnnkta/nemesis-auditor.

    244 GitHub starsUsed in 1 repo~11k tokens
    Backend & APIsAuto-check passed
  • Radar

    Auditware/radar

    Use radar for smart contract security analysis, AST generation, and detection template development.

    154 GitHub stars~2.1k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Safe Solana Builder

    Frankcastleauditor/safe-solana-builder

    A skill your agent uses whenever the user wants to write, scaffold, or build a Solana smart contract or program from scratch.

    145 GitHub stars~3.6k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Wiremock Test

    OpenZeppelin/openzeppelin-relayer

    Manage WireMock proxy for RPC testing. An agent skill from OpenZeppelin/openzeppelin-relayer.

    153 GitHub stars~1.6k tokensUpdated today
    Backend & APIsAuto-check: notes
  • Stellar Dev

    VelaPayments/vela-payments

    End-to-end Stellar development playbook. An agent skill from VelaPayments/vela-payments.

    131 GitHub stars~1.8k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Evm Maintainer

    RaoFoundation/subtensor

    Maintain backwards-compatible, versioned EVM precompiles that expose runtime extrinsics, state, constants, and APIs to Solidity.

    387 GitHub stars~2.5k tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from axone-protocol/contracts

All 9 skills in this repo
  • Conventional Commits

    axone-protocol/contracts

    Guide for writing conventional commit messages. An agent skill from axone-protocol/contracts.

    123 GitHub stars~909 tokensUpdated 12 days ago
    Auto-check passed
  • Rust Testing

    axone-protocol/contracts

    Patterns for Rust testing in Axone CosmWasm contracts. An agent skill from axone-protocol/contracts.

    123 GitHub stars~501 tokensUpdated 12 days ago
    Auto-check passed
  • Rust Quality Gates

    axone-protocol/contracts

    Repository quality gates for Rust and generated artifacts. An agent skill from axone-protocol/contracts.

    123 GitHub stars~248 tokensUpdated 12 days ago
    Auto-check passed
  • API Doc Comments

    axone-protocol/contracts

    Guide for writing Rust doc comments that produce accurate generated contract documentation.

    123 GitHub stars~849 tokensUpdated 12 days ago
    Auto-check passed
  • Cosmwasm Contract

    axone-protocol/contracts

    Axone contract structure and Abstract SDK patterns. An agent skill from axone-protocol/contracts.

    123 GitHub stars~1.2k tokensUpdated 12 days ago
    Auto-check passed
  • Deployment

    axone-protocol/contracts

    Axone deployment workflows with cargo-make, cw-orch, and Abstract.

    123 GitHub stars~927 tokensUpdated 12 days ago
    Auto-check: notes

Works with

Categories

Questions about API Design

What does API Design do?

Best practices for designing CosmWasm smart contract APIs. An agent skill from axone-protocol/contracts. API Design is an agent skill from axone-protocol/contracts. Best practices for designing CosmWasm smart contract APIs.

When should I use API Design?

API Design fits situations like: defining message types; designing execute/query interfaces; optimizing API ergonomics.

How do I install API Design in Claude Code?

Run `npx skills add axone-protocol/contracts --skill api-design -a claude-code`. Or copy the skill folder (.agents/skills/api-design in axone-protocol/contracts) into .claude/skills/api-design in your project. Claude Code loads it when a task matches its description.

How do I install API Design in Codex?

Run `npx skills add axone-protocol/contracts --skill api-design -a codex`. Or copy the skill folder (.agents/skills/api-design in axone-protocol/contracts) into .agents/skills/api-design in your project. Codex loads it when a task matches its description.

Can I use API Design in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add axone-protocol/contracts --skill api-design -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/api-design, .gemini/skills/api-design, .github/skills/api-design and .opencode/skills/api-design in your project.

What does API Design need to run?

SKILL.md names no scripts, command-line tools or credentials: API Design is instructions for the agent only.

Does API Design access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is API Design safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does API Design use?

API Design is published under the BSD-3-Clause licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does API Design use?

About 1.1k tokens (SKILL.md is roughly 4.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to API Design?

Skills that share tags, products or a category with API Design: Feynman Auditor (0xiehnnkta/nemesis-auditor, 244 stars), Radar (Auditware/radar, 154 stars), Safe Solana Builder (Frankcastleauditor/safe-solana-builder, 145 stars) and Wiremock Test (OpenZeppelin/openzeppelin-relayer, 153 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains API Design?

axone-protocol (a GitHub organization) maintains it in axone-protocol/contracts, which has 123 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on September 25, 2026.

Source: axone-protocol/contracts on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.