Midnight Compact Guide

Comprehensive guide to writing Compact smart contracts for Midnight Network. Use this skill when writing, reviewing, debugging, or learning Compact code. Triggers on "write a contract", "Compact syntax", "Midnight smart contract", "ledger state", "circuit function", or "ZK proof".

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add UvRoxx/midnight-agent-skills --skill midnight-compact-guide
Manual install
git clone --depth 1 https://github.com/UvRoxx/midnight-agent-skills.git /tmp/midnight-agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/midnight-agent-skills/skills/midnight-compact-guide ~/.claude/skills/midnight-compact-guide

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Midnight Compact Language Reference (v0.19+)

> **CRITICAL**: This reference is derived from **actual compiling contracts** in the Midnight ecosystem (MeshJS starter template). Always verify syntax against this reference before generating contracts.

## Quick Start Template

Use this as a starting point - it compiles successfully:

```compact
pragma language_version >= 0.19;

import CompactStandardLibrary;

// Ledger state (individual declarations, NOT a block)
export ledger counter: Counter;
export ledger owner: Bytes<32>;

// Witness for private/off-chain data (declaration only)
witness local_secret_key(): Bytes<32>;

// Circuit (returns [] not Void)
export circuit increment(): [] {
  counter.increment(1);
}
```

---

## 1. Pragma (Version Declaration)

**CORRECT** - simple minimum version:
```compact
pragma language_version >= 0.19;
```

**WRONG** - these will cause issues:
```compact
pragma language_version >= 0.14.0;           // ❌ outdated version
pragma language_version >= 0.16 && <= 0.18;  // ❌ outdated, use >= 0.19
```

---

## 2. Imports

Always import the standard library:
```compact
import CompactStandardLibrary;
```

For modular code:
```compact
import "path/to/module";
import { SomeType } from "other/module";
```

---

## 3. Ledger Declarations

**CORRECT** - individual declarations with `export ledger`:
Read the full skill on GitHub

Details

Skill name
midnight-compact-guide
Path
skills/midnight-compact-guide/SKILL.md
License
MIT
Repo updated
29 March 2026

FAQ

What does the Midnight Compact Guide skill do?

Comprehensive guide to writing Compact smart contracts for Midnight Network. Use this skill when writing, reviewing, debugging, or learning Compact code. Triggers on "write a contract", "Compact syntax", "Midnight smart contract", "ledger state", "circuit function", or "ZK proof".

How do I install the Midnight Compact Guide skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add UvRoxx/midnight-agent-skills --skill midnight-compact-guide. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Midnight Compact Guide popular?

It lives in UvRoxx/midnight-agent-skills, which has 9 GitHub stars and 2 forks.

Related skills

Midnight Deploy

9

UvRoxx/midnight-agent-skills

Deploy and manage Midnight smart contracts to local or preview network. Use this skill when deploying contracts, starting local infrastructure, or connecting to testnet. Triggers on "deploy contract", "start local node", "setup standalone", "deploy to preview", or "midnight infrastructure".

DevOps & Cloud

Midnight Infra Setup

9

UvRoxx/midnight-agent-skills

Set up and run Midnight infrastructure locally using official dev tools. Use this skill when setting up local development environment, starting node/indexer/proof-server, troubleshooting infrastructure, or syncing components. Triggers on "setup infrastructure", "start local node", "run indexer", "proof server", "midnight-infra-dev-tools", or "local development".

DevOps & Cloud

Midnight SDK Guide

9

UvRoxx/midnight-agent-skills

TypeScript SDK integration guide for Midnight dApps. Use this skill when building frontends, connecting wallets, or calling contracts from TypeScript. Triggers on "SDK", "TypeScript", "wallet integration", "connect dApp", "call contract".

Software Development

Pipeline Hygiene Audit

9

elijeangilles/revops-skills

Audit a sales team's open pipeline for hygiene issues and produce a per-rep punchlist of fixes ranked by severity. Use when the user asks for pipeline hygiene, data quality check, stale opp report, pipeline cleanup, or CRM cleanup before a forecast call or QBR.

Marketing, Sales & Business

Lead Routing Rule Analyzer

9

elijeangilles/revops-skills

Diagnose lead routing health and grade it A through F. Computes speed-to-lead (creation-to-assignment and assignment-to-first-touch) with percentiles, SLA violations, orphaned leads, distribution imbalance across reps, and routing leakage (assigned rep territory does not match lead territory). Use when the user asks about LeanData, Salesforce Assignment Rules, lead handoffs, speed-to-lead SLA, or whether leads are reaching the right reps.

Marketing, Sales & Business

Salesforce Revops Audit

9

elijeangilles/revops-skills

Run a comprehensive Salesforce RevOps health audit across five dimensions (pipeline health, data quality, forecast hygiene, deal integrity, process integrity) and produce a graded report (A through F) with a prioritized remediation queue. Use as the entry point for any new Salesforce org assessment, before a new RevOps leader's first forecast call, before a QBR cycle, or quarterly as a recurring health check. The audit recommends which remediation skills to run next.

Marketing, Sales & Business

Browse the most popular Claude skills, all marketing, sales & business skills, or write your own with the skills generator.