bootstrap-project
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBootstrap 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 or
CLAUDE.mdAGENTS.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 directory:
.git- Skip to step 3.
New project — the current directory is not a project, or the user wants to create one:
- Ask for:
- Project name — used for the directory name (kebab-case, e.g. ) and the
my-projectheading.AGENTS.md - Location — parent directory (default: current directory).
- Brief description — purpose, intended stack, key constraints. This replaces file-based inference in step 3.
- Project name — used for the directory name (kebab-case, e.g.
- Create the directory:
mkdir -p <location>/<project-name> - into it.
cd - Run .
git init - Create a appropriate for the described stack (e.g. Node, Python, Rust).
.gitignore
已存在项目——当前目录包含源码文件、README或目录:
.git- 直接跳至步骤3。
新建项目——当前目录并非项目目录,或用户想要创建新项目:
- 询问以下信息:
- 项目名称——用于目录命名(短横线分隔格式,如)及
my-project的标题。AGENTS.md - 位置——父目录(默认:当前目录)。
- 简要描述——项目用途、计划采用的技术栈、关键约束条件。这将替代步骤3中的文件内容推断环节。
- 项目名称——用于目录命名(短横线分隔格式,如
- 创建目录:
mkdir -p <location>/<project-name> - 进入该目录:
cd <location>/<project-name> - 执行初始化仓库。
git init - 创建与描述的技术栈匹配的文件(例如Node、Python、Rust对应的模板)。
.gitignore
2. Guard against overwrites
2. 防止文件覆盖
- If already exists, stop and ask before overwriting.
AGENTS.md - If exists and is not a symlink to
CLAUDE.md, stop and ask.AGENTS.md - If already exists, skip creating it but mention it.
agent_docs/
- 若已存在,停止操作并询问用户是否覆盖。
AGENTS.md - 若已存在且不是指向
CLAUDE.md的符号链接,停止操作并询问用户。AGENTS.md - 若目录已存在,跳过创建步骤但需告知用户。
agent_docs/
3. Gather project context
3. 收集项目上下文信息
Read (do not modify) the following if they exist:
- /
README.mdREADME - ,
package.json,pyproject.toml,Cargo.toml, or equivalent manifestgo.mod - Top-level directory listing (one level deep)
- CI config (,
.github/workflows/,.gitlab-ci.yml,Makefile, etc.)Justfile
For new projects with no files, use the user's description from step 1 instead.
若以下文件/内容存在,仅读取(不要修改):
- /
README.mdREADME - 、
package.json、pyproject.toml、Cargo.toml或其他等效的项目清单文件go.mod - 顶层目录结构(仅一级深度)
- CI配置文件(、
.github/workflows/、.gitlab-ci.yml、Makefile等)Justfile
对于无文件的新项目,使用步骤1中用户提供的描述信息。
4. Write AGENTS.md
AGENTS.md4. 编写AGENTS.md
文件
AGENTS.mdCreate 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.
AGENTS.mdStructure:
- 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.).
在项目根目录创建文件。以下面的结构为指引——用步骤3收集到的具体信息填充每个章节。省略不适用的章节,切勿在输出中留下占位文本或尖括号标记。
AGENTS.md结构说明:
- 标题——项目名称。
- 开篇句——用一句话描述项目用途。
- 技术栈——使用的编程语言、框架、主要依赖项。
- 目录结构——关键路径及其用途的表格。
- 核心命令——构建、测试、代码检查/格式化、开发服务启动命令(仅保留实际存在的命令)。
- 约定规范——编码风格、命名规则、分支模型、PR流程。
- 注意事项——Agent需要知晓的非显性信息(环境变量、生成文件、单体仓库特殊情况等)。
5. Create CLAUDE.md
symlink
CLAUDE.md5. 创建CLAUDE.md
符号链接
CLAUDE.mdbash
ln -s AGENTS.md CLAUDE.mdClaude Code reads for project instructions. The symlink keeps as the single source of truth. Codex reads directly — no extra symlink needed.
CLAUDE.mdAGENTS.mdAGENTS.mdbash
ln -s AGENTS.md CLAUDE.mdClaude Code会读取获取项目指令。该符号链接确保作为唯一的事实来源。Codex则直接读取——无需额外创建符号链接。
CLAUDE.mdAGENTS.mdAGENTS.md6. Create agent_docs/
directory
agent_docs/6. 创建agent_docs/
目录
agent_docs/bash
mkdir -p agent_docsAdd so the directory is tracked by git:
agent_docs/README.mdmarkdown
undefinedbash
mkdir -p agent_docs添加文件,让该目录能被git追踪:
agent_docs/README.mdmarkdown
undefinedagent_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规范或入职说明等内容。
undefined7. 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/目录
- 提交新创建的文件