make-env-setup
Get this machine ready to build a Make App: install the toolchain, verify Make login, and initialize the project folder. Run it on a new machine, and again whenever the tools need updating.
Safety Rules
- Do not print or store tokens, cookies, Authorization headers, passwords, or secrets.
- Do not manually create PRD, DSL, Service, or UI files; only run
makecli app init in the selected directory.
- Interactive secret entry must be completed by the user. Do not ask the user to paste secrets into chat.
Install Or Update Toolchain
The only prerequisite is Node.js (LTS, 20 or newer); it ships npm, and everything else installs through npm. Never touch a tool that exists but is managed elsewhere (for example node via nvm, pnpm via corepack) — note it in the summary instead.
Ensure node, git, and pnpm exist.
node and git are system-level installs; if either is missing, install it with the platform's own method — but only after the user confirms:
| Platform |
Node.js |
git |
| macOS |
nodejs.org installer, or brew install node if Homebrew is already present |
xcode-select --install |
| Linux |
distro package (apt install nodejs npm, dnf install nodejs) or nvm |
distro package (apt install git) |
| Windows |
winget install OpenJS.NodeJS.LTS or nodejs.org installer |
winget install Git.Git |
Open a new terminal after installing Node so npm and its global bin directory are on PATH. If pnpm is missing, npm install -g pnpm.
Install or update makecli. If makecli exists, run makecli update --skip-skills; otherwise npm install -g @qfeius/makecli. makecli update knows how it was installed: an npm or pnpm install is upgraded through that package manager, any other install replaces the binary in place.
If npm install -g fails with EACCES, do not use sudo. Point npm's global prefix at a user-owned directory, add it to PATH, then retry:
npm config set prefix "$HOME/.npm-global"
export PATH="$HOME/.npm-global/bin:$PATH" # also add this line to the shell profile
Install or update Make platform skills every run.
npx skills add qfeius/make-platform-skills --all -y
Show a compact Make skills result based on the command output, such as installed, updated, or already current.
Verify Versions
After install or update, run all checks and show a compact summary:
node --version
npm --version
pnpm --version
git --version
makecli version
Verify Token With Guided Login
After the environment is configured successfully, check the current token:
makecli configure verify --output=json
If verification succeeds, continue to project folder initialization.
If verification fails because the token is missing, expired, invalid, or belongs to the wrong environment:
- Run:
makecli login --timeout=60s
The command opens the browser, waits up to 60 seconds for the login callback, then exits on its own. If it prints an authorization URL instead of opening a browser, relay that URL to the user.
- If the command exits successfully, login is done; continue to project folder initialization.
- If the command exits with a timeout or callback error, tell the user:
请在浏览器中完成 makecli 登录。完成后回复“已经完成登录”。
Then stop and wait for the user to reply 已经完成登录.
- After the user replies, run
makecli configure verify --output=json. If valid is true, login succeeded; continue. If valid is false, go back to step 1.
If browser login is not convenient, offer the token fallback:
makecli configure token
The user must complete interactive secret entry in their own terminal. After the user finishes, run makecli configure verify --output=json to confirm the token. If valid is false, ask the user to re-enter the token, or fall back to the guided makecli login flow above.
Initialize App Project Folder
makecli app init derives the app key from the target directory's basename and validates the name itself; do not pre-validate names in this skill.
- Pick a candidate:
- If the user has already described the app they want to build, recommend a folder name derived from that description.
- Otherwise, if the current directory is not an existing project, recommend initializing in place.
- Otherwise recommend a generic name such as
make_app.
- Confirm with the user:
是否使用 <app-folder> 作为 App 目录?请回复 “是” 或 “否”。
If the user replies anything other than 是 or 否, ask again with the same prompt.
- If the user replies
否, ask:请输入 App 目录地址:
Accept an absolute or relative path as provided.
- Run
makecli app init <app-folder>, or makecli app init with no argument when initializing the current directory. The command creates the directory if needed and is idempotent.
- If init fails with an invalid key error, the error message states the naming rule: derive a compliant folder name from the chosen one (for example
contract-ledger → contract_ledger), tell the user the adjusted name, and retry. For other errors, report the error and ask the user whether to retry or choose another directory. Continue only after init succeeds.
Setup Completion Output
End only after the toolchain is installed and verified, the token is valid (initial verification passed or the login flow succeeded), and makecli app init succeeded. Use a concise readiness report:
- Tool versions: Node, npm, pnpm, git, makecli.
- Make skills result.
- Login status: already valid or refreshed with
makecli login.
- App folder: the initialized directory.
Keep the completion output concise and next-step focused. Omit negative summaries about actions not performed.
If everything passes, say:
Make 开发环境已经准备好,可以进行下一步开发 App。
Then provide this small example:
App 参考示例:
我要做一个 Make App,用来演示合同台账管理。
角色包括管理员和业务人员。
核心流程是新建合同、维护付款计划、查看合同列表和详情。
请先和我确认需求细节,生成 apps/docs/PRD.md,再进行 DSL 建模;DSL 必须先 diff,等我确认后才 apply。
1---2name: make-env-setup3description: Use when preparing or updating the local Make development environment before development. Triggered by Make 环境安装, Make 环境初始化, 更新 Make 环境. Does not manage Make resources, deploy Apps, or write PRD, DSL, Service, or UI code; use makecli for resource/deploy operations and the owning skills for implementation.4---56# make-env-setup7Get this machine ready to build a Make App: install the toolchain, verify Make login, and initialize the project folder. Run it on a new machine, and again whenever the tools need updating.8910## Safety Rules11- Do not print or store tokens, cookies, Authorization headers, passwords, or secrets.12- Do not manually create PRD, DSL, Service, or UI files; only run `makecli app init` in the selected directory.13- Interactive secret entry must be completed by the user. Do not ask the user to paste secrets into chat.1415## Install Or Update Toolchain1617The only prerequisite is Node.js (LTS, 20 or newer); it ships `npm`, and everything else installs through `npm`. Never touch a tool that exists but is managed elsewhere (for example node via nvm, pnpm via corepack) — note it in the summary instead.18191. Ensure `node`, `git`, and `pnpm` exist.2021 `node` and `git` are system-level installs; if either is missing, install it with the platform's own method — but only after the user confirms:2223 | Platform | Node.js | git |24 |---|---|---|25 | macOS | [nodejs.org](https://nodejs.org/) installer, or `brew install node` if Homebrew is already present | `xcode-select --install` |26 | Linux | distro package (`apt install nodejs npm`, `dnf install nodejs`) or [nvm](https://github.com/nvm-sh/nvm) | distro package (`apt install git`) |27 | Windows | `winget install OpenJS.NodeJS.LTS` or [nodejs.org](https://nodejs.org/) installer | `winget install Git.Git` |2829 Open a new terminal after installing Node so `npm` and its global bin directory are on `PATH`. If `pnpm` is missing, `npm install -g pnpm`.30312. Install or update `makecli`. If `makecli` exists, run `makecli update --skip-skills`; otherwise `npm install -g @qfeius/makecli`. `makecli update` knows how it was installed: an npm or pnpm install is upgraded through that package manager, any other install replaces the binary in place.3233 If `npm install -g` fails with `EACCES`, do not use `sudo`. Point npm's global prefix at a user-owned directory, add it to `PATH`, then retry:3435 ```bash36 npm config set prefix "$HOME/.npm-global"37 export PATH="$HOME/.npm-global/bin:$PATH" # also add this line to the shell profile38 ```39403. Install or update Make platform skills every run.4142 ```bash43 npx skills add qfeius/make-platform-skills --all -y44 ```4546 Show a compact Make skills result based on the command output, such as installed, updated, or already current.4748## Verify Versions4950After install or update, run all checks and show a compact summary:5152```bash53node --version54npm --version55pnpm --version56git --version57makecli version58```5960## Verify Token With Guided Login6162After the environment is configured successfully, check the current token:6364```bash65makecli configure verify --output=json66```6768If verification succeeds, continue to project folder initialization.6970If verification fails because the token is missing, expired, invalid, or belongs to the wrong environment:71721. Run:73 ```bash74 makecli login --timeout=60s75 ```76 The command opens the browser, waits up to 60 seconds for the login callback, then exits on its own. If it prints an authorization URL instead of opening a browser, relay that URL to the user.772. If the command exits successfully, login is done; continue to project folder initialization.783. If the command exits with a timeout or callback error, tell the user:79 ```text80 请在浏览器中完成 makecli 登录。完成后回复“已经完成登录”。81 ```82 Then stop and wait for the user to reply `已经完成登录`.834. After the user replies, run `makecli configure verify --output=json`. If `valid` is `true`, login succeeded; continue. If `valid` is `false`, go back to step 1.8485If browser login is not convenient, offer the token fallback:8687```bash88makecli configure token89```9091The user must complete interactive secret entry in their own terminal. After the user finishes, run `makecli configure verify --output=json` to confirm the token. If `valid` is `false`, ask the user to re-enter the token, or fall back to the guided `makecli login` flow above.9293## Initialize App Project Folder9495`makecli app init` derives the app key from the target directory's basename and validates the name itself; do not pre-validate names in this skill.96971. Pick a candidate:98 - If the user has already described the app they want to build, recommend a folder name derived from that description.99 - Otherwise, if the current directory is not an existing project, recommend initializing in place.100 - Otherwise recommend a generic name such as `make_app`.1012. Confirm with the user:102 ```text103 是否使用 <app-folder> 作为 App 目录?请回复 “是” 或 “否”。104 ```105 If the user replies anything other than `是` or `否`, ask again with the same prompt.1063. If the user replies `否`, ask:107 ```text108 请输入 App 目录地址:109 ```110 Accept an absolute or relative path as provided.1114. Run `makecli app init <app-folder>`, or `makecli app init` with no argument when initializing the current directory. The command creates the directory if needed and is idempotent.1125. If init fails with an invalid key error, the error message states the naming rule: derive a compliant folder name from the chosen one (for example `contract-ledger` → `contract_ledger`), tell the user the adjusted name, and retry. For other errors, report the error and ask the user whether to retry or choose another directory. Continue only after init succeeds.113114## Setup Completion Output115116End only after the toolchain is installed and verified, the token is valid (initial verification passed or the login flow succeeded), and `makecli app init` succeeded. Use a concise readiness report:117118- Tool versions: Node, npm, pnpm, git, makecli.119- Make skills result.120- Login status: already valid or refreshed with `makecli login`.121- App folder: the initialized directory.122123Keep the completion output concise and next-step focused. Omit negative summaries about actions not performed.124125If everything passes, say:126127```text128Make 开发环境已经准备好,可以进行下一步开发 App。129```130131Then provide this small example:132133```text134App 参考示例:135136我要做一个 Make App,用来演示合同台账管理。137角色包括管理员和业务人员。138核心流程是新建合同、维护付款计划、查看合同列表和详情。139请先和我确认需求细节,生成 apps/docs/PRD.md,再进行 DSL 建模;DSL 必须先 diff,等我确认后才 apply。140```