Skills for building, testing, and auditing confidential smart contracts and dApps on Fhenix CoFHE — FHE.sol, @cofhe/sdk, mocks, and a 30+ gotcha catalog.
Then ask Claude "help me write a confidential ERC20" or "audit this FHE.sol contract" — the right skill activates on its own.
Why fhenix-toolkit
Writing confidential smart contracts is full of subtle traps that look fine in plaintext-land but silently break under FHE. ACL slips. Decrypt flow mismatches. Type-tag misreads. Plaintext leaking through events or gas. A model with general Solidity knowledge will produce code that compiles and passes mock tests — and is unsafe in production.
This plugin closes that gap.
The pain you know
How fhenix-toolkit handles it
Claude writes if (FHE.gt(a, b)) and your tests pass against the mock
fhenix-contracts activates on the import, refuses if/require on ebool, routes to FHE.select
Stored encrypted state but forgot FHE.allowThis — next transaction reverts
Hard-rules check fires before you submit. fhenix-review flags it as Critical (G1) on PR review
decryptForTx().withoutPermit() silently 0s out because the contract didn't call FHE.allowPublic
fhenix-review flags it as Critical (G15) with the matching on-chain fix
Narrowing cast asEuint8(euint64Val) decrypts to a value you didn't expect
Gotcha G3 explains the modular-reduction semantics and the saturation patterns
Test passes on mocks, fails in prod because gas profile differs
fhenix-tests carries the mock-gas ≠ prod-gas warning and the mocks-vs-plugin decision tree
Skill says X but the SDK shipped Y last week
Plugin is lookup-driven: no snapshots, every code reference is a recipe that pulls live from the public Fhenix repos
Each skill activates on the right context (file imports, file extensions, prompt cues) so you don't pay context cost for skills you aren't using.
What ships
Skill
Activates on
Purpose
fhenix-contracts
Solidity files importing @fhenixprotocol/cofhe-contracts/FHE.sol, or files using euint* / ebool / eaddress
Hard rules (FHE.select, ACL cascade, no encrypted mul/div), the four-verb ACL taxonomy, three decrypt-flow choices, confidential-token standards picker
fhenix-sdk
Files importing @cofhe/sdk or its subpaths; hooks like useCofhe*
Canonical init recipe, decrypt-flow decision tree (decryptForView vs decryptForTx), permit lifecycle, encrypted-input ABI cast
Plus the fhe-reviewer subagent — deep-audit companion to fhenix-review. Invoked for substantial diffs (>200 LOC of FHE code) or pre-launch audits. Loads the full catalog into a fresh context, walks function-by-function, returns a prioritized report.
fhenix-migrate (legacy cofhejs → @cofhe/sdk) is deferred to v1.5 — design intact, ship timing TBD.
Design philosophy
Curated wisdom, looked-up specifics. The skills carry concepts, decision trees, and gotchas — the things that don't change between releases. API surfaces (FHE.sol functions, SDK method signatures, error codes, deployed addresses) are looked up live from the public Fhenix repos at the moment of need.
That way the plugin stays correct as the SDK and contracts evolve, without constant snapshot maintenance. Drift gets caught by CI (lookup-recipe-smoke.yml) and surfaces as a failed build, not as silently-wrong Claude output.