fhevm-agent-skill
v1.0.2
Published
FHEVM Agent Engineer — Production skill pack for building confidential smart contracts with AI agents
Downloads
333
Maintainers
Readme
FHEVM Agent Engineer: Production Skill Pack for Confidential Smart Contracts
Turn any AI coding agent (Cursor, Claude Code, Windsurf) into a reliable FHEVM developer. This skill pack provides the patterns, references, examples, and validator that agents need to build, test, and deploy confidential smart contracts correctly.
Quick Install
# Option 1: npm package
npx @fhevm/agent-skill init
# Option 2: clone repo
git clone https://github.com/Saber1Y/fhevm-agent-skill-pack.git
cp fhevm-agent-skill-pack/SKILL.md my-project/
cp -r fhevm-agent-skill-pack/references my-project/
cp fhevm-agent-skill-pack/scripts/fhevm-lint.js my-project/scripts/What's Included
SKILL.md
The core agent brain — tells AI agents how to set up FHEVM, write contracts, test, deploy, and integrate frontends. Includes decision trees and anti-pattern warnings.
references/ (9 files)
fhevm-patterns.md— Core FHEVM operation patternsencrypted-types.md— Full type matrix (euint8 through euint256)acl-and-permissions.md— ACL system: FHE.allow, FHE.allowThis, FHE.allowTransientinput-proofs.md— ZK proof validation for encrypted inputsdecryption-flows.md— User decryption with EIP-712 signingerc7984-confidential-token.md— ERC-7984 confidential token standardfrontend-fhevmjs.md— Frontend integration with fhevmjs + Reacttesting-hardhat.md— Hardhat testing patterns with encrypted inputsanti-patterns.md— 8 common mistakes with fixes
examples/ (5 production examples)
confidential-voting/— Encrypted voting with tally decryptionsealed-bid-auction/— Sealed-bid auction with encrypted bidsconfidential-erc7984/— Full ERC-7984 confidential tokenerc20-wrapper/— ERC-20 ↔ ERC-7984 wrapping flowfrontend-decrypt-demo/— React frontend with decrypt button
scripts/fhevm-lint.js
Validator that scans Solidity files for 8 common FHEVM mistakes:
- Missing ZamaEthereumConfig import
- Missing FHE.allowThis()
- Missing FHE.allow() for users
- Encrypted values in require()
- Returning encrypted values without ACL
- Missing inputProof parameter
- Decrypting inside Solidity
- Encrypted handles in events
agent-evals/ (5 test cases)
Prompt-based evaluation cases with expected output and checklists:
- Confidential voting
- Confidential payroll
- Confidential ERC-7984 token
- Frontend decrypt demo
- Hardhat test writing
Usage
- Install the skill into your project
- Open your project in Cursor/Claude Code (agent reads SKILL.md automatically)
- Prompt: "Build a confidential voting dApp with encrypted votes, user decryption, tests, and frontend"
- Agent generates the code
- Run
npm run fhevm:lintto catch mistakes - Run
npm run testto verify - Deploy
Development Workflow
prompt → agent reads SKILL.md → generates code → fhevm:lint catches errors → agent fixes → npm run test passes → deployLicense
MIT
