Help us improve
Share bugs, ideas, or general feedback.
From bn-fhevm
Use when scaffolding a new FHEVM workspace -- contracts, Next.js frontend, or Vite frontend. Copies the canonical bundled template (project/ or templates/frontend-{next,vite}/) into a target directory and customizes package metadata, env-var defaults, and the Sepolia RPC URL via an interactive AskUserQuestion wizard.
npx claudepluginhub bootnodedev/zama-s2-bounty-skillsHow this skill is triggered — by the user, by Claude, or both
Slash command
/bn-fhevm:create-templateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Scaffold a fresh FHEVM workspace from one of the bundle's canonical templates.
Measures whether skills, rules, and agent definitions are actually followed by auto-generating test scenarios at 3 strictness levels and reporting compliance rates with full tool call timelines.
Share bugs, ideas, or general feedback.
Scaffold a fresh FHEVM workspace from one of the bundle's canonical templates.
Core principle: Templates are the source of truth. The wizard copies, then patches — it never invents.
| Variant | Source path | Produces |
|---|---|---|
contracts | project/ | Hardhat workspace with the three flagships |
frontend-next | templates/frontend-next/ | Next.js 16 App Router app wired against ConfidentialVoting |
frontend-vite | templates/frontend-vite/ | Vite + React app wired against ConfidentialVoting |
both | project/ + templates/frontend-{next,vite}/ (chosen) | Parent dir containing contracts/ and frontend/ as sibling workspaces |
Use AskUserQuestion (single-select):
contracts — Hardhat workspace with ConfidentialCounter, ConfidentialToken, ConfidentialVoting.frontend-next — Next.js 16 reference app for ConfidentialVoting.frontend-vite — Vite reference app for ConfidentialVoting.both — fullstack: contracts + frontend (Next or Vite, chosen in step 2D) as siblings under one parent.Branch on the answer to one of the four step-2 paths below.
contracts sub-questionsUse a single AskUserQuestion call with up to 4 questions:
"Target dir"): default ./contracts. Reject answers that already exist as a non-empty directory — re-ask with a different default."Pkg name"): default the basename of the target dir (e.g. contracts)."RPC provider"):
Alchemy (default) — keep the URL template from project/hardhat.config.ts verbatim.Infura — rewrite the URL template to https://sepolia.infura.io/v3/${RPC_KEY}.Public RPC — rewrite to https://ethereum-sepolia-rpc.publicnode.com (constant; no key needed; user can still override per-deploy)."Wrap test"): default Yes. If No, drop contracts/mocks/, test/ConfidentialToken.ts's ConfidentialTokenWrapper describe block, and MockERC20/ERC7984ERC20WrapperMock typechain bindings.frontend-next sub-questions./frontend-next).NEXT_PUBLIC_CONFIDENTIAL_VOTING_ADDRESS). If a non-default name is chosen, rewrite every app/page.tsx and lib/*.ts reference.frontend-vite sub-questions./frontend-vite).VITE_CONTRACT_ADDRESS). Same rewrite rule as the Next variant.both sub-questions (contracts + frontend in one parent)Use a single AskUserQuestion call with up to 4 questions:
"Frontend"): Next.js (frontend-next) or Vite (frontend-vite)."Parent dir"): default ./my-app. Reject answers that already exist as a non-empty directory."RPC provider"): Alchemy (default) / Infura / Public RPC — applied to the contracts side only."Wrap test"): default Yes — same semantics as the contracts variant.Derived defaults (no question needed):
<parent-basename>-contracts<parent-basename>-frontendNEXT_PUBLIC_CONFIDENTIAL_VOTING_ADDRESS (Next) or VITE_CONTRACT_ADDRESS (Vite)The wizard creates this layout:
<parent>/
├── contracts/ # from project/
└── frontend/ # from templates/frontend-{next,vite}/ (variant chosen above)
Resolve <repo-root> to the directory containing CLAUDE.md and architecture.md. Resolve <source> to the source path from the table above (<repo-root>/project or <repo-root>/templates/<variant>).
Use cp -r (NOT git clone) and skip the listed paths via rsync or two-step copy:
| Variant | Skip paths |
|---|---|
contracts | node_modules, artifacts, cache, types, deployments, coverage, dist, fhevmTemp |
frontend-next | node_modules, .next, dist |
frontend-vite | node_modules, dist |
both | Run two copies: <parent>/contracts/ from project/ (same skip list as contracts), then <parent>/frontend/ from templates/frontend-{next,vite}/ (same skip list as the chosen frontend variant). |
Concretely:
rsync -a \
--exclude=node_modules \
--exclude=artifacts \
--exclude=cache \
--exclude=types \
--exclude=deployments \
--exclude=coverage \
--exclude=dist \
--exclude=fhevmTemp \
"$SOURCE/" "$TARGET/"
(Adapt the --exclude list per variant. For both, run this twice with different $SOURCE/$TARGET pairs.)
Apply the user's customizations to the copy, never to the source.
Always (every variant):
<target>/package.json:
"name": ... with the user's package name."version": "0.1.0"."homepage" and "repository" fields (or leave them up to the user — print a TODO).<target>/README.md if it references this repo by name; replace with a generic placeholder.Contracts variant only:
sepolia.url line in <target>/hardhat.config.ts from the Alchemy URL template to https://sepolia.infura.io/v3/${RPC_KEY}.https://ethereum-sepolia-rpc.publicnode.com and drop the RPC_KEY interpolation. Add a comment noting that public RPCs are rate-limited.<target>/contracts/mocks/.<target>/test/ConfidentialToken.ts, delete the second describe("ConfidentialTokenWrapper", ...) block.Frontend variants only:
<target>/app/page.tsx, <target>/src/App.tsx (Vite), <target>/lib/wagmi.ts, etc.Summarize what was done. Print the next-step commands the user should run, customized to the variant:
Contracts:
cd <target>
npm install
npx hardhat vars set MNEMONIC
npx hardhat vars set RPC_KEY
npm run compile
npm test
Frontend (Next):
cd <target>
npm install
echo "NEXT_PUBLIC_CONFIDENTIAL_VOTING_ADDRESS=0x..." > .env.local
npm run dev
Frontend (Vite):
cd <target>
npm install
echo "VITE_CONTRACT_ADDRESS=0x..." > .env.local
npm run dev
Both (fullstack):
# 1. Compile + test contracts side
cd <parent>/contracts
npm install
npx hardhat vars set MNEMONIC
npx hardhat vars set RPC_KEY
npm run compile && npm test
# 2. (Optional) deploy to Sepolia and capture the address
# npx hardhat run scripts/deploy.ts --network sepolia
# 3. Wire the address into the frontend env and start dev server
cd ../frontend
npm install
# For Next.js variant:
echo "NEXT_PUBLIC_CONFIDENTIAL_VOTING_ADDRESS=0x..." > .env.local
# For Vite variant:
# echo "VITE_CONTRACT_ADDRESS=0x..." > .env.local
npm run dev
AskUserQuestion with a different default. Never overwrite without explicit user confirmation.<repo-root>/project or <repo-root>/templates/<variant> doesn't exist, abort and explain — likely the user is invoking the skill outside the bundle.rsync not available. Fall back to cp -r plus a follow-up rm -rf <target>/{node_modules,...}.npm install && npm run compile in the target as a smoke test if the user opts in.fhevm-contracts / fhevm-erc7984 / fhevm-decryption skills directly.npx hardhat deploy --network sepolia themselves after hardhat vars set.project/, templates/frontend-{next,vite}/). The wizard is one-way — copy and patch.fhevm-contracts.@zama-fhe/sdk@3.0.0 → fhevm-decryption + fhevm-frontend directly.project/ or templates/<variant>/ in place; do not invoke this wizard.fhevm-setup/SKILL.md — bootstrap from scratch (no template). Use only if the bundle isn't checked out alongside.fhevm-contracts/SKILL.md — Solidity authoring patterns inside the scaffolded contracts workspace.fhevm-frontend/SKILL.md — extending the scaffolded frontend (provider wiring, encrypt/decrypt hooks).