@zedtech/zedkit-ai 0.0.0-stage → 0.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 (95) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +175 -2
  3. package/kit/AGENTS.template.md +96 -0
  4. package/kit/THIRD_PARTY_NOTICES.md +63 -0
  5. package/kit/agents/architect.md +48 -0
  6. package/kit/agents/explorer.md +33 -0
  7. package/kit/agents/improver.md +34 -0
  8. package/kit/agents/plan-challenger.md +50 -0
  9. package/kit/agents/security-reviewer.md +33 -0
  10. package/kit/agents/verifier.md +39 -0
  11. package/kit/commands/challenge.md +5 -0
  12. package/kit/commands/handoff.md +5 -0
  13. package/kit/commands/implement.md +5 -0
  14. package/kit/commands/plan.md +5 -0
  15. package/kit/commands/pr.md +5 -0
  16. package/kit/commands/review.md +5 -0
  17. package/kit/commands/setup-ai.md +5 -0
  18. package/kit/kit.json +47 -0
  19. package/kit/skills/LICENSE-humanlayer-Apache-2.0 +202 -0
  20. package/kit/skills/LICENSE-mattpocock-skills-MIT +21 -0
  21. package/kit/skills/LICENSE-ponytail-MIT +21 -0
  22. package/kit/skills/adversarial-tests/SKILL.md +64 -0
  23. package/kit/skills/challenge/SKILL.md +18 -0
  24. package/kit/skills/code-review/SKILL.md +74 -0
  25. package/kit/skills/code-review/agents/openai.yaml +3 -0
  26. package/kit/skills/codebase-design/DEEPENING.md +37 -0
  27. package/kit/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  28. package/kit/skills/codebase-design/SKILL.md +114 -0
  29. package/kit/skills/codebase-design/agents/openai.yaml +3 -0
  30. package/kit/skills/definition-of-done/SKILL.md +53 -0
  31. package/kit/skills/diagnosing-bugs/SKILL.md +138 -0
  32. package/kit/skills/diagnosing-bugs/agents/openai.yaml +3 -0
  33. package/kit/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
  34. package/kit/skills/domain-modeling/ADR-FORMAT.md +47 -0
  35. package/kit/skills/domain-modeling/GLOSSARY-FORMAT.md +60 -0
  36. package/kit/skills/domain-modeling/SKILL.md +74 -0
  37. package/kit/skills/domain-modeling/agents/openai.yaml +3 -0
  38. package/kit/skills/ground-truth/SKILL.md +50 -0
  39. package/kit/skills/handoff/SKILL.md +16 -0
  40. package/kit/skills/handoff/agents/openai.yaml +5 -0
  41. package/kit/skills/implement/SKILL.md +25 -0
  42. package/kit/skills/implement/agents/openai.yaml +5 -0
  43. package/kit/skills/implement-spec/SKILL.md +42 -0
  44. package/kit/skills/implement-spec/agents/openai.yaml +5 -0
  45. package/kit/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  46. package/kit/skills/improve-codebase-architecture/SKILL.md +71 -0
  47. package/kit/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
  48. package/kit/skills/parallel-work/SKILL.md +61 -0
  49. package/kit/skills/persona-review/SKILL.md +38 -0
  50. package/kit/skills/plan/SKILL.md +38 -0
  51. package/kit/skills/ponytail/SKILL.md +53 -0
  52. package/kit/skills/ponytail-audit/SKILL.md +103 -0
  53. package/kit/skills/ponytail-debt/SKILL.md +44 -0
  54. package/kit/skills/ponytail-gain/SKILL.md +52 -0
  55. package/kit/skills/ponytail-help/SKILL.md +76 -0
  56. package/kit/skills/ponytail-review/SKILL.md +119 -0
  57. package/kit/skills/pr/CREDITS.md +3 -0
  58. package/kit/skills/pr/SKILL.md +170 -0
  59. package/kit/skills/pr/agents/openai.yaml +3 -0
  60. package/kit/skills/research/SKILL.md +12 -0
  61. package/kit/skills/research/agents/openai.yaml +3 -0
  62. package/kit/skills/retro/SKILL.md +44 -0
  63. package/kit/skills/retro/agents/openai.yaml +5 -0
  64. package/kit/skills/review/SKILL.md +37 -0
  65. package/kit/skills/rules-upkeep/SKILL.md +55 -0
  66. package/kit/skills/setup-ai/SKILL.md +139 -0
  67. package/kit/skills/setup-matt-pocock-skills/SKILL.md +118 -0
  68. package/kit/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
  69. package/kit/skills/setup-matt-pocock-skills/domain.md +51 -0
  70. package/kit/skills/setup-matt-pocock-skills/issue-tracker-github.md +46 -0
  71. package/kit/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
  72. package/kit/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
  73. package/kit/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  74. package/kit/skills/setup-ts-deep-modules/SKILL.md +102 -0
  75. package/kit/skills/setup-ts-deep-modules/agents/openai.yaml +5 -0
  76. package/kit/skills/setup-ts-deep-modules/dependency-cruiser.config.cjs +95 -0
  77. package/kit/skills/tdd/SKILL.md +38 -0
  78. package/kit/skills/tdd/agents/openai.yaml +3 -0
  79. package/kit/skills/tdd/mocking.md +59 -0
  80. package/kit/skills/tdd/tests.md +77 -0
  81. package/kit/skills/to-spec/SKILL.md +75 -0
  82. package/kit/skills/to-spec/agents/openai.yaml +5 -0
  83. package/kit/skills/to-tickets/SKILL.md +105 -0
  84. package/kit/skills/to-tickets/agents/openai.yaml +5 -0
  85. package/kit/skills/triage/AGENT-BRIEF.md +207 -0
  86. package/kit/skills/triage/OUT-OF-SCOPE.md +105 -0
  87. package/kit/skills/triage/SKILL.md +112 -0
  88. package/kit/skills/triage/agents/openai.yaml +5 -0
  89. package/kit/skills/use-zedkit/SKILL.md +32 -0
  90. package/kit/skills/wayfinder/SKILL.md +128 -0
  91. package/kit/skills/wayfinder/agents/openai.yaml +5 -0
  92. package/kit/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
  93. package/kit/skills/writing-for-agents/SKILL.md +81 -0
  94. package/kit/skills/writing-for-agents/agents/openai.yaml +3 -0
  95. package/package.json +48 -3
@@ -0,0 +1,139 @@
1
+ ---
2
+ name: setup-ai
3
+ description: "Set up or improve this repo's AI setup from what the repo actually contains: explores code, docs and CI, then writes or upgrades AGENTS.md, nested rules, and repo-specific skills and subagents. Use when asked to set up AI, onboard agents, audit or improve existing agent instructions, or after installing the kit. Takes provider names (setup-ai cursor claude); with none, asks once which providers to wire."
4
+ ---
5
+
6
+ # Setup AI
7
+
8
+ Make the AI setup of **this** repo true and specific. Generic advice is already in the kit; your job is what only this repo can say: its commands, its layout, its traps, its repeated workflows.
9
+
10
+ Two modes, decided in step 1: **fresh** (little or nothing exists) and **improve** (a setup exists: keep it, fix it, extend it).
11
+
12
+ One shared source, then thin provider layers. The audit (steps 1-3) is provider-neutral. Write the shared source first (`AGENTS.md`, `.agents/`), then wire only the chosen providers (step 5). Providers: `cursor`, `claude`, `codex`, `muse`.
13
+
14
+ ## Rules for the whole run
15
+
16
+ - **Evidence only.** Every command, path, version and convention you write comes from a file you opened or a command you ran (see `ground-truth`). Mark the rest `UNVERIFIED` or leave it out.
17
+ - **Additive.** Never delete or rewrite the user's existing text without asking. Propose, then apply what they accept.
18
+ - **Smallest useful setup** (see `ponytail`). Each artifact must be justified by evidence from step 3. No skill for a workflow that happened once.
19
+ - **Prefer enforcement to prose.** If a linter, type check, test or CI job can enforce a rule, configure that and mention it in one line. Prose is for what tools cannot check.
20
+ - A public repo gets no private names, customer data or internal URLs in any file you write.
21
+
22
+ ## 1. Inventory what exists
23
+
24
+ List, with paths: `AGENTS.md` (root and nested), `CLAUDE.md`, `GEMINI.md`, `.cursor/rules`, `.cursorrules`, `.github/copilot-instructions.md`, `.agents/`, `.claude/`, `.cursor/`, `.codex/`, `CONTRIBUTING.md`, PR and issue templates, `CODEOWNERS`.
25
+
26
+ - Nothing or only boilerplate: **fresh**. Run `zedkit-ai init` (if the kit is not installed yet) and continue.
27
+ - Anything real: **improve**. Read all of it first. Note what each file is for and which tool reads it.
28
+ - Audit only files the repo owns. A vendored or symlinked kit (for example `.agents/skills` pointing into a package) is listed once and not audited.
29
+ - Note uncommitted changes. Treat the current working state as the baseline and do not revert anything.
30
+ - Settle the providers: the names given after `setup-ai` win; otherwise reuse the providers the repo already wires (`.cursor/`, `.claude/`, `CLAUDE.md`, docs saying so). If neither tells you, ask exactly one question — which of cursor, claude, codex, muse (several allowed) — before writing; with nobody to ask, wire all four.
31
+ - Workspace check: two or more child directories that are themselves git checkouts, or a manifest listing member projects, means a multi-repo workspace root: switch to Workspace mode below instead of steps 2-5.
32
+
33
+ ## 2. Explore in parallel
34
+
35
+ Launch read-only `explorer` subagents in one batch, one question each, with the brief format of `parallel-work`. Ask each to return `file:line` evidence and nothing else. If you cannot spawn subagents, ask the same questions yourself, one after the other.
36
+
37
+ | Question | Where it looks |
38
+ |---|---|
39
+ | Stack, layout, entry points, workspaces | manifests, lockfiles, top-level folders, build config |
40
+ | The real commands: install, dev, typecheck, lint, test, build, migrate | manifest scripts, `Makefile`, task runners, CI workflow files |
41
+ | Conventions already enforced | lint, format and compiler configs, test layout, naming seen in the code |
42
+ | What the docs say | README, `docs/`, ADRs, glossary, contributing guide |
43
+ | How the team works | `git log` (commit style, PR size, hotfix habits), templates, branch rules, CI jobs and what blocks a merge |
44
+ | Sensitive areas | auth, tenancy, secrets handling, money, migrations, generated code, vendored folders |
45
+
46
+ Then **run the gate commands you found**, preferring forms without side effects (note any that write build output). Judge a command by its exit code, not by parsed output. A command that fails is a finding, not something to hide.
47
+
48
+ ## 3. Find the gaps
49
+
50
+ In **improve** mode, audit each existing file and report before you edit:
51
+
52
+ | Check | How |
53
+ |---|---|
54
+ | Stale | paths that no longer exist, commands that fail, tools the repo no longer uses. Check each path and run each command; do not judge by reading. |
55
+ | Contradictory | two files giving different commands or rules |
56
+ | Duplicated | a paragraph, or three or more lines, repeated across files; keep one home and link to it |
57
+ | Too long for always-loaded | root file over about 100 lines, nested file over about 60, skill over about 150; or details only one folder needs |
58
+ | Missing trigger | skills or agents whose `description` does not say when to use them |
59
+ | Unenforced | prose rules a tool could check. Before calling a rule unenforced, open the lint, type and CI configs and search them for it. |
60
+ | Missing ladder | root `AGENTS.md`, or the `plan` / `implement` / `review` skills, does not state the 7-question ladder. Search for the ladder section or the 7 rungs; an existing `AGENTS.md` without it is a gap like any other. |
61
+
62
+ In both modes, list **gaps**: repo facts an agent would otherwise get wrong. Examples: a non-obvious test command, a generated folder not to edit, a module boundary, a migration procedure, a naming rule the linter misses, a service that must be running.
63
+
64
+ ## 4. Decide what to create
65
+
66
+ For each gap pick the smallest home:
67
+
68
+ | Artifact | Create it when |
69
+ |---|---|
70
+ | Root `AGENTS.md` | always: role and style, non-negotiables, verified commands, map, review angles. Short. |
71
+ | Nested `AGENTS.md` | a folder has its own stack, commands or rules that the rest of the repo does not |
72
+ | Repo skill | a multi-step workflow is repeated in this repo (seen in two or more places in code, docs or `git log`), for example "add an endpoint" or "add a migration" |
73
+ | Subagent | a narrow job needs fresh context or fewer permissions, for example a reviewer for one sensitive area |
74
+ | Lint, CI or hook change | a rule is mechanical and keeps being broken |
75
+ | Nothing | the fact is already clear from the code |
76
+
77
+ Present the plan as a table: artifact, path, why (with evidence), action (create, edit, dedupe, leave alone), and whether it is `safe` (additive) or `needs OK` (removes or rewrites existing text). Every finding from step 3 gets a row, or an explicit "left alone: reason". **Wait for the user's go before writing.** If nobody can answer (non-interactive run), output the table and stop.
78
+
79
+ ## 5. Write
80
+
81
+ Shared source first, provider layers after. `zedkit-ai init --provider <names>` does the mechanical part; you do the repo-specific part.
82
+
83
+ | Provider | Layer on top of `AGENTS.md` + `.agents/` |
84
+ |---|---|
85
+ | `cursor` | `.cursor/rules/project.mdc` (skip it when an always-on rule exists), `.cursor/skills` link, agents and commands as real-file copies (a linked folder shows up empty there) |
86
+ | `claude` | `CLAUDE.md` link, `.claude/{skills,agents,commands}` links |
87
+ | `codex` | none: reads `AGENTS.md` and `.agents/skills` directly |
88
+ | `muse` | none: reads `.agents/` directly |
89
+
90
+ - **Root `AGENTS.md`**: start from the kit template if there is none; when one exists, keep it and add the missing ladder section (the same 7 questions as the template). Replace every `<placeholder>` with a verified fact or delete the line. Non-negotiables name how each is enforced.
91
+ - **Role and style**: fill it from evidence, not taste. Role and audience from the README (who the project serves); reply language from the language of the docs and commit messages; tone from commit style (terse or explanatory). If the evidence is missing or mixed, ask the user exactly one question covering what is unknown (for example reply language and audience) before writing; with nobody to ask, default to English replies and mark the choice `UNVERIFIED`.
92
+ - **Nested `AGENTS.md`**: only what differs from the root. Link, do not copy.
93
+ - **Repo skills**: folder `.agents/skills/<name>/SKILL.md`. The `description` says when to use it. Steps use this repo's real paths and commands, end with the command that proves the result, and point at an existing example file as the model. Follow `rules-upkeep` for format.
94
+ - **Subagents**: `.agents/agents/<name>.md`, one-line description, `model` omitted. Read-only unless the job needs writes.
95
+ - **Improve mode**: edit in place, smallest change, keep the author's wording where it is correct. Log what changed.
96
+
97
+ ## 6. Verify
98
+
99
+ - Every command in the written files was run, or is marked `UNVERIFIED` with the reason.
100
+ - Every path and link exists: check each one (`test -e`).
101
+ - No placeholder like `<Project>` is left.
102
+ - `zedkit-ai validate` is clean, the tool folders (`.claude/`, `.cursor/`) resolve, and the `.cursor` copies match `.agents/` (no drift).
103
+ - A fresh reader, or a subagent given only the new files, can answer: how do I run the tests, where does X live, what must I never do here?
104
+
105
+ ## 7. Report
106
+
107
+ Short: what you created or changed, what you left alone and why, the findings you did not fix (failing commands, contradictions needing a human decision), and everything marked `UNVERIFIED`.
108
+
109
+ ## Workspace mode
110
+
111
+ For a multi-repo workspace root (a folder or meta repo holding several
112
+ separate git checkouts). The root gets a workspace setup, not a repo setup;
113
+ each child keeps its own.
114
+
115
+ - **Inventory each child** (read-only): path, git remote, stack, package
116
+ manager, real commands (run the read-only ones to verify), and whether
117
+ it already has `AGENTS.md` or rules of its own. One row per repo.
118
+ - **Map cross-repo dependencies from evidence**: manifests depending on a
119
+ sibling's package name, git remotes in the same group, docs and CI
120
+ referencing another child, shared tooling and scripts. Write them as a
121
+ small table in the root `AGENTS.md`; if the workspace already has a map
122
+ doc, put the table there and link it from `AGENTS.md`.
123
+ - **Root `AGENTS.md` says**: this is a workspace of separate checkouts;
124
+ work inside one repo at a time; the nested `AGENTS.md` wins over the
125
+ root; which repo owns what; visibility rules (which repos are public or
126
+ private, and what may reference what); how to sync every checkout;
127
+ and the 7-question ladder (same section as the kit template).
128
+ - **Children are proposals, not targets**: for each child without a setup,
129
+ propose running `setup-ai` inside it. Never write inside a child repo
130
+ without asking, and never audit child files from the root as if the root
131
+ owned them.
132
+
133
+ Example: a `workspace/` root holding `services-api/` and `services-web/`
134
+ (each with its own `.git`) gets a root `AGENTS.md` declaring the workspace,
135
+ a two-row inventory, and:
136
+
137
+ | Repo | Depends on | Evidence |
138
+ |---|---|---|
139
+ | `services-web` | `services-api` | `package.json` needs `@example/api-client`, same git group |
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: setup-matt-pocock-skills
3
+ 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."
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Setup Matt Pocock's Skills
8
+
9
+ Scaffold the per-repo configuration that the engineering skills assume:
10
+
11
+ - **Issue tracker**: where issues live (GitHub by default; local markdown is also supported out of the box)
12
+ - **Triage labels**: the strings used for the five canonical triage roles
13
+ - **Domain docs**: where `GLOSSARY.md` and ADRs live, and the consumer rules for reading them
14
+
15
+ This is a prompt-driven skill, not a deterministic script. Explore, present what you found, confirm with the user, then write.
16
+
17
+ ## Process
18
+
19
+ ### 1. Explore
20
+
21
+ Look at the current repo to understand its starting state. Read whatever exists; don't assume:
22
+
23
+ - `git remote -v` and `.git/config`: is this a GitHub repo? Which one?
24
+ - `AGENTS.md` and `CLAUDE.md` at the repo root: does either exist? Is there already an `## Agent skills` section in either?
25
+ - `GLOSSARY.md` and `GLOSSARY-MAP.md` at the repo root
26
+ - `docs/adr/` and any `src/*/docs/adr/` directories
27
+ - `docs/agents/`: does this skill's prior output already exist?
28
+ - `.scratch/`: a sign that a local-markdown issue tracker convention is already in use
29
+ - 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.
30
+ - 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.
31
+
32
+ ### 2. Present findings and ask
33
+
34
+ Summarise what's present and what's missing. Then take the sections in order. One section, one answer, then the next.
35
+
36
+ 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).
37
+
38
+ **Section A: Issue tracker.**
39
+
40
+ > 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.
41
+
42
+ 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:
43
+
44
+ - **GitHub**: issues live in the repo's GitHub Issues (uses the `gh` CLI)
45
+ - **GitLab**: issues live in the repo's GitLab Issues (uses the [`glab`](https://gitlab.com/gitlab-org/cli) CLI)
46
+ - **Local markdown**: issues live as files under `.scratch/<feature>/` in this repo (good for solo projects or repos without a remote)
47
+ - **Other** (Linear, etc.): ask the user to describe the workflow in one paragraph; the skill will record it as freeform prose
48
+
49
+ 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.
50
+
51
+ **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.
52
+
53
+ If it is installed, ask exactly one question:
54
+
55
+ > Do you want to keep the default triage labels? (recommended: **yes**)
56
+
57
+ 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.
58
+
59
+ **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.
60
+
61
+ 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.
62
+
63
+ ### 3. Confirm and edit
64
+
65
+ Show the user a draft of:
66
+
67
+ - The `## Agent skills` block to add to whichever of `CLAUDE.md` / `AGENTS.md` is being edited (see step 4 for selection rules)
68
+ - 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)
69
+
70
+ Let them edit before writing.
71
+
72
+ ### 4. Write
73
+
74
+ **Pick the file to edit:**
75
+
76
+ - If `CLAUDE.md` exists, edit it.
77
+ - Else if `AGENTS.md` exists, edit it.
78
+ - If neither exists, ask the user which one to create; don't pick for them.
79
+
80
+ Never create `AGENTS.md` when `CLAUDE.md` already exists (or vice versa); always edit the one that's already there.
81
+
82
+ 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.
83
+
84
+ The block:
85
+
86
+ ```markdown
87
+ ## Agent skills
88
+
89
+ ### Issue tracker
90
+
91
+ [one-line summary of where issues are tracked]. See `docs/agents/issue-tracker.md`.
92
+
93
+ ### Triage labels
94
+
95
+ [one-line summary of the label vocabulary]. See `docs/agents/triage-labels.md`.
96
+
97
+ ### Domain docs
98
+
99
+ [one-line summary of layout: "single-context" or "multi-context"]. See `docs/agents/domain.md`.
100
+ ```
101
+
102
+ 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.
103
+
104
+ When Section B ran on GitHub or GitLab, create each configured label the tracker lacks (`gh label create` / `glab label create`).
105
+
106
+ Then write the docs files using the seed templates in this skill folder as a starting point:
107
+
108
+ - [issue-tracker-github.md](./issue-tracker-github.md): GitHub issue tracker
109
+ - [issue-tracker-gitlab.md](./issue-tracker-gitlab.md): GitLab issue tracker
110
+ - [issue-tracker-local.md](./issue-tracker-local.md): local-markdown issue tracker
111
+ - [triage-labels.md](./triage-labels.md): label mapping (only if `triage` is installed)
112
+ - [domain.md](./domain.md): domain doc consumer rules + layout
113
+
114
+ For "other" issue trackers, write `docs/agents/issue-tracker.md` from scratch using the user's description.
115
+
116
+ ### 5. Done
117
+
118
+ 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.
@@ -0,0 +1,5 @@
1
+ interface:
2
+ display_name: "Setup Matt Pocock Skills"
3
+ short_description: "Configure a repo for the skills"
4
+ policy:
5
+ allow_implicit_invocation: false
@@ -0,0 +1,51 @@
1
+ # Domain Docs
2
+
3
+ How the engineering skills should consume this repo's domain documentation when exploring the codebase.
4
+
5
+ ## Before exploring, read these
6
+
7
+ - **`GLOSSARY.md`** at the repo root, or
8
+ - **`GLOSSARY-MAP.md`** at the repo root if it exists: it points at one `GLOSSARY.md` per context. Read each one relevant to the topic.
9
+ - **`docs/adr/`**: read ADRs that touch the area you're about to work in. In multi-context repos, also check `src/<context>/docs/adr/` for context-scoped decisions.
10
+
11
+ If any of these files don't exist, **proceed silently**. Don't flag their absence; don't suggest creating them upfront. The `/domain-modeling` skill (reached via `/grill-with-docs` and `/improve-codebase-architecture`) creates them lazily when terms or decisions actually get resolved.
12
+
13
+ ## File structure
14
+
15
+ Single-context repo (most repos):
16
+
17
+ ```
18
+ /
19
+ ├── GLOSSARY.md
20
+ ├── docs/adr/
21
+ │ ├── 0001-event-sourced-orders.md
22
+ │ └── 0002-postgres-for-write-model.md
23
+ └── src/
24
+ ```
25
+
26
+ Multi-context repo (presence of `GLOSSARY-MAP.md` at the root):
27
+
28
+ ```
29
+ /
30
+ ├── GLOSSARY-MAP.md
31
+ ├── docs/adr/ ← system-wide decisions
32
+ └── src/
33
+ ├── ordering/
34
+ │ ├── GLOSSARY.md
35
+ │ └── docs/adr/ ← context-specific decisions
36
+ └── billing/
37
+ ├── GLOSSARY.md
38
+ └── docs/adr/
39
+ ```
40
+
41
+ ## Use the glossary's vocabulary
42
+
43
+ When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in `GLOSSARY.md`. Don't drift to synonyms the glossary explicitly avoids.
44
+
45
+ If the concept you need isn't in the glossary yet, that's a signal: either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for `/domain-modeling`).
46
+
47
+ ## Flag ADR conflicts
48
+
49
+ If your output contradicts an existing ADR, surface it explicitly rather than silently overriding:
50
+
51
+ > _Contradicts ADR-0007 (event-sourced orders), but worth reopening because…_
@@ -0,0 +1,46 @@
1
+ # Issue tracker: GitHub
2
+
3
+ Issues and specs for this repo live as GitHub issues. Use the `gh` CLI for all operations.
4
+
5
+ ## Conventions
6
+
7
+ - **Create an issue**: `gh issue create --title "..." --body "..."`. Use a heredoc for multi-line bodies.
8
+ - **Read an issue**: `gh issue view <number> --json number,title,body,labels,comments`.
9
+ - **List issues**: `gh issue list --state open --json number,title,body,labels,comments --jq '[.[] | {number, title, body, labels: [.labels[].name], comments: [.comments[].body]}]'` with appropriate `--label` and `--state` filters.
10
+ - **Make an issue a sub-issue of a parent**: `gh issue create --parent <parent> ...`, or `gh issue edit <parent> --add-sub-issue <child>` afterwards (`gh` 2.94+). Older `gh`: `gh api --method POST repos/<owner>/<repo>/issues/<parent>/sub_issues -F sub_issue_id=<child-db-id>` (database id, as in **Blocking** below). Without sub-issues, put `Part of #<parent>` at the top of the child body.
11
+ - **Comment on an issue**: `gh issue comment <number> --body "..."`
12
+ - **Apply / remove labels**: `gh issue edit <number> --add-label "..."` / `--remove-label "..."`
13
+ - **Close**: `gh issue close <number> --comment "..."`
14
+
15
+ Infer the repo from `git remote -v`; `gh` does this automatically when run inside a clone.
16
+
17
+ ## Pull requests as a triage surface
18
+
19
+ **PRs as a request surface: no.** _(Set to `yes` if this repo treats external PRs as feature requests; `/triage` reads this flag.)_
20
+
21
+ When set to `yes`, PRs run through the same labels and states as issues, using the `gh pr` equivalents:
22
+
23
+ - **Read a PR**: `gh pr view <number> --comments` and `gh pr diff <number>` for the diff.
24
+ - **List external PRs for triage**: `gh api --paginate 'repos/{owner}/{repo}/pulls?state=open' --jq '.[] | select(.author_association | IN("OWNER","MEMBER","COLLABORATOR") | not) | {number, title, author: .user.login, author_association, labels: [.labels[].name]}'`.
25
+ - **Comment / label / close**: `gh pr comment`, `gh pr edit --add-label`/`--remove-label`, `gh pr close`.
26
+
27
+ GitHub shares one number space across issues and PRs, so a bare `#42` may be either: resolve with `gh pr view 42` and fall back to `gh issue view 42`.
28
+
29
+ ## When a skill says "publish to the issue tracker"
30
+
31
+ Create a GitHub issue.
32
+
33
+ ## When a skill says "fetch the relevant ticket"
34
+
35
+ Read it as in **Read an issue** above.
36
+
37
+ ## Wayfinding operations
38
+
39
+ Used by `/wayfinder`. The **map** is a single issue with **child** issues as tickets.
40
+
41
+ - **Map**: a single issue labelled `wayfinder:map`, holding the Notes / Decisions-so-far / Fog body. `gh issue create --label wayfinder:map`.
42
+ - **Child ticket**: an issue linked to the map as a GitHub sub-issue (see **Make an issue a sub-issue of a parent**). Where sub-issues aren't enabled, add the child to a task list in the map body and put `Part of #<map>` at the top of the child body. Labels: `wayfinder:<type>` (`research`/`prototype`/`grilling`/`task`). Once claimed, the ticket is assigned to the driving dev.
43
+ - **Blocking**: GitHub's **native issue dependencies**, the canonical, UI-visible representation. Add an edge with `gh api --method POST repos/<owner>/<repo>/issues/<child>/dependencies/blocked_by -F issue_id=<blocker-db-id>`, where `<blocker-db-id>` is the blocker's numeric **database id** (`gh api repos/<owner>/<repo>/issues/<n> --jq .id`, _not_ the `#number` or `node_id`). GitHub reports `issue_dependencies_summary.blocked_by` (open blockers only, the live gate). Where dependencies aren't available, fall back to a `Blocked by: #<n>, #<n>` line at the top of the child body. A ticket is unblocked when every blocker is closed.
44
+ - **Frontier query**: list the map's open children (`gh issue list --state open`, scoped to the map's sub-issues / task list), drop any with an open blocker (`issue_dependencies_summary.blocked_by > 0`, or an open issue in the `Blocked by` line) or an assignee; first in map order wins.
45
+ - **Claim**: `gh issue edit <n> --add-assignee @me`, the session's first write.
46
+ - **Resolve**: `gh issue comment <n> --body "<answer>"`, then `gh issue close <n>`, then append a context pointer (gist + link) to the map's Decisions-so-far.
@@ -0,0 +1,46 @@
1
+ # Issue tracker: GitLab
2
+
3
+ Issues and specs for this repo live as GitLab issues. Use the [`glab`](https://gitlab.com/gitlab-org/cli) CLI for all operations.
4
+
5
+ ## Conventions
6
+
7
+ - **Create an issue**: `glab issue create --title "..." --description "..."`. Use a heredoc for multi-line descriptions. Pass `--description -` to open an editor.
8
+ - **Read an issue**: `glab issue view <number> --comments`. Use `-F json` for machine-readable output.
9
+ - **List issues**: `glab issue list -O json` with appropriate `--label` filters.
10
+ - **Comment on an issue**: `glab issue note <number> --message "..."`. GitLab calls comments "notes".
11
+ - **Apply / remove labels**: `glab issue update <number> --label "..."` / `--unlabel "..."`. Multiple labels can be comma-separated or by repeating the flag.
12
+ - **Close**: `glab issue close <number>`. `glab issue close` does not accept a closing comment, so post the explanation first with `glab issue note <number> --message "..."`, then close.
13
+ - **Merge requests**: GitLab calls PRs "merge requests". Use `glab mr create`, `glab mr view`, `glab mr note`, etc., the same shape as `gh pr ...` with `mr` in place of `pr` and `note`/`--message` in place of `comment`/`--body`.
14
+
15
+ Infer the repo from `git remote -v`; `glab` does this automatically when run inside a clone.
16
+
17
+ ## Merge requests as a triage surface
18
+
19
+ **MRs as a request surface: no.** _(Set to `yes` if this repo treats external merge requests as feature requests; `/triage` reads this flag.)_
20
+
21
+ When set to `yes`, MRs run through the same labels and states as issues, using the `glab mr` equivalents:
22
+
23
+ - **Read an MR**: `glab mr view <number> --comments` and `glab mr diff <number>` for the diff.
24
+ - **List external MRs for triage**: `glab mr list -F json`, then keep only MRs whose author is not a project member/owner (a contributor's MR, not a maintainer's in-flight work).
25
+ - **Comment / label / close**: `glab mr note`, `glab mr update --label`/`--unlabel`, `glab mr close`.
26
+
27
+ Unlike GitHub, GitLab numbers issues and MRs separately, so `#42` is unambiguous once you know which surface the maintainer means.
28
+
29
+ ## When a skill says "publish to the issue tracker"
30
+
31
+ Create a GitLab issue.
32
+
33
+ ## When a skill says "fetch the relevant ticket"
34
+
35
+ Run `glab issue view <number> --comments`.
36
+
37
+ ## Wayfinding operations
38
+
39
+ Used by `/wayfinder`. The **map** is a single issue with **child** issues as tickets.
40
+
41
+ - **Map**: a single issue labelled `wayfinder:map`, holding the Notes / Decisions-so-far / Fog body. `glab issue create --label wayfinder:map`. (On GitLab tiers with native epics, an epic may hold the map instead; a labelled issue works everywhere.)
42
+ - **Child ticket**: an issue carrying `Part of #<map>` at the top of its description and labels `wayfinder:<type>` (`research`/`prototype`/`grilling`/`task`). Once claimed, the ticket is assigned to the driving dev.
43
+ - **Blocking**: GitLab's **native blocking link**, the canonical, UI-visible representation. Add it with the `/blocked_by #<n>` quick action, posted as a note (`glab issue note <child> --message "/blocked_by #<blocker>"`). Native blocking links are a Premium/Ultimate feature; on the free tier (or where unavailable) fall back to a `Blocked by: #<n>, #<n>` line at the top of the description. A ticket is unblocked when every blocker is closed.
44
+ - **Frontier query**: `glab issue list -O json` scoped to the map's children, drop any with an open blocker: a native `blocked_by` link to an open issue (`glab api projects/:id/issues/<child-iid>/links`), or an open issue in the `Blocked by` line, or an assignee; first in map order wins.
45
+ - **Claim**: `glab issue update <n> --assignee @me`, the session's first write.
46
+ - **Resolve**: `glab issue note <n> --message "<answer>"`, then `glab issue close <n>`, then append a context pointer (gist + link) to the map's Decisions-so-far.
@@ -0,0 +1,30 @@
1
+ # Issue tracker: Local Markdown
2
+
3
+ Issues and specs for this repo live as markdown files in `.scratch/`.
4
+
5
+ ## Conventions
6
+
7
+ - One feature per directory: `.scratch/<feature-slug>/`
8
+ - The spec is `.scratch/<feature-slug>/spec.md`
9
+ - Implementation issues are one file per ticket at `.scratch/<feature-slug>/issues/<NN>-<slug>.md`, numbered from `01`, never a single combined tickets file
10
+ - Triage state is recorded as a `Status:` line near the top of each issue file (see `triage-labels.md` for the role strings)
11
+ - Comments and conversation history append to the bottom of the file under a `## Comments` heading
12
+
13
+ ## When a skill says "publish to the issue tracker"
14
+
15
+ Create a new file under `.scratch/<feature-slug>/` (creating the directory if needed).
16
+
17
+ ## When a skill says "fetch the relevant ticket"
18
+
19
+ Read the file at the referenced path. The user will normally pass the path or the issue number directly.
20
+
21
+ ## Wayfinding operations
22
+
23
+ Used by `/wayfinder`. The **map** is a file with one **child** file per ticket.
24
+
25
+ - **Map**: `.scratch/<effort>/map.md` (the Notes / Decisions-so-far / Fog body).
26
+ - **Child ticket**: `.scratch/<effort>/issues/NN-<slug>.md`, numbered from `01`, with the question in the body. A `Type:` line records the ticket type (`research`/`prototype`/`grilling`/`task`); a `Status:` line records `claimed`/`resolved`.
27
+ - **Blocking**: a `Blocked by: NN, NN` line near the top. A ticket is unblocked when every file it lists is `resolved`.
28
+ - **Frontier**: scan `.scratch/<effort>/issues/` for files that are open, unblocked, and unclaimed; first by number wins.
29
+ - **Claim**: set `Status: claimed` and save before any work.
30
+ - **Resolve**: append the answer under an `## Answer` heading, set `Status: resolved`, then append a context pointer (gist + link) to the map's Decisions-so-far in `map.md`.
@@ -0,0 +1,15 @@
1
+ # Triage Labels
2
+
3
+ The skills speak in terms of five canonical triage roles. This file maps those roles to the actual label strings used in this repo's issue tracker.
4
+
5
+ | Label in mattpocock/skills | Label in our tracker | Meaning |
6
+ | -------------------------- | -------------------- | ---------------------------------------- |
7
+ | `needs-triage` | `needs-triage` | Maintainer needs to evaluate this issue |
8
+ | `needs-info` | `needs-info` | Waiting on reporter for more information |
9
+ | `ready-for-agent` | `ready-for-agent` | Fully specified, ready for an AFK agent |
10
+ | `ready-for-human` | `ready-for-human` | Requires human implementation |
11
+ | `wontfix` | `wontfix` | Will not be actioned |
12
+
13
+ When a skill mentions a role (e.g. "apply the AFK-ready triage label"), use the corresponding label string from this table.
14
+
15
+ Edit the "Label in our tracker" column to match whatever vocabulary you actually use.
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: setup-ts-deep-modules
3
+ description: Wire dependency-cruiser into a TypeScript repo so each package is a deep module, with implementation hidden in subfolders and reachable only through its entry-point files. User-invoked.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Setup TS Deep Modules
8
+
9
+ Make every package in this repo a **deep module**: a lot of behaviour behind a small interface. A package's public surface is its **entry points** (the files at the package root), and everything in its subfolders is hidden. This skill installs [dependency-cruiser](https://github.com/sverweij/dependency-cruiser) and the rules that make the entry points the only way in, then proves the rules bite.
10
+
11
+ For the vocabulary (deep module, interface, seam, depth), call the Skill tool with "codebase-design" and use its language throughout.
12
+
13
+ ## The shape this enforces
14
+
15
+ ```
16
+ src/packages/
17
+ <name>/
18
+ index.ts ← an entry point (public). Import this from outside.
19
+ client.ts ← another entry point. Packages may expose SEVERAL.
20
+ lib/ ← implementation: hidden from outside, free to import each other.
21
+ tests/ ← co-located tests + fixtures (a subfolder, so private).
22
+ ```
23
+
24
+ The public surface is the package's **root files**, not one designated `index.ts`. By convention implementation lives in `lib/` and tests in `tests/`, giving every package the same two-folder shape. The rule itself is general, though: *anything* in *any* subfolder is private, so you never extend the config to add a folder.
25
+
26
+ Four rules, all `error`:
27
+
28
+ 1. **Entry-point boundary**: code outside a package (app code or another package) may import only that package's entry points (its root files), never anything in its subfolders.
29
+ 2. **Intra-package freedom**: a package's own files import each other freely.
30
+ 3. **Tests through the entry points**: files under `<pkg>/tests/` may import any package's entry points and their own `tests/` fixtures, but never any package's subfolder internals (not even their own). Integration tests across packages are fine; deep imports are not.
31
+ 4. **No cycles**: no dependency cycles.
32
+
33
+ **Entry points, not a barrel.** Because the public surface is *every* root file, a package can expose several small entry points (`index.ts`, `client.ts`, `server.ts`) instead of funnelling everything through one giant `index.ts`. Barrel files that re-export a whole subtree are discouraged; keep entry points small and hide implementation in subfolders.
34
+
35
+ Layering (which packages may depend on which) is a *different* concern and is left as a commented stub in the config for this repo to fill in.
36
+
37
+ ## Steps
38
+
39
+ ### 1. Detect the environment
40
+
41
+ - **Package manager**: `pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, `bun.lockb` → bun, else npm. Use it for every command below (`pnpm`/`yarn`/`npm run`/`bunx`).
42
+ - **Packages root**: if `src/` exists use `src/packages`, else `packages`. Confirm the choice with the user if the repo already has a different obvious convention.
43
+ - **Existing config**: check for a `.dependency-cruiser.*` file. If one exists, do **not** overwrite it: merge the four rules and the options in, and tell the user what you added.
44
+
45
+ **Done when:** package manager, packages root, and existing-config status are all known.
46
+
47
+ ### 2. Install dependency-cruiser
48
+
49
+ Install `dependency-cruiser` as a devDependency with the detected package manager.
50
+
51
+ **Done when:** `dependency-cruiser` is in `devDependencies`.
52
+
53
+ ### 3. Write the config
54
+
55
+ Copy [`dependency-cruiser.config.cjs`](./dependency-cruiser.config.cjs) to the repo root as `.dependency-cruiser.cjs`. Set `PACKAGES_ROOT` to the root detected in step 1. The rules are path-depth based and extension-agnostic, so nothing else needs adapting.
56
+
57
+ **Done when:** `.dependency-cruiser.cjs` exists with the correct `PACKAGES_ROOT`, and the four forbidden rules are present.
58
+
59
+ ### 4. Wire it into the checks
60
+
61
+ - Add a `lint:boundaries` script: `depcruise <packages-root>` (or `depcruise src`).
62
+ - Fold it into the repo's umbrella check command, the one that already runs typecheck (e.g. a `check` / `ci` / `validate` script). Do **not** touch `tsconfig` or add path aliases.
63
+ - If there is no umbrella script, add `lint:boundaries` and tell the user to include it in CI.
64
+
65
+ **Done when:** `lint:boundaries` exists and runs as part of the same command as typecheck.
66
+
67
+ ### 5. Scaffold the example package
68
+
69
+ Create a committed `<packages-root>/example/` as a copy-me template:
70
+
71
+ - `index.ts` is an entry point. Export one function that delegates to an internal file (so the package is visibly *deep*, not a pass-through).
72
+ - `lib/impl.ts`: an internal file in a **subfolder**, imported by `index.ts`, not reachable from outside.
73
+ - `tests/example.test.ts` imports **only** `../index` (an entry point) and asserts against the public function.
74
+
75
+ Tell the user this is a starter template to copy or delete.
76
+
77
+ **Done when:** the example package exists, exposes its behaviour through a root entry point, and hides `impl` in a subfolder.
78
+
79
+ ### 6. Prove the rules bite
80
+
81
+ This is the completion criterion for the whole skill: a config that doesn't fail on a violation is worthless.
82
+
83
+ 1. Run `lint:boundaries`. It must **pass** on the clean example.
84
+ 2. Temporarily add a deep import to `tests/example.test.ts` (e.g. `import { thing } from "../lib/impl"`). Run `lint:boundaries` again; it must **fail** with `tests-through-entrypoints`.
85
+ 3. Revert the deep import. Run once more, and it must **pass**.
86
+
87
+ **Done when:** you have observed a pass, then a fail on the deep import, then a pass again. If step 2 does not fail, the rules are not wired correctly, so fix before finishing.
88
+
89
+ ### 7. Document the convention
90
+
91
+ Write a `README.md` **in the packages folder** (`<packages-root>/README.md`, next to the packages it governs) covering: the `src/packages/<name>/` layout (entry points at the root, `lib/` for implementation, `tests/` for tests), "import only through a package's entry points (its root files)", and how to run `lint:boundaries`. **Discourage barrel files** explicitly: expose several small entry points instead of re-exporting a whole subtree through one index. Keep it to the copy-me snippet plus the four rules in one paragraph each.
92
+
93
+ Then add a **context pointer** to it from the repo's agent-instructions file (`CLAUDE.md` if present, else `AGENTS.md`, creating `AGENTS.md` if neither exists). One line is enough, e.g. `Packages are deep modules: see [src/packages/README.md](./src/packages/README.md) before adding or importing one.` This is what makes an agent discover the boundary rule instead of tripping over it.
94
+
95
+ **Done when:** `<packages-root>/README.md` exists and discourages barrels, and the repo's `CLAUDE.md`/`AGENTS.md` links to it.
96
+
97
+ ## Notes
98
+
99
+ - The config's `$1` back-references (dependency-cruiser's group matching) are what let a package reach its own internals while outsiders can't. Don't flatten them into separate per-package rules.
100
+ - Public vs private is decided by **depth**: a package's root files are entry points; anything in a subfolder is private. The conventional subfolders are `lib/` (implementation) and `tests/`, but the rule doesn't hardcode them: any subfolder is private, so a new folder never needs a config change. Adding an entry point is just adding a root file (no barrel).
101
+ - Packages are **flat**: one tier of immediate children under the root. A package's internals may nest as deep as you like; a package may not contain another package.
102
+ - Use `.cjs` (not `.js`) so the config's `module.exports` works even in `"type": "module"` repos.
@@ -0,0 +1,5 @@
1
+ interface:
2
+ display_name: "Setup TS Deep Modules"
3
+ short_description: "Enforce deep TypeScript modules"
4
+ policy:
5
+ allow_implicit_invocation: false