Agent skill

Rust Contract Domain Modeling

by axone-protocol in axone-protocol/contracts

Domain-driven modeling patterns for Axone contracts. An agent skill from axone-protocol/contracts.

BSD-3-ClauseAuto-check passedDevelopment

Install Rust Contract Domain Modeling

skills CLI
$ npx skills add axone-protocol/contracts --skill rust-contract-domain-modeling -a claude-code

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

GitHub CLI
$ gh skill install axone-protocol/contracts rust-contract-domain-modeling --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/rust-contract-domain-modeling .claude/skills/rust-contract-domain-modeling && 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
rust-contract-domain-modeling
GitHub stars
123
Token cost
~678 tokens
SKILL.md length
305 words
Files
2 (incl. references)
Skills in repo
9
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

Domain-driven modeling patterns for Axone contracts. An agent skill from axone-protocol/contracts.

  • Introducing domain concepts
  • SKILL.md covers Goal, Boundary Rules, Domain Rules and Patterns From This Repository, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Encoding invariants

What it does

Rust Contract Domain Modeling is an agent skill from axone-protocol/contracts. Domain-driven modeling patterns for Axone contracts. Use when introducing domain concepts, encoding invariants, or deciding boundaries between domain, handlers, services, gateways, queries, and state.

Its SKILL.md is about 680 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/repo-patterns.md`).

It sits in Development, covering Domain-driven design. 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

  • Introducing domain concepts
  • Encoding invariants
  • Deciding boundaries between domain

Example prompts

  • “/rust-contract-domain-modeling”

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.

    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

Rust Contract Domain Modeling loads about 678 tokens when it runs, and up to ~1.1k if it reads all its reference files. Until then it costs about 58 tokens; SKILL.md has 305 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~58
When it runs · the whole SKILL.md, loaded when a task matches
~678
With references · SKILL.md plus every file in references/, read only if the agent opens them
~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). 305 words, ~678 tokens.

Download SKILL.mdSave it as .claude/skills/rust-contract-domain-modeling/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
rust-contract-domain-modeling
description
Domain-driven modeling patterns for Axone contracts. Use when introducing domain concepts, encoding invariants, or deciding boundaries between domain, handlers, services, gateways, queries, and state.
license
BSD-3-Clause
metadata.author
axone.xyz
metadata.version
1.0

Rust Contract Domain Modeling

Goal

Keep business invariants in explicit domain types instead of scattering them across handlers, query builders, or storage code.

Boundary Rules

  • domain/ owns business concepts and invariants.
  • handlers/ decode messages, orchestrate use cases, and shape responses.
  • services/ compose domain logic with environment-dependent enrichment or cross-module coordination.
  • gateway/ isolates external module interaction and protocol-specific I/O.
  • queries/ build external query payloads or request strings; they should not become the home of business rules.
  • state/ persists data and reconstructs domain values; it should not silently redefine domain invariants.

Domain Rules

  • Prefer constructors such as new or try_new that reject invalid states up front.
  • Use TryFrom when validating a parsed or transport-level representation into a domain type.
  • Keep domain methods deterministic and side-effect-light whenever possible.
  • If a value is reconstructed from trusted state, make that explicit with a constructor such as from_state.
  • Model canonical representations once in the domain layer, then reuse them everywhere else.

Patterns From This Repository

  • Case::new and TryFrom<Term> validate that a case is a ground Prolog dict before it can circulate as a domain object.
  • Constitution::try_new validates UTF-8, required predicates, and engine feedback before a constitution exists as a valid domain value.
  • Constitution::from_state reconstructs a previously validated value from storage without re-running external validation.
  • Decision::new captures an immutable decision snapshot from already validated inputs.
  • Authority::new canonicalizes a bech32 account into the DID form exposed by the contract.

Design Heuristics

  • Put parsing and invariant checks as close as possible to the creation of the domain object.
  • Keep handlers thin. If a handler starts accumulating validation branches, move that logic into a domain type or service.
  • Avoid passing partially validated strings through multiple layers when a dedicated type can encode the guarantee once.
  • Make invalid states unrepresentable where practical, especially for smart-contract-critical logic.

References

  • For concrete domain examples from this repository, read repo-patterns.

© 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

SKILL.md and 1 other file (references) in .agents/skills/rust-contract-domain-modeling of axone-protocol/contracts.

  • SKILL.md
  • references/repo-patterns.md

Open the folder on GitHubat commit 02724f3

Compare with similar skills

Rust Contract Domain Modeling 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.

Rust Contract Domain Modeling compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Rust Contract Domain Modeling this skillaxone-protocol/contracts123—~678Automated safety check: PassBSD-3-Clause
M09 Domainfjrevoredo/mini-diarium3081 repos~1kAutomated safety check: PassMIT
Build Teaql Appteaql/teaql-agent-kit2.8k—~4.6kAutomated safety check: PassMIT
Evolutionary Modular Architecturetech-leads-club/agent-skills7k—~3.7kAutomated safety check: PassCC-BY-4.0
Migration PathAxonIQ/AxonFramework3.6k—~594Automated safety check: PassApache-2.0
Windmill Rust Backend Patternswindmill-labs/windmill18k—~869Automated safety check: PassCustom licence

Similar skills

  • M09 Domain

    fjrevoredo/mini-diarium

    CRITICAL: Use for domain modeling. An agent skill from fjrevoredo/mini-diarium.

    308 GitHub starsUsed in 1 repo~1k tokens
    DevelopmentAuto-check passed
  • Build Teaql App

    teaql/teaql-agent-kit

    Build or change a TeaQL application in Java, Rust, Go, Swift, Python, C/.NET, or TypeScript, including Kotlin/JVM applications that consume Java-generated libraries.

    2.8k GitHub stars~4.6k tokensUpdated 11 days ago
    MobileAuto-check passed
  • Evolutionary Modular Architecture

    tech-leads-club/agent-skills

    Guides design of modular-monolith platforms with DDD, flat-by-aggregate modules, anti-corruption layers, outbox events and resilience, plus an architecture document with SVG diagrams.

    7k GitHub stars~3.7k tokensUpdated 18 days ago
    DevelopmentAuto-check passed
  • Migration Path

    AxonIQ/AxonFramework

    Create a new Axon Framework 4→5 migration path documentation page.

    3.6k GitHub stars~594 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Windmill Rust Backend Patterns

    windmill-labs/windmill

    Sets Rust conventions for the Windmill backend: error types, SQLx queries, JSON handling, async rules, module layout and rust-analyzer navigation.

    18k GitHub stars~869 tokensUpdated today
    DevelopmentAuto-check passed
  • Rust Skills

    JMBeresford/retrom

    Comprehensive Rust coding guidelines with 265 rules across 26 categories.

    2.1k GitHub starsUsed in 1 repo~9.5k tokens
    DevelopmentAuto-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 13 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 13 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 13 days ago
    Auto-check passed
  • API Design

    axone-protocol/contracts

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

    123 GitHub stars~1.1k tokensUpdated 13 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 13 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 13 days ago
    Auto-check passed

Works with

Questions about Rust Contract Domain Modeling

What does Rust Contract Domain Modeling do?

Domain-driven modeling patterns for Axone contracts. An agent skill from axone-protocol/contracts. Rust Contract Domain Modeling is an agent skill from axone-protocol/contracts. Domain-driven modeling patterns for Axone contracts.

When should I use Rust Contract Domain Modeling?

Rust Contract Domain Modeling fits situations like: introducing domain concepts; encoding invariants; deciding boundaries between domain.

How do I install Rust Contract Domain Modeling in Claude Code?

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

How do I install Rust Contract Domain Modeling in Codex?

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

Can I use Rust Contract Domain Modeling 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 rust-contract-domain-modeling -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rust-contract-domain-modeling, .gemini/skills/rust-contract-domain-modeling, .github/skills/rust-contract-domain-modeling and .opencode/skills/rust-contract-domain-modeling in your project.

What does Rust Contract Domain Modeling need to run?

SKILL.md names no scripts, command-line tools or credentials: Rust Contract Domain Modeling is instructions for the agent only.

Does Rust Contract Domain Modeling 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 Rust Contract Domain Modeling 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 Rust Contract Domain Modeling use?

Rust Contract Domain Modeling 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 Rust Contract Domain Modeling use?

About 678 tokens (SKILL.md is roughly 2.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 469 tokens, read only when the agent opens those files.

What are the alternatives to Rust Contract Domain Modeling?

Skills that share tags, products or a category with Rust Contract Domain Modeling: M09 Domain (fjrevoredo/mini-diarium, 308 stars), Build Teaql App (teaql/teaql-agent-kit, 2.8k stars), Evolutionary Modular Architecture (tech-leads-club/agent-skills, 7k stars) and Migration Path (AxonIQ/AxonFramework, 3.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Rust Contract Domain Modeling?

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.