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.
curl -O https://raw.githubusercontent.com/sparq-org/sparq/main/.claude/skills/noir-optimisation/SKILL.mdgit clone --depth 1 https://github.com/sparq-org/sparqWrote 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/sparq-org/sparq/noir-optimisation)<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>- NVIDIA SkillSpector pass
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.00185 | $0.18883 |
| Opus 5 | $0.00093 | $0.09441 |
| Sonnet 5 | $0.00037 | $0.03777 |
| Haiku 4.5 | $0.00018 | $0.01888 |
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.
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.
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.
- 8d ago First seen · 1,476 lines · 185 tokens per session scan A 7af23bb4d849
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.
Other skills, from other repositories
jolt
Wrap a Rust function in a Jolt zero-knowledge proof.
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…
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.
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.
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…
upgrade-viem
Input: optionally a target viem version. Without one, use the latest release on npm.