name: setup-matt-pocock-skills description: "为本仓库配置工程技能:工单系统、分诊标签词汇和领域文档布局。首次使用其他工程技能前运行一次。" disable-model-invocation: true
为技能确定工作地点和约定
安装文件与配置项目是两件事。此技能设置工单位置、分诊标签和领域文档布局。
还不清楚 Skill、Agent、安装和调用?先读 从零开始的6节入门课。
在关系图中查看 setup-matt-pocock-skills 与其他技能的关联 →
先把必要的概念讲清楚
这项配置回答三个基础问题:任务记录在哪里、状态标签代表什么、业务文档在哪里。它让后续 skill 能在同一个项目中相互接续,而不是各写各的。
下面是老师补充的入门说明;原作者的要求保留在中英对照正文中。所有例子均为帮助理解而构造的教学情境。
repo / repository|项目代码仓库
保存项目源代码、配置、测试和文档,并通常用 Git 记录修改历史的地方。把它理解为“可追溯的项目工作档案”。探索仓库就是查看现有系统,不等于开始改代码。例如新增课程收藏前,应先看已有课程数据、用户身份和保存接口,避免另造一套。
issue / ticket|问题或任务工单
跟踪一项需求、缺陷、调查或实施任务的记录,通常有标题、正文、状态和引用。issue 和 ticket 在这些文档里经常都指工单,具体含义由上下文决定。工单写着“已完成”只是状态声明,还需要相应证据支持。
state machine|状态与允许的转换
列出对象可能处于哪些状态,以及什么事件允许它从一个状态变为另一个。例如工单从待澄清到可执行,再到实施中,最后验收完成。不能仅因为“写完代码”就跨过验收。状态机让进度含义明确,而不仅是漂亮的标签。
domain glossary|业务领域术语表
规定项目的重要概念叫什么、指什么。domain 在这里是业务领域,不是互联网域名。课程是一组课时,课时是一份学习内容;混用会把“收藏课程”实现成“收藏某一课时”。统一语言不仅统一拼写,还统一概念边界。
ADR|架构决策记录
Architecture Decision Record 的缩写,记录一个重要技术决定、当时为什么选择它,以及接受了什么代价。例如规定所有写入经过后端权限检查。遵循相关 ADR,是在适用范围内延续已确认决定;新需求与之冲突时,应说明冲突和修改理由,而不是默默绕过。
context pointer|上下文资料指引
告诉 Agent 在什么条件下去读哪份材料的短指引。例如“新增或修改数据写入时,先读权限规则文档”。它同时承担地址与触发条件两项作用。只有“见文档”太模糊,可能找不到或不知道何时需要;一股脑放入所有内容又会占用上下文。
frontmatter|Markdown 文件头元数据
文档最前面两条 --- 之间的键值信息,如 name、description。正文讲怎样做事,文件头帮助宿主识别名称、用途和调用方式。保留字段名称是为了维持技术含义,不是要求你熟悉英文;具体支持哪些字段取决于客户端。
读原文,理解每一步为什么这样做
左右内容按小节对应;窄屏先中文、后英文。两种语言均完整展示,对应讲解紧接在小节之后。译文传达原文要求;老师讲解补充概念、原因、例子与适用边界。
name: setup-matt-pocock-skills description: "Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills." disable-model-invocation: true
为当前项目配置这套工程技能
建立其他工程技能默认依赖的项目配置,主要包括三方面:
- 工单系统:这个项目把任务放在哪里。默认倾向 GitHub,也直接支持本地 Markdown。
- 分诊标签:五个标准分诊状态,在项目中实际对应哪些标签文字。
- 业务文档:
CONTEXT.md和架构决策记录放在哪里,以及使用这些文档时应遵循的读取规则。
这是由提示词引导 Agent 工作的技能,不是一段始终机械产生相同结果的脚本。先查看项目,展示发现,与用户确认,再写入配置。
Setup Matt Pocock's Skills
Scaffold the per-repo configuration that the engineering skills assume:
- 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
CONTEXT.mdand ADRs live, and the consumer rules for reading them
This is a prompt-driven skill, not a deterministic script. Explore, present what you found, confirm with the user, then write.
执行过程
Process
1. 查看已有情况
先理解仓库当前起点,阅读存在的内容,不作没有依据的假设:
- 用
git remote -v和.git/config确认远程地址,是否为 GitHub,以及具体仓库。 - 阅读根目录
AGENTS.md、CLAUDE.md,确认是否已存在## Agent skills。 - 查看根目录
CONTEXT.md和CONTEXT-MAP.md。 - 查看
docs/adr/及src/*/docs/adr/等目录。 - 查看
docs/agents/,是否已有本技能上一次生成的内容。 - 查看
.scratch/,判断是否已经采用本地 Markdown 管理任务。 - 检查是否安装
triage:可查看旁边的技能文件夹或当前可用技能列表。这决定后面 B 部分是否需要执行。 - 查看多包仓库的迹象,包括
pnpm-workspace.yaml、package.json的workspaces,或packages/*下各自的src/。作者将这些视为较大多包项目的线索;没有则采用单一业务上下文,适用于绝大多数仓库。
1. Explore
Look at the current repo to understand its starting state. Read whatever exists; don't assume:
git remote -vand.git/config: is this a GitHub repo? Which one?AGENTS.mdandCLAUDE.mdat the repo root: does either exist? Is there already an## Agent skillssection in either?CONTEXT.mdandCONTEXT-MAP.mdat the repo rootdocs/adr/and anysrc/*/docs/adr/directoriesdocs/agents/: does this skill's prior output already exist?.scratch/: a sign that a local-markdown issue tracker convention is already in use- Is the
triageskill installed? (atriageskill folder alongside this one, ortriagein your available skills.) This decides whether Section B runs at all. - Monorepo signals: a
pnpm-workspace.yaml, aworkspacesfield inpackage.json, or a populatedpackages/*with its ownsrc/. These are present only in a genuinely large multi-package repo; their absence means single-context, which is almost every repo.
先调查已有约定,避免再造一套配置
AI 应先读仓库远端、Agent 指令文件、领域文档和已有任务目录。目的不是收集越多信息越好,而是确定该沿用什么。已有 GitHub 工单,就不应未经说明再建立另一份本地任务清单。
monorepo 指在一个仓库管理多个代码包。存在多个目录,不足以证明需要复杂的多上下文安排。作者要求寻找明确的多包信号,避免小项目被套上大型组织的文档结构。
**完成这一阶段后,**应能说出哪些文件已存在、哪个任务系统真实在用、哪些配置缺失。读不到的信息标为未知,不能把默认值说成调查结果。
2. 展示发现,并按部分询问
概括已经存在什么、缺少什么。每次处理一个部分,获得回答后再处理下一个。
每个部分先给推荐,让用户容易直接接受。只有选择确实分叉时,才补一句解释。调查已确定无须询问的部分跳过:未安装 triage 不问 B,没有多包信号不问 C。
A:工单保存在哪里。
工单系统是这个仓库记录任务的位置。to-tickets、triage 和 to-spec 会从这里读写。它们需要知道是调用
gh issue create,在.scratch/写 Markdown,还是采用其他流程。请选择实际管理这个项目工作的地方。
这套技能原本围绕 GitHub 设计。远程地址指向 GitHub 时推荐 GitHub;指向 GitLab,包括自建 GitLab 时,推荐 GitLab。否则,或用户另有偏好时,提供以下选择:
- GitHub Issues,通过
gh工具操作。 - GitLab Issues,通过
glab操作。 - 本地 Markdown,在仓库
.scratch/<feature>/保存文件,适合个人项目或没有远程仓库的情形。 - Jira、Linear 等其他工具。请用户用一段话说明流程,记录成自然语言。
将选择写入 docs/agents/issue-tracker.md。GitHub 和 GitLab 模板中“将 PR 作为需求入口”的开关默认关闭。保持关闭,不主动增加这个问题;需要处理外部 PR 的用户可以之后在文件中修改。
B:分诊标签。 没安装 triage 就完整跳过,无需为未使用的技能配置标签。
已安装时只先问:“是否保留默认分诊标签?推荐是。”默认文字与角色相同:needs-triage、needs-info、ready-for-agent、ready-for-human、wontfix。用户接受就原样记录;拒绝时才收集替代名称,例如项目原本用 bug:triage 表示待评估。这样复用已有标签,避免重复创建。
C:业务文档布局。 默认采用单一上下文,即根目录一份 CONTEXT.md 和 docs/adr/。作者认为适合绝大多数仓库,直接按此安排。
只有调查发现多包信号,才询问是否使用多上下文:根目录 CONTEXT-MAP.md 指向各区域自己的 CONTEXT.md。
2. Present findings and ask
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 triage isn't installed, Section C when there's no monorepo).
Section A: Issue tracker.
Explainer: The "issue tracker" is where issues live for this repo. Skills like
to-tickets,triage, andto-specread from and write to it. They need to know whether to callgh issue create, write a markdown file under.scratch/, or follow some other workflow you describe. Pick the place you actually track work for this repo.
Default posture: these skills were designed for GitHub. If a git remote points at GitHub, propose that. If a git remote points at GitLab (gitlab.com or a self-hosted host), propose GitLab. Otherwise (or if the user prefers), offer:
- GitHub: issues live in the repo's GitHub Issues (uses the
ghCLI) - GitLab: issues live in the repo's GitLab Issues (uses the
glabCLI) - Local markdown: issues live as files under
.scratch/<feature>/in this repo (good for solo projects or repos without a remote) - 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 docs/agents/issue-tracker.md. 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.
Section B: Triage label vocabulary. Skip this section entirely if the triage skill isn't installed (exploration told you), since an uninstalled skill needs no labels.
If 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: needs-triage, needs-info, ready-for-agent, ready-for-human, wontfix. On yes, write them as-is. Only if the user says no, usually because their tracker already uses other names (e.g. bug:triage for needs-triage), collect the overrides so triage applies existing labels instead of creating duplicates.
Section C: Domain docs. Default to single-context (one CONTEXT.md + docs/adr/ at the repo root). This fits almost every repo; write it without asking.
Offer multi-context (a root CONTEXT-MAP.md pointing to per-context CONTEXT.md files) only when exploration found monorepo signals. Then confirm which layout they want.
配置的是去向与含义,不是安装后的魔法能力
issue tracker 是任务的权威位置,可以是 GitHub、GitLab、本地 Markdown 或其他系统。配置文档要告诉后续 Agent 到哪里读写,以及采用什么操作方法。
五个分诊角色表达待分类、缺资料、可由 Agent 处理、需人处理和不处理等含义。如果你已有不同标签名称,应建立对应关系,而不是重复创建几套相近标签。
例如团队已有“待补充”,就可以把它对应 needs-info。重要的是角色含义稳定,而不是必须使用作者的英文字符串。没有安装 triage 就跳过相应标签配置,也体现按需而非全套照搬。
安装之后为什么还要 setup?
安装让客户端找到技能,setup 让技能知道这个项目怎样工作。 两件事解决不同问题。
安装 to-tickets 后,Agent 可以读取如何拆工单,但还不知道你要写进 GitHub,还是本地文件。setup 查看现有配置,再把“任务放哪里、标签叫什么、词汇表在哪”记录下来,供后面读取。
你可以把它理解为项目的工作地址簿。入口 AGENTS.md 只需链接详细说明,其他 Agent 就有地方查,不必每次复制所有平台操作。
配置也不会自动登录 GitHub、创造文件工具,或授权今后所有发布操作。它主要生成项目约定。实际能否执行,还要有对应客户端能力和任务权限。
3. 展示将写入的草稿
展示 Agent 入口文件中的 ## Agent skills 区块,以及 docs/agents/issue-tracker.md、docs/agents/domain.md。安装了 triage 时,还展示 docs/agents/triage-labels.md。
给用户机会在真正写入前调整。
3. Confirm and edit
Show the user a draft of:
- The
## Agent skillsblock to add to whichever ofCLAUDE.md/AGENTS.mdis being edited (see step 4 for selection rules) - The contents of
docs/agents/issue-tracker.md,docs/agents/domain.md, anddocs/agents/triage-labels.md(the last only whentriageis installed)
Let them edit before writing.
预览修改帮助发现会影响后续工作的决定
原文要求先展示准备写入的配置,再让用户修改。这里的价值在于看清实际写入内容,例如工单是否误指向另一个仓库,而不只是口头问一句“同意吗”。
已有 CLAUDE.md 或 AGENTS.md 时按原文选择规则修改,已有区块原地更新,并保留周围用户内容。更新一个局部配置,不等于可以覆盖整份项目指令。
在真实环境中,已得到的授权和项目规则仍应一起考虑。教学重点是“调查、明确、审视、写入”的关系,不是让每个普通动作都增加确认。
4. 写入文件
存在 CLAUDE.md 就编辑它;否则编辑已有 AGENTS.md。两者都没有时,询问用户希望创建哪一个,不替用户选择。
其中一种已有时,不要为同一目的再创建另一种。已有 Agent skills 区块就就地更新,不追加重复内容,也不覆盖周围用户编辑的其他部分。
## Agent skills
### Issue tracker
[一句话说明工单位置]。参见 `docs/agents/issue-tracker.md`。
### Triage labels
[一句话说明标签对应关系]。参见 `docs/agents/triage-labels.md`。
### Domain docs
[说明采用 single-context 或 multi-context]。参见 `docs/agents/domain.md`。
只有安装 triage 并执行 B 部分,才加入对应小节和标签文档。否则两者都省略。
以技能目录内模板为起点写入:
- issue-tracker-github.md:GitHub。
- issue-tracker-gitlab.md:GitLab。
- issue-tracker-local.md:本地 Markdown。
- triage-labels.md:安装 triage 时的标签映射。
- domain.md:业务文档读取规则与布局。
其他工单系统依据用户描述,从头编写 issue-tracker.md。
4. Write
Pick the file to edit:
- If
CLAUDE.mdexists, edit it. - Else if
AGENTS.mdexists, edit it. - If neither exists, ask the user which one to create; don't pick for them.
Never create AGENTS.md when CLAUDE.md already exists (or vice versa); always edit the one that's already there.
If an ## Agent skills block already exists in the chosen file, update its contents in-place rather than appending a duplicate. Don't overwrite user edits to the surrounding sections.
The block:
## Agent skills
### Issue tracker
[one-line summary of where issues are tracked]. See `docs/agents/issue-tracker.md`.
### Triage labels
[one-line summary of the label vocabulary]. See `docs/agents/triage-labels.md`.
### Domain docs
[one-line summary of layout: "single-context" or "multi-context"]. See `docs/agents/domain.md`.
Include the ### Triage labels sub-block, and write docs/agents/triage-labels.md, only when triage is installed and Section B ran. When it isn't, both are omitted.
Then 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
triageis installed) - domain.md: domain doc consumer rules + layout
For "other" issue trackers, write docs/agents/issue-tracker.md from scratch using the user's description.
5. 告知结果
说明配置已完成,以及哪些工程技能之后读取这些文件。用户可以直接修改 docs/agents/*.md;只有想更换工单系统或重新配置时,才需要再次运行本技能。
5. Done
Tell the user the setup is complete and which engineering skills will now read from these files. Mention they can edit docs/agents/*.md directly later; re-running this skill is only necessary if they want to switch issue trackers or restart from scratch.
配置完成,只能证明后续有地方读写
完成时说明配置了哪些文件、哪些技能会读取它们,以及以后如何修改。不能因为配置写好了,就声称测试、部署或业务流程已经工作。
比如 issue-tracker.md 写着 GitHub,并不证明当前 Agent 已认证、具备创建工单权限。配置、工具可用和执行成功是不同条件。
你可以用一句话检验理解:“现在所有规划工单写到同一位置,所有状态按同一词汇解释。”这就是设置阶段的主要价值。
配套参考资料(英文)
先作答,再看参考思路
用自己的话说明:它解决什么问题,完成后会留下什么?
请各用一句话回答。若它只做规划或解释,不要把“已开发”“已部署”写成产物。
为什么没有安装 triage 时可以不配置分诊标签?
我已思考,查看参考思路
配置只为实际消费者服务。没有使用者的标签会增加维护成本,不会提高交付可靠性。
原文中哪条要求在你的环境下可能不成立?
说出具体一句及其前提,例如工具不可用、资料缺失、已有项目约定冲突,或它只是作者偏好。把你的答案带回课堂,我们据此继续讨论。
把方法放进一个具体情境
教学案例:一个已有唯一项目状态入口的仓库,安装后不应突然多出一套本地任务台账。需要明确哪些状态仍从原处读取,避免两个地方分别说“已完成”和“待开始”。
边界与容易误读的地方
它不会替你获得平台权限,也不会安装后自动运行全部工程。首次配置和每次执行要分清。
讨论后再实践:先判断上述情境是否适用,再选择真实任务。现在无需安装、运行命令或修改现有项目。