.agents/skills/rust-contract-domain-modeling/SKILL.md
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.
npx skillsauth add axone-protocol/contracts rust-contract-domain-modelingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Keep business invariants in explicit domain types instead of scattering them across handlers, query builders, or storage code.
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.new or try_new that reject invalid states up front.TryFrom when validating a parsed or transport-level representation into a domain type.from_state.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.development
Patterns for Rust testing in Axone CosmWasm contracts. Use when adding unit tests, integration tests, data-driven cases, or coverage-oriented test scenarios.
development
Repository quality gates for Rust and generated artifacts. Use when validating changes locally or before committing Rust, schema, or documentation updates.
development
Guide for regenerating Axone contract schemas and rendered Markdown docs. Use when contract APIs or metadata change, when checking generated-doc drift, or when preparing documentation commits.
development
Axone deployment workflows with cargo-make, cw-orch, and Abstract. Use when publishing modules, installing them on accounts, running local chain tasks, or inspecting deployments.