Cadence Code Scaffold
Generate production-ready Cadence contracts, transactions, and DeFi transactions following security-first standards.
Scaffold Types
Determine what the user needs and follow the appropriate reference:
| What to generate | Reference |
|---|---|
| Smart contract (NFT, FT, general, admin) | scaffold-contract.md |
| Transaction (transfer, setup, mint, multi-sig) | scaffold-transaction.md |
| DeFi Actions transaction (restake, swap, auto-balance) | scaffold-defi.md |
General Principles
All generated code must follow:
access(self)by default for all fields/functions- Entitlements for all privileged operations
- String-based imports (
import "ContractName") - Descriptive panic messages with interpolated values
- Events for significant state changes
- Complete
init()with all state initialized
Companion Skills
cadence-lang— Always consult when generating code. Every scaffolded contract and transaction must follow Cadence access control, entitlement, resource safety, and design pattern rules.cadence-tokens— Consult when scaffolding NFT or FT contracts for standard interface requirements and MetadataViews.cadence-audit— Run an audit on generated code to verify it follows security best practices before the user deploys.flow-cli— Use to deploy and test scaffolded contracts and transactions.cadence-testing— Use to write tests for any scaffolded contract or transaction before deployment.