Skill Learning

setup-matt-pocock-skills

1. Bilingual SKILL.md

左右滑动可直接切换英文版与中文版;两种语言按段落自动对齐。英文中的蓝色虚线词语可点击查看解释。共标记 14 处。

入口 skill:setup-matt-pocock-skills左右滑动切换语言 · 段落位置自动对齐
# 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 ) - **Triage labels**: the strings used for the five canonical triage roles - **Domain docs**: where `GLOSSARY.md` and ADRs live, and the consumer rules for reading them
This is , not a deterministic script. Explore, present what you found, confirm with the user, then write.
## Process
### 1. Explore
Look at the current repo to understand its . Read whatever exists; :
- `git remote -v` and `.git/config`: is this a GitHub repo? Which one? - `AGENTS.md` and `CLAUDE.md` at the repo root: does either exist? Is there already an `## Agent skills` section in either? - `GLOSSARY.md` and `GLOSSARY-MAP.md` at the repo root - `docs/adr/` and any `src/*/docs/adr/` directories - `docs/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 `triage` skill installed? (a `triage` skill folder alongside this one, or `triage` in your available skills.) This decides whether Section B runs at all. - Monorepo signals: a `pnpm-workspace.yaml`, a `workspaces` field in `package.json`, or a populated `packages/*` with its own `src/`. These are present only in a genuinely large multi-package repo; their absence means single-context, which is almost every repo.
### 2. Present findings and ask
Summarise . Then take the sections in order. One section, one answer, then the next.
Lead each section with the recommended answer so the user can . Give a one-line explainer only when the choice ; 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`, and `to-spec` read from and write to it. They need to know whether to call `gh 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.
: 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 `gh` CLI) - **GitLab**: issues live in the repo's GitLab Issues (uses the [`glab`](https://gitlab.com/gitlab-org/cli) CLI) - **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 " 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**, . 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 `GLOSSARY.md` + `docs/adr/` at the repo root). This fits almost every repo; write it without asking.
Offer **multi-context** (a root `GLOSSARY-MAP.md` pointing to per-context `GLOSSARY.md` files) only when exploration found monorepo signals. Then confirm which layout they want.
### 3. Confirm and edit
Show the user a draft of:
- The `## Agent skills` block to add to whichever of `CLAUDE.md` / `AGENTS.md` is being edited (see step 4 for selection rules) - The contents of `docs/agents/issue-tracker.md`, `docs/agents/domain.md`, and `docs/agents/triage-labels.md` (the last only when `triage` is installed)
Let them edit before writing.
### 4. Write
**Pick the file to edit:**
- If `CLAUDE.md` exists, edit it. - Else if `AGENTS.md` exists, 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 . Don't overwrite user edits to the surrounding sections.
The block:
```markdown ## 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.
When Section B ran on GitHub or GitLab, create each configured label (`gh label create` / `glab label create`).
Then write the docs files using the seed templates in this skill folder as a starting point:
- [issue-tracker-github.md](./issue-tracker-github.md): GitHub issue tracker - [issue-tracker-gitlab.md](./issue-tracker-gitlab.md): GitLab issue tracker - [issue-tracker-local.md](./issue-tracker-local.md): local-markdown issue tracker - [triage-labels.md](./triage-labels.md): label mapping (only if `triage` is installed) - [domain.md](./domain.md): domain doc consumer rules + layout
For "other" issue trackers, write `docs/agents/issue-tracker.md` using the user's description.
### 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 .
# 设置 Matt Pocock Skills
搭建工程 skills 所依赖的仓库级配置:
- **Issue tracker(问题跟踪器)**:问题存放在哪里(默认使用 GitHub;同时开箱即用地支持本地 Markdown) - **Triage labels(分诊标签)**:五种规范分诊角色所使用的字符串 - **Domain docs(领域文档)**:`GLOSSARY.md` 和 ADR 存放在哪里,以及读取它们的消费方规则
这是一个由提示驱动的 skill,而不是确定性脚本。先探索、展示发现、与用户确认,然后再写入。
## 流程
### 1. 探索
查看当前仓库,理解它的初始状态。读取一切已有内容;不要想当然:
- `git remote -v` 和 `.git/config`:这是 GitHub 仓库吗?具体是哪一个? - 仓库根目录的 `AGENTS.md` 和 `CLAUDE.md`:是否存在其中之一?其中是否已经有 `## Agent skills` 小节? - 仓库根目录的 `GLOSSARY.md` 和 `GLOSSARY-MAP.md` - `docs/adr/` 以及所有 `src/*/docs/adr/` 目录 - `docs/agents/`:这个 skill 之前的输出是否已经存在? - `.scratch/`:这是已经在使用本地 Markdown 问题跟踪约定的迹象 - 是否已安装 `triage` skill?(与本 skill 同级的 `triage` skill 文件夹,或可用 skills 中的 `triage`。)这决定 B 节是否运行。 - Monorepo 信号:`pnpm-workspace.yaml`、`package.json` 中的 `workspaces` 字段,或已有内容且带自身 `src/` 的 `packages/*`。这些只会出现在真正庞大的多包仓库中;若不存在,就意味着采用单上下文,而绝大多数仓库都是如此。
### 2. 展示发现并提问
总结哪些已经存在、哪些仍然缺失。然后按顺序处理各节:一节、一个回答,再进入下一节。
每一节都先给出推荐答案,让用户只用一个词就能接受。只有当选择确实会分叉时,才给出一行解释;如果探索已经得出结论,则完全跳过对应小节(未安装 `triage` 时跳过 B 节;不存在 monorepo 时跳过 C 节)。
**A 节:Issue tracker(问题跟踪器)。**
> 解释:“issue tracker” 是此仓库存放问题的位置。`to-tickets`、`triage` 和 `to-spec` 等 skills 会读写它。它们需要知道应该调用 `gh issue create`、在 `.scratch/` 下写 Markdown 文件,还是遵循你描述的其他工作流。请选择你在这个仓库里真正跟踪工作的地方。
默认立场:这些 skills 是为 GitHub 设计的。如果某个 `git remote` 指向 GitHub,就建议使用 GitHub;如果指向 GitLab(`gitlab.com` 或自托管主机),就建议使用 GitLab。否则(或用户另有偏好),提供以下选项:
- **GitHub**:问题位于仓库的 GitHub Issues(使用 `gh` CLI) - **GitLab**:问题位于仓库的 GitLab Issues(使用 [`glab`](https://gitlab.com/gitlab-org/cli) CLI) - **Local markdown(本地 Markdown)**:问题以文件形式存放在此仓库的 `.scratch/<feature>/` 下(适合个人项目或没有远程仓库的项目) - **Other(其他)**(Jira、Linear 等):让用户用一段话描述工作流;skill 会把它记录为自由文本
将选择记录到 `docs/agents/issue-tracker.md`。GitHub 和 GitLab 模板都带有 “PRs as a request surface” 标志,默认值为 **off**。保持关闭且不要主动提起:希望把外部 PR 纳入分诊队列的用户,以后可以直接在文件中开启该标志。
**B 节:Triage label vocabulary(分诊标签词汇)。** 如果未安装 `triage` skill(探索阶段已经得知),则完全跳过本节,因为未安装的 skill 不需要标签。
如果已经安装,只问一个问题:
> 你想保留默认分诊标签吗?(推荐:**yes**)
默认值是五种规范角色,每个标签字符串都与其名称相同:`needs-triage`、`needs-info`、`ready-for-agent`、`ready-for-human`、`wontfix`。若回答 **yes**,则原样写入。只有用户回答 no 时——通常是因为跟踪器已经使用其他名称(例如用 `bug:triage` 表示 `needs-triage`)——才收集覆盖值,使 `triage` 应用现有标签,而不是创建重复标签。
**C 节:Domain docs(领域文档)。** 默认采用 **single-context(单上下文)**(仓库根目录放一个 `GLOSSARY.md` 和 `docs/adr/`)。这适合几乎所有仓库;无需询问,直接写入。
只有探索发现 monorepo 信号时,才提供 **multi-context(多上下文)** 选项(根目录的 `GLOSSARY-MAP.md` 指向各上下文的 `GLOSSARY.md` 文件)。然后确认他们想要哪种布局。
### 3. 确认并编辑
向用户展示以下内容的草稿:
- 要添加到所编辑的 `CLAUDE.md` / `AGENTS.md` 中的 `## Agent skills` 块(选择规则见第 4 步) - `docs/agents/issue-tracker.md`、`docs/agents/domain.md` 和 `docs/agents/triage-labels.md` 的内容(最后一个仅在安装了 `triage` 时提供)
允许用户在写入前进行编辑。
### 4. 写入
**选择要编辑的文件:**
- 如果 `CLAUDE.md` 存在,就编辑它。 - 否则,如果 `AGENTS.md` 存在,就编辑它。 - 如果两者都不存在,询问用户要创建哪一个;不要替用户决定。
当 `CLAUDE.md` 已存在时,绝不要创建 `AGENTS.md`(反之亦然);始终编辑已经存在的那个。
如果选定文件中已经存在 `## Agent skills` 块,就在原位置更新其内容,而不是追加重复块。不要覆盖周边小节中的用户编辑。
配置块如下:
```markdown ## 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 节时,才包含 `### Triage labels` 子块并写入 `docs/agents/triage-labels.md`。否则两者都省略。
当 B 节在 GitHub 或 GitLab 上运行时,为跟踪器中缺失的每个已配置标签执行创建操作(`gh label create` / `glab label create`)。
然后以本 skill 文件夹中的种子模板为起点写入文档文件:
- [issue-tracker-github.md](./issue-tracker-github.md):GitHub 问题跟踪器 - [issue-tracker-gitlab.md](./issue-tracker-gitlab.md):GitLab 问题跟踪器 - [issue-tracker-local.md](./issue-tracker-local.md):本地 Markdown 问题跟踪器 - [triage-labels.md](./triage-labels.md):标签映射(仅在安装了 `triage` 时) - [domain.md](./domain.md):领域文档消费规则与布局
对于“其他”问题跟踪器,依据用户描述从头编写 `docs/agents/issue-tracker.md`。
### 5. 完成
告诉用户设置已完成,并说明哪些工程 skills 现在会读取这些文件。提醒他们以后可以直接编辑 `docs/agents/*.md`;只有想切换问题跟踪器或从头重置时,才需要重新运行此 skill。

Entry SHA-256: f148858ffb7f63c03c06fca06e6fdb1d91a35c6b293244b8fdfacd5f4cc028c4

2. Why This Skill Is Clever

一句话核心机制

先读取仓库现状,用“推荐默认值 + 只在真正分叉处提问”完成三个配置决策,再经用户预览确认后,以幂等、差量方式写入一组供其他工程 skills 消费的长期契约。

触发与边界

直接来源: frontmatter 的 disable-model-invocation: true 与 “Run once before first use” 把它限定为用户显式触发的一次性初始化 skill;它配置 issue tracker、triage 标签与领域文档布局,不处理具体 issue,也不执行后续工程任务。

直接来源: “This is a prompt-driven skill, not a deterministic script” 明确拒绝把仓库配置压成无条件脚本。探索、展示、确认、写入是硬顺序,用户选择仍然保留在有意义的分叉点。

解读: 它最适合首次接入这套工程 skills,或确实要切换问题跟踪器、重置配置时运行。日常使用不应重复执行;文末明确说普通修改可直接编辑 docs/agents/*.md。

信息架构 / 执行顺序

  1. 探索现状。 检查远程仓库、agent 指令文件、术语表、ADR、旧输出、本地 issue 约定、triage 可用性与 monorepo 信号。
  2. 按证据裁剪问题。 Issue tracker 总是处理;未安装 triage 就跳过标签问题;没有 monorepo 信号就直接采用 single-context,不制造多余选择。
  3. 推荐优先。 每节先给推荐答案,只有执行路径真正分叉时才补一行解释。
  4. 先预览再写入。 展示 ## Agent skills 块和三个配置文件草稿,允许用户编辑。
  5. 幂等落盘。 复用已有 CLAUDE.md / AGENTS.md,原位更新受管块,只创建跟踪器缺少的标签,并从种子模板生成配置文档。
  6. 交代消费方。 完成后说明哪些工程 skills 会读取这些文件,以及何时才需要再次运行。

最巧妙的设计点

  1. “Read whatever exists; don't assume” — 把环境探测设为所有决策的前置条件。
    直接来源: 探索清单逐项覆盖远程、指令文件、领域文档、既有输出与仓库形态。
    解读: 配置型 skill 最大的风险不是“不会写”,而是覆盖已有约定;先读现状能把破坏性假设变成可验证事实。

  2. “skip the section entirely when exploration already settled it” — 用证据消灭伪选择。
    直接来源: 未安装 triage 时跳过 B 节,没有 monorepo 时跳过 C 节。
    解读: 它不是把每个参数都丢给用户,而是让探索结果直接收缩对话;这同时降低用户负担和配置组合数。

  3. “Lead each section with the recommended answer” — 把默认值做成可快速接受的决策界面。
    直接来源: 用户应能 “accept it in a word”,只有真正分叉才需要解释。
    解读: 好的交互式 skill 不是问题清单,而是带依据的建议;用户保留否决权,却不必承担从零设计配置的成本。

  4. “Let them edit before writing” — 把可逆预览放在副作用之前。
    直接来源: 第 3 步要求展示指令块和所有配置文件草稿,再进入第 4 步写入。
    解读: 这是一道事务门:把理解偏差暴露在廉价的文本审阅阶段,而不是等文件、标签已经改变后再回滚。

  5. “update its contents in-place rather than appending a duplicate” — 为重复运行设计幂等语义。
    直接来源: 已有 ## Agent skills 块必须原位更新,周边用户编辑不可覆盖;CLAUDE.md 与 AGENTS.md 也不能并存式复制。
    解读: skill 明确区分“自己管理的 seam”和“用户拥有的周边内容”,因此既能更新,又不会持续制造重复和漂移。

  6. “create each configured label the tracker lacks” — 把外部副作用收敛成差量操作。
    直接来源: 仅在 B 节运行且使用 GitHub/GitLab 时,创建尚缺的标签。
    解读: 先比较再创建避免重复失败,也让自定义标签映射与既有 tracker 共存。此次上游更新补上了这条执行闭环:不只写标签文档,还让真实跟踪器状态与契约一致。

防失败机制与 trade-off

原文明确的不变量: 不猜测仓库现状;每次只处理一个小节和一个回答;已由探索确定的分支不再询问;写入前必须展示草稿;已有 agent 文件优先原位编辑;不可同时新建另一种 agent 文件;已有受管块不得重复追加;只在安装 triage 时写标签配置;只创建跟踪器缺失的标签。

防失败价值: 这些规则分别防止错误平台假设、过度提问、重复配置、覆盖用户编辑、标签命名冲突,以及“文档写了但外部 tracker 没配置”的半完成状态。

权衡与可移植性风险:

可迁移原则

  1. 配置前先盘点存量。 探测结果应直接参与决策,而不是只做背景信息。
  2. 只把真正的分叉交给用户。 能由证据或安全默认值确定的内容,就不要制造问卷。
  3. 副作用前提供完整预览。 把确认门放在写文件、建标签、调用外部 API 之前。
  4. 明确受管 seam。 原位更新自己拥有的块,保护周边用户内容,并让重复运行保持幂等。
  5. 让文档契约与真实系统状态一起闭环。 既写配置,也以差量方式补齐外部资源;两者缺一不可。

今日实践题

如果你要为自己的项目写一个初始化 skill,哪些信息可以通过仓库探索自动确定,哪些选择会真正改变后续执行路径而必须询问用户?请各列两项,并指出写入前要展示哪些草稿。

Evidence note

Source & provenance
Repository path
skills/engineering/setup-matt-pocock-skills/SKILL.md
Generated
2026-10-13 08:24 Asia/Shanghai
Upstream commit
49dd158d1076134a641b33efb035946536778336
Source
View on GitHub