Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add mzf11125/midnight_agent_skills --skill midnight-compactgit clone --depth 1 https://github.com/mzf11125/midnight_agent_skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/mzf11125/midnight_agent_skills/midnight-compact)<a href="https://agentmods.dev/skills/mzf11125/midnight_agent_skills/midnight-compact"><img src="https://agentmods.dev/badge/skills/mzf11125/midnight_agent_skills/midnight-compact/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/mzf11125/midnight_agent_skills/midnight-compact"><img src="https://agentmods.dev/badge/skills/mzf11125/midnight_agent_skills/midnight-compact.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00091 | $0.05149 |
| Opus 5.5 | $0.00036 | $0.02060 |
| Sonnet 5.5 | $0.00018 | $0.01030 |
| Haiku 4.5 | $0.00009 | $0.00515 |
Grade A, and why
midnight-compact scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 723 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Midnight Compact Language (v0.22+)
Complete guide to writing privacy-preserving smart contracts with Compact.
What is Compact?
Compact is a purpose-built programming language for zero-knowledge smart contracts. Unlike adapting existing languages, Compact was designed from scratch to make privacy-preserving programming natural and secure.
Key Design Goals:
- Compile directly to efficient ZK circuits
- Type-safe cryptographic operations
- Familiar syntax for developers (TypeScript-like)
- Automatic proof generation
- Bounded for finite proving circuits
Key Features:
- Strong static typing (no bypass via unsafe casts)
- Generic type and numeric parameters
- Explicit disclosure via
disclose()wrappers - Module-based namespace management
Quick Start
Minimal Working Contract (v0.22+)
pragma language_version >= 0.20;
import CompactStandardLibrary;
// Ledger state (individual declarations)
export ledger counter: Counter;
export ledger owner: Bytes<32>;
// Witness for private data
witness local_secret_key(): Bytes<32>;
// Circuit (returns [] not Void)
export circuit increment(): [] {
counter.increment(1);
}
Full Counter with Read/Write
pragma language_version >= 0.20;
import CompactStandardLibrary;
export ledger count: Counter;
export circuit increment(): [] {
count.increment(1);
}
export circuit decrement(): [] {
count.decrement(1);
}
export circuit getCount(): Uint<64> {
return count.read();
}
export circuit setCount(newValue: Uint<64>): [] {
count.write(newValue);
}
Core Concepts
Three-Part Contract Structure
Each Compact contract has three components:
- Replicated component on a public ledger
- Zero-knowledge circuit that confidentially proves correct execution
- Local, off-chain component for arbitrary code
Program Elements
A Compact program can contain:
module/importfor namespace managementstruct/enum/typefor program-defined typesexport ledgerfor public state storagewitnessfor callback functions (private state)circuitfor the operational coreconstructorfor initialization
What ships with it
25 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- assets/templates/basic-contract/contract.compact 305 B
- assets/templates/defi-contract/contract.compact 583 B
- assets/templates/private-token/contract.compact 821 B
- assets/templates/voting-contract/contract.compact 654 B
- references/best-practices.md 8.9 KB
- references/community-gotchas.md 6.4 KB
- references/compiler-usage.md 5.1 KB
- references/contract-deployment.md 11 KB
- references/contract-examples.md 1.8 KB
- references/editor-setup.md 6.3 KB
- references/language-basics.md 7.0 KB
- references/ledger-operations.md 8.4 KB
- references/private-state-patterns.md 9.6 KB
- references/quick-start.md 4.3 KB
- references/smart-contract-security.md 11 KB
- references/standard-library.md 6.9 KB
- references/token-contracts.md 6.0 KB
- references/tutorial-contracts.md 6.9 KB
- references/type-system.md 7.9 KB
- references/typescript-interop.md 9.1 KB
- references/zk-patterns.md 4.1 KB
- scripts/compile-compact.py 1.1 KB runs code
- scripts/generate-contract.py 1.4 KB runs code
- scripts/init-compact-project.py 1.9 KB runs code
- skill.json 285 B
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 723 lines · 91 tokens per session scan A 9100db092b82
midnight-compact is a skill published in the GitHub repository mzf11125/midnight_agent_skills (5 stars, last pushed 4mo ago), licensed MIT. It adds 91 tokens to every session and 5,149 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
midnight-compact compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| midnight-compactmzf11125/midnight_agent_skills | Skill | 5 | 4mo ago | MIT | A | 91 | Claude Code, Codex |
| blockchain-bitcoinj4flmao/agent-skills | Skill | 38 | 3d ago | MIT | A | 232 | Claude Code, Codex |
| blockchain-corej4flmao/agent-skills | Skill | 38 | 3d ago | MIT | A | 175 | Claude Code, Codex |
| use-ts-sdkaptos-labs/aptos-agent-skills | Skill | 20 | 4mo ago | MIT | A | 102 | Claude Code |
| ts-sdk-accountaptos-labs/aptos-agent-skills | Skill | 20 | 4mo ago | MIT | A | 96 | Claude Code |
| ts-sdk-addressaptos-labs/aptos-agent-skills | Skill | 20 | 4mo ago | MIT | A | 95 | Claude Code |
| ts-sdk-transactionsaptos-labs/aptos-agent-skills | Skill | 20 | 4mo ago | MIT | A | 94 | Claude Code |