setup-matt-pocock-skills

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

设置 Matt Pocock 技能

Set Up Matt Pocock Skills

搭建工程技能所依赖的逐仓库配置:
  • Issue 跟踪器 — issue 放在哪里(默认 GitHub;本地 markdown 也开箱即用)
  • 分类标签 — 五个规范分类角色所用的标签字符串
  • 领域文档
    CONTEXT.md
    和 ADR 放在哪里,以及读取它们的消费规则
这是一个提示驱动的技能,不是确定性的脚本。探索、呈现你的发现、与用户确认,然后写入。
Set up per-repository configurations that engineering skills depend on:
  • Issue Tracker — Where issues are stored (default: GitHub; local markdown works out of the box)
  • Triage Labels — Label strings used for the five standard triage roles
  • Domain Documentation — Where
    CONTEXT.md
    and ADRs are stored, as well as consumption rules for reading them
This is a prompt-driven skill, not a deterministic script. Explore, present your findings, confirm with the user, then write.

流程

Process

1. 探索

1. Exploration

查看当前仓库,了解它的起始状态。读一切存在的东西;不要假设:
  • 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 issue 跟踪器约定已在使用的迹象
  • triage
    技能是否已安装?(与这个技能文件夹并列的
    triage
    技能文件夹,或你的可用技能中有
    triage
    。)这决定 B 节是否执行。
  • Monorepo 信号 — 有
    pnpm-workspace.yaml
    package.json
    里有
    workspaces
    字段,或有带自己的
    src/
    packages/*
    。只在真正大的多包仓库里出现;没有它们就是单上下文,而几乎所有仓库都是单上下文。
Check the current repository to understand its starting state. Read everything that exists; don't make assumptions:
  • git remote -v
    and
    .git/config
    — Is this a GitHub repository? Which one?
  • AGENTS.md
    and
    CLAUDE.md
    in the repository root — Do they exist? Do they already have a
    ## Agent skills
    section?
  • CONTEXT.md
    and
    CONTEXT-MAP.md
    in the repository root
  • docs/adr/
    and any
    src/*/docs/adr/
    directories
  • docs/agents/
    — Does output from a previous run of this skill already exist?
  • .scratch/
    — Signs indicating that the local markdown issue tracker convention is in use
  • Is the
    triage
    skill installed? (A
    triage
    skill folder alongside this skill folder, or
    triage
    in your available skills.) This determines whether Section B is executed.
  • Monorepo signals — Presence of
    pnpm-workspace.yaml
    , a
    workspaces
    field in
    package.json
    , or
    packages/*
    with their own
    src/
    . Only present in truly large multi-package repositories; without them, it's a single context, and almost all repositories are single-context.

2. 呈现发现并询问

2. Present Findings and Ask

总结哪些存在、哪些缺失。然后按顺序过各节——一节、一个回答,然后下一节。
每节先用推荐答案开头,让用户一个字就能接受。只有在选择确实分叉时才给一行解释;当探索已经解决了该节时就整节跳过(没装
triage
时跳过 B 节,没有 monorepo 时跳过 C 节)。
A 节 — Issue 跟踪器。
解释:这个仓库的 "issue tracker" 就是 issue 存放的地方。
to-tickets
triage
to-spec
等技能会读写它——它们需要知道该调用
gh issue create
、在
.scratch/
下写 markdown 文件,还是遵循你描述的其他工作流。选一个你实际为本仓库跟踪工作的位置。
默认姿态:这些技能是为 GitHub 设计的。如果
git remote
指向 GitHub,就提议 GitHub。如果
git remote
指向 GitLab(
gitlab.com
或自托管主机),就提议 GitLab。否则(或用户偏好),提供:
  • GitHub — issue 存在仓库的 GitHub Issues 里(使用
    gh
    CLI)
  • GitLab — issue 存在仓库的 GitLab Issues 里(使用
    glab
    CLI)
  • 本地 markdown — issue 作为
    .scratch/<feature>/
    下的文件存在本仓库中(适合单人项目或没有 remote 的仓库)
  • 其他(Jira、Linear 等)— 让用户用一段话描述工作流;技能会把它记录为自由文本
把选择记录在
docs/agents/issue-tracker.md
。GitHub 和 GitLab 模板带有"PRs as a request surface"(把 PR 当作请求入口)标志,默认关闭——保持关闭,不要提起它;想把外部 PR 放进分类队列的用户可以稍后在文件里打开这个标志。
B 节 — 分类标签词汇。 如果
triage
技能未安装(探索已告诉你),整节跳过——未安装的技能不需要标签。
如果已安装,只问一个问题:
你想保留默认的分类标签吗?(推荐:
默认值就是五个规范角色,每个标签字符串等于其角色名:
needs-triage
needs-info
ready-for-agent
ready-for-human
wontfix
。选,就原样写入。只有当用户说不——通常是因为他们的跟踪器已经用了别的名字(比如用
bug:triage
表示
needs-triage
)——才收集覆盖项,这样
triage
会应用已有标签而不是创建重复的。
C 节 — 领域文档。 默认单上下文——仓库根目录一个
CONTEXT.md
+
docs/adr/
。这适合几乎所有仓库;不问直接写。
只有当探索发现 monorepo 信号时,才提供多上下文——一个指向各上下文
CONTEXT.md
文件的根级
CONTEXT-MAP.md
。然后确认他们想要哪种布局。
Summarize what exists and what's missing. Then go through each section in order — one section, one answer, then the next.
Start each section with a recommended answer so the user can accept it with a single word. Only provide a one-line explanation if the choice actually branches; skip the entire section if exploration has already resolved it (skip Section B if
triage
is not installed, skip Section C if there's no monorepo).
Section A — Issue Tracker.
Explanation: The "issue tracker" for this repository is where issues are stored. Skills like
to-tickets
,
triage
,
to-spec
will read from and write to it — they need to know whether to call
gh issue create
, write markdown files under
.scratch/
, or follow another workflow you describe. Choose the location where you actually track work for this repository.
Default stance: These skills are designed for GitHub. If
git remote
points to GitHub, propose GitHub. If
git remote
points to GitLab (
gitlab.com
or self-hosted), propose GitLab. Otherwise (or if the user prefers), provide:
  • GitHub — Issues are stored in the repository's GitHub Issues (uses
    gh
    CLI)
  • GitLab — Issues are stored in the repository's GitLab Issues (uses
    glab
    CLI)
  • Local Markdown — Issues exist as files under
    .scratch/<feature>/
    in this repository (suitable for solo projects or repositories without a remote)
  • Other (Jira, Linear, etc.) — Ask the user to describe the workflow in a paragraph; the skill will record it as free text
Record the choice in
docs/agents/issue-tracker.md
. GitHub and GitLab templates come with a "PRs as a request surface" flag, which is off by default — keep it off and don't mention it; users who want external PRs to be added to the triage queue can turn this flag on in the file later.
Section B — Triage Label Vocabulary. If the
triage
skill is not installed (as exploration has told you), skip this entire section — uninstalled skills don't need labels.
If it is installed, ask only one question:
Do you want to keep the default triage labels? (Recommended: Yes)
The default values are the five standard roles, with each label string equal to its role name:
needs-triage
,
needs-info
,
ready-for-agent
,
ready-for-human
,
wontfix
. If Yes is selected, write them as-is. Only if the user says No — usually because their tracker already uses other names (e.g.,
bug:triage
instead of
needs-triage
) — collect overrides so
triage
will apply existing labels instead of creating duplicates.
Section C — Domain Documentation. Default is single-context — one
CONTEXT.md
+
docs/adr/
at the repository root. This is suitable for almost all repositories; write it without asking.
Only if exploration finds monorepo signals, offer multi-context — a root-level
CONTEXT-MAP.md
pointing to each context's
CONTEXT.md
file. Then confirm which layout they want.

3. 确认并编辑

3. Confirm and Edit

向用户展示草稿:
  • 要加进
    CLAUDE.md
    /
    AGENTS.md
    中正在编辑的那个文件的
    ## Agent skills
    块(选择规则见步骤 4)
  • docs/agents/issue-tracker.md
    docs/agents/domain.md
    docs/agents/triage-labels.md
    的内容(最后一个仅在
    triage
    已安装时)
写入前让他们编辑。
Show the user the draft:
  • The
    ## Agent skills
    block to be added to either
    CLAUDE.md
    /
    AGENTS.md
    (selection rules are in Step 4)
  • Contents of
    docs/agents/issue-tracker.md
    ,
    docs/agents/domain.md
    and
    docs/agents/triage-labels.md
    (the last one only if
    triage
    is installed)
Let them edit before writing.

4. 写入

4. Write

选择要编辑的文件:
  • 如果
    CLAUDE.md
    存在,编辑它。
  • 否则如果
    AGENTS.md
    存在,编辑它。
  • 如果都不存在,问用户要创建哪一个——不要替他们选。
CLAUDE.md
已存在时绝不创建
AGENTS.md
(反之亦然)——总是编辑已经存在的那个。
如果所选文件中已有
## Agent skills
块,就地更新其内容,而不是追加一份重复的。不要覆盖用户对周围章节的编辑。
该块:
markdown
undefined
Choose the file to edit:
  • If
    CLAUDE.md
    exists, edit it.
  • Otherwise, if
    AGENTS.md
    exists, edit it.
  • If neither exists, ask the user which one to create — don't choose for them.
Never create
AGENTS.md
if
CLAUDE.md
exists (and vice versa) — always edit the one that already exists.
If the selected file already has a
## Agent skills
block, update its content in place instead of appending a duplicate. Don't overwrite the user's edits to surrounding sections.
The block:
markdown
undefined

Agent skills

Agent skills

Issue tracker

Issue tracker

[one-line summary of where issues are tracked]. See
docs/agents/issue-tracker.md
.
[one-line summary of where issues are tracked]. See
docs/agents/issue-tracker.md
.

Triage labels

Triage labels

[one-line summary of the label vocabulary]. See
docs/agents/triage-labels.md
.
[one-line summary of the label vocabulary]. See
docs/agents/triage-labels.md
.

Domain docs

Domain docs

[one-line summary of layout — "single-context" or "multi-context"]. See
docs/agents/domain.md
.

只有当 `triage` 已安装且 B 节执行过时,才包含 `### Triage labels` 子块并写 `docs/agents/triage-labels.md`。否则两者都省略。

然后用本技能文件夹中的种子模板作为起点写文档文件:

- [issue-tracker-github.md](./issue-tracker-github.md) — GitHub issue 跟踪器
- [issue-tracker-gitlab.md](./issue-tracker-gitlab.md) — GitLab issue 跟踪器
- [issue-tracker-local.md](./issue-tracker-local.md) — 本地 markdown issue 跟踪器
- [triage-labels.md](./triage-labels.md) — 标签映射(仅当 `triage` 已安装)
- [domain.md](./domain.md) — 领域文档消费规则 + 布局

对于"其他" issue 跟踪器,用用户的描述从头写 `docs/agents/issue-tracker.md`。
[one-line summary of layout — "single-context" or "multi-context"]. See
docs/agents/domain.md
.

Only include the `### Triage labels` sub-block and write `docs/agents/triage-labels.md` if `triage` is installed and Section B was executed. Otherwise, omit both.

Then write the documentation 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 documentation consumption rules + layout

For "Other" issue trackers, write `docs/agents/issue-tracker.md` from scratch using the user's description.

5. 完成

5. Complete

告诉用户设置已完成,以及哪些工程技能现在会读取这些文件。提及他们之后可以直接编辑
docs/agents/*.md
——只有想切换 issue 跟踪器或从头重来时才需要重跑本技能。
Tell the user the setup is complete, and which engineering skills will now read these files. Mention that they can edit
docs/agents/*.md
directly later — they only need to re-run this skill if they want to switch issue trackers or start over.