bootstrap-project

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Bootstrap Project

项目初始化引导

Set up agent context files so Claude Code, Codex, and other AI agents understand a project from the first prompt.
设置Agent上下文文件,让Claude Code、Codex及其他AI Agent从首次提示起就能理解项目情况。

When to Use This Skill

何时使用该Skill

Use when the user:
  • Wants to start a new project with agent context from the beginning
  • Opens an existing repo that lacks
    AGENTS.md
  • Says "bootstrap this project", "set up agent context", or similar
  • Asks for help creating
    CLAUDE.md
    or
    AGENTS.md
当用户出现以下情况时使用:
  • 希望从项目启动初期就配置好Agent上下文
  • 打开了一个缺少
    AGENTS.md
    文件的现有仓库
  • 说出“初始化这个项目”、“设置Agent上下文”或类似表述
  • 请求协助创建
    CLAUDE.md
    AGENTS.md
    文件

Steps

操作步骤

1. Determine whether this is a new or existing project

1. 判断项目是新建还是已存在

Existing project — the current directory has source files, a README, or a
.git
directory:
  • Skip to step 3.
New project — the current directory is not a project, or the user wants to create one:
  • Ask for:
    1. Project name — used for the directory name (kebab-case, e.g.
      my-project
      ) and the
      AGENTS.md
      heading.
    2. Location — parent directory (default: current directory).
    3. Brief description — purpose, intended stack, key constraints. This replaces file-based inference in step 3.
  • Create the directory:
    mkdir -p <location>/<project-name>
  • cd
    into it.
  • Run
    git init
    .
  • Create a
    .gitignore
    appropriate for the described stack (e.g. Node, Python, Rust).
已存在项目——当前目录包含源码文件、README或
.git
目录:
  • 直接跳至步骤3。
新建项目——当前目录并非项目目录,或用户想要创建新项目:
  • 询问以下信息:
    1. 项目名称——用于目录命名(短横线分隔格式,如
      my-project
      )及
      AGENTS.md
      的标题。
    2. 位置——父目录(默认:当前目录)。
    3. 简要描述——项目用途、计划采用的技术栈、关键约束条件。这将替代步骤3中的文件内容推断环节。
  • 创建目录:
    mkdir -p <location>/<project-name>
  • 进入该目录:
    cd <location>/<project-name>
  • 执行
    git init
    初始化仓库。
  • 创建与描述的技术栈匹配的
    .gitignore
    文件(例如Node、Python、Rust对应的模板)。

2. Guard against overwrites

2. 防止文件覆盖

  • If
    AGENTS.md
    already exists, stop and ask before overwriting.
  • If
    CLAUDE.md
    exists and is not a symlink to
    AGENTS.md
    , stop and ask.
  • If
    agent_docs/
    already exists, skip creating it but mention it.
  • AGENTS.md
    已存在,停止操作并询问用户是否覆盖。
  • CLAUDE.md
    已存在且不是指向
    AGENTS.md
    的符号链接,停止操作并询问用户
  • agent_docs/
    目录已存在,跳过创建步骤但需告知用户。

3. Gather project context

3. 收集项目上下文信息

Read (do not modify) the following if they exist:
  • README.md
    /
    README
  • package.json
    ,
    pyproject.toml
    ,
    Cargo.toml
    ,
    go.mod
    , or equivalent manifest
  • Top-level directory listing (one level deep)
  • CI config (
    .github/workflows/
    ,
    .gitlab-ci.yml
    ,
    Makefile
    ,
    Justfile
    , etc.)
For new projects with no files, use the user's description from step 1 instead.
若以下文件/内容存在,仅读取(不要修改):
  • README.md
    /
    README
  • package.json
    pyproject.toml
    Cargo.toml
    go.mod
    或其他等效的项目清单文件
  • 顶层目录结构(仅一级深度)
  • CI配置文件(
    .github/workflows/
    .gitlab-ci.yml
    Makefile
    Justfile
    等)
对于无文件的新项目,使用步骤1中用户提供的描述信息。

4. Write
AGENTS.md

4. 编写
AGENTS.md
文件

Create
AGENTS.md
in the project root. Use the structure below as a guide — fill every section with specifics from step 3. Omit sections that don't apply. Never leave placeholder text or angle-bracket tokens in the output.
Structure:
  • Heading — project name.
  • Opening line — one-sentence purpose.
  • Stack — language, framework, major dependencies.
  • Directory Structure — table of key paths and their purpose.
  • Key Commands — build, test, lint/format, dev server (only those that exist).
  • Conventions — coding style, naming, branching model, PR process.
  • Gotchas — non-obvious things an agent should know (env vars, generated files, monorepo quirks, etc.).
在项目根目录创建
AGENTS.md
文件。以下面的结构为指引——用步骤3收集到的具体信息填充每个章节。省略不适用的章节,切勿在输出中留下占位文本或尖括号标记。
结构说明:
  • 标题——项目名称。
  • 开篇句——用一句话描述项目用途。
  • 技术栈——使用的编程语言、框架、主要依赖项。
  • 目录结构——关键路径及其用途的表格。
  • 核心命令——构建、测试、代码检查/格式化、开发服务启动命令(仅保留实际存在的命令)。
  • 约定规范——编码风格、命名规则、分支模型、PR流程。
  • 注意事项——Agent需要知晓的非显性信息(环境变量、生成文件、单体仓库特殊情况等)。

5. Create
CLAUDE.md
symlink

5. 创建
CLAUDE.md
符号链接

bash
ln -s AGENTS.md CLAUDE.md
Claude Code reads
CLAUDE.md
for project instructions. The symlink keeps
AGENTS.md
as the single source of truth. Codex reads
AGENTS.md
directly — no extra symlink needed.
bash
ln -s AGENTS.md CLAUDE.md
Claude Code会读取
CLAUDE.md
获取项目指令。该符号链接确保
AGENTS.md
作为唯一的事实来源。Codex则直接读取
AGENTS.md
——无需额外创建符号链接。

6. Create
agent_docs/
directory

6. 创建
agent_docs/
目录

bash
mkdir -p agent_docs
Add
agent_docs/README.md
so the directory is tracked by git:
markdown
undefined
bash
mkdir -p agent_docs
添加
agent_docs/README.md
文件,让该目录能被git追踪:
markdown
undefined

agent_docs

agent_docs

Supplementary context for AI agents working in this repository. Place architecture decisions, API specs, or onboarding notes here.
undefined
为在本仓库工作的AI Agent提供补充上下文。 可在此存放架构决策文档、API规范或入职说明等内容。
undefined

7. Report results

7. 反馈操作结果

Print a summary of what was created:
Created:
  AGENTS.md          — project context for AI agents
  CLAUDE.md          -> AGENTS.md (symlink)
  agent_docs/        — supplementary context directory

Next steps:
  - Review AGENTS.md and refine any sections
  - Add architecture docs or API specs to agent_docs/
  - Commit the new files
打印已创建内容的摘要:
已创建:
  AGENTS.md          — 供AI Agent使用的项目上下文文件
  CLAUDE.md          -> AGENTS.md (符号链接)
  agent_docs/        — 补充上下文目录

后续步骤:
  - 检查AGENTS.md并完善相关章节
  - 将架构文档或API规范添加至agent_docs/目录
  - 提交新创建的文件