make-env-setup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

make-env-setup

make-env-setup

Get this machine ready to build a Make App: select the appropriate toolchain, verify Make login, and initialize a project folder only for a new App. Run it on a new machine, and again whenever the tools need updating. Use
makecli
for resource/deploy operations and the owning skills for implementation.
将本机配置为可构建Make App的状态:选择合适的工具链、验证Make登录状态,且仅为新应用初始化项目文件夹。在新机器上运行此技能,工具需要更新时也可再次运行。资源/部署操作请使用
makecli
,功能实现请使用对应专属技能。

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.
  • Do not install pnpm through npm. For a new or explicitly migrated App, use the fixed Corepack/pnpm baseline below. An existing compatible npm or Yarn App keeps its declared installer and lockfile; this environment skill must not switch it to pnpm.
  • 不得打印或存储token、cookie、Authorization头、密码或其他密钥信息。
  • 不得手动创建PRD、DSL、Service或UI文件;仅可在选定目录中运行
    makecli app init
    。
  • 交互式密钥输入必须由用户自行完成。不得要求用户将密钥粘贴到聊天框中。
  • 不得通过npm安装pnpm。对于新建应用或明确要求迁移的应用,请使用下方固定的Corepack/pnpm基准版本。现有兼容的npm或Yarn应用应保留其声明的安装工具和lockfile;本环境技能不得将其切换为pnpm。

Select Project Mode

选择项目模式

  • For a new App or a user-requested explicit runtime migration, follow the fixed Node.js/Corepack/pnpm baseline below. Runtime migration itself belongs to
    make-app-runtime
    ; do not change an existing repository's manifests or lockfile in this setup flow.
  • For an existing Make App without an explicit migration, inspect its workspace
    packageManager
    , Node
    engines
    , Node-selection file, lockfile and CI/install workflow before choosing tools. Keep the compatible declared Node and package manager, including npm or Yarn. Do not add Corepack or pnpm merely to update the local environment. If these declarations disagree, the needed runtime is unclear, or the target platform build image is incompatible, stop and report the blocker to
    make-app-runtime
    rather than guessing or creating another lockfile.
  • If the target folder or new-versus-existing mode is unclear, ask the user before choosing a project runtime or initializing a folder.
  • 对于新建应用或用户明确要求的运行时迁移,请遵循下方固定的Node.js/Corepack/pnpm基准版本。运行时迁移本身属于
    make-app-runtime
    技能的职责;在本配置流程中不得修改现有仓库的清单文件或lockfile。
  • 对于未明确要求迁移的现有Make应用,在选择工具前请先检查其工作区的
    packageManager
    、Node
    engines
    、Node版本选择文件、lockfile以及CI/安装工作流。保留其声明的兼容Node版本和包管理器(包括npm或Yarn)。不得仅为更新本地环境而添加Corepack或pnpm。如果这些声明存在冲突、所需运行时不明确,或与目标平台构建镜像不兼容,请停止操作并将阻塞问题上报给
    make-app-runtime
    ,不得猜测或创建新的lockfile。
  • 如果目标文件夹或新建/现有模式不明确,请先询问用户,再选择项目运行时或初始化文件夹。

Install Or Update Toolchain

安装或更新工具链

This skill supports macOS, Linux, and Windows. For a new App or an explicitly migrated App, the runtime is fixed: Node.js
22.20.0
, its bundled Corepack
0.34.0
, and
pnpm@10.20.0
. Steps 1–3 below apply only to that mode. Do not substitute a moving LTS release, a Homebrew or global pnpm binary, or a newer Corepack release.
For an existing Make App without migration, verify its declared Node version with the active Node binary and use its established npm, Yarn or Corepack-managed pnpm workflow. If its declared Node is not installed, ask before installing that version; do not install
22.20.0
as an automatic replacement. Continue with the shared git, makecli and Skill checks, without rewriting App files.
  1. Ensure exact Node.js
    22.20.0
    and
    git
    are available. If either is missing, install it with the platform's own method only after the user confirms.
    PlatformNode.js
    22.20.0
    git
    macOSInstall and select with
    nvm install 22.20.0
    then
    nvm use 22.20.0
    ; if nvm is unavailable, use an exact-version manager selected by the user
    xcode-select --install
    , or Homebrew if already present
    LinuxInstall and select with
    nvm install 22.20.0
    then
    nvm use 22.20.0
    ; if nvm is unavailable, use an exact-version manager selected by the user
    distro package, for example
    apt install git
    WindowsUse an exact-version manager such as nvm-windows to install and select
    22.20.0
    , or the official Node.js
    22.20.0
    installer
    winget install Git.Git
    Do not use a moving package-manager formula such as
    brew install node
    ,
    apt install nodejs
    , or
    winget install OpenJS.NodeJS.LTS
    for the Make App runtime. If no exact-version Node manager is available, stop and ask the user to select one.
  2. Verify the fixed Node.js and Corepack baseline before installing pnpm. The checks below are cross-platform and must both pass:
    bash
    node -e 'if (process.versions.node !== "22.20.0") { throw new Error(`Make Apps require Node.js 22.20.0; got ${process.versions.node}`) }'
    node -e 'const { execFileSync } = require("node:child_process"); const actual = execFileSync("corepack", ["--version"], { encoding: "utf8" }).trim(); if (actual !== "0.34.0") { throw new Error(`Corepack must report 0.34.0; got ${actual}`) }'
  3. Enable Corepack and cache the fixed new/migrated App pnpm baseline. Do not install pnpm through npm, Homebrew, or another global package manager. Use
    corepack install -g
    , not the deprecated
    corepack prepare
    .
    bash
    corepack enable
    corepack install -g pnpm@10.20.0
    node -e 'const { execFileSync } = require("node:child_process"); const actual = execFileSync("corepack", ["pnpm", "--version"], { encoding: "utf8" }).trim(); if (actual !== "10.20.0") { throw new Error(`pnpm must report 10.20.0; got ${actual}`) }'
  4. Install or update
    makecli
    . If
    makecli
    exists, run
    makecli update --skip-skills
    ; otherwise run
    npm install -g @qfeius/makecli
    .
    makecli update
    knows how it was installed: an npm or pnpm install is upgraded through that package manager, and any other installation replaces the binary in place.
    If the npm global install fails with
    EACCES
    on macOS or Linux, do not use
    sudo
    . Point npm's global prefix at a user-owned directory, add it to
    PATH
    , then retry:
    bash
    npm config set prefix "$HOME/.npm-global"
    export PATH="$HOME/.npm-global/bin:$PATH"   # also add this line to the shell profile
  5. Install or update Make platform skills every run.
    bash
    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.
本技能支持macOS、Linux和Windows系统。对于新建应用或明确迁移的应用,运行时版本是固定的:Node.js
22.20.0
、其捆绑的Corepack
0.34.0
,以及
pnpm@10.20.0
。以下步骤1-3仅适用于该模式。不得使用动态LTS版本、Homebrew或全局pnpm二进制文件,或更新的Corepack版本替代。
对于未迁移的现有Make应用,请使用当前激活的Node二进制文件验证其声明的Node版本,并沿用其已建立的npm、Yarn或Corepack管理的pnpm工作流。如果其声明的Node版本未安装,请先询问用户再安装该版本;不得自动安装
22.20.0
作为替代。继续执行通用的git、makecli和技能检查,不得修改应用文件。
  1. 确保已安装精确版本的Node.js
    22.20.0
    和
    git
    。如果两者任一缺失,仅在用户确认后,使用对应平台的原生方法安装。
    平台Node.js
    22.20.0
    git
    macOS使用
    nvm install 22.20.0
    再执行
    nvm use 22.20.0
    来安装并选择版本;如果没有nvm,使用用户选择的精确版本管理器
    xcode-select --install
    ,如果已安装Homebrew也可通过Homebrew安装
    Linux使用
    nvm install 22.20.0
    再执行
    nvm use 22.20.0
    来安装并选择版本;如果没有nvm,使用用户选择的精确版本管理器
    发行版自带的包管理器,例如
    apt install git
    Windows使用nvm-windows之类的精确版本管理器安装并选择
    22.20.0
    ,或使用官方Node.js
    22.20.0
    安装包
    winget install Git.Git
    不得为Make App运行时使用动态的包管理器安装方式,例如
    brew install node
    、
    apt install nodejs
    或
    winget install OpenJS.NodeJS.LTS
    。如果没有可用的精确版本Node管理器,请停止操作并要求用户选择一个。
  2. 在安装pnpm之前,验证固定的Node.js和Corepack基准版本。以下检查是跨平台的,必须全部通过:
    bash
    node -e 'if (process.versions.node !== "22.20.0") { throw new Error(`Make Apps require Node.js 22.20.0; got ${process.versions.node}`) }'
    node -e 'const { execFileSync } = require("node:child_process"); const actual = execFileSync("corepack", ["--version"], { encoding: "utf8" }).trim(); if (actual !== "0.34.0") { throw new Error(`Corepack must report 0.34.0; got ${actual}`) }'
  3. 启用Corepack并缓存固定的新建/迁移应用pnpm基准版本。不得通过npm、Homebrew或其他全局包管理器安装pnpm。使用
    corepack install -g
    ,不要使用已弃用的
    corepack prepare
    。
    bash
    corepack enable
    corepack install -g pnpm@10.20.0
    node -e 'const { execFileSync } = require("node:child_process"); const actual = execFileSync("corepack", ["pnpm", "--version"], { encoding: "utf8" }).trim(); if (actual !== "10.20.0") { throw new Error(`pnpm must report 10.20.0; got ${actual}`) }'
  4. 安装或更新
    makecli
    。如果已存在
    makecli
    ,运行
    makecli update --skip-skills
    ;否则运行
    npm install -g @qfeius/makecli
    。
    makecli update
    会识别自身的安装方式:通过npm或pnpm安装的会通过对应包管理器升级,其他安装方式则直接替换二进制文件。
    如果在macOS或Linux上npm全局安装因
    EACCES
    失败,不要使用
    sudo
    。将npm的全局前缀设置为用户拥有的目录,将其添加到
    PATH
    中,然后重试:
    bash
    npm config set prefix "$HOME/.npm-global"
    export PATH="$HOME/.npm-global/bin:$PATH"   # also add this line to the shell profile
  5. 每次运行时都安装或更新Make平台技能。
    bash
    npx skills add qfeius/make-platform-skills --all -y
    根据命令输出显示简洁的Make技能结果,例如已安装、已更新或已是最新版本。

Verify Versions

验证版本

For a new or explicitly migrated App, run all checks and show a compact summary:
bash
node --version
npm --version
corepack --version
corepack pnpm --version
git --version
makecli version
In that mode, Node must report exactly
v22.20.0
, Corepack exactly
0.34.0
, and pnpm exactly
10.20.0
. If any check fails, stop and repair the active runtime; do not continue with a different version.
For an existing Make App without migration, check
node --version
,
git --version
,
makecli version
, and only the package-manager command declared by the project (
npm --version
,
yarn --version
, or
corepack pnpm --version
for a compatible pnpm App). Compare them with the inspected manifest, Node-selection file and CI/install workflow. Do not require the fixed new-App triple or run Corepack checks for an npm/Yarn App. If they do not agree, stop and hand the compatibility blocker to
make-app-runtime
.
对于新建或明确迁移的应用,运行所有检查并显示简洁的汇总结果:
bash
node --version
npm --version
corepack --version
corepack pnpm --version
git --version
makecli version
在该模式下,Node必须精确显示
v22.20.0
,Corepack精确显示
0.34.0
,pnpm精确显示
10.20.0
。如果任何检查失败,请停止操作并修复当前运行时;不得使用其他版本继续。
对于未迁移的现有Make应用,检查
node --version
、
git --version
、
makecli version
,以及仅项目声明的包管理器命令(npm/Yarn应用对应
npm --version
/
yarn --version
,兼容的pnpm应用对应
corepack pnpm --version
)。将其与检查过的清单文件、Node版本选择文件和CI/安装工作流进行比对。不得要求使用新建应用的固定三件套版本,也不得对npm/Yarn应用运行Corepack检查。如果不一致,请停止操作并将兼容性阻塞问题移交
make-app-runtime
处理。

Verify Token With Guided Login

通过引导式登录验证Token

After the environment is configured successfully, check the current token:
bash
makecli configure verify --output=json
If verification succeeds, continue to project folder selection or initialization as appropriate.
If verification fails because the token is missing, expired, invalid, or belongs to the wrong environment:
  1. Run:
    bash
    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.
  2. If the command exits successfully, login is done; continue to project folder selection or initialization as appropriate.
  3. If the command exits with a timeout or callback error, tell the user:
    text
    请在浏览器中完成 makecli 登录。完成后回复“已经完成登录”。
    Then stop and wait for the user to reply
    已经完成登录
    .
  4. 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:
bash
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.
环境配置成功后,检查当前token:
bash
makecli configure verify --output=json
如果验证成功,根据情况继续进行项目文件夹选择或初始化。
如果因token缺失、过期、无效或属于错误环境导致验证失败:
  1. 运行:
    bash
    makecli login --timeout=60s
    该命令会打开浏览器,最多等待60秒等待登录回调,然后自动退出。如果它打印了授权URL而不是打开浏览器,请将该URL转发给用户。
  2. 如果命令成功退出,说明登录完成;根据情况继续进行项目文件夹选择或初始化。
  3. 如果命令因超时或回调错误退出,请告知用户:
    text
    请在浏览器中完成 makecli 登录。完成后回复“已经完成登录”。
    然后停止操作,等待用户回复
    已经完成登录
    。
  4. 用户回复后,运行
    makecli configure verify --output=json
    。如果
    valid
    为
    true
    ,说明登录成功;继续操作。如果
    valid
    为
    false
    ,返回步骤1。
如果不方便使用浏览器登录,可提供token备选方案:
bash
makecli configure token
用户必须在自己的终端中完成交互式密钥输入。用户完成后,运行
makecli configure verify --output=json
确认token。如果
valid
为
false
,请用户重新输入token,或回退到上述引导式
makecli login
流程。

Initialize App Project Folder

初始化应用项目文件夹

For an existing Make App without a requested reinitialization, do not run
makecli app init
. Keep its current project folder and report that location. The steps below apply only to a new App or a user-requested initialization.
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.
  1. 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
      .
  2. Confirm with the user:
    text
    是否使用 <app-folder> 作为 App 目录?请回复 “是” 或 “否”。
    If the user replies anything other than
    是
    or
    否
    , ask again with the same prompt.
  3. If the user replies
    否
    , ask:
    text
    请输入 App 目录地址:
    Accept an absolute or relative path as provided.
  4. 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.
  5. 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.
对于未要求重新初始化的现有Make应用,不得运行
makecli app init
。保留其当前项目文件夹并告知该位置。以下步骤仅适用于新建应用或用户要求初始化的情况。
makecli app init
会从目标目录的基名派生应用key并验证名称本身;本技能不得预先验证名称。
  1. 选择候选目录:
    • 如果用户已经描述了他们想要构建的应用,推荐一个从该描述派生的文件夹名称。
    • 否则,如果当前目录不是现有项目,推荐就地初始化。
    • 否则推荐一个通用名称,例如
      make_app
      。
  2. 向用户确认:
    text
    是否使用 <app-folder> 作为 App 目录?请回复 “是” 或 “否”。
    如果用户回复的不是
    是
    或
    否
    ,使用相同提示再次询问。
  3. 如果用户回复
    否
    ,询问:
    text
    请输入 App 目录地址:
    接受用户提供的绝对路径或相对路径。
  4. 运行
    makecli app init <app-folder>
    ,如果是初始化当前目录则运行不带参数的
    makecli app init
    。该命令会在需要时创建目录,且具有幂等性。
  5. 如果初始化因key无效错误失败,错误消息会说明命名规则:从所选名称派生出符合规则的文件夹名称(例如
    contract-ledger
    →
    contract_ledger
    ),告知用户调整后的名称,然后重试。对于其他错误,报告错误并询问用户是重试还是选择其他目录。仅在初始化成功后继续。

Setup Completion Output

配置完成输出

End only after the selected toolchain is verified and the token is valid (initial verification passed or the login flow succeeded). A new App also requires successful
makecli app init
; an existing App requires its declared runtime and folder to be verified without reinitialization. Use a concise readiness report:
  • Tool versions: Node, git, makecli and the selected project's package manager; include Corepack only when that project's workflow requires it.
  • Make skills result.
  • Login status: already valid or refreshed with
    makecli login
    .
  • App folder: the initialized or verified existing directory.
Keep the completion output concise and next-step focused. Omit negative summaries about actions not performed.
If everything passes, say:
text
Make 开发环境已经准备好,可以进行下一步开发 App。
For a newly initialized App, provide this small example:
text
App 参考示例:

我要做一个 Make App,用来演示合同台账管理。
角色包括管理员和业务人员。
核心流程是新建合同、维护付款计划、查看合同列表和详情。
请先和我确认需求细节,生成 apps/docs/PRD.md,再进行 DSL 建模;DSL 必须先 diff,等我确认后才 apply。
仅在所选工具链验证通过且token有效(初始验证通过或登录流程成功)后才可结束。新建应用还需要
makecli app init
成功;现有应用则需要验证其声明的运行时和文件夹,无需重新初始化。使用简洁的就绪报告:
  • 工具版本:Node、git、makecli以及所选项目的包管理器;仅当项目工作流需要时才包含Corepack。
  • Make技能结果。
  • 登录状态:已有效或通过
    makecli login
    刷新。
  • 应用文件夹:已初始化的目录或已验证的现有目录。
保持完成输出简洁,聚焦下一步操作。省略关于未执行操作的负面总结。
如果所有检查都通过,输出:
text
Make 开发环境已经准备好,可以进行下一步开发 App。
对于新初始化的应用,提供以下小示例:
text
App 参考示例:

我要做一个 Make App,用来演示合同台账管理。
角色包括管理员和业务人员。
核心流程是新建合同、维护付款计划、查看合同列表和详情。
请先和我确认需求细节,生成 apps/docs/PRD.md,再进行 DSL 建模;DSL 必须先 diff,等我确认后才 apply。