Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
7
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Next.js-based decentralized web frontend for the LOVE20 Protocol, a blockchain governance and token system. The project uses:
# Development server (runs on 0.0.0.0:3000) yarn dev # Production build yarn build # Test build (uses NODE_ENV=test) yarn test # Public test build (copies .env.public_test to .env.local) yarn public-test # Start production server yarn start # Generate ABI TypeScript files from Foundry contracts yarn generate:abi # Generate environment configuration yarn generate:env
src/pages/ - Next.js pages using Pages Router (not App Router)src/components/ - Reusable React components organized by featuresrc/hooks/ - Custom React hooks, especially contract interaction hookssrc/lib/ - Utility functions and shared logicsrc/abis/ - Generated TypeScript ABI files from smart contractssrc/errors/ - Error mapping for smart contract errorssrc/config/ - Configuration files (token configs, etc.)scripts/ - Build and utility scriptsThe application supports multiple blockchain networks configured via environment variables:
NEXT_PUBLIC_CHAIN environment variable selects the target blockchainsrc/wagmi.ts, dynamically configures based on selected chainsrc/lib/web3.ts provides wallet network validation utilitiesyarn generate:abi to generate TypeScript ABIs from Foundry contract artifactssrc/hooks/contracts/ wrap contract interactions using wagmisrc/errors/ for better UXyarn generate:abi. The frontend uses these ABIs to interact with smart contracts. Each core contract (such as LOVE20Token, LOVE20Vote, LOVE20Submit, LOVE20Join, etc.) has a corresponding ABI file, ensuring type safety and reliable contract method calls..env.development, .env.public_test, etc.NEXT_PUBLIC_CHAIN, RPC URLs, Foundry ABI pathsscripts/generate-env.js.env.* file is configured for target networkyarn generate:abi to update TypeScript ABIsNEXT_PUBLIC_CHAIN environment variable to target different networksyarn test for build validation; no traditional test framework detectedyarn build for production deploymentconst { token } = useContext(TokenContext) 获取symbol=${token.symbol} 作为 token 标识参数id=${actionId} 而不是 actionId=${actionId}