@heihei0299/matt-skills 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/.agents/skills/ask-matt/SKILL.md +78 -0
  2. package/.agents/skills/ask-matt/agents/openai.yaml +5 -0
  3. package/.agents/skills/code-review/SKILL.md +94 -0
  4. package/.agents/skills/code-review/agents/openai.yaml +3 -0
  5. package/.agents/skills/codebase-design/DEEPENING.md +37 -0
  6. package/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  7. package/.agents/skills/codebase-design/SKILL.md +114 -0
  8. package/.agents/skills/codebase-design/agents/openai.yaml +3 -0
  9. package/.agents/skills/commit-check/SKILL.md +65 -0
  10. package/.agents/skills/commit-check/agents/openai.yaml +5 -0
  11. package/.agents/skills/commit-check/scripts/scan-sensitive.sh +36 -0
  12. package/.agents/skills/diagnose-fix/SKILL.md +66 -0
  13. package/.agents/skills/diagnose-fix/agents/openai.yaml +5 -0
  14. package/.agents/skills/diagnose-fix/references/anti-patterns.md +20 -0
  15. package/.agents/skills/diagnosing-bugs/SKILL.md +134 -0
  16. package/.agents/skills/diagnosing-bugs/agents/openai.yaml +3 -0
  17. package/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +41 -0
  18. package/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
  19. package/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  20. package/.agents/skills/domain-modeling/SKILL.md +74 -0
  21. package/.agents/skills/domain-modeling/agents/openai.yaml +3 -0
  22. package/.agents/skills/grill-me/SKILL.md +7 -0
  23. package/.agents/skills/grill-me/agents/openai.yaml +5 -0
  24. package/.agents/skills/grill-to-spec/SKILL.md +83 -0
  25. package/.agents/skills/grill-to-spec/agents/openai.yaml +5 -0
  26. package/.agents/skills/grill-to-spec/references/rules.md +33 -0
  27. package/.agents/skills/grill-with-docs/SKILL.md +7 -0
  28. package/.agents/skills/grill-with-docs/agents/openai.yaml +5 -0
  29. package/.agents/skills/grilling/SKILL.md +12 -0
  30. package/.agents/skills/grilling/agents/openai.yaml +3 -0
  31. package/.agents/skills/handoff/SKILL.md +16 -0
  32. package/.agents/skills/handoff/agents/openai.yaml +5 -0
  33. package/.agents/skills/implement/SKILL.md +15 -0
  34. package/.agents/skills/implement/agents/openai.yaml +5 -0
  35. package/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  36. package/.agents/skills/improve-codebase-architecture/SKILL.md +71 -0
  37. package/.agents/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
  38. package/.agents/skills/prototype/LOGIC.md +79 -0
  39. package/.agents/skills/prototype/SKILL.md +26 -0
  40. package/.agents/skills/prototype/UI.md +112 -0
  41. package/.agents/skills/prototype/agents/openai.yaml +3 -0
  42. package/.agents/skills/research/SKILL.md +12 -0
  43. package/.agents/skills/research/agents/openai.yaml +3 -0
  44. package/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
  45. package/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
  46. package/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
  47. package/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
  48. package/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
  49. package/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
  50. package/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
  51. package/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
  52. package/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  53. package/.agents/skills/tdd/SKILL.md +36 -0
  54. package/.agents/skills/tdd/agents/openai.yaml +3 -0
  55. package/.agents/skills/tdd/mocking.md +59 -0
  56. package/.agents/skills/tdd/tests.md +77 -0
  57. package/.agents/skills/tdd-implement/SKILL.md +143 -0
  58. package/.agents/skills/tdd-implement/agents/openai.yaml +5 -0
  59. package/.agents/skills/tdd-implement/references/stages.md +315 -0
  60. package/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
  61. package/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
  62. package/.agents/skills/teach/MISSION-FORMAT.md +31 -0
  63. package/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
  64. package/.agents/skills/teach/SKILL.md +140 -0
  65. package/.agents/skills/teach/agents/openai.yaml +5 -0
  66. package/.agents/skills/to-spec/SKILL.md +75 -0
  67. package/.agents/skills/to-spec/agents/openai.yaml +5 -0
  68. package/.agents/skills/to-tickets/SKILL.md +105 -0
  69. package/.agents/skills/to-tickets/agents/openai.yaml +5 -0
  70. package/.agents/skills/triage/AGENT-BRIEF.md +207 -0
  71. package/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
  72. package/.agents/skills/triage/SKILL.md +112 -0
  73. package/.agents/skills/triage/agents/openai.yaml +5 -0
  74. package/.agents/skills/wayfinder/SKILL.md +128 -0
  75. package/.agents/skills/wayfinder/agents/openai.yaml +5 -0
  76. package/.agents/skills/writing-great-skills/GLOSSARY.md +201 -0
  77. package/.agents/skills/writing-great-skills/SKILL.md +83 -0
  78. package/.agents/skills/writing-great-skills/agents/openai.yaml +5 -0
  79. package/LICENSE +21 -0
  80. package/README.md +167 -0
  81. package/bin/cli.js +353 -0
  82. package/package.json +26 -0
  83. package/template/.opencode/CONTEXT.md +47 -0
  84. package/template/.opencode/agents/issue-audit.md +52 -0
  85. package/template/.opencode/commands/grill-to-spec.md +13 -0
  86. package/template/.opencode/commands/handoff.md +12 -0
  87. package/template/.opencode/commands/improve-codebase-architecture.md +13 -0
  88. package/template/.opencode/commands/issue-audit.md +115 -0
  89. package/template/.opencode/commands/teach.md +12 -0
  90. package/template/.opencode/commands/to-spec.md +13 -0
  91. package/template/.opencode/commands/to-tickets.md +12 -0
  92. package/template/.opencode/commands/triage.md +12 -0
  93. package/template/.opencode/commands/wayfinder.md +13 -0
  94. package/template/.opencode/commands/writing-great-skills.md +12 -0
  95. package/template/.opencode/docs/agents/domain.md +51 -0
  96. package/template/.opencode/docs/agents/issue-tracker.md +30 -0
  97. package/template/.opencode/docs/agents/runtime-discipline.md +36 -0
  98. package/template/.opencode/docs/agents/skill-design.md +32 -0
  99. package/template/.opencode/docs/agents/triage-labels.md +15 -0
  100. package/template/.opencode/skills/commit-check/SKILL.md +65 -0
  101. package/template/.opencode/skills/commit-check/agents/openai.yaml +5 -0
  102. package/template/.opencode/skills/commit-check/scripts/scan-sensitive.sh +36 -0
  103. package/template/.opencode/skills/diagnose-fix/SKILL.md +66 -0
  104. package/template/.opencode/skills/diagnose-fix/agents/openai.yaml +5 -0
  105. package/template/.opencode/skills/diagnose-fix/references/anti-patterns.md +20 -0
  106. package/template/.opencode/skills/grill-to-spec/SKILL.md +83 -0
  107. package/template/.opencode/skills/grill-to-spec/agents/openai.yaml +5 -0
  108. package/template/.opencode/skills/grill-to-spec/references/rules.md +33 -0
  109. package/template/.opencode/skills/tdd-implement/SKILL.md +143 -0
  110. package/template/.opencode/skills/tdd-implement/agents/openai.yaml +5 -0
  111. package/template/.opencode/skills/tdd-implement/references/stages.md +315 -0
  112. package/template/.pi/agents/issue-audit.md +52 -0
  113. package/template/.pi/docs/agents/domain.md +51 -0
  114. package/template/.pi/docs/agents/issue-tracker.md +30 -0
  115. package/template/.pi/docs/agents/runtime-discipline.md +36 -0
  116. package/template/.pi/docs/agents/skill-design.md +32 -0
  117. package/template/.pi/docs/agents/triage-labels.md +15 -0
  118. package/template/.pi/prompts/issue-audit.md +114 -0
  119. package/template/.pi/skills/commit-check/SKILL.md +65 -0
  120. package/template/.pi/skills/commit-check/agents/openai.yaml +5 -0
  121. package/template/.pi/skills/commit-check/scripts/scan-sensitive.sh +36 -0
  122. package/template/.pi/skills/diagnose-fix/SKILL.md +66 -0
  123. package/template/.pi/skills/diagnose-fix/agents/openai.yaml +5 -0
  124. package/template/.pi/skills/diagnose-fix/references/anti-patterns.md +20 -0
  125. package/template/.pi/skills/grill-to-spec/SKILL.md +83 -0
  126. package/template/.pi/skills/grill-to-spec/agents/openai.yaml +5 -0
  127. package/template/.pi/skills/grill-to-spec/references/rules.md +33 -0
  128. package/template/.pi/skills/tdd-implement/SKILL.md +143 -0
  129. package/template/.pi/skills/tdd-implement/agents/openai.yaml +5 -0
  130. package/template/.pi/skills/tdd-implement/references/stages.md +315 -0
  131. package/template/AGENTS.md +59 -0
@@ -0,0 +1,128 @@
1
+ ---
2
+ name: wayfinder
3
+ description: Plan a huge chunk of work — more than one agent session can hold — as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ A loose idea has arrived — too big for one agent session, and wrapped in fog: the way from here to the **destination** isn't visible yet. Wayfinding is about finding that way, not charging at the destination. This skill charts the way as a **shared map** on the repo's issue tracker, then works its **decision tickets** — questions whose resolution is a decision, not slices of a build to execute — one at a time until the route is clear.
8
+
9
+ The destination varies per effort, and naming it is the first act of charting — it shapes every ticket. It might be a spec to hand off and iterate on, a decision to lock before planning starts, or a change made in place like a data-structure migration. The map is domain-agnostic — engineering work, course content, whatever fits the shape.
10
+
11
+ ## Plan, don't do
12
+
13
+ Wayfinder is **planning** by default: each ticket resolves a decision, and the map is done when the way is clear — nothing left to decide before someone goes and does the thing. The pull to just do the work is usually the signal you've reached the edge of the map and it's time to hand off. An effort can override this in its **Notes** — carrying execution into the map itself — but absent that, produce decisions, not deliverables.
14
+
15
+ ## Refer by name
16
+
17
+ Every map and ticket is an issue, so it has a **name** — its title. In everything the human reads — narration, the map's Decisions-so-far — refer to it by that name, never by a bare id, number, or slug. A wall of `#42, #43, #44` is illegible; names read at a glance. The id and URL don't vanish — a name wraps its link — but they ride *inside* the name, never stand in for it.
18
+
19
+ ## The Map
20
+
21
+ The map is a single issue on this repo's issue tracker, labelled `wayfinder:map` — the canonical artifact. Its tickets are child issues of the map.
22
+
23
+ The map is an **index**, not a store. It lists the decisions made and points at the tickets that hold their detail; a decision lives in exactly one place — its ticket — so the map never restates it, only gists it and links.
24
+
25
+ **Where the map, its child tickets, blocking, and frontier queries physically live is tracker-specific.** The issue tracker should have been provided to you — run `/setup-matt-pocock-skills` if not. Consult the tracker doc's "Wayfinding operations" section for how _this_ repo expresses them. If no tracker has been provided, default to the local-markdown tracker.
26
+
27
+ ### The map body
28
+
29
+ The whole map at low resolution, loaded once per session. Open tickets are **not** listed — they are open child issues, found by query.
30
+
31
+ ```markdown
32
+ ## Destination
33
+
34
+ <what reaching the end of this map looks like — the spec, decision, or change this effort is finding its way to. One or two lines; every session orients to it before choosing a ticket.>
35
+
36
+ ## Notes
37
+
38
+ <domain; skills every session should consult; standing preferences for this effort>
39
+
40
+ ## Decisions so far
41
+
42
+ <!-- the index — one line per closed ticket: enough to judge relevance, then zoom the link for the detail the ticket holds -->
43
+
44
+ - [<closed ticket title>](link) — <one-line gist of the answer>
45
+
46
+ ## Not yet specified
47
+
48
+ <!-- see "Fog of war": in-scope fog you can't ticket yet; graduates as the frontier advances -->
49
+
50
+ ## Out of scope
51
+
52
+ <!-- see "Out of scope": work ruled beyond the destination; closed, never graduates -->
53
+ ```
54
+
55
+ ### Tickets
56
+
57
+ Each ticket is a **child issue** of the map; the tracker's issue id is its identity. Its body is the question, sized to one 100K token agent session:
58
+
59
+ ```markdown
60
+ ## Question
61
+
62
+ <the decision or investigation this ticket resolves>
63
+ ```
64
+
65
+ Each ticket carries a `wayfinder:<type>` label — one of `research`, `prototype`, `grilling`, `task` (see [Ticket Types](#ticket-types)).
66
+
67
+ A session **claims** a ticket by assigning it to the dev driving the map, **first**, before any work, so concurrent sessions skip it. That assignee _is_ the claim: an open, unassigned ticket is unclaimed.
68
+
69
+ Blocking uses the tracker's **native** dependency relationship — essential because it renders the frontier _visually_ in the tracker's own UI, so the human sees what's takeable without opening the map. Only a tracker that lacks native blocking falls back to a body convention. A ticket is **unblocked** when every ticket blocking it is closed; the **frontier** is the open, unblocked, unclaimed children — the edge of the known.
70
+
71
+ The answer isn't part of the body — it's recorded on resolution (see [Work through the map](#work-through-the-map)). Assets created while resolving a ticket are linked from the issue, not pasted in.
72
+
73
+ ## Ticket Types
74
+
75
+ Every ticket is either **HITL** — human in the loop, worked *with* a human who speaks for themselves — or **AFK**, driven by the agent alone. A HITL ticket only resolves through that live exchange; the agent never stands in for the human's side of it (a grilling agent that answers its own questions has broken this).
76
+
77
+ - **Research** (AFK): Reading documentation, third-party APIs, or local resources like knowledge bases to surface a fact a decision waits on. Resolved by a `/research` **subagent**. Use when knowledge outside the current working directory is required.
78
+ - **Prototype** (HITL): Raise the fidelity of the discussion by making a cheap, rough, concrete artifact to react to — an outline, a rough take, a stub, or UI/logic code via the /prototype skill. Links the prototype as an asset. Use when "how should it look" or "how should it behave" is the key question.
79
+ - **Grilling** (HITL): Conversation via the /grilling and /domain-modeling skills, one question at a time. The default case.
80
+ - **Task** (HITL or AFK): Manual work that must happen before a *decision* can be made — nothing to decide, prototype, or research, but the discussion is blocked until it's done. Signing up for a service so its API can be judged, provisioning access, moving data so its shape can be seen. This is the one type that *does* rather than decides — and it earns its place by unblocking a decision, not by delivering the destination. The agent drives it alone where it can (AFK); otherwise it hands the human a precise checklist (HITL). Resolved when the work is done; the answer records what was done and any resulting facts (credentials location, new URLs, row counts) later tickets depend on.
81
+
82
+ ## Fog of war
83
+
84
+ The map is _deliberately_ incomplete: don't chart what you can't yet see. Beyond the live tickets lies the **fog of war** — the dim view of decisions and investigations you can tell are coming but can't yet pin down, because they hang on questions still open. Resolving a ticket clears the fog ahead of it, graduating whatever's now specifiable into fresh tickets — one at a time, until the way to the destination is clear and no tickets remain.
85
+
86
+ The map's **Not yet specified** section is where that dim view is written down: the suspected question, the area to revisit later. It's the undiscovered frontier _toward_ the destination — everything here is in scope, just not sharp enough to ticket. Write as loosely or as fully as the view allows; it doubles as a signpost for collaborators reading where the effort is headed.
87
+
88
+ **Fog or ticket?** The test is whether you can state the question precisely now — _not_ whether you can answer it now.
89
+
90
+ - **Ticket when** the question is already sharp — even if it's blocked and you can't act on it yet.
91
+ - **Not yet specified when** you can't yet phrase it that sharply. Don't pre-slice the fog into ticket-sized pieces: it's coarser than a ticket, and one patch may graduate into several tickets, or none, once the frontier reaches it.
92
+
93
+ **Not yet specified** excludes what's already decided (Decisions so far), what's already a live ticket, and what's out of scope (the next section).
94
+
95
+ ## Out of scope
96
+
97
+ Fog only ever gathers _toward_ the destination. The destination fixes the scope, so work beyond it is **out of scope** — it isn't fog, and it doesn't belong in **Not yet specified**. It gets its own **Out of scope** section on the map: work you've consciously ruled out of _this_ effort. Scope, not sharpness, lands it here.
98
+
99
+ Out-of-scope work never graduates — the frontier stops at the destination — so it returns only if the destination is redrawn, and then as a fresh effort, not a resumption.
100
+
101
+ Ruling something out of scope is a scoping act, not a step on the route. When a ticket that already exists turns out to sit past the destination — mis-scoped in while charting, or exposed by a resolution — **close it** (a closed ticket is unambiguously off the frontier) and leave one line in the **Out of scope** section: the gist plus why it's out of scope, linking the closed ticket. It stays out of **Decisions so far**, which records the route actually walked — a scope boundary isn't a step on it.
102
+
103
+ ## Invocation
104
+
105
+ Two modes. Either way, **never resolve more than one ticket per session** — with the exception of research tickets.
106
+
107
+ ### Chart the map
108
+
109
+ User invokes with a loose idea.
110
+
111
+ 1. **Name the destination.** Run a `/grilling` and `/domain-modeling` session to pin down what this map is finding its way to — the spec, decision, or change. The destination fixes the scope, so it's settled first.
112
+ 2. **Map the frontier.** Grill again, **breadth-first** this time: fan out across the whole space rather than deep on any one thread, surfacing the open decisions and the first steps takeable now. **If this surfaces no fog** — the way to the destination is already clear, the whole journey small enough for one session — you don't need a map. Stop and ask the user how they'd like to proceed.
113
+ 3. **Create the map** (label `wayfinder:map`): Destination and Notes filled in, Decisions-so-far empty, the fog sketched into **Not yet specified**.
114
+ 4. **Create the tickets you can specify now** as child issues of the map — then wire blocking edges in a **second pass** (issues need ids before they can reference each other). Wiring sorts them into the frontier and the blocked; everything you can't yet specify stays in the fog — the **Not yet specified** section.
115
+ 5. **Fire the research subagents.** For each `research` ticket you just created, spin up a `/research` subagent to resolve it in parallel, capturing its findings on a throwaway `research/<name>` branch with a context pointer from the ticket.
116
+ 6. Stop — charting is one session's work; it hand-resolves nothing.
117
+
118
+ ### Work through the map
119
+
120
+ User invokes with a map (URL or number). A ticket is **optional** — without one, you pick the next decision, not the user.
121
+
122
+ 1. Load the **map** — the low-res view, not every ticket body.
123
+ 2. Choose the ticket. If the user named one, use it. Otherwise take the first frontier ticket in order. **Claim it**: assign it to yourself before any work.
124
+ 3. Resolve it — **zoom as needed**: fetch the full body of any related or closed ticket on demand; invoke the skills the `## Notes` block names. If in doubt, use `/grilling` and `/domain-modeling`.
125
+ 4. Record the resolution: post the answer as a **resolution comment**, **close** the issue, and **append a context pointer** to the map's Decisions-so-far.
126
+ 5. Add newly-surfaced tickets (create-then-wire); graduate any fog the answer has made specifiable, clearing each graduated patch from **Not yet specified** so it lives only as its new ticket. If the answer reveals a ticket — this one or another — sits beyond the destination, **rule it out of scope** rather than resolving it on the route. If the decision invalidates other parts of the map, update or delete those tickets.
127
+
128
+ The user may run unblocked tickets in parallel, so expect other sessions to be editing the tracker concurrently.
@@ -0,0 +1,5 @@
1
+ interface:
2
+ display_name: "Wayfinder"
3
+ short_description: "Map a large effort as decision tickets"
4
+ policy:
5
+ allow_implicit_invocation: false
@@ -0,0 +1,201 @@
1
+ # Glossary — Building Great Skills
2
+
3
+ The domain model for what makes a skill great. A skill exists to wrangle determinism out of a stochastic system; the root virtue is **Predictability**, and every term below is a lever on it. This is the disclosed reference for [`writing-great-skills`](SKILL.md).
4
+
5
+ The terms are grouped by axis: **Invocation** (how a skill is reached), **Information Hierarchy** (how its content is arranged), **Steering** (how the agent's runtime behaviour is shaped), and **Pruning** (how it is kept lean). Each **failure mode** lives beside the lever that cures it, tagged _failure mode_.
6
+
7
+ **Bold terms** in any definition are themselves defined in this glossary; find them by their heading.
8
+
9
+ ## Predictability
10
+
11
+ The degree to which a skill makes the agent behave the same _way_ on every run — the same process, not the same output (a brainstorming skill should _predictably_ diverge; its tokens vary, its behaviour doesn't). The root virtue every other term serves — cost and maintainability are symptoms of it, not rivals.
12
+
13
+ _Avoid_: consistency, reliability, robustness, output-determinism
14
+
15
+ ## Invocation
16
+
17
+ How a skill is reached — and the two loads you pay for the choice.
18
+
19
+ ### Model-Invoked
20
+
21
+ A skill that keeps its **description** field, so the agent can see it and fire it autonomously — and the human can still type its name, so model-invocation always _includes_ user reach. There is no model-only state: a description only ever _adds_ agent discovery, never removes the human's. Pays a permanent **context load** on every turn in exchange for that discoverability. Reachable by other skills, because the description that makes it agent-discoverable makes it invocable. A model-invoked skill whose content is all **reference** is also one home for shared reference: another skill can invoke it, so reference needed by several skills lives in one place. Pick model-invocation only when the agent must reach the skill on its own; if it never fires except by hand, drop the description and pay no context load.
22
+
23
+ _Avoid_: ability, tool, capability
24
+
25
+ ### User-Invoked
26
+
27
+ A skill with its **description** stripped — invisible to the agent and reachable only by the human typing its name (user-_only_, where **model-invoked** is user-_and-agent_). Trades agent-discoverability for zero **context load**. Because it has no description, nothing but the human can reach it: no other skill can fire it.
28
+
29
+ _Avoid_: procedure, workflow, command
30
+
31
+ ### Description
32
+
33
+ The skill's machine-readable trigger, and the one **context pointer** a **model-invoked** skill is forced to keep loaded at all times. Its mere presence _is_ the invocation axis: keep it and the skill is model-invoked (and reachable by other skills); delete it and the skill is **user-invoked**, reachable only by the human. The source of a model-invoked skill's **context load**.
34
+
35
+ _Avoid_: frontmatter, summary
36
+
37
+ ### Context Pointer
38
+
39
+ A reference held in the agent's context that names some out-of-context material and encodes the condition for reaching it. The **description** is the top-level context pointer (context window → skill); pointers to disclosed files are the same object one level down. Its wording, not the target, decides _when_ the agent reaches — and _how reliably_. A must-have target behind a weakly worded pointer is a variance bug: fix the wording first, and inline the material only if sharpening fails.
40
+
41
+ _Avoid_: link, reference, import
42
+
43
+ ### Context Load
44
+
45
+ The cost a **model-invoked** skill imposes on the agent's context window — its **description**, always loaded, spending both tokens and attention. What **user-invoked** skills escape by having no description, and the brake on splitting into more model-invoked skills.
46
+
47
+ _Avoid_: token cost, context bloat
48
+
49
+ ### Cognitive Load
50
+
51
+ The cost a **user-invoked** skill imposes on the human — what they must hold in their head: which skills exist and when to reach for each (the human is the index). What **model-invocation** removes by being agent-discoverable, and the brake on splitting into more user-invoked skills. Not a cost to minimise: it is the price of human agency, the reason some skills stay user-invoked. Spend it where human judgement matters; remove it where it does not.
52
+
53
+ _Avoid_: human index, burden, overhead
54
+
55
+ ### Router Skill
56
+
57
+ A **user-invoked** skill whose job is to point at your other user-invoked skills — naming each and when to reach for it — so the human has one skill to remember instead of many. It can only hint, never fire them: user-invoked skills have no **description**, so nothing but the human can reach them. The cure for **cognitive load** when user-invoked skills multiply.
58
+
59
+ _Avoid_: dispatcher, menu, registry, index, router procedure
60
+
61
+ ### Granularity
62
+
63
+ How finely you divide skills. Finer division spends one of the two loads: more **model-invoked** skills spend **context load** (more descriptions crowding the window and competing for attention); more **user-invoked** skills spend **cognitive load** (more for the human to remember and reach for). Two cuts guide the division. By **invocation**, split off a model-invoked skill where you have a distinct **leading word** to trigger it — a trigger word you actually use in your prompts. By **sequence**, split a run of **steps** where a step's **post-completion steps** need hiding, since isolating it in its own context clears what follows. Beware the reverse: merging sequences exposes each step's post-completion steps to what follows, inviting premature completion.
64
+
65
+ _Avoid_: chunking, modularity
66
+
67
+ ## Information Hierarchy
68
+
69
+ How a skill's content is arranged, and how far down the ladder each piece sits.
70
+
71
+ ### Information Hierarchy
72
+
73
+ A skill's content ranked by how immediately the agent needs it — a single ladder, produced by two cuts: in-file or behind a pointer, and step or reference. The rungs:
74
+
75
+ - **Steps** — in-file, primary
76
+ - **Reference**, in-file — secondary
77
+ - **Reference**, disclosed — behind a **context pointer**
78
+
79
+ A skill with no **steps** uses just the bottom two rungs — often a legitimately flat peer-set (e.g. every rule of a review on one rung), which is a fine arrangement, not a smell. The hierarchy is independent of invocation: a skill can be model- or user-invoked whether it is all steps, all reference, or both. When a skill has steps, in-file reference that should be disclosed buries them and turns attending to them into a coin-flip — a variance lever, not just a legibility one. Keep the top of the ladder legible; push down it whatever you can.
80
+
81
+ _Avoid_: structure, organization, layout
82
+
83
+ ### Steps
84
+
85
+ The ordered actions the agent performs — when a skill has them, the primary tier of its content, and the part that earns its place in SKILL.md. Not every skill has steps: a skill can be all steps (`tdd`), all **reference** (a review), or both, independent of invocation. Every step ends on a **completion criterion**, clear or vague.
86
+
87
+ _Avoid_: workflow, instructions, choreography
88
+
89
+ ### Reference
90
+
91
+ Material the agent refers to on demand — definitions, facts, parameters, examples, conditional instructions. When a skill has **steps** it is secondary to them; when a skill has none it is the entire content; or it lives outside any skill entirely — see **External Reference**. Reached via **context pointers**, and the prime candidate for **progressive disclosure**.
92
+
93
+ _Avoid_: supporting material, docs, background
94
+
95
+ ### External Reference
96
+
97
+ **Reference** that lives outside the skill system — a plain file, no **description**, no **steps**, not invocable — that any skill can point at. The home for shared reference that needn't fire on its own, and the only shared home two **user-invoked** skills can use, since neither has a description and so neither can fire the other.
98
+
99
+ _Avoid_: doc, resource, knowledge base
100
+
101
+ ### Progressive Disclosure
102
+
103
+ Moving **reference** down the ladder — out of SKILL.md and behind a **context pointer** — so the top stays legible. Not primarily a token optimisation; it is how the **information hierarchy** is protected. Licensed by **branching**: disclose what only some branches need, inline what every path needs, and if a pointer fires unreliably on must-have material, sharpen its wording, and pull it back inline only if that fails.
104
+
105
+ _Avoid_: lazy loading, chunking
106
+
107
+ ### Co-location
108
+
109
+ Keeping the material an agent needs at once in one place — a concept's definition, rules, and caveats under a single heading, not scattered across the file — so reading one part brings its neighbours with it. The within-file companion to the **Information Hierarchy**: the hierarchy ranks _how far down_ a piece sits; co-location decides _what sits beside it_ once there. There is no formula for the right format of a body of **reference**; the test is that a skill should read like documentation written for the agent, and grouped material reads that way where scattered material does not. Distinct from **Duplication**: that repeats one meaning in two places, where scattering fragments a single meaning across many.
110
+
111
+ _Avoid_: grouping, clustering, cohesion
112
+
113
+ ### Sprawl
114
+
115
+ _Failure mode._ A skill that is simply too long — too many lines in SKILL.md — independent of whether they are stale or repeated. Even an all-live, all-unique skill can sprawl. It costs readability (the agent wades through more before it can act, and attention thins across the excess), maintainability (every extra line is one more to keep **relevant**), and tokens. The cure is the **information hierarchy**: push **reference** down behind **context pointers**, and split by **branch** or sequence so each path carries only what it needs. Distinct from **sediment** (length from stale accumulation) and **duplication** (length from repeated meaning) — sprawl is length itself, whatever its cause.
116
+
117
+ _Avoid_: bloat, length, size, verbosity
118
+
119
+ ## Steering
120
+
121
+ The levers that shape the agent's runtime behaviour toward **Predictability**.
122
+
123
+ ### Branch
124
+
125
+ A distinct way a skill can be invoked — a case the skill handles — so different runs take different paths through it. A skill with many steps may carry many branches; a linear one has none.
126
+
127
+ _Avoid_: path, case, fork
128
+
129
+ ### Leading Word
130
+
131
+ A compact concept — also called a _Leitwort_ — already living in the model's pretraining, that the agent thinks with while running the skill. It encodes a behavioural principle in the fewest possible tokens by invoking priors the model already holds (e.g. _lesson_, _proximal zone of development_, _fog of war_, _tracer bullets_). Repeated as a token, never as a sentence, it accumulates a distributed definition across the skill and anchors a whole region of behaviour. Coining your own works if you define it clearly, but a made-up word recruits no priors — you pay in definition tokens what a pretrained word gives free. Reach for an existing word first.
132
+
133
+ A leading word serves **predictability** twice. In the body it anchors **execution** — the agent reaches for the same behaviour every time the concept appears, and inside flat reference it focuses attention on a class of thing to look for, recruiting the right checks each run. In the **description** it anchors **invocation** — and not only within the skill: when the same word lives in your prompts, your docs, and your codebase, the agent links that shared language to the skill and fires it more reliably. Word a description with the leading words you actually use when you want the skill.
134
+
135
+ _Avoid_: keyword, term, motif
136
+
137
+ ### Completion Criterion
138
+
139
+ The condition that tells the agent a unit of work is done — the target it judges against. Two properties make it a lever, not just a quality. Its **clarity** (can the agent tell done from not-done?) resists **premature completion** — a vague bound ("understanding reached") lets the agent declare done and slip to the next step; this axis needs _steps_ to bite, since premature completion is a between-steps failure. Its **demand** (how much it requires) sets **legwork** — "every modified model accounted for" forces thorough work where "produce a change list" does not — and this axis is _not_ step-bound: it can bind a body of flat reference too, which is how a skill with no steps still carries an exhaustiveness bar ("every rule applied"). The strongest criteria are both checkable and exhaustive.
140
+
141
+ _Avoid_: done condition, exit condition, stopping rule
142
+
143
+ ### Legwork
144
+
145
+ The work an agent does behind the scenes within a single step — reading files, exploring the codebase, making changes, digging up what it needs rather than offloading to the user. It lives below the step structure: never written as its own step, latent in the wording, controlled by the agent rather than the skill. The within-step counterpart to **post-completion steps**' across-step pull. Raised by a **leading word** (_comprehensive_, _thorough_) or a **completion criterion** that demands the work be exhaustive — including the demand axis applied to flat reference, which is what drives a skill of flat reference to cover all its rungs. Goes thin either when that demand is missing or when **premature completion** cuts the step short.
146
+
147
+ _Avoid_: scope, effort, diligence, coverage
148
+
149
+ ### Post-Completion Steps
150
+
151
+ The **steps** that follow the current step. Visible, they pull the agent forward into **premature completion** — the more it sees, the stronger the tug; the defence is to hide them by splitting the sequence of steps into two.
152
+
153
+ _Avoid_: horizon, fog of war, lookahead
154
+
155
+ ### Premature Completion
156
+
157
+ _Failure mode._ Ending the current step before it is genuinely done, because the agent's attention slips to being done rather than to the work. A between-steps failure: it needs **steps** to occur — a skill with no steps that quits early isn't premature completion but thin **legwork** under an unmet demand. A tug-of-war between two forces: visible **post-completion steps** (the pull forward) and the **completion criterion**'s clarity (the resistance — a sharp, checkable bar holds; a vague one gives way). Fuzziness is the necessary condition: a sharp bound resists the pull no matter how many later steps are visible, so a step that never rushes needs no defending. Two levers hold a step that does, but reach for them in order: **sharpen the bound first** — it is local and cheap. Only when the criterion is irreducibly fuzzy _and_ you actually observe the rush do you **hide the later steps** — and hiding only works across a real context boundary (a user-invoked hand-off or a subagent dispatch; an inline model-invoked call leaves the later steps in context and clears nothing). One cause of thin legwork, but distinct from it: legwork can be thin even when a step runs to full completion.
158
+
159
+ _Avoid_: premature closure, the rush, rushing, shortcutting
160
+
161
+ ### Negation
162
+
163
+ _Failure mode._ Steering by prohibition — telling the agent what _not_ to do — which drags the forbidden behaviour into context and makes it _more_ available, not less. _Don't think of an elephant_, and the elephant is all there is; _never write verbose comments_, and verbosity is the pattern the agent has just read. The negation is a weak modifier the strongly-activated concept overruns, so the ban half-reads as an instruction to do the thing. Its **leading word** is the _elephant_: whatever a prohibition names into the frame. Cure: prompt the **positive** — describe the target behaviour ("write one-line comments") so the banned one is never spoken. A prohibition earns its place only as a hard guardrail on a behaviour you cannot phrase positively; even then, pair it with the positive target so attention lands on what to do.
164
+
165
+ _Avoid_: ironic rebound, don't-prompting, the pink elephant
166
+
167
+ ## Pruning
168
+
169
+ Keeping a skill lean — each remedy paired with the failure it cures.
170
+
171
+ ### Single Source of Truth
172
+
173
+ The desired state where each meaning lives in exactly one authoritative place, so a change to the skill's behaviour is a change in one place. **Duplication** is its violation.
174
+
175
+ _Avoid_: home, canonical location
176
+
177
+ ### Duplication
178
+
179
+ _Failure mode._ The same meaning given more than one **single source of truth**. It costs maintenance (change one place, you must change the others), costs tokens, and inflates prominence — repeating a meaning weights it on the ladder past its real rank. The accidental inverse of a **leading word**, which raises attention on purpose by repeating a token, never the meaning.
180
+
181
+ _Avoid_: repetition, redundancy
182
+
183
+ ### Relevance
184
+
185
+ Whether a line still bears on what the skill does — the lens for what to keep. A line loses relevance either by never bearing on the task (mere exposition, or a **branch** that should be disclosed) or by going stale: drifting out of date as the behaviour or world it describes changes. Shorter skills are easier to keep relevant, because each line is cheaper to check. Distinct from **no-op**: relevance asks whether a line bears on the task, not whether it changes behaviour.
186
+
187
+ _Avoid_: load-bearing, staleness, freshness
188
+
189
+ ### Sediment
190
+
191
+ _Failure mode._ Layers of old content that settle in a skill and are never cleared, because adding feels safe and removing feels risky — so stale and irrelevant lines accumulate and you must core down through them to find what is still live. The default fate of any skill without a pruning discipline; the slow erosion of **relevance**, as opposed to **duplication**'s repeated meaning.
192
+
193
+ _Avoid_: accretion, bloat, cruft, rot
194
+
195
+ ### No-Op
196
+
197
+ _Failure mode._ An instruction that changes nothing because the model already does it by default — you pay load to tell the agent what it would do anyway. The test: does a line change behaviour versus the default? A line can be perfectly **relevant** and still be a no-op. The same priors that make a **leading word** free make a no-op worthless.
198
+
199
+ A leading word is a _technique_; No-Op is a _verdict_ on a line — and they cross. A leading word too weak to beat the default is a no-op (_be thorough_ when the agent is already thorough-ish), and the fix is a stronger word that passes the verdict (_relentless_), not a different technique. So the No-Op test — does it change behaviour versus the default? — is also how you grade whether a leading word is earning its repetitions. This is model-relative, not reader-relative: two people disagreeing over whether a line is a no-op disagree about the default, and settle it by running the skill, not by debate.
200
+
201
+ _Avoid_: redundant instruction, restating the obvious, belaboring
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: writing-great-skills
3
+ description: Reference for writing and editing skills well — the vocabulary and principles that make a skill predictable.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ A skill exists to wrangle determinism out of a stochastic system. **Predictability** — the agent taking the same _process_ every run, not producing the same output — is the root virtue; every lever below serves it.
8
+
9
+ **Bold terms** are defined in [`GLOSSARY.md`](GLOSSARY.md); look them up there for the full meaning.
10
+
11
+ ## Invocation
12
+
13
+ Two choices, trading different costs:
14
+
15
+ - A **model-invoked** skill keeps a **description**, so the agent can fire it autonomously _and_ other skills can reach it (you can still type its name too). It contributes to **context load** — the description sits in the window every turn. Mechanics: omit `disable-model-invocation`, and write a model-facing description with rich trigger phrasing ("Use when the user wants…, mentions…").
16
+ - A **user-invoked** skill strips the description from the agent's reach: only you, typing its name, can invoke it — and no other skill can. Zero context load, but it spends **cognitive load**: _you_ are the index that must remember it exists. Mechanics: set `disable-model-invocation: true`; the `description` becomes human-facing — a one-line summary, trigger lists stripped.
17
+
18
+ Pick model-invocation only when the agent must reach the skill on its own, or another skill must. If it only ever fires by hand, make it user-invoked and pay no context load.
19
+
20
+ When user-invoked skills multiply past what you can remember, that piled-up cognitive load is cured by a **router skill**: one user-invoked skill that names the others and when to reach for each.
21
+
22
+ ## Writing the description
23
+
24
+ A model-invoked **description** does two jobs — state what the skill is, and list the **branches** that should trigger it. Every word increases **context load**, so a description earns even harder pruning than the body:
25
+
26
+ - **Front-load the skill's leading word** — the description is where it does its invocation work.
27
+ - **One trigger per branch.** Synonyms that rename a single branch are **duplication** — "build features using TDD … asks for test-first development" is one branch written twice. Collapse them; keep only genuinely distinct branches.
28
+ - **Cut identity that's already in the body.** Keep the description to triggers, plus any "when another skill needs…" reach clause.
29
+
30
+ ## Information hierarchy
31
+
32
+ A skill is built from two content types — **steps** and **reference** — that mix freely: a skill can be all steps, all reference, or both. The core decision is which to use and where each sits on the **information hierarchy**, a ladder ranked by how immediately the agent needs the material:
33
+
34
+ 1. **In-skill step** — an ordered action in `SKILL.md`, the primary tier: what the agent does, in order. Each step ends on a **completion criterion**, the condition that tells the agent the work is done. Make it _checkable_ (can the agent tell done from not-done?) and, where it matters, _exhaustive_ ("every modified model accounted for", not "produce a change list") — a vague criterion invites **premature completion**.
35
+ 2. **In-skill reference** — a definition, rule, or fact in `SKILL.md`, consulted on demand. Often a legitimately flat peer-set (every rule of a review on one rung) — a fine arrangement, not a smell. _This skill is all reference._
36
+ 3. **External reference** — reference pushed out of `SKILL.md` into a separate file, reached by a **context pointer**, loaded only when the pointer fires. (Spans _disclosed_ reference — a sibling file like `GLOSSARY.md`, still part of the skill — through fully **external reference** that lives outside the skill system and any skill can point at.)
37
+
38
+ A demanding completion criterion drives thorough **legwork** — the digging the agent does within the work — whether the skill has steps or not, since "every rule applied" binds flat reference just as "every step done" binds a sequence.
39
+
40
+ Push too little down and the top bloats; push too much and you hide material the agent actually needs. That tension is the whole decision.
41
+
42
+ **Progressive disclosure** is the move down the ladder — out of `SKILL.md` into a linked file — so the top stays legible. Mechanics: a linked `.md` file in the skill folder, named for what it holds (this skill discloses its full definitions to `GLOSSARY.md`). Some skills are used in more than one way, and each distinct way is a **branch** — different runs taking different paths through the skill. Branching is the cleanest disclosure test: inline what every branch needs, and push behind a pointer what only some branches reach. A **context pointer**'s _wording_, not its target, decides when and how reliably the agent reaches the material.
43
+
44
+ Where the ladder decides _how far down_ a piece sits, **co-location** decides _what sits beside it_ once there: keep a concept's definition, rules, and caveats under one heading rather than scattered, so reading one part brings its neighbours with it.
45
+
46
+ ## When to split
47
+
48
+ **Granularity** is how finely you divide skills, and each cut spends one of the two loads, so split only when the cut earns it. Two cuts:
49
+
50
+ - **By invocation** — split off a **model-invoked** skill when you have a distinct **leading word** that should trigger it on its own, or another skill must reach it. You pay **context load** for the new always-loaded **description**, so that independent reach has to be worth it.
51
+ - **By sequence** — split a run of **steps** when the steps still ahead (a step's **post-completion steps**) tempt the agent to rush the one in front of it (**premature completion**). Keeping them out of view encourages the agent to do more **legwork** on the current task.
52
+
53
+ ## Pruning
54
+
55
+ Keep each meaning in a **single source of truth**: one authoritative place, so changing the behaviour is a one-place edit.
56
+
57
+ Check every line for **relevance**: does it still bear on what the skill does?
58
+
59
+ Then hunt **no-ops** sentence by sentence, not just line by line: run the no-op test on each sentence in isolation, and when one fails, delete the whole sentence rather than trim words from it. Be aggressive — most prose that fails should go, not be rewritten.
60
+
61
+ ## Leading words
62
+
63
+ A **leading word** is a compact concept already living in the model's pretraining that the agent thinks with while running the skill (e.g. _lesson_, _fog of war_, _tracer bullets_). Repeated throughout the text (though not necessarily - a strong leading word might only be needed once), it accumulates a distributed definition and anchors a whole region of behaviour in the fewest tokens, by recruiting priors the model already holds.
64
+
65
+ It serves predictability twice. In the body it anchors _execution_: the agent reaches for the same behaviour every time the word appears. In the description it anchors _invocation_: when the same word lives in your prompts, docs, and code, the agent links that shared language to the skill and fires it more reliably.
66
+
67
+ Hunt for opportunities to refactor skills to use leading words. A triad spelled out at three sites (**duplication**), a description spending a sentence to gesture at one idea — each is a passage begging to **collapse** into a single token. Examples include:
68
+
69
+ - "fast, deterministic, low-overhead" -> _tight_ — one quality restated across a phase — into a single pretrained word (a _tight_ loop).
70
+ - "a loop you believe in" -> _red_ — converts a fuzzy gate into a binary observable state (the loop goes _red_ on the bug, or it doesn't).
71
+
72
+ You win twice over: fewer tokens, _and_ a sharper hook for the agent to hang its thinking on. Assume every skill is carrying restatements that leading words retire — go find them.
73
+
74
+ ## Failure modes
75
+
76
+ Use these to diagnose issues the user may be having with the skill.
77
+
78
+ - **Premature completion** — ending a step before it's genuinely done, attention slipping to _being done_. Defence, in order: sharpen the completion criterion first (cheap, local); only if it is irreducibly fuzzy _and_ you observe the rush, hide the post-completion steps by splitting (the sequence cut).
79
+ - **Duplication** — the same meaning in more than one place. Costs maintenance and tokens, and inflates a meaning's prominence on the ladder past its real rank.
80
+ - **Sediment** — stale layers that settle because adding feels safe and removing feels risky. The default fate of any skill without a pruning discipline.
81
+ - **Sprawl** — a skill simply too long, even when every line is live and unique. Hurts readability and maintainability and wastes tokens. The cure is the ladder: disclose **reference** behind pointers, and split by **branch** or sequence so each path carries only what it needs.
82
+ - **No-op** — a line the model already obeys by default, so you pay load to say nothing. The test: does it change behaviour versus the default? A weak leading word (_be thorough_ when the agent is already thorough-ish) is a no-op; the fix is a stronger word (_relentless_), not a different technique.
83
+ - **Negation** — steering by prohibition backfires: _don't think of an elephant_ names the elephant and makes it more available, not less. Prompt the **positive** — state the target behaviour so the banned one is never spoken; keep a prohibition only as a hard guardrail you can't phrase positively, and even then pair it with what to do instead.
@@ -0,0 +1,5 @@
1
+ interface:
2
+ display_name: "Writing Great Skills"
3
+ short_description: "Principles for predictable skills"
4
+ policy:
5
+ allow_implicit_invocation: false
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 heihei0299
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,167 @@
1
+ # matt-skills
2
+
3
+ mattpocock/skills(`skills/engineering` + `skills/productivity`)的配置仓库:工作区内容镜像为 `template/` 模板快照,以 npm 包 `@heihei0299/matt-skills` 分发,目标仓库一条命令即完成初始化。
4
+
5
+ ## 模板结构
6
+
7
+ ```
8
+ template/
9
+ ├── AGENTS.md 项目级全局配置(行为路由 + 分文件指针)
10
+ ├── .pi/ pi-agent 项目配置(pi 标准结构:`.pi/skills/` 直放独有技能,自动发现)
11
+ └── .opencode/ 分发内容(目标仓库的 opencode 项目配置)
12
+ ├── skills/ 4 个独有技能(tdd-implement、grill-to-spec、diagnose-fix、commit-check)
13
+ ├── agents/ issue-audit 子代理定义
14
+ ├── commands/ issue-audit + 9 个显式触发技能命令(grill-to-spec/wayfinder/to-spec/to-tickets/triage/improve-codebase-architecture/teach/handoff/writing-great-skills)
15
+ ├── docs/agents/ 5 个分文件(运行时纪律 / 技能设计 / issue tracker / triage labels / domain)
16
+ ├── CONTEXT.md 术语表
17
+ ├── package.json 插件依赖清单
18
+ └── .gitignore
19
+ ```
20
+
21
+ ## 初始化
22
+
23
+ 在目标仓库根目录执行一条命令:
24
+
25
+ ```sh
26
+ npx @heihei0299/matt-skills init
27
+ ```
28
+
29
+ `init` 做两件事:
30
+
31
+ 1. 复制 `template/` 快照(`AGENTS.md`、`.opencode/`、`.pi/`)到当前目录;
32
+ 2. 把上游技能(engineering 17 个 + productivity 5 个)复制到 `.agents/skills/`。
33
+
34
+ 选项:`--dest <path>` 指定目标目录(默认当前目录);`--force` 覆盖已存在的文件并自动备份被覆盖文件到 `.bak`(默认跳过)。
35
+
36
+ **增量同步(已有项目)**:已有项目更新到最新模板与技能:
37
+
38
+ ```sh
39
+ npx @heihei0299/matt-skills sync # 增量同步,备份被覆盖文件到 .bak
40
+ npx @heihei0299/matt-skills sync --force # 覆盖不备份
41
+ ```
42
+
43
+ `sync` 专为已有项目设计:自动检测 `AGENTS.md` 是否存在,存在则增量更新模板与上游技能并备份,不存在则等同全新 `init`。与 `init --force` 的区别:`sync` 默认即备份、语义更明确,建议已有项目优先用 `sync`。
44
+
45
+ 上游没有 `tdd-implement`、`grill-to-spec`、`diagnose-fix`、`commit-check`,复制天然不冲突。目标仓库会话即自动加载全部技能(上游在 `.agents/skills/`、独有在 `.opencode/skills/`;pi 侧独有在 `.pi/skills/`)与项目级全局配置(行为路由表、分文件约定);`issue-audit` 以子代理 + 命令形式分发(`.opencode/agents/`、`.opencode/commands/`);9 个显式触发技能注册为 opencode 命令(`.opencode/commands/`,`/命令名` 触发)。
46
+
47
+ **pi-agent 用户**:初始化命令完全相同。pi 从 `.pi/skills/` 自动发现独有技能(tdd-implement、grill-to-spec、diagnose-fix、commit-check),无需任何指向配置;首次在目标仓库交互启动时 pi 会询问项目信任,用 `/trust` 保存即可。
48
+
49
+ **手动方式(备选)**:无 npx 环境时,将 `template/` 整个文件夹复制到目标仓库根目录,再拉取上游技能:
50
+
51
+ ```sh
52
+ cp -r template/. /path/to/target/
53
+ git clone --depth 1 https://github.com/mattpocock/skills.git /tmp/mattpocock-skills
54
+ cp -r /tmp/mattpocock-skills/skills/engineering/. .agents/skills/
55
+ cp -r /tmp/mattpocock-skills/skills/productivity/. .agents/skills/
56
+ rm -rf /tmp/mattpocock-skills
57
+ ```
58
+
59
+ 上游没有 `tdd-implement`、`grill-to-spec`、`diagnose-fix`、`commit-check`,复制天然不冲突。目标仓库会话即自动加载全部技能(上游在 `.agents/skills/`、独有在 `.opencode/skills/`;pi 侧独有在 `.pi/skills/`)与项目级全局配置(行为路由表、分文件约定);`issue-audit` 以子代理 + 命令形式分发(`.opencode/agents/`、`.opencode/commands/`);9 个显式触发技能注册为 opencode 命令(`.opencode/commands/`,`/命令名` 触发)。
60
+
61
+ **pi-agent 用户**:初始化命令完全相同。pi 从 `.pi/skills/` 自动发现独有技能(tdd-implement、grill-to-spec、diagnose-fix、commit-check),无需任何指向配置;首次在目标仓库交互启动时 pi 会询问项目信任,用 `/trust` 保存即可。
62
+
63
+ ## 维护约定
64
+
65
+ 改动工作区后,必须同步到 `template/` 对应路径,路径映射如下(同步方向单向:工作区 → 模板快照):
66
+
67
+ | 工作区 | 模板 |
68
+ |--------|------|
69
+ | `.agents/skills/{tdd-implement,grill-to-spec,diagnose-fix,commit-check}/` | `template/.opencode/skills/{tdd-implement,grill-to-spec,diagnose-fix,commit-check}/` |
70
+ | `.agents/skills/{tdd-implement,grill-to-spec,diagnose-fix,commit-check}/` | `template/.pi/skills/{tdd-implement,grill-to-spec,diagnose-fix,commit-check}/` |
71
+ | `.opencode/agents/issue-audit.md`、`commands/*.md`(issue-audit + 9 个显式技能命令)、`.gitignore`、`package.json`、`package-lock.json` | `template/.opencode/` 同名 |
72
+ | `.pi/prompts/issue-audit.md`(pi 命令:opencode 版适配,去 subagent frontmatter) | `template/.pi/prompts/issue-audit.md` |
73
+ | `AGENTS.md` | `template/AGENTS.md`(引用映射为 `.opencode/` 路径) |
74
+ | `CONTEXT.md` | `template/.opencode/CONTEXT.md` |
75
+ | `docs/agents/*` | `template/.opencode/docs/agents/*`(引用映射为 `.opencode/` 路径) |
76
+
77
+ 独有技能需同步**双份**:`.opencode/skills/`(opencode 分发)与 `.pi/skills/`(pi 标准分发)。
78
+ `test/template-sync.test.js` 守护同步(含路径映射),漏同步测试即红。
79
+
80
+ 新增技能前先查上游 `mattpocock/skills` 是否已存在;仅上游没有的技能才作为独有技能落在本仓库(当前独有:tdd-implement、grill-to-spec、diagnose-fix、commit-check),上游技能一律不进 `template/`。
81
+
82
+ ## harness 支持
83
+
84
+ 模板同时面向 opencode 与 pi-agent 两种 harness:技能(Agent Skills 标准)与 `AGENTS.md` 行为路由跨 harness 通用,同一份配置两处均可运行。
85
+
86
+ 以下为 opencode 专属能力,**pi 下不可用**(不移植,仅文档注明):
87
+
88
+ - `issue-audit`:opencode 以 subagent + command 形式分发(`.opencode/agents/`、`.opencode/commands/`);pi 无 subagent 机制,以 prompt template 命令分发(`.pi/prompts/issue-audit.md`,去 subagent 委托、保留完整审计流程)
89
+ - codegraph MCP:`opencode.jsonc` 配置的代码图服务,pi 无原生 MCP
90
+ - `explore` 子代理、`firecrawl` 网页抓取:opencode 会话能力
91
+
92
+ pi 下对应能力以内置工具或已装扩展为准(`AGENTS.md`「能力边界」已按此表述)。
93
+
94
+ ## harness 目录结构
95
+
96
+ 两个 harness 的技能加载目录结构如下(本项目只分发项目级目录,全局目录由用户自备):
97
+
98
+ ### pi-agent
99
+
100
+ - **全局**:`~/.pi/agent/skills/`、`~/.agents/skills/`(用户级技能,自动发现);配置在 `~/.pi/agent/settings.json`
101
+ - **项目**:
102
+ - `.pi/skills/` — pi 标准结构,目录内技能**自动发现**(本项目独有技能直放此处)
103
+ - `.pi/prompts/` — pi 命令(prompt template)自动发现,如 `issue-audit.md` → `/issue-audit`
104
+ - `.agents/skills/` — 自动发现(上游技能与 workspace 技能在此)
105
+ - `.pi/settings.json` — `skills` 数组可选,指向额外技能目录(本项目不再使用)
106
+
107
+ ### opencode
108
+
109
+ - **项目**:`.opencode/skills/`(技能)、`.opencode/agents/`(子代理)、`.opencode/commands/`(命令:issue-audit + 9 个显式触发技能,`/命令名` 触发)、`.opencode/docs/`(文档)
110
+ - **全局**:`~/.config/opencode/`(`opencode.json` 配置、`skills/`、`agents/`、`commands/`),按 opencode 官方文档
111
+
112
+ 同一份技能(Agent Skills 标准)与 `AGENTS.md` 行为路由在两种 harness 下均可加载:opencode 从 `.opencode/skills/`、pi 从 `.pi/skills/` 与 `.agents/skills/`。
113
+ ## 仓库 CLI
114
+
115
+ 仓库内提供安装管理 CLI(`bin/cli.js`,依赖 `prompts`,见 `package.json`),同时作为 npm 包 `@heihei0299/matt-skills` 分发(`npx @heihei0299/matt-skills <command>`):
116
+
117
+ ```sh
118
+ node bin/cli.js init [--dest <dir>] [--force] # 初始化项目:template + 上游技能
119
+ node bin/cli.js sync [--dest <dir>] [--force] # 同步已有项目到最新(备份到 .bak)
120
+ node bin/cli.js list [--json] # 列出 .agents/skills/ 下全部技能及描述
121
+ node bin/cli.js install [选项] # 把技能复制到目标工具目录(交互式选择)
122
+ ```
123
+
124
+ `init` 选项:`--dest <dir>` 指定目标目录(默认当前目录);`--force` 覆盖已存在的文件并备份到 `.bak`(默认跳过),见「初始化」。
125
+ `sync` 选项:`--dest <dir>` 指定目标目录;`--force` 覆盖不备份(默认备份),见「初始化」增量同步。
126
+
127
+ `install` 选项:
128
+
129
+ - `--dest <dir>`:复制到指定目录(覆盖工具映射)
130
+ - `--tools <t1,t2>`:指定工具,项目级映射 `codex→.agents/skills`、`pi→.pi/skills`、`opencode→.opencode/skills`、`claude→.claude/skills`
131
+ - `--global`:安装到全局目录(`~/.codex/skills`、`~/.pi/agent/skills`、`~/.config/opencode/skills`、`~/.claude/skills`);`--project` 回到项目级
132
+ - `--all`:安装全部技能(默认交互勾选);`--force`:覆盖已存在的技能
133
+
134
+ ## 发布
135
+
136
+ 推送 `v*` 标签自动发布到 npm(GitHub Actions,见 `.github/workflows/publish.yml`):
137
+
138
+ ```sh
139
+ # 1. 确保 main 分支为最新且测试全绿
140
+ git checkout main && git pull
141
+ npm test
142
+
143
+ # 2. 打标签并推送(标签即版本,v 前缀自动去除)
144
+ git tag v1.0.1
145
+ git push origin v1.0.1
146
+ ```
147
+
148
+ Action 流程:`checkout` → 校验标签在 `main` 分支 → `Node 24` → `npm ci` → `npm test` 全绿 → 以标签为准 `npm version <tag> --no-git-tag-version` → `npm publish --access public`(需在 GitHub Secrets 配置 `NPM_TOKEN`)。
149
+
150
+ 本地手动发布(备选):
151
+
152
+ ```sh
153
+ npm version <patch|minor|major>
154
+ npm publish
155
+ ```
156
+
157
+ - `prepublishOnly` 自动跑全量测试(`node --test test/*.test.js`)
158
+ - 发布内容 = `bin/` + `template/` + `.agents/skills/` + `README.md`,由 `package.json` 的 `files` 白名单控制,`npm pack` 可预览
159
+ - `template/` 与 `.agents/skills/` 是包内容:改动后需重新发版才对目标仓库生效
160
+ ## 开发
161
+
162
+ ```sh
163
+ npm test
164
+ ```
165
+
166
+ 交互模式依赖 `prompts`(见 `package.json`);测试见 `test/cli.test.js`。
167
+