What problem does it solve?
This skill prevents brittle or insecure Substrate pallet designs by providing proven FRAME patterns for extrinsics, storage, runtime API wiring, and pallet-to-pallet interface coupling in Anarchy’s tight architecture.
Core Features & Use Cases
- Pallet skeleton & structure: Standardize Config/Storage/Event/Error/Call layout so new pallets compile cleanly for no_std WASM runtime targets.
- Extrinsic flow correctness: Enforce a validate → charge → mutate → emit ordering using ensure! to guarantee safe reverts and predictable side effects.
- Tight coupling without dependency traps: Use trait-based interfaces and ownership rules so pallets depend on abstractions rather than circular concrete bounds.
- Storage & sizing safety: Choose hashers appropriately and use BoundedVec with explicit Max* constants to keep weights and benchmarking stable.
- Runtime API & query guardrails: Declare sp_api runtime APIs for efficient frontend scanning while adding range-query upper limits to avoid DoS vectors.
- Runtime composition checklist: Wire pallets into construct_runtime, add impls, declare runtime APIs, and bump spec_version to keep clients compatible.
Quick Start
Use the backend-patterns skill to implement a new Anarchy Substrate pallet by copying its Config/Storage/Event/Error/Call skeleton and applying the validate → charge → mutate → emit extrinsic ordering.