详细分析 ▾
运行时依赖
版本
- Initial release of the create-aptos-project skill. - Scaffolds new Aptos projects using npx create-aptos-dapp, supporting fullstack (Vite or Next.js) and contract-only templates. - Guides users through project type, framework, network selection, and optional API key setup. - Enforces best practices: always scaffold with create-aptos-dapp, never create project structures manually, and never display private keys. - Includes a detailed workflow and checklist for initializing, testing, and committing new projects. - Covers troubleshooting and recommendations for a smooth project setup experience.
安装命令 点击复制
技能文档
Purpose
Scaffold new Aptos projects using npx create-aptos-dapp. This is the mandatory first step when a user wants to
build any new Aptos app, dApp, or project — regardless of how they phrase it.
ALWAYS
- 使用
npx 创建-aptos-dapp到 scaffold — NEVER 创建 projects 从 scratch manually - Ask 用户 关于 project 类型, 框架, 和 network 之前 scaffolding
- 验证
.env在...中.gitignore之前 任何 git operations - 使用 相同 network 对于 both
创建-aptos-dapp和aptos init - 关注 满 Build dApp workflow 之后 scaffolding (contracts, tests, audit, deploy, frontend)
NEVER
- Skip scaffolding — 甚至 对于 "simple" projects, always 开始 带有
创建-aptos-dapp - 创建 project structure manually — boilerplate 模板 handles
- Display 或 读取 私有 keys — 使用
"0x..."作为 placeholder - Run
git 添加 .或git 添加 -没有 第一个 verifying.env在...中.gitignore
Decision Tree
Before running the scaffold command, gather these inputs from the user:
1. Project Name
Derive from the user's description or ask directly. Use kebab-case (e.g., habit-tracker, nft-marketplace).
2. Project 类型
| Option | When to Use |
|---|---|
| Fullstack (default) | User wants a frontend + smart contracts |
| Contract-only | User only wants Move smart contracts (no frontend) |
3. 框架 (fullstack 仅)
| Option | When to Use |
|---|---|
| Vite (default) | Default choice, lighter setup |
| Next.js | User asks for Next.js or SSR |
4. Network
| Option | When to Use |
|---|---|
| devnet (default) | Development and testing |
| testnet | Pre-production, user explicitly asks |
| mainnet | Production, user explicitly asks |
5. API 键 (可选)
Ask if the user has a Geomi API key. It's optional for devnet but recommended for testnet/mainnet to avoid rate limits. Get one at https://geomi.dev (create project -> API Resource -> copy key).
Scaffolding Commands
# Fullstack dApp with Vite (frontend + contracts)
npx create-aptos-dapp \
--project-type fullstack \
--template boilerplate-template \
--framework vite \
--network # Fullstack dApp with Next.js
npx create-aptos-dapp \
--project-type fullstack \
--template boilerplate-template \
--framework nextjs \
--network
# Contract-only (Move project)
npx create-aptos-dapp \
--project-type move \
--network
可选 flags:
--api-键 <键>— Pass Geomi API 键 期间 scaffolding--使用-surf— Enable Surf 对于 类型-safe contract interactions
Post-Scaffold Checklist
After scaffolding, complete these steps in order:
cd- 验证
.env在...中.gitignore之前 任何 git operations - Run
aptos init --network(使用 相同 network 作为 上面)--assume-是 - 验证:
npm run 移动:compile && npm run 移动:test git init && git 添加 . && git commit -m "Initial commit"
Build dApp Workflow
ALWAYS 关注 workflow 当...时 用户 wants 到 build 新的 Aptos app, dApp, 或 project. applies regardless of how the user phrases it ("build me a ...", "create a ...", "make a ...", "I want to build ...").
/创建-aptos-project-> scaffold 带有npx 创建-aptos-dapp( skill — NEVER skip)/写入-contracts-> 写入 移动 modules/generate-tests-> 创建 test suite, 验证 100% coverage/security-audit-> audit 之前 deployment/deploy-contracts-> deploy contract 到 specified network/使用-ts-sdk-> orchestrates frontend integration (routes 到 ts-sdk-client, ts-sdk-transactions,
什么 Boilerplate Includes
Fullstack 模板
contract/— 移动 smart contract 带有移动.toml和 starter 模块frontend/— React app 带有 Aptos wallet adapter pre-configured包.json— Scripts 对于移动:compile,移动:test,移动:发布,dev,build.env— Environment variables 对于 network, API 键, 和 publisher 账户
Contract-仅 模板
contract/— 移动 smart contract 带有移动.toml和 starter 模块包.json— Scripts 对于移动:compile,移动:test,移动:发布.env— Environment variables 对于 network 和 publisher 账户
Troubleshooting
npx 创建-aptos-dapp command 不 found
# Auto-confirm the npx package install prompt
npx --yes create-aptos-dapp ...
If that still fails, verify Node.js and npm are installed (node -v && npm -v).
Compile failures 之后 scaffold
- Check
contract/移动.toml有 正确 named addresses - Run
aptos init --network如果 不 已完成--assume-是 - 验证
my_addr设置 到"_"在...中[addresses]section
Named address errors
The boilerplate uses my_addr = "_" which gets resolved from .env at compile time. Ensure
VITE_MODULE_PUBLISHER_ACCOUNT_ADDRESS is set in .env (populated by aptos init).
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制