first-commit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

first-commit

first-commit

create-first-commit
creates a project from a kit: a base project plus the dependencies, agent skills, MCP servers and
AGENTS.md
rules for the stack the user picks. Catalog and configurator: https://first-commit.dev.
create-first-commit
根据一个 kit 创建项目:kit 包含基础项目,以及用户所选技术栈对应的依赖项、Agent skills、MCP servers 和
AGENTS.md
规则。目录与配置器:https://first-commit.dev。

When to use it

何时使用

  • New project in an empty folder ("make me a recipes app with Expo", "a landing with animations"): use a kit instead of scaffolding by hand.
  • Existing project with
    kits.lock
    : it came from a kit. Use
    update
    to get the kit's improvements and
    add
    to add libraries, so the rules in
    AGENTS.md
    stay in sync.
  • Adding a catalog library (Sentry, PostHog, Stripe, Resend, Better Auth, Kokonut UI, Motion…) to any project:
    add
    writes its config and its rule in
    AGENTS.md
    .
  • 空文件夹中的新项目(“给我做一个使用 Expo 的食谱应用”、“制作一个带动画的落地页”):使用 kit,而不是手动 scaffolding。
  • 现有项目包含
    kits.lock
    :该项目来自某个 kit。使用
    update
    获取该 kit 的改进,并使用
    add
    添加库,从而让
    AGENTS.md
    中的规则保持同步。
  • 向任意项目添加目录中的库(Sentry、PostHog、Stripe、Resend、Better Auth、Kokonut UI、Motion……):
    add
    会写入其配置及对应的
    AGENTS.md
    规则。

Create a project

创建项目

  1. Pick the kit. If the first-commit MCP server is available, call
    recommend_kit
    with the user's description, then
    get_kit
    for the options. Otherwise:
    • npx create-first-commit list
      — official kits.
    • npx create-first-commit info <kit>
      — options and their values.
  2. Choose only the options the user asked for; keep the defaults for everything else. Options are flags:
    --<option> <value>
    (comma-separated for multi options).
  3. Show the plan and ask before running anything:
    npx create-first-commit <kit> <folder> [options] --dry-run
    (or the
    plan_init
    tool). Installing runs commands and downloads packages.
  4. After the user agrees: the same command without
    --dry-run
    and with
    --yes
    (or
    init_kit
    with
    approved: true
    ). It takes a few minutes.
  5. Read the new project's
    AGENTS.md
    and follow its "first steps": do the setup tasks you can, and tell the user which ones need them (API keys, accounts). Copy
    .env.example
    to
    .env
    but never invent secret values.
Community kits (
user/kit
) that aren't verified ask for confirmation; with
--yes
they also need
--allow-commands
. Only add it if the user explicitly trusts that kit.
  1. 选择 kit。如果 first-commit MCP server 可用,使用用户描述调用
    recommend_kit
    ,然后调用
    get_kit
    获取选项。否则:
    • npx create-first-commit list
      ——查看官方 kits。
    • npx create-first-commit info <kit>
      ——查看选项及其值。
  2. 仅选择用户要求的选项;其他所有选项保持默认值。选项以 flags 形式指定:
    --<option> <value>
    (多选项使用逗号分隔)。
  3. 运行任何操作前先展示计划并征得用户同意:
    npx create-first-commit <kit> <folder> [options] --dry-run
    (或使用
    plan_init
    工具)。安装过程会运行命令并下载软件包。
  4. 用户同意后:使用相同命令,但去掉
    --dry-run
    并加上
    --yes
    (或调用
    init_kit
    并设置
    approved: true
    )。这需要几分钟。
  5. 读取新项目的
    AGENTS.md
    并遵循其中的“first steps”:完成你能够完成的设置任务,并告诉用户哪些任务需要他们处理(API keys、accounts)。将
    .env.example
    复制为
    .env
    ,但绝不虚构 secret 值。
未经验证的社区 kits(
user/kit
)会要求确认;使用
--yes
时还需要
--allow-commands
。只有在用户明确信任该 kit 时,才添加
--allow-commands
。

Maintain a project

维护项目

  • npx create-first-commit update --dry-run
    , then
    npx create-first-commit update --yes
    : new dependencies, skills, MCP servers and rules from the kit's latest version. Files the user changed are never overwritten; it lists them.
  • npx create-first-commit add <library|owner/repo@skill> --yes
    : adds a catalog library with the right variant for the framework (Sentry for Next.js, Expo or Node).
  • npx create-first-commit doctor
    : checks that the project still follows its rules (one component library, env vars, skills installed). Exit code 1 means errors; fix them or tell the user.
  • npx create-first-commit update --dry-run
    ,然后运行
    npx create-first-commit update --yes
    :从 kit 的最新版本获取新的依赖项、skills、MCP servers 和规则。用户修改过的文件永远不会被覆盖;命令会列出这些文件。
  • npx create-first-commit add <library|owner/repo@skill> --yes
    :为相应 framework 添加目录中的库及其正确 variant(例如适用于 Next.js、Expo 或 Node 的 Sentry)。
  • npx create-first-commit doctor
    :检查项目是否仍然遵循其规则(仅使用一个 component library、env vars 已配置、skills 已安装)。退出码为 1 表示存在错误;修复这些问题或告知用户。

Rules

规则

  • The rules in
    AGENTS.md
    between
    <!-- kits:start -->
    and
    <!-- kits:end -->
    come from the kit: follow them (for example, "only use the chosen component library"). Don't edit that block by hand;
    update
    rewrites it.
  • Don't install a second library for something the kit already chose (another component system, another auth). Use
    add --force
    only if the user explicitly wants to switch.
  • AGENTS.md
    中位于
    <!-- kits:start -->
    和
    <!-- kits:end -->
    之间的规则来自 kit:应遵循这些规则(例如“只使用选定的 component library”)。不要手动编辑该区块;
    update
    会重写它。
  • 如果 kit 已经为某项功能选择了 library,不要再安装第二个 library(另一套 component system、另一种 auth)。只有在用户明确希望切换时,才使用
    add --force
    。