From vechain-ai
Scaffolds VeChain dApps using Next.js, VeChain Kit, Chakra UI v3; supports standalone frontend or monorepo with Turborepo, Hardhat contracts; deploys to GitHub Pages.
npx claudepluginhub vechain/vechain-ai-skills --plugin secure-github-actionsThis skill uses the workspace's default tool permissions.
Scaffold a production-ready VeChain dApp with wallet connection, dark mode, and GitHub Pages deployment.
Suggests manual /compact at logical task boundaries in long Claude Code sessions and multi-phase tasks to avoid arbitrary auto-compaction losses.
Share bugs, ideas, or general feedback.
Scaffold a production-ready VeChain dApp with wallet connection, dark mode, and GitHub Pages deployment.
shared.md — it contains the source code templates used by both modes.| Layer | Technology |
|---|---|
| Framework | Next.js 14 (App Router, static export) |
| UI | Chakra UI v3, next-themes |
| Wallet | @vechain/vechain-kit (VeWorld + WalletConnect) |
| State | React Query |
| Contracts | Hardhat + @vechain/sdk-hardhat-plugin + OpenZeppelin UUPS (monorepo only) |
| Build | Turborepo (monorepo only) |
| Deploy | GitHub Pages via GitHub Actions |
| Node | 20 LTS |
Ask the user (use structured questions if available):
my-vechain-dapp)standalone (frontend only) or monorepo (Turbo + contracts)test or main (default: test)Read the appropriate reference files and create all files.
Standalone mode:
{{TARGET_DIR}}/{{PROJECT_NAME}}/Monorepo mode:
{{TARGET_DIR}}/{{PROJECT_NAME}}/apps/frontend/packages/Replace these placeholders in ALL templates:
| Placeholder | Value |
|---|---|
{{PROJECT_NAME}} | kebab-case project name |
{{PROJECT_TITLE}} | Title-case project name (for UI display) |
{{NETWORK_TYPE}} | test or main |
cd {{PROJECT_NAME}}
nvm use
yarn install
Standalone: yarn dev (localhost:3000), yarn build (static export → out/)
Monorepo: make solo-up (start Thor solo node, requires Docker), then yarn dev (auto-deploys contracts to solo), yarn build, yarn contracts:compile, yarn contracts:test. Stop with make solo-down, reset with make solo-clean.
git init && git add . && git commit -m "Initial scaffold: VeChain dApp"
yarn dev starts without errorsyarn build produces static output.github/workflows/deploy.yml is presentVeChain Kit cannot run server-side. The entire app shell (ClientApp) is loaded via dynamic(() => ..., { ssr: false }) in layout.tsx. All VeChain Kit imports inside ClientApp children work normally since the parent is already client-only.
next.config.js uses output: "export" with configurable basePath/assetPrefix via NEXT_PUBLIC_BASE_PATH env var. GitHub Actions defaults to /${{ github.event.repository.name }} for GitHub Pages. Set to empty string for custom domains. Important: metadata.icons and raw <img src> paths do NOT auto-prepend basePath — prefix them manually.
Pin @chakra-ui/react to an exact version (currently 3.30.0). VeChain Kit uses Chakra v2 internally, and newer v3 releases can break VeChain Kit's button/modal theming.
ChakraProvider → ColorModeProvider → QueryClientProvider → VeChainKitProvider → App
All contracts in the monorepo scaffold are UUPS upgradeable using OpenZeppelin's upgradeable contracts and a custom VeChainProxy.sol (ERC1967). Key files:
scripts/helpers/upgrades.ts — core deploy/upgrade proxy helpers. Copy as-is from the template. All deploy scripts, upgrade scripts, and tests depend on it.contracts/VeChainProxy.sol — ERC1967 proxy contract. Copy as-is.scripts/deploy/deploy.ts — production deployment using deployProxy from helpers.scripts/upgrade/ — interactive CLI upgrade system with versioned config registry.For contract architecture, upgrade patterns, storage safety, security, and testing — follow the smart-contract-development skill. It is the authoritative reference for all Solidity development patterns on VeChain.
The monorepo uses a packages/config package that centralizes contract addresses and network settings per environment. Key mechanics:
local.ts is git-ignored — each dev's solo deployment produces different addresses. A mock is auto-generated on first run.NEXT_PUBLIC_APP_ENV controls which config file is loaded (local, testnet, mainnet).yarn dev runs against solo, yarn dev:testnet against testnet, yarn dev:mainnet against mainnet.checkContractsDeployment.ts runs before dev for any environment — if contracts aren't deployed, it deploys them and writes addresses to the correct config file (local.ts, testnet.ts, or mainnet.ts).VeChainKitProvider wraps the app with network config and wallet optionsWalletButton from vechain-kit renders the connect/account buttonuseWallet, useSendTransaction, useCallClause for wallet/contract interactionvechain-kit skill for advanced patterns (hooks, theming, social login)vechain-core skill for SDK patterns (fee delegation, multi-clause)Read the matching files BEFORE creating any files. See Critical Rules above.
| Topic | File | Read when... |
|---|---|---|
| Shared source code | references/shared.md | Always — contains all component/provider templates |
| Standalone config | references/standalone.md | User chose standalone mode (frontend only) |
| Monorepo config | references/monorepo.md | User chose monorepo mode (Turbo + contracts) |