set-up-project
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSet up project
设置项目
Scaffold and audit the per-repo configuration the skills assume:
- Rules file: , which every harness reads.
AGENTS.mdis either the single lineCLAUDE.mdor a symlink to@AGENTS.md. Claude Code skips a project'sAGENTS.mdwhen aAGENTS.mdexists, and both of those forms give it the same text.CLAUDE.md - Issue tracker: where issues live (GitHub by default; local markdown is also supported out of the box)
- Triage labels: the strings used for the five canonical triage roles
- Domain docs: where and ADRs live, and the consumer rules for reading them
GLOSSARY.md - Folder standard: the lines of orchestrating/folder-standard.md
.gitignore - Allow-only project permissions: the global rules are the machine's safety rails, and a project's own harness files only add convenience. The audit flags every project file that weakens a global rule.
You explore, present what you found, confirm with the user, then write. Running it again is the audit.
搭建并审计这些 skill 所依赖的各仓库配置:
- 规则文件:,所有 harness 都会读取它。
AGENTS.md要么只包含一行CLAUDE.md,要么是指向@AGENTS.md的符号链接。Claude Code 在项目中存在AGENTS.md时会跳过该项目的CLAUDE.md,而这两种形式都会为它提供相同的文本。AGENTS.md - Issue tracker:issue 所在的位置(默认使用 GitHub;也开箱即用地支持本地 Markdown)
- Triage 标签:五个标准 triage 角色所使用的字符串
- Domain 文档:和 ADR 的存放位置,以及读取它们的 consumer 规则
GLOSSARY.md - 目录规范:orchestrating/folder-standard.md 中的 配置行
.gitignore - 仅允许(allow-only)的项目权限:全局规则是机器的安全护栏,而项目自身的 harness 文件只能增加便利性。审计会标出每个削弱全局规则的项目文件。
你先进行探索,展示发现,与用户确认,然后才写入。再次运行即为审计。
Process
流程
1. Check the machine
1. 检查机器
Run set-up-machine's verify script, (the skill is installed beside this one). A pass is exit code 0. That means the line says and no line says . A line that says , , , or is not a failure. is what the script prints for a row Codex can't express, and it still exits 0 with . When the exit code is not 0, run the set-up-machine skill first, then come back. Done when verify exits 0.
python3 <set-up-machine skill>/scripts/verify.pyrulesokhookFAILcodexdifferssamestricterskippeddiffersrules ok运行 set-up-machine 的验证脚本:(该 skill 安装在此 skill 旁边)。退出码为 0 即表示通过。这意味着 行显示 ,且没有任何 行显示 。 行显示 、、 或 均不属于失败。 是脚本在 Codex 无法表达某一行时输出的结果;此时脚本仍会在 的情况下以 0 退出。退出码不是 0 时,先运行 set-up-machine skill,然后返回本流程。验证脚本以 0 退出即完成。
python3 <set-up-machine skill>/scripts/verify.pyrulesokhookFAILcodexdifferssamestricterskippeddiffersrules ok2. Explore
2. 探索
Look at the current repo to understand its starting state. Read whatever exists; don't assume:
- and
git remote -v: is this a GitHub repo? Which one?.git/config - and
AGENTS.mdat the repo root: does either exist? Is there already anCLAUDE.mdor## Agent skillssection in either?## Environment defaults - and
GLOSSARY.mdat the repo root, and anyGLOSSARY-MAP.mdorCONTEXT.mdin the repo: the domain docs' old names, which the skills no longer readCONTEXT-MAP.md - and any
docs/adr/directoriessrc/*/docs/adr/ - : does this skill's prior output already exist?
docs/agents/ - : a sign that a local-markdown issue tracker is already in use
.efforts/ - : the folder standard's old image folder
docs/assets/ - Is the skill installed? (a
triageskill folder alongside this one, ortriagein your available skills.) This decides whether Section B runs at all.triage - Monorepo signals: a , a
pnpm-workspace.yamlfield inworkspaces, or a populatedpackage.jsonwith its ownpackages/*. These are present only in a genuinely large multi-package repo; their absence means single-context, which is almost every repo.src/ - A tool the project's own docs require for a role skills name (a worktree tool in a , a session host its scripts assume). This decides whether Section D runs.
docs/worktrees.md
查看当前仓库以了解其初始状态。读取已有内容;不要想当然:
- 和
git remote -v:这是 GitHub 仓库吗?是哪个仓库?.git/config - 仓库根目录的 和
AGENTS.md:是否存在其中之一?其中是否已经包含CLAUDE.md或## Agent skills部分?## Environment defaults - 仓库根目录的 和
GLOSSARY.md,以及仓库中的任何GLOSSARY-MAP.md或CONTEXT.md:这些是 domain 文档的旧名称,而相关 skill 已不再读取它们CONTEXT-MAP.md - 以及任何
docs/adr/目录src/*/docs/adr/ - :此 skill 之前是否已经生成过相应输出?
docs/agents/ - :是否已有使用本地 Markdown issue tracker 的迹象
.efforts/ - :目录规范中的旧图片目录
docs/assets/ - 是否安装了 skill?(当前 skill 旁边是否有
triageskill 文件夹,或可用 skills 中是否列有triage。)这决定是否执行 B 节。triage - Monorepo 信号:是否存在 、
pnpm-workspace.yaml中的package.json字段,或已填充且各自带有workspaces的src/。这些信号只会在真正的大型多包仓库中出现;没有这些信号就表示采用 single-context,而几乎所有仓库都是如此。packages/* - 项目自身文档为某个 role skill 所要求的工具(中的 worktree 工具,或其脚本所假设的 session host)。这决定是否执行 D 节。
docs/worktrees.md
3. Present findings and ask
3. 展示发现并询问
Summarise what's present and what's missing. Then take the sections in order. One section, one answer, then the next.
Lead each section with the recommended answer so the user can accept it in a word. Give a one-line explainer only when the choice genuinely branches; skip the section entirely when exploration already settled it (Section B when isn't installed, Section C when there's no monorepo and no old or , Section D when the project names no tool for a role).
triageCONTEXT.mdCONTEXT-MAP.mdSection A: Issue tracker.
Explainer: The "issue tracker" is where issues live for this repo. Skills like,to-tickets, andtriageread from and write to it. They need to know whether to callto-spec, write a markdown file undergh issue create, or follow some other workflow you describe. Pick the place you actually track work for this repo..efforts/
Default posture: these skills were designed for GitHub. If a points at GitHub, propose that. If a points at GitLab ( or a self-hosted host), propose GitLab. Otherwise (or if the user prefers), offer:
git remotegit remotegitlab.com- GitHub: issues live in the repo's GitHub Issues (uses the CLI)
gh - GitLab: issues live in the repo's GitLab Issues (uses the CLI)
glab - Local markdown: issues live as files under in this repo (good for solo projects or repos without a remote)
.efforts/<effort>/ - Other (Jira, Linear, etc.): ask the user to describe the workflow in one paragraph; the skill will record it as freeform prose
Record the choice in . The GitHub and GitLab templates carry a "PRs as a request surface" flag, defaulted off. Leave it off and don't raise it: a user who wants external PRs in the triage queue can flip the flag in the file later.
docs/agents/issue-tracker.mdSection B: Triage label vocabulary. Skip this section entirely if the skill isn't installed (exploration told you), since an uninstalled skill needs no labels.
triageIf it is installed, ask exactly one question:
Do you want to keep the default triage labels? (recommended: yes)
The defaults are the five canonical roles, each label string equal to its name: , , , , . On yes, write them as-is. Only if the user says no, usually because their tracker already uses other names (e.g. for ), collect the overrides so applies existing labels instead of creating duplicates.
needs-triageneeds-infoready-for-agentready-for-humanwontfixbug:triageneeds-triagetriageSection C: Domain docs. Default to single-context (one + at the repo root). This fits almost every repo; write it without asking.
GLOSSARY.mddocs/adr/Offer multi-context (a root pointing to per-context files) only when exploration found monorepo signals. Then confirm which layout they want.
GLOSSARY-MAP.mdGLOSSARY.mdWhen exploration found an old or , propose renaming each with , so its history follows it: , , and the same for each per-context . Where the new name already exists, refuses: propose merging the old file into the new one instead, and ask which wins where they disagree. Also propose updating the map's links and any other file that names the old files; the drafts of and already use the new names.
CONTEXT.mdCONTEXT-MAP.mdgit mvgit mv CONTEXT.md GLOSSARY.mdgit mv CONTEXT-MAP.md GLOSSARY-MAP.mdCONTEXT.mdgit mvAGENTS.mddocs/agents/domain.mdWhen exploration found a folder, propose moving each topic with , as the folder standard's Migration from older layouts says: images the project ships or shows to , screenshots to , and each relative link to them updated.
docs/assets/git mvassets/images/<topic>/assets/screenshots/<topic>/Section D: Project environment defaults. Recommend none. Ask only when exploration found a tool the project requires for a role: then propose an row for it, which overrides the user's global row for this project. agents-md.md, Environment defaults, says what may go there.
## Environment defaults总结已有和缺失的内容。然后按顺序处理各节。每节只问一个问题,得到一个答案后再进入下一节。
每节先给出建议答案,让用户可以用一个词接受。只有当选项确实会产生不同分支时才提供一行说明;如果探索阶段已经确定了答案,则整节跳过(未安装 时跳过 B 节;没有 monorepo 且不存在旧 或 时跳过 C 节;项目未为任何 role 指定工具时跳过 D 节)。
triageCONTEXT.mdCONTEXT-MAP.mdA 节:Issue tracker。
说明:“issue tracker”是此仓库中 issue 的存放位置。、to-tickets和triage等 skill 会从中读取 issue 并向其写入 issue。它们需要知道是应调用to-spec、在gh issue create下写入 Markdown 文件,还是遵循你描述的其他工作流。请选择你实际用于跟踪此仓库工作的地方。.efforts/
默认方案:这些 skill 是围绕 GitHub 设计的。如果 指向 GitHub,则建议使用 GitHub。如果 指向 GitLab( 或自托管主机),则建议使用 GitLab。其他情况(或如果用户另有偏好)则提供以下选项:
git remotegit remotegitlab.com- GitHub:issue 存放在仓库的 GitHub Issues 中(使用 CLI)
gh - GitLab:issue 存放在仓库的 GitLab Issues 中(使用 CLI)
glab - 本地 Markdown:issue 作为文件存放在此仓库的 下(适合个人项目或没有 remote 的仓库)
.efforts/<effort>/ - 其他(Jira、Linear 等):让用户用一段话描述工作流;skill 会将其记录为自由格式文本
将选择记录在 中。GitHub 和 GitLab 模板包含一个“PRs as a request surface”标志,默认关闭。保持关闭且不要主动提起:如果用户希望将外部 PR 加入 triage 队列,之后可以自行在文件中启用该标志。
docs/agents/issue-tracker.mdB 节:Triage 标签词汇。 如果未安装 skill,则整节跳过(探索阶段已经确定),因为未安装的 skill 不需要标签。
triage如果已安装,则只问一个问题:
你想保留默认的 triage 标签吗?(建议:是)
默认值为五个标准角色,每个标签字符串都与其角色名相同:、、、、。用户回答是时,原样写入。只有用户回答否时——通常是因为其 tracker 已经使用其他名称(例如用 表示 )——才收集覆盖值,使 沿用现有标签,而不是创建重复标签。
needs-triageneeds-infoready-for-agentready-for-humanwontfixbug:triageneeds-triagetriageC 节:Domain 文档。 默认采用 single-context(仓库根目录下一个 和 )。它适合几乎所有仓库;无需询问,直接写入。
GLOSSARY.mddocs/adr/只有探索发现 monorepo 信号时,才提供 multi-context(根目录的 指向各 context 的 )选项。然后确认他们想要哪种布局。
GLOSSARY-MAP.mdGLOSSARY.md当探索发现旧 或 时,建议使用 重命名每个文件,使其历史记录随文件一起保留:、,每个 context 下的 也执行同样操作。如果新名称已经存在, 会拒绝执行:建议改为将旧文件合并到新文件中,并询问双方内容不一致时以哪一方为准。还应建议更新 map 中的链接以及所有引用旧文件名的其他文件; 和 的草稿已经使用新名称。
CONTEXT.mdCONTEXT-MAP.mdgit mvgit mv CONTEXT.md GLOSSARY.mdgit mv CONTEXT-MAP.md GLOSSARY-MAP.mdCONTEXT.mdgit mvAGENTS.mddocs/agents/domain.md当探索发现 文件夹时,按照目录规范中的从旧布局迁移建议,使用 移动各个主题:项目附带或展示的图片移至 ,截图移至 ,并更新指向它们的每条相对链接。
docs/assets/git mvassets/images/<topic>/assets/screenshots/<topic>/D 节:项目环境默认值。 建议设为无。只有当探索发现项目为某个 role 所需工具时才询问:此时为该工具提出一个 行,它会覆盖此项目中用户的全局行。agents-md.md 的 Environment defaults 部分说明了其中可以写什么。
## Environment defaults4. Confirm and write
4. 确认并写入
Show the user a draft of:
- : new from agents-md.md, or the existing one with the
AGENTS.mdblock and any## Agent skillsrows added, and each line of an existing## Environment defaultsmoved into itCLAUDE.md - : the single line
CLAUDE.md, or an existing symlink to@AGENTS.mdleft as it is. Claude Code skips a project'sAGENTS.mdwhen aAGENTS.mdexists, and both forms give it the same text.CLAUDE.md - :
.gitignoreand.scratch/, each only where it's missing.claude/worktrees/ - The contents of ,
docs/agents/issue-tracker.md, anddocs/agents/domain.md(the last only whendocs/agents/triage-labels.mdis installed)triage - Each rename or merge of an old or
CONTEXT.md, and the edits to the files that name them, when Section C proposed themCONTEXT-MAP.md - Each move out of , and the links it updates, when proposed
docs/assets/
Let them edit, then take one approval for all of it. Then write:
-
Edit, never
AGENTS.md. If anCLAUDE.mdblock already exists, update its contents in place rather than appending a duplicate, and keep the user's edits around it. Include the## Agent skillssub-block only when### Triage labelsis installed and Section B ran.triage -
Leaveholding
CLAUDE.mdalone (a@AGENTS.mdthat is a symlink toCLAUDE.mdis fine as it is), and add the missingAGENTS.mdlines..gitignore -
Write the docs files using the seed templates in this skill folder as a starting point:
- issue-tracker-github.md: GitHub issue tracker
- issue-tracker-gitlab.md: GitLab issue tracker
- issue-tracker-local.md: local-markdown issue tracker
- triage-labels.md: label mapping (only if is installed)
triage - domain.md: domain doc consumer rules + layout
For "other" issue trackers, writefrom scratch using the user's description.docs/agents/issue-tracker.mdGive everythe templates'docs/agents/issue-tracker.mdsection, so each skill that creates an issue titles it the same way. Seed its semantic list from the areas the project's open issue titles already name, one line each with what the area covers.## Title prefixes -
Run each approved rename or merge of an oldor
CONTEXT.md, then update the files that named it.CONTEXT-MAP.md -
Run each approved move out of, then update the links to it.
docs/assets/
Done when every approved change is made.
向用户展示以下内容的草稿:
- :根据 agents-md.md 新建,或在现有文件基础上添加
AGENTS.md块和任何## Agent skills行,并将现有## Environment defaults中的每一行移入其中CLAUDE.md - :仅一行
CLAUDE.md,或保持现有指向@AGENTS.md的符号链接不变。Claude Code 在项目中存在AGENTS.md时会跳过该项目的CLAUDE.md,而这两种形式都会为它提供相同的文本。AGENTS.md - :补充
.gitignore和.scratch/,且仅在对应行缺失时添加.claude/worktrees/ - 、
docs/agents/issue-tracker.md和docs/agents/domain.md的内容(仅在安装了docs/agents/triage-labels.md时包含最后一个文件)triage - 对旧 或
CONTEXT.md的每次重命名或合并,以及 C 节建议对这些文件所做的相关修改CONTEXT-MAP.md - 从 移出的每个文件,以及建议更新的相关链接
docs/assets/
让用户自行编辑,然后对全部内容进行一次审批。审批后执行:
-
编辑,绝不编辑
AGENTS.md。如果已经存在CLAUDE.md块,则原地更新其内容,而不是追加重复块,并保留用户在其周围所做的编辑。仅当安装了## Agent skills且执行过 B 节时,才加入triage子块。### Triage labels -
让保持只含
CLAUDE.md的状态不变(@AGENTS.md是指向CLAUDE.md的符号链接也无需改动),并补充缺失的AGENTS.md行。.gitignore -
使用此 skill 文件夹中的种子模板作为起点写入文档文件:
- issue-tracker-github.md:GitHub issue tracker
- issue-tracker-gitlab.md:GitLab issue tracker
- issue-tracker-local.md:本地 Markdown issue tracker
- triage-labels.md:标签映射(仅在安装了 时)
triage - domain.md:domain 文档 consumer 规则和布局
对于其他 issue tracker,根据用户的描述从头编写。docs/agents/issue-tracker.md为每个写入模板中的docs/agents/issue-tracker.md部分,使每个创建 issue 的 skill 都采用一致方式命名。根据项目现有开放 issue 标题中提到的领域生成语义列表,每个领域占一行,并说明其涵盖内容。## Title prefixes -
执行所有已批准的对旧或
CONTEXT.md的重命名或合并,然后更新引用这些旧文件名的文件。CONTEXT-MAP.md -
执行所有已批准的从移出文件的操作,然后更新指向这些文件的链接。
docs/assets/
完成所有已批准的更改即告完成。
5. Audit
5. 审计
Read every harness file the project holds, from the root down, against set-up-machine's , whether or not that harness is set up on this machine: and , , and , . references/project-files.md says what each harness lets a project file do to a global rule, and how to judge an entry. Report each finding as:
rules.json.claude/settings.jsonsettings.local.json.cursor/cli.jsonopencode.json(c).opencode/.codex/config.toml- : a global rule no longer holds as the machine sets it, in some harness. Explain which and why, and propose the fix: remove the entry, or narrow it to the project's own commands. The file is the project's, so change it only on the user's approval.
weakens - : an allow that covers a rule's command while the rule still holds. Propose narrowing it.
overlaps - (a project deny or ask) and
extra(what you can't judge): name each.gap
Also report each old or still in the repo, with the rename Section C proposes for it. Report a that has no section, and propose the section step 3 writes.
CONTEXT.mdCONTEXT-MAP.mddocs/agents/issue-tracker.md## Title prefixesThe audit passes with no . Done when it passes, or the user has chosen to keep a entry: then it stays failed, and the report names that entry.
weakensweakens读取项目持有的每个 harness 文件(从根目录向下),依据 set-up-machine 的 进行检查,无论该 harness 是否已在此机器上设置: 和 、、 和 、。references/project-files.md 说明了每个 harness 允许项目文件对全局规则执行哪些操作,以及如何判断某个条目。
rules.json.claude/settings.jsonsettings.local.json.cursor/cli.jsonopencode.json(c).opencode/.codex/config.toml将每项发现报告为:
- :某个 harness 中的全局规则不再保持机器所设定的状态。说明是哪一个规则以及原因,并提出修复方案:移除该条目,或将其收窄到项目自己的命令。该文件属于项目,因此只有在用户批准后才能更改。
weakens - :一条 allow 覆盖某条规则的命令,但该规则仍然成立。建议将其收窄。
overlaps - (项目级 deny 或 ask)和
extra(无法判断的内容):分别列出每一项。gap
还要报告仓库中仍然存在的每个旧 或 ,并给出 C 节建议的重命名方案。如果 缺少 部分,也要报告,并提出第 3 步会写入该部分。
CONTEXT.mdCONTEXT-MAP.mddocs/agents/issue-tracker.md## Title prefixes审计在没有 的情况下通过。审计通过即完成;如果用户选择保留某条 ,它仍保持失败状态,报告必须点名该条目。
weakensweakens6. Done
6. 完成
Tell the user the setup is complete, what the audit found, and which skills will now read from these files. Mention they can edit and directly later; re-running this skill audits the project again, and switches issue trackers when they want to. Leave the commit to the user or the skill that called this one.
AGENTS.mddocs/agents/*.md告知用户设置已完成、审计发现了什么,以及哪些 skill 现在会读取这些文件。说明用户以后可以直接编辑 和 ;再次运行此 skill 会重新审计项目,并可在用户需要时切换 issue tracker。将 commit 操作留给用户或调用此 skill 的 skill 处理。
AGENTS.mddocs/agents/*.md