/fhenix-toolkit:fhenix-reviewfrom fhenix-toolkit
Audits Fhenix CoFHE confidential code for ACL bugs, decrypt-flow mismatches, plaintext leaks, and 30+ recurring gotchas in on-chain (FHE.sol) and off-chain (@cofhe/sdk) contexts. Activates on PR diffs or review prompts.
Ships in fhenix-toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill is for review contexts. The companion skills fhenix-contracts and fhenix-sdk already activate when editing FHE code; this one layers an audit lens on top of (or instead of) them when the task is review rather than authoring.
FHE.allowThis after a stored encrypted write; mismatched ACL pairing (e.g., decryptForTx().withoutPermit() without allowPublic); allowSender granted to an attacker-controlled msg.sender for someone else's handle.decryptForView used where decryptForTx is needed (or vice versa); legacy FHE.decrypt(...) / getDecryptResultSafe(...) references that should have been migrated to the SDK-mediated flow.trivialEncrypt(literal) for secret values; plaintext values stored / emitted alongside their encrypted twins; revert paths that branch on what should be private.ebool — if (FHE.gt(...)), require(FHE.gt(...)), while (...) — must be FHE.select.approve/transferFrom semantics for ciphertexts.FHE.randomEuintXX used where user-contributed entropy is required (auctions, gifts, fair shuffles).InEuintXX accepted without "Proof of Plaintext Input" where the protocol's invariants depend on the cleartext meeting bounds.expiration in milliseconds not seconds; stale per-cycle permits; sharing-permit JSONs leaked publicly.Full catalog: references/gotchas.md.
Walk the changed code in this order:
FHE.allowThis(result) if stored.allow* call → check the pairing matrix.FHE.decrypt → confirm async handling on the read side.select → confirm both arms are the same encrypted type and neither leaks.decryptForView / decryptForTx:
allow* for the same handle.CofheError, not Result<T>.For substantive review (PR with >200 LOC of FHE code; security-sensitive merges; pre-launch audits), invoke the fhe-reviewer subagent (at agents/fhe-reviewer.md). It loads the full gotcha catalog and security checklist up front and produces a prioritized report.
Invoke it via the Task tool with subagent_type: "fhe-reviewer" (Claude Code's standard subagent invocation — see https://docs.claude.com/en/docs/claude-code/sub-agents). When passing context, include absolute paths to any diff files so the subagent's reads resolve correctly regardless of its working directory.
A review should produce one of:
Cite line numbers from the user's code. Quote ~3-10 lines around each concern.
concepts/confidentiality-vs-anonymity.md — the distinction reviewers must constantly enforce.concepts/pattern-leakage.md — gas / events / tx-graph as side channels.concepts/proof-of-plaintext-input.md — validating InEuintXX arrivals.concepts/reveal-labels.md — categorizing every decrypt as UI-view or protocol-reveal.When verifying a suspicious claim about an FHE.sol function or SDK method, look it up live (see references/lookup-recipes.md). Never assume from training data — the libraries evolve.
references/concepts/confidentiality-vs-anonymity.md (opens in a new tab)references/concepts/pattern-leakage.md (opens in a new tab)references/concepts/proof-of-plaintext-input.md (opens in a new tab)references/concepts/reveal-labels.md (opens in a new tab)references/decision-trees.md (opens in a new tab)references/gotchas.md (opens in a new tab)references/lookup-recipes.md (opens in a new tab)references/security-checklist.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/fhenix-contractsUse when working on Solidity files importing @fhenixprotocol/cofhe-contracts/FHE.sol or fhenix-confidential-contracts, or using euint*/ebool/eaddress types. Teaches confidential contract patterns — branchless updates with FHE.select, the four ACL verbs, the two decryption flows, and the confidential-token standards picker. Activates on Fhenix CoFHE contract work./fhenix-sdkUse when working with @cofhe/sdk in TypeScript — encrypting inputs, managing permits, choosing decrypt modes (decryptForView vs decryptForTx), or wiring CoFHE into a Next.js / wagmi / viem dApp. Activates on imports of @cofhe/sdk or its subpaths, on hooks named useCofhe* or usePermit*, and on prompts like "encrypt this input" or "set up cofhe in Next.js."/fhenix-testsUse when writing or extending tests for confidential CoFHE code — Foundry mocks, Hardhat plugin, encrypted input fixtures, SDK decrypt flows (decryptForView and decryptForTx) in tests. Activates on .test.ts / .t.sol files importing FHE.sol, @cofhe/sdk, @cofhe/hardhat-plugin, or @fhenixprotocol/cofhe-mock-contracts; on files under tests/contracts/; or on prompts like "test this confidential contract."npx claudepluginhub fhenixprotocol/fhenix-toolkit --plugin fhenix-toolkitOther plugins' skills for the same job