Skills for builders and agents.

Plain markdown skills, direct repo links, and focused guidance for building on Zama FHEVM.

start here

fhevm-router

General-purpose skill that triages a Zama FHEVM task, points to the right official docs, and keeps contract and frontend responsibilities separated.

Repo path: skills/fhevm-router/SKILL.md

what it covers

  • Classifies the task as contract, frontend, wallet, or review oriented
  • Points to the narrowest official Zama docs page to keep open while working
  • Calls out trust boundaries, ACL concerns, and decryption boundaries early
  • Keeps the repo honest about current scope instead of routing to missing modules

Core FHE mechanics

focused skill

erc7984-confidential-tokens

Focused skill for designing, implementing, or reviewing ERC-7984 confidential tokens, especially wrappers, operators, transfer variants, and unwrap correctness.

Repo path: skills/erc7984-confidential-tokens/SKILL.md

what it covers

  • Frames ERC-7984 around token, caller, decryption, and proof-verification boundaries
  • Calls out operator semantics instead of drifting back to ERC-20 allowance mental models
  • Keeps unwrap flows honest as async decrypt-and-verify, not single-step plaintext settlement
  • Maps custom designs back to the smallest OpenZeppelin confidential token module set

focused skill

fhe-privacy-constraints

Focused skill for product and mechanism design when confidential balances, ACL boundaries, and async decryption change what can actually be measured or enforced.

Repo path: skills/fhe-privacy-constraints/SKILL.md

what it covers

  • Separates what is public, hidden, user-readable, or only available after async decrypt
  • Explains why balance-based rewards and threshold checks break under confidential transfers
  • Forces ACL access plans to be explicit before proposing on-chain reads or enforcement
  • Reframes blocked mechanisms toward wrap activity, lockups, utility, or user-initiated proofs

focused skill

fhe-acl-lifecycle

Focused skill for managing encrypted value permissions — FHE.allow, FHE.allowThis, FHE.allowTransient, handle re-creation, and the critical rule that new handles carry no permissions.

Repo path: skills/fhe-acl-lifecycle/SKILL.md

what it covers

  • Explains why FHE operations return NEW handles that need fresh ACL grants
  • Distinguishes allow, allowThis, and allowTransient for different trust scenarios
  • Traces permission chains across multi-step encrypted computations
  • Catches the #1 FHEVM bug: assuming permissions transfer to derived values

focused skill

fhe-control-flow

Focused skill for replacing if/else and require patterns with FHE equivalents — FHE.select, silent zeroing, and designing UX around non-reverting failures.

Repo path: skills/fhe-control-flow/SKILL.md

what it covers

  • Explains why require(ebool) does not exist and what replaces it
  • Shows FHE.select as the only way to branch on encrypted conditions
  • Covers silent fallback to zero and its impact on user experience
  • Guides product design for non-reverting failure modes

focused skill

fhe-encrypted-inputs

Focused skill for accepting user-encrypted values in contracts — FHE.fromExternal, input proofs, caller binding, and replay prevention.

Repo path: skills/fhe-encrypted-inputs/SKILL.md

what it covers

  • Explains the FHE.fromExternal(ciphertext, inputProof) ingestion pattern
  • Shows how input proofs bind ciphertext to msg.sender and contract address
  • Covers client-side encryption with the Zama SDK
  • Prevents replay and cross-contract ciphertext injection attacks

Decryption patterns

focused skill

fhe-user-decryption

Focused skill for client-side decryption — off-chain reencryption, EIP-712 authorization, React hooks, and ACL pre-grant requirements.

Repo path: skills/fhe-user-decryption/SKILL.md

what it covers

  • Explains the off-chain reencryption flow: sign, decrypt, display
  • Shows ACL pre-grant as a prerequisite for user decryption
  • Covers EIP-712 typed signatures for reencryption authorization
  • Guides React and Next.js integration with the relayer SDK

focused skill

fhe-public-decryption

Focused skill for two-step decrypt-verify-finalize flows — public decryption, on-chain proof verification, and state-changing plaintext settlement.

Repo path: skills/fhe-public-decryption/SKILL.md

what it covers

  • Explains the two-step pattern: compute encrypted result, then finalize with proof
  • Shows FHE.makePubliclyDecryptable and relayer publicDecrypt flow
  • Covers on-chain proof verification with FHE.checkSignatures
  • Prevents the single-step unwrap bug where user-claimed plaintext bypasses FHE checks

Security & compliance

focused skill

fhe-security-audit

Focused skill for auditing and reviewing confidential contracts — ACL flow verification, silent fallback tracing, handle lifecycle, and a catalog of common footguns.

Repo path: skills/fhe-security-audit/SKILL.md

what it covers

  • Provides a systematic audit checklist for FHEVM contracts
  • Traces ACL permission flows across multi-step operations
  • Catalogs known footguns: missing ACL, silent zero, wrong unwrap, handle reuse
  • Covers arithmetic constraint verification and overflow behavior

focused skill

fhe-compliance-patterns

Focused skill for implementing regulatory compliance on confidential tokens — observer access, freezing, blocklists, RWA controls, and institutional adoption patterns.

Repo path: skills/fhe-compliance-patterns/SKILL.md

what it covers

  • Maps OpenZeppelin compliance modules: ObserverAccess, Freezable, Restricted, Rwa
  • Explains selective transparency for auditors without breaking user privacy
  • Covers force-transfer, pause, and encrypted freeze amount mechanics
  • Guides institutional adoption: how to satisfy regulators while preserving confidentiality

Operations

focused skill

fhe-arithmetic-ops

Focused skill for FHE arithmetic — add/sub/mul, ciphertext-scalar vs ciphertext-ciphertext costs, division constraints, euint64 limits, and operation chaining.

Repo path: skills/fhe-arithmetic-ops/SKILL.md

what it covers

  • Lists supported vs unsupported FHE operations with type constraints
  • Explains why ciphertext-scalar is far cheaper than ciphertext-ciphertext
  • Shows division requires a plaintext divisor — no encrypted denominators
  • Covers euint64 overflow behavior and safe arithmetic patterns

focused skill

fhe-gas-optimization

Focused skill for FHE gas costs and optimization — operation cost multipliers, scalar preference, batching, handle reuse, and keeping denominators public.

Repo path: skills/fhe-gas-optimization/SKILL.md

what it covers

  • Explains 100-10,000x cost multipliers for FHE vs plaintext operations
  • Guides ciphertext-scalar preference over ciphertext-ciphertext
  • Shows handle reuse and ACL batching strategies to reduce gas
  • Covers architecture decisions: keeping rates, time, and denominators public

focused skill

fhe-testing

Focused skill for testing FHE contracts — Hardhat plugin, mock utils, mocked vs real protocol, debug decrypt, and end-to-end validation.

Repo path: skills/fhe-testing/SKILL.md

what it covers

  • Shows @fhevm/hardhat-plugin and @fhevm/mock-utils setup for local testing
  • Explains mocked mode vs real protocol: what each catches and misses
  • Covers debug decrypt for inspecting encrypted values during development
  • Guides end-to-end validation on testnet before mainnet deployment

Advanced patterns

focused skill

fhe-frontend-integration

Focused skill for integrating the Zama SDK into web apps — React, Next.js, relayer setup, SSR boundaries, and browser-side encryption.

Repo path: skills/fhe-frontend-integration/SKILL.md

what it covers

  • Shows @zama-fhe/react-sdk and @zama-fhe/sdk setup in React and Next.js
  • Explains SSR boundaries: SDK must run client-side only
  • Covers relayer SDK integration for reencryption and decryption
  • Guides WalletConnect vs Privy auth patterns for different user bases

focused skill

fhe-cross-contract

Focused skill for passing encrypted handles between contracts — multi-contract ACL flows, DeFi composability, and permission chain patterns.

Repo path: skills/fhe-cross-contract/SKILL.md

what it covers

  • Explains how to pass encrypted handles across contract boundaries
  • Shows multi-contract ACL grant chains: allowTransient for immediate forwarding
  • Covers factory and proxy patterns that preserve encrypted state
  • Guides composable DeFi flows where encrypted values traverse multiple protocols

focused skill

fhe-confidential-governance

Focused skill for confidential governance — ERC7984Votes, encrypted voting power, public delegation, private ballot casting, and tally patterns.

Repo path: skills/fhe-confidential-governance/SKILL.md

what it covers

  • Explains ERC7984Votes: delegation is public but voting power stays encrypted
  • Shows private ballot casting without revealing token holdings
  • Covers tally and reveal patterns for confidential vote counting
  • Guides integration with existing DAO governance frameworks

focused skill

fhe-defi-patterns

Focused skill for confidential DeFi — DEX integration, vaults, lending, streaming, and payment channels with encrypted state.

Repo path: skills/fhe-defi-patterns/SKILL.md

what it covers

  • Shows how to build DEX routers and AMMs with confidential order flow
  • Covers confidential vaults and lending with hidden collateral amounts
  • Explains payment streaming with encrypted deposits and time-based release
  • Guides operator and transfer variant selection for DeFi composability

focused skill

fhe-custodian-omnibus

Focused skill for omnibus and custodian patterns — ERC7984Omnibus, sub-account management, exchange custody, and reconciliation under encryption.

Repo path: skills/fhe-custodian-omnibus/SKILL.md

what it covers

  • Explains ERC7984Omnibus for managing sub-accounts under one on-chain address
  • Shows exchange deposit and withdrawal flows with encrypted amounts
  • Covers per-user accounting within omnibus wallets
  • Guides reconciliation and audit patterns under encrypted custodian state