rust-contract-domain-modeling
/rust-contract-domain-modeling
Modeluje domenę kontraktów Axone w Rust: pojęcia domenowe, niezmienniki i granice między handlerami, usługami, bramkami i stanem.
- Autor
- axone-protocol ↗
- Repozytorium
- contracts ↗
- Licencja
- BSD-3-Clause
- Ostatnia zmiana repozytorium
- 27.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 2
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 27.10.2026, bez odwołań do wycofanych modeli i API.
BSD-3-Clause, otwarta.
Co robi i kiedy
Modeluje domenę kontraktów Axone w Rust: pojęcia domenowe, niezmienniki i granice między handlerami, usługami, bramkami i stanem.
Oryginalny opis (EN)
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.
Jak działa
- Goal
- Boundary Rules
- Domain Rules
- Patterns From This Repository
- Design Heuristics
- References
Podgląd SKILL.md
--- 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 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](./references/repo-patterns.md).
Pliki w paczce (2)
- SKILL.md 3 KB
- references/repo-patterns.md 2 KB
Wersje
W bazie nie ma innych skilli o nazwie rust-contract-domain-modeling.
Migawka bazy z 13.11.2026 · wersja paczki e1c056f7d7e2 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100rust-testing
Podpowiada wzorce testów jednostkowych, integracyjnych i danych testowych dla kontraktów CosmWasm w projekcie Axone. - 100cosmwasm-contract
Opisuje strukturę kontraktów Axone i wzorce Abstract SDK: szkielet i refaktoryzacja kontraktów, granice warstw, podpinanie entrypointów AppContract oraz metadane i odpowiedzi modułów. - 100rs-domain-model
Modeluje domenę biznesową w Rust zgodnie z DDD: encje, obiekty wartości, agregaty, repozytoria, reguły biznesowe i niezmienniki walidacji. - 100domain-modeling
Rozstrzyga niejednoznaczne pojęcia domenowe, stany, zdarzenia i niezmienniki, zanim kod lub interfejs od nich zacznie zależeć. - 100domain-modeling-design
Pomaga zaprojektować nową domenę lub agregat przed pisaniem kodu: gdzie umieścić logikę biznesową, jakie niezmienniki i konteksty ograniczone zdefiniować. - 90domain-modeling
Łączy modelowanie domeny i danych: encje biznesowe, niezmienniki, projekt schematu, granice agregatów i strategia ewolucji, przy projektowaniu modeli, zmian schematu, bounded contexts i reguł spójności.