sparq: Skill for Claude Code

.claude/skills/noir-optimisation/SKILL.md

noir-optimisation is a skill for Claude Code from sparq-org/sparq. It costs 185 tokens per session (18,883 once invoked), scanned A, original, MIT.

A reference for reducing the number of constraints in Noir programs. Noir is a language for writing zero-knowledge circuits, which prove that a computation was done correctly without revealing all its inputs.

In plain words
What is it for?
Use it when sizing Noir circuits, comparing arithmetic and bit-based operations, checking gate counts, or deciding where work should happen inside or outside a proof.
Why use it?
It helps estimate circuit cost and avoid changes that appear faster but produce incorrect proofs or use more constraints after measurement.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is sparq-org/sparq's own configuration. It tells Claude Code how to work on sparq itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything sparq configures →

Part of the sparq plugin — 55 skills, 20 agents, 2 hooks shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to sparq-org/sparq. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/sparq-org/sparq/main/.claude/skills/noir-optimisation/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/sparq-org/sparq

Made for: Claude Code.

Or install sparq, the plugin that ships this one along with the rest of its 55 skills, 20 agents, 2 hooks.

Wrote 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.

agentmods badge for noir-optimisation

README.md
[![agentmods](https://agentmods.dev/badge/skills/sparq-org/sparq/noir-optimisation.svg)](https://agentmods.dev/skills/sparq-org/sparq/noir-optimisation)
Your own site
<a href="https://agentmods.dev/skills/sparq-org/sparq/noir-optimisation"><img src="https://agentmods.dev/badge/skills/sparq-org/sparq/noir-optimisation.svg" alt="Measured on agentmods" height="20"></a>
Per session 185 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 18,883 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00185 $0.18883
Opus 5 $0.00093 $0.09441
Sonnet 5 $0.00037 $0.03777
Haiku 4.5 $0.00018 $0.01888

Measured 8d ago against content hash 7af23bb4d849, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

noir-optimisation 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 8d 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.

.claude/skills/noir-optimisation/SKILL.md · 1,476 lines

How it starts

The opening of the file, as written. The whole thing — 1,476 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Noir optimisation — cost model + decision rules

This is a low-level library; always optimise for minimal gate count. Every call site pays the constraint cost on every proof. Per-site savings of 5-15 gates compound across thousands of call sites in downstream callers' circuits. Readability is secondary to constraint count: when the two trade off, take the gates and add a comment. The only exception is when two forms compile to the same constraints (the optimiser CSE's identical sub-expressions); in that case pick whichever reads better.

A reference for someone already writing Noir circuits in this workspace. Optimisation in Noir is empirical: measure with bb gates before declaring a win. The 2026-05-03 round-1 of unconstrained_ops for IEEE 754 had us predict an ACIR-opcode + Width win for count_leading_zeros_u64_verified; PR #37 measured both regressing in both isolated and composed regimes, and the follow-up bit-decomposition spike (c0f433d, reverted in 63d0b95) regressed twice as hard again. The 2026-05-10 shr_sticky_u64 Field-arith spike looked like a 17% win on bb gates until we discovered the relation was unsound — see §3.4. Don't trust the textbook shape; measure, and measure the right number.

For which primitive to write — BGP matchers, joins, filters — see noir-circuit-patterns. This skill picks up where that one stops: given a candidate gadget, does the proposed implementation beat the in-circuit-spec baseline on the metric that actually drives prover wall-clock?

For generic Noir guidance (language syntax, the stdlib, project setup, testing patterns, JS integration) consult the upstream skills: noir-developer (circuit-dev, stdlib, workspace), noir-idioms (hint-and-verify principle, ACIR-vs-Brillig basics, bool vs Field, if/else selects, assert_eq style), noir-testing (test attributes and organisation), noir-js (noir_js / bb.js integration). This skill is intentionally narrow: the empirical, measured findings on bb gates cost that the upstream skills don't cover.

Read the full file on GitHub · 1,476 lines

Changes

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.

  1. 8d ago First seen · 1,476 lines · 185 tokens per session scan A 7af23bb4d849

Subscribe to this mod's changes

noir-optimisation is a skill published in the GitHub repository sparq-org/sparq (10 stars, last pushed yesterday), licensed MIT. It adds 185 tokens to every session and 18,883 once invoked, about $0.0009 per session on Opus 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.

Related

Other skills, from other repositories

jolt

Wrap a Rust function in a Jolt zero-knowledge proof.

a16z/jolt · 15 tokens

starknet-js

Use when writing or debugging JavaScript/TypeScript that interacts with Starknet through the starknet.js SDK — building Call objects or calldata, encoding/decoding Cairo types (felt252, u256, structs, arrays, spans, ByteArray, Option/Result/custom enums), or working with contracts, accounts, providers, transactions…

starknet-io/starknet.js · 79 tokens

v4-hook-generator

Generate Uniswap v4 hook contracts via OpenZeppelin MCP. Use when building custom swap logic, async swaps, hook-owned liquidity, custom curves, dynamic fees, MEV protection, limit orders, or oracle hooks.

Uniswap/uniswap-ai · 49 tokens

viem-integration

Integrate EVM blockchains using viem. Use when user says "read blockchain data", "send transaction", "interact with smart contract", "connect to Ethereum", "use viem", "use wagmi", "wallet integration", "viem setup", or mentions blockchain/EVM development with TypeScript.

Uniswap/uniswap-ai · 69 tokens

wallet-cli

Operate the TypeScript TRON wallet CLI for accounts, transfers, staking, governance, contracts, signing, chain queries, and password input with wallet-cli 4.13.0. Refuse wallet passwords in argv and require the supported stdin channel. For Java REPL requests, refuse that entry and offer the TypeScript one-shot CLI…

BofAI/skills · 82 tokens

upgrade-viem

Input: optionally a target viem version. Without one, use the latest release on npm.

evmts/tevm · 0 tokens