home / skills / multiversx / mx-ai-skills / spec_compliance

spec_compliance skill

/antigravity/skills/spec_compliance

This skill verifies Rust smart contracts align with Whitepaper, MIP, and spec claims, ensuring math, constraints, and tokenomics match precisely.

npx playbooks add skill multiversx/mx-ai-skills --skill spec_compliance

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
898 B
---
name: spec_compliance
description: Verifying code against Whitepapers or MIPs (MultiversX Improvement Proposals).
---

# Specification Compliance

This skill ensures the implemented Smart Contract matches the intended design documents (Whitepaper, MIP, Spec).

## 1. Inputs
- **Code**: The Rust implementation.
- **Spec**: `whitepaper.pdf`, `MIP-XX.md`, or `README.md`.

## 2. Process
1.  **Extract Claims**: List every "MUST", "SHOULD", and formula in the Spec.
2.  **Map to Code**: Find the exact lines implementing each claim.
3.  **Verify**: Does the math match? Are the constraints enforced?

## 3. MultiversX Specifics
- **MIP Compliance**: If the project claims to implement `MIP-2` (Fractional NFT), verify it adheres to the SFT metadata standard defined in that MIP.
- **Economics**: Verify tokenomics (inflation, burn rates) match the whitepaper exactly (BigUint precision matters!).

Overview

This skill verifies that smart contract code implements the rules and formulas stated in design documents such as whitepapers and MIPs. It detects mismatches between specification claims and Rust implementations, with attention to numeric precision and protocol-specific standards. The goal is to produce actionable findings that developers can use to bring code into compliance.

How this skill works

The skill extracts normative statements and formulas from the Spec by identifying every MUST, SHOULD, and explicit equation. It maps each claim to the exact Rust lines or modules that implement it, then checks logic, numeric precision (BigUint usage), constraints, and metadata formats. For MultiversX-related projects it also enforces MIP-specific conventions such as SFT metadata and declared tokenomics.

When to use it

  • Before security audits to surface spec/code divergences early
  • When implementing or reviewing a MIP-based feature (e.g., Fractional NFT / MIP-2)
  • During release preparation to confirm tokenomics and economic parameters match the whitepaper
  • When changes to the spec or contract are proposed and you need a compliance diff

Best practices

  • Provide the authoritative spec files (whitepaper, MIP) alongside the Rust codebase for analysis
  • Call out every normative term (MUST/SHOULD) and any formulas in the spec up front
  • Include test vectors and expected numeric precision to validate BigUint behavior
  • Keep spec versions and code commits linked so the skill evaluates the intended revision
  • Treat findings as prioritized tasks: critical mismatches first (security/math), then style/metadata

Example use cases

  • Verify a project claiming MIP-2 support actually encodes SFT metadata as required
  • Check that inflation schedules, burn rates, and token distributions in code match whitepaper formulas with BigUint precision
  • Map a newly implemented staking reward formula back to the spec and produce failing test cases if mismatched
  • Produce a compliance checklist for auditors highlighting missing MUST implementations and relaxed SHOULDs

FAQ

Which input formats are supported for specs?

Supply PDFs, Markdown MIPs, or plain README text. The skill extracts normative language and equations from these formats.

How precise are numeric checks?

Numeric checks validate integer math and BigUint usage, ensuring formulas, rounding, and boundary constraints match the spec exactly.