plugins/midnight-tooling/skills/midnight-compatibility/SKILL.md
Use when checking Midnight version compatibility, understanding pragma language_version, verifying compiler and runtime version relationships, or troubleshooting version mismatch errors between Midnight components.
npx skillsauth add aaronbassett/midnight-knowledgebase midnight-tooling:midnight-compatibilityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Understanding version relationships between Midnight components.
Midnight development involves multiple versioned components:
| Component | Purpose | Version Check |
|-----------|---------|---------------|
| Compact Developer Tools | CLI for managing compilers | compact --version |
| Compact Compiler | Compiles .compact to ZK circuits | compact compile --version |
| compact-runtime | JavaScript runtime library | npm list @midnight-ntwrk/compact-runtime |
| ledger | Core ledger types | npm list @midnight-ntwrk/ledger |
| midnight.js | JavaScript SDK | npm list @midnight-ntwrk/midnight.js |
| Proof Server | ZK proof generation | Docker image tag |
Language Version (in pragma)
│
▼
┌─────────────────────────┐
│ Compact Compiler │ ──── Produces ───▶ Contract Artifacts
│ (e.g., 0.26.0) │
└─────────────────────────┘
│
│ Must match
▼
┌─────────────────────────┐
│ compact-runtime │
│ (e.g., 0.9.0) │
└─────────────────────────┘
│
│ Compatible with
▼
┌─────────────────────────┐
│ ledger, midnight.js │
│ Proof Server │
└─────────────────────────┘
The authoritative source is the support matrix in Midnight release notes.
To check current recommended versions:
/midnight:versions
Or parse directly:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/parse-support-matrix.py
Every Compact contract must declare its language version:
pragma language_version 0.18;
ledger {
// ...
}
The compiler version (e.g., 0.26.0) maps to a language version (e.g., 0.18.0):
# Check release notes for mapping
/midnight:changelog compact
Recent mappings (verify with release notes):
In package.json, always use exact versions:
{
"dependencies": {
"@midnight-ntwrk/compact-runtime": "0.9.0",
"@midnight-ntwrk/ledger": "4.0.0",
"@midnight-ntwrk/midnight.js": "2.1.0"
}
}
Never use:
^0.9.0 (allows minor updates)~0.9.0 (allows patch updates)>=0.9.0 (allows any newer version)Midnight components have strict compatibility requirements. A minor version bump in one component may require updates to others. Using ranges can lead to:
For reproducible builds, use npm ci instead of npm install:
# npm ci uses exact versions from package-lock.json
npm ci
# npm install may update within semver ranges
npm install # Avoid for production
compact list
compact list --installed
# Update to latest
compact update
# Switch to specific version
compact update 0.25.0
# Prefix with +version
compact compile +0.25.0 src/contract.compact contract/
This is useful for:
The proof server must be compatible with your contracts:
# Check available tags
docker search midnightnetwork/proof-server
# Pull specific version
docker pull midnightnetwork/proof-server:4.0.0
# Run specific version
docker run -p 6300:6300 midnightnetwork/proof-server:4.0.0 -- midnight-proof-server --network testnet
When upgrading, check release notes for breaking changes:
/midnight:changelog compact
Common breaking changes include:
slice in 0.18.0)/midnight:versions/midnight:changelog <component>compact update <version>rm -rf node_modules && npm cicompact compile src/*.compact contract/references/compatibility-matrix.md - Detailed version compatibility tablereferences/pragma-guide.md - Pragma declaration guideFor troubleshooting version issues, see the midnight-debugging skill.
tools
Use when setting up Midnight development environment, installing Compact compiler and developer tools, configuring proof server, verifying prerequisites, or getting started with Midnight development.
tools
--- name: midnight-tooling:midnight-debugging description: Use when encountering Midnight errors like "compact: command not found", "ERR_UNSUPPORTED_DIR_IMPORT", version mismatches, proof server failures, "@midnight-ntwrk" package errors, or compilation failures. --- # Midnight Environment Debugging Expert knowledge for identifying and resolving common Midnight development toolchain issues. ## Diagnostic Approach When encountering Midnight-related errors, follow this systematic approach: 1.
tools
Use when setting up CI/CD for Midnight projects, configuring GitHub Actions for Compact contract compilation, running TypeScript tests in CI, validating version consistency, or automating contract builds.
tools
Use when managing deployed contract lifecycles, inspecting contract state, backing up state before upgrades, planning contract migrations, implementing versioning strategies, or deprecating contracts gracefully.