pi-dev 0.1.1
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.
- package/LICENSE +28 -0
- package/README.md +117 -0
- package/dist/cli.js +73 -0
- package/dist/install.js +101 -0
- package/dist/manifest.js +28 -0
- package/dist/paths.js +14 -0
- package/package.json +48 -0
- package/presets/preferences.md +74 -0
- package/skills/diagnose/SKILL.md +117 -0
- package/skills/diagnose/scripts/hitl-loop.template.sh +41 -0
- package/skills/do/SKILL.md +180 -0
- package/skills/grill-with-docs/ADR-FORMAT.md +47 -0
- package/skills/grill-with-docs/CONTEXT-FORMAT.md +77 -0
- package/skills/grill-with-docs/SKILL.md +88 -0
- package/skills/improve-codebase-architecture/DEEPENING.md +37 -0
- package/skills/improve-codebase-architecture/INTERFACE-DESIGN.md +44 -0
- package/skills/improve-codebase-architecture/LANGUAGE.md +53 -0
- package/skills/improve-codebase-architecture/SKILL.md +71 -0
- package/skills/migrate/SKILL.md +231 -0
- package/skills/recon-with-vision/SKILL.md +106 -0
- package/skills/setup/SKILL.md +121 -0
- package/skills/setup/domain.md +51 -0
- package/skills/setup/issue-tracker-github.md +22 -0
- package/skills/setup/issue-tracker-gitlab.md +23 -0
- package/skills/setup/issue-tracker-local.md +19 -0
- package/skills/setup/triage-labels.md +15 -0
- package/skills/taste/SKILL.md +148 -0
- package/skills/tdd/SKILL.md +109 -0
- package/skills/tdd/deep-modules.md +33 -0
- package/skills/tdd/interface-design.md +31 -0
- package/skills/tdd/mocking.md +59 -0
- package/skills/tdd/refactoring.md +10 -0
- package/skills/tdd/tests.md +61 -0
- package/skills/to-issues/SKILL.md +81 -0
- package/skills/to-prd/SKILL.md +74 -0
- package/skills/triage/AGENT-BRIEF.md +168 -0
- package/skills/triage/OUT-OF-SCOPE.md +101 -0
- package/skills/triage/SKILL.md +111 -0
- package/skills/where/SKILL.md +108 -0
- package/skills/zoom-out/SKILL.md +7 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: migrate
|
|
3
|
+
description: Audit a repo's existing AI/agent conventions (AGENTS.md, CLAUDE.md, scoped agent dirs, handoff systems, context/ADR variants) and migrate them to the canonical engineering framework. STRICT GATE — `/do` refuses to run on un-migrated repos. Also enforces GitHub readiness when GitHub is the tracker.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Migrate Repo Conventions
|
|
8
|
+
|
|
9
|
+
The engineering framework assumes a single canonical shape. Mixed systems cause confusion and drop efficiency. This skill is the **strict gate** that ensures every repo conforms before any engineering work begins.
|
|
10
|
+
|
|
11
|
+
## Canonical end state
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
<repo>/
|
|
15
|
+
├── AGENTS.md # hard rules + ## Agent skills block (canonical)
|
|
16
|
+
├── docs/
|
|
17
|
+
│ ├── agents/
|
|
18
|
+
│ │ ├── domain.md
|
|
19
|
+
│ │ ├── issue-tracker.md
|
|
20
|
+
│ │ ├── triage-labels.md
|
|
21
|
+
│ │ └── preferences.md # ends with migration marker
|
|
22
|
+
│ ├── adr/ (or docs/decisions/, documented in domain.md)
|
|
23
|
+
│ └── ...
|
|
24
|
+
└── .archive/<date>-pre-migration/ # original artifacts, if migration changed them
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Forbidden after migration:**
|
|
28
|
+
- Standalone handoff systems (`docs/handoff/SESSION_*.md`, `.scratch/flow/`, `.handoff/`, etc.)
|
|
29
|
+
- Duplicate process docs in AGENTS.md (anything our skills cover)
|
|
30
|
+
- Multiple competing rule files (CLAUDE.md + AGENTS.md both alive — pick one)
|
|
31
|
+
|
|
32
|
+
State of work lives in three places only: **code (git), issue tracker, merged preferences**.
|
|
33
|
+
|
|
34
|
+
## Process
|
|
35
|
+
|
|
36
|
+
### 1. Inventory
|
|
37
|
+
|
|
38
|
+
Scan and list:
|
|
39
|
+
|
|
40
|
+
**A. Agent rule files**
|
|
41
|
+
- `AGENTS.md`, `CLAUDE.md` — root and scoped (subdir)
|
|
42
|
+
- `.agents/`, `.claude/`, `.opencode/`, `.omc/`, `.hermes/`, `.sisyphus/`, `.cursor/`, `.windsurf/`
|
|
43
|
+
|
|
44
|
+
**B. Handoff systems**
|
|
45
|
+
- `docs/handoff/`, `docs/sessions/`, `.handoff/`, `.scratch/flow/`, `.ref/`
|
|
46
|
+
- Anything matching `SESSION_*.md`, `HANDOFF_*.md`, session-log naming
|
|
47
|
+
|
|
48
|
+
**C. Context / ADR variants**
|
|
49
|
+
- `CONTEXT.md`, `CONTEXT-MAP.md`, `docs/contexts/*/CONTEXT.md`
|
|
50
|
+
- `docs/adr/`, `docs/decisions/`, `docs/architecture/`
|
|
51
|
+
|
|
52
|
+
**D. GitHub readiness** (if user picks GitHub during setup)
|
|
53
|
+
- `git remote -v` — GitHub remote present?
|
|
54
|
+
- `gh --version` — CLI installed?
|
|
55
|
+
- `gh auth status` — authenticated?
|
|
56
|
+
- `gh repo view <owner>/<repo>` — repo accessible?
|
|
57
|
+
- `gh issue list --limit 1 --repo <owner>/<repo>` — issue API works?
|
|
58
|
+
|
|
59
|
+
### 2. Classify each artifact
|
|
60
|
+
|
|
61
|
+
| Class | Action |
|
|
62
|
+
| ----------- | -------------------------------------------------------------------------------------------- |
|
|
63
|
+
| PRESERVE | Hard rules (NEVER/MUST/BLOCKING/CRITICAL/MANDATORY) — domain-specific, survive migration |
|
|
64
|
+
| TRANSLATE | Process/workflow docs that duplicate our skills — replace with `## Agent skills` block |
|
|
65
|
+
| ARCHIVE | Handoff logs, session notes — move to `.archive/<date>-pre-migration/` or delete with OK |
|
|
66
|
+
| NORMALIZE | Context/ADR variants — either move to canonical paths OR document the variant in domain.md |
|
|
67
|
+
|
|
68
|
+
Heuristics:
|
|
69
|
+
- A bullet that starts with `NEVER`, `MUST`, `BLOCKING`, `CRITICAL`, `MANDATORY`, `ALWAYS` → PRESERVE.
|
|
70
|
+
- A section titled `Build & Run`, `Test`, `Session Onboarding`, `Session Handoff`, `Validation Before Commit`, `Long-Running Commands`, etc. → TRANSLATE if generic, PRESERVE if domain-specific (e.g. fetchflow's `pnpm test` is generic, but `BUZZ formula differs per platform` is domain).
|
|
71
|
+
- File with timestamp in name under `docs/handoff/` or `.scratch/` → ARCHIVE.
|
|
72
|
+
|
|
73
|
+
### 3a. Local-live readiness gate
|
|
74
|
+
|
|
75
|
+
Before declaring migration complete, the agent must confirm it can drive the project locally without the user playing test runner. This is a one-time conversation per project; the answers go into preferences free notes and become the agent's playbook for every future run.
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
[migration] Local-live readiness
|
|
79
|
+
|
|
80
|
+
Detected:
|
|
81
|
+
• language/runtime: <node | python | go | rust | mixed>
|
|
82
|
+
• dev script(s): <list of package.json scripts matching dev|start|serve>
|
|
83
|
+
• docker presence: <docker-compose*.yml | Dockerfile*>
|
|
84
|
+
• infra deps: <postgres | mysql | oracle | redis | s3 | ... if hinted in env example>
|
|
85
|
+
• playwright/e2e: <yes/no>
|
|
86
|
+
• complexity: <light | medium | heavy>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Branch:
|
|
90
|
+
|
|
91
|
+
- **light** (single `npm run dev` / `pnpm dev` boots everything, no infra): record the exact command. No interview.
|
|
92
|
+
- **medium** (one or two services, simple env): record the boot command and the env-source command (e.g. `source .env.development &&`). No interview.
|
|
93
|
+
- **heavy** (multi-service compose, real DB/queue, ops-only secrets): **ask the user 3 questions, once**:
|
|
94
|
+
1. **Local boot path** — exact command(s) to bring the app/subsystem up locally (or "not yet possible — agent will build a harness").
|
|
95
|
+
2. **Infra strategy** — `local-everything` / `borrow-ops-conn` (DB/queue from prod read-only) / `mock-infra-only-app-live` / other.
|
|
96
|
+
3. **Smoke probe** — one HTTP/CLI/log signal that proves the system is alive (e.g. `curl localhost:8080/healthz`, log line pattern, queue depth metric).
|
|
97
|
+
|
|
98
|
+
Record answers in `docs/agents/preferences.md` under a new section:
|
|
99
|
+
|
|
100
|
+
```markdown
|
|
101
|
+
## Local-live playbook
|
|
102
|
+
|
|
103
|
+
- boot: <command(s)>
|
|
104
|
+
- env: <source / docker / k8s context>
|
|
105
|
+
- infra-strategy: <one of the four above>
|
|
106
|
+
- alive-probe: <one signal>
|
|
107
|
+
- known-gotchas: <free text>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
After this is set, the agent boots and verifies on its own for the rest of the project's life. The user is asked again only if the playbook breaks (probe fails for a structural reason, not a flaky network).
|
|
111
|
+
|
|
112
|
+
If the user picks "not yet possible — agent will build a harness", record that fact and `/migrate` exits with the playbook in TODO state. The first `/do` run will build the harness and update the playbook in place.
|
|
113
|
+
|
|
114
|
+
### 3b. GitHub readiness gate (if applicable)
|
|
115
|
+
|
|
116
|
+
If user already chose / will choose GitHub as tracker:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
[migration] GitHub readiness check
|
|
120
|
+
|
|
121
|
+
git remote (github): <ok | missing | non-github>
|
|
122
|
+
gh CLI installed: <ok | missing>
|
|
123
|
+
gh auth status: <ok | unauth>
|
|
124
|
+
repo accessible: <ok | denied | unknown>
|
|
125
|
+
issue API: <ok | failed>
|
|
126
|
+
|
|
127
|
+
Status: <READY | BLOCKED>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
If BLOCKED, print exact fix commands and stop. Examples:
|
|
131
|
+
|
|
132
|
+
- gh missing: `brew install gh` (mac) / `apt install gh` (linux)
|
|
133
|
+
- unauth: `gh auth login`
|
|
134
|
+
- no remote: `gh repo create <owner>/<repo> --source . --push --private`
|
|
135
|
+
|
|
136
|
+
Do not proceed with migration body until READY, OR until user picks a non-GitHub tracker (then `/setup` handles it).
|
|
137
|
+
|
|
138
|
+
### 4. Present diff plan
|
|
139
|
+
|
|
140
|
+
One screen, no surprises:
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
[migration] plan for <repo>
|
|
144
|
+
|
|
145
|
+
PRESERVE (hard rules → AGENTS.md ## Hard rules + docs/agents/preferences.md ## Project taboos):
|
|
146
|
+
• <rule 1> [from: AGENTS.md:42]
|
|
147
|
+
• <rule 2> [from: api/AGENTS.md:15]
|
|
148
|
+
• ...
|
|
149
|
+
|
|
150
|
+
TRANSLATE (delete from AGENTS.md, covered by skills):
|
|
151
|
+
• "## Build & Run" → tdd / repo scripts
|
|
152
|
+
• "## Session Onboarding" → `/do` Step 0
|
|
153
|
+
• "## Session Handoff" → not needed (no handoffs in this framework)
|
|
154
|
+
• ...
|
|
155
|
+
|
|
156
|
+
ARCHIVE (move to .archive/<date>-pre-migration/):
|
|
157
|
+
• docs/handoff/SESSION_2025-04-10.md
|
|
158
|
+
• .scratch/flow/*
|
|
159
|
+
• ...
|
|
160
|
+
|
|
161
|
+
NORMALIZE:
|
|
162
|
+
• docs/decisions/ → keep, document in docs/agents/domain.md
|
|
163
|
+
• CONTEXT-MAP.md → keep (multi-context layout)
|
|
164
|
+
|
|
165
|
+
WRITE/UPDATE:
|
|
166
|
+
• AGENTS.md (rewrite)
|
|
167
|
+
• docs/agents/issue-tracker.md (via `/setup`)
|
|
168
|
+
• docs/agents/triage-labels.md
|
|
169
|
+
• docs/agents/domain.md
|
|
170
|
+
• docs/agents/preferences.md (via `/taste` onboarding)
|
|
171
|
+
|
|
172
|
+
DELETE (with user OK):
|
|
173
|
+
• CLAUDE.md (if AGENTS.md is the keeper)
|
|
174
|
+
• <empty/duplicate dirs>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Wait for user OK. Show exact text being preserved or translated if user asks.
|
|
178
|
+
|
|
179
|
+
### 5. Execute
|
|
180
|
+
|
|
181
|
+
In order:
|
|
182
|
+
|
|
183
|
+
1. **Backup**: `mv` everything in ARCHIVE to `.archive/<date>-pre-migration/`. Add `.archive/` to `.gitignore` if not present.
|
|
184
|
+
2. **Setup docs**: invoke `/setup` if any of `docs/agents/{issue-tracker,triage-labels,domain}.md` missing.
|
|
185
|
+
3. **Rewrite AGENTS.md** with the canonical skeleton:
|
|
186
|
+
```markdown
|
|
187
|
+
# <Repo> — Operating Rules
|
|
188
|
+
|
|
189
|
+
<one-liner repo summary>
|
|
190
|
+
|
|
191
|
+
## Hard rules
|
|
192
|
+
|
|
193
|
+
<preserved rules, deduplicated, grouped by topic>
|
|
194
|
+
|
|
195
|
+
## Agent skills
|
|
196
|
+
|
|
197
|
+
### Issue tracker
|
|
198
|
+
<one-liner>. See `docs/agents/issue-tracker.md`.
|
|
199
|
+
|
|
200
|
+
### Triage labels
|
|
201
|
+
<one-liner>. See `docs/agents/triage-labels.md`.
|
|
202
|
+
|
|
203
|
+
### Domain docs
|
|
204
|
+
<one-liner>. See `docs/agents/domain.md`.
|
|
205
|
+
|
|
206
|
+
### Preferences
|
|
207
|
+
<one-liner>. See `docs/agents/preferences.md` (overrides on `~/.pi/agent/preferences.md`).
|
|
208
|
+
```
|
|
209
|
+
4. **Sub-AGENTS.md**: if scoped `<subdir>/AGENTS.md` exists, leave it but strip duplicated process docs; preserve only hard rules specific to that subtree.
|
|
210
|
+
5. **Onboard preferences**: invoke `/taste` in onboarding mode.
|
|
211
|
+
6. **Mark migrated**: append to `docs/agents/preferences.md`:
|
|
212
|
+
```
|
|
213
|
+
<!-- migrated: <ISO-date> by `/migrate` -->
|
|
214
|
+
```
|
|
215
|
+
7. **Print summary**: counts of preserved / translated / archived / written, plus any FYI items needing manual review.
|
|
216
|
+
|
|
217
|
+
### 6. Idempotency
|
|
218
|
+
|
|
219
|
+
This skill is safe to re-run. On second run:
|
|
220
|
+
- If marker present and no drift detected → print "already migrated, no changes" and exit.
|
|
221
|
+
- If drift detected (new handoff files appeared, AGENTS.md got a generic process section bolted on, etc.) → present a diff for those drifts only.
|
|
222
|
+
|
|
223
|
+
## When migration cannot proceed
|
|
224
|
+
|
|
225
|
+
- User refuses to delete a competing rule file (CLAUDE.md vs AGENTS.md both alive) → migration stops, `/do` stays blocked. The decision must be made.
|
|
226
|
+
- GitHub gate fails and user does not pick alternative → blocked.
|
|
227
|
+
- User wants to keep a handoff system → migration writes a one-paragraph exception in `docs/agents/preferences.md` free notes ("this repo retains `docs/handoff/` because <reason>") and skill respects it. But the canonical posture is no-handoff.
|
|
228
|
+
|
|
229
|
+
## Why this is strict
|
|
230
|
+
|
|
231
|
+
Hybrid systems silently degrade. A skill thinks it should write a handoff because the repo has `docs/handoff/`; another skill thinks it shouldn't because the framework says no handoff. The agent ends up writing handoffs no one reads, OR skipping state-of-work tracking entirely. The migration gate prevents this class of bug at the source.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: recon-with-vision
|
|
3
|
+
description: Reconnaissance for HTML extractors and external-site adapters. Captures the rendered page at the canonical desktop viewport, reads it as an image, and locks the schema against what a human actually sees — not what raw HTML grep happens to find. Use before designing or revising an extractor / scraper / adapter, before writing parser regex, and before committing a response schema for an external page.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<what-to-do>
|
|
7
|
+
|
|
8
|
+
You are about to design or revise an extractor against a third-party HTML page. Do not trust raw HTML grep alone — modern pages hydrate fields client-side, embed values in attributes you didn't anticipate, and split visual sections across DOM blocks that don't resemble the rendered layout. Verify against what a human actually sees, then lock the schema.
|
|
9
|
+
|
|
10
|
+
Work the recipe, one target page at a time. Each target produces a fixture and a verified field list. Stop and present findings to the user before writing parser code.
|
|
11
|
+
|
|
12
|
+
</what-to-do>
|
|
13
|
+
|
|
14
|
+
<recipe>
|
|
15
|
+
|
|
16
|
+
## Recipe — per target page
|
|
17
|
+
|
|
18
|
+
1. **Raw fetch baseline.** `curl -sS -L -A '<desktop UA>' <url> -o /tmp/<name>.html -w '%{http_code} %{size_download}\n'`. Confirm 200 + reasonable size. This is your fixture candidate.
|
|
19
|
+
|
|
20
|
+
2. **Quick raw probe.** Grep / regex the obvious fields you expect (full_name, description, counts, etc.). Note which ones extract cleanly and which don't. Do not yet infer "the field doesn't exist" from grep failure — hydration may hide it.
|
|
21
|
+
|
|
22
|
+
3. **Vision capture.** Render the page through Playwright at the canonical desktop viewport `1280 × 1560` and screenshot the first viewport (no fullPage). Save to a stable path. The capture script is a one-off — write it inline, do not commit it.
|
|
23
|
+
|
|
24
|
+
- 1280 = standard desktop max-width many sites optimise for.
|
|
25
|
+
- 1560 = enough vertical space to see most "above the fold" + first content section without infinite scroll.
|
|
26
|
+
- `waitUntil: 'networkidle'` + 1.5s extra timeout to let React hydration finish.
|
|
27
|
+
- Use a real desktop User-Agent. Do not use the default Playwright UA.
|
|
28
|
+
|
|
29
|
+
4. **Vision read.** Read the screenshot with the Read tool (image input). List every field a human actually sees on the rendered page: tabs, filters, badges, sidebar metadata, repeated card structure, counts, relative-time strings, language breakdowns, "X by Y" attributions.
|
|
30
|
+
|
|
31
|
+
5. **Delta the two lists.** Fields visible in vision but missing from raw grep are your discovery. These are usually the most valuable fields — they tend to be hydrated counters (stars, watchers, releases), language %, contributor avatars, sidebar metadata.
|
|
32
|
+
|
|
33
|
+
6. **Lock the schema.** Decide for each visible field: include / exclude / defer. State the reason for each exclusion (LLM-noise, visual-only, requires-second-fetch, phase-2). Capture the locked schema in the PRD or ADR before any parser code is written.
|
|
34
|
+
|
|
35
|
+
7. **Save the fixture.** Move the raw HTML (not the screenshot) into `tests/fixtures/<adapter>/<page-name>.html` with a fixture README documenting source URL, capture date, and refresh policy: "fixture refresh and parser refresh must land together in the same PR."
|
|
36
|
+
|
|
37
|
+
</recipe>
|
|
38
|
+
|
|
39
|
+
<known-traps>
|
|
40
|
+
|
|
41
|
+
## Traps this skill exists to prevent
|
|
42
|
+
|
|
43
|
+
- **Hydration blindness.** Counters like stars / forks / watching often render via client-side JS and end up in `<span title="N">` or data-attributes that don't match the obvious selector. Vision sees them; grep doesn't.
|
|
44
|
+
- **Section blindness.** Sidebars (About / Topics / Languages / Releases / Packages / Contributors) are often a separate DOM tree. Reading the screenshot makes them visible at a glance; reading the HTML buries them.
|
|
45
|
+
- **Filter blindness.** Tabs and filters (e.g. `Repositories | Developers`, `Spoken Language: Any`, `Sort: Most stars`) are obvious in vision and easy to miss in HTML.
|
|
46
|
+
- **"This field doesn't exist" false negatives.** Raw grep returns 0 → don't conclude "absent". Conclude "I don't yet have the right selector" until vision confirms.
|
|
47
|
+
- **Field-name drift.** What looks like "watchers" in your model may render as "watching" in the UI. Use the rendered label as the canonical name when nothing else is at stake.
|
|
48
|
+
- **Mobile vs desktop layout drift.** Some sites collapse sidebars on smaller viewports and the schema gets gutted. Desktop 1280 stays consistent.
|
|
49
|
+
|
|
50
|
+
</known-traps>
|
|
51
|
+
|
|
52
|
+
<schema-decisions>
|
|
53
|
+
|
|
54
|
+
## Decisions to make once vision delta is in hand
|
|
55
|
+
|
|
56
|
+
For every field in the vision list:
|
|
57
|
+
|
|
58
|
+
- **Include and always-present (`null`-explicit).** Default for typed-client / MCP-tool / CLI consumers — schema stable across calls.
|
|
59
|
+
- **Include but optional.** Only when the field is genuinely rare (e.g. topic page `created_by` exists for ~5% of topics) and including it as `null` would dominate the response.
|
|
60
|
+
- **Exclude — visual-only noise.** Avatars without identity value, social preview images, sponsor button states, internal telemetry attributes.
|
|
61
|
+
- **Exclude — requires extra fetch.** Note in the PRD; defer to Phase 2 unless one extra request gives high value.
|
|
62
|
+
- **Exclude — REST gives this better.** State the boundary explicitly. Don't double-source.
|
|
63
|
+
|
|
64
|
+
State the reason next to each exclusion in the PRD body. A future reader must be able to ask "why isn't this field here?" and find the answer without re-running the recon.
|
|
65
|
+
|
|
66
|
+
</schema-decisions>
|
|
67
|
+
|
|
68
|
+
<fixture-policy>
|
|
69
|
+
|
|
70
|
+
## Fixture policy
|
|
71
|
+
|
|
72
|
+
- One captured HTML per page-class, stored under `tests/fixtures/<adapter>/`.
|
|
73
|
+
- Add a `README.md` to the fixture directory listing source URL, capture date, and the refresh-with-parser rule.
|
|
74
|
+
- Parser unit tests run against the fixture, not the live network. Network tests live in smoke runners, not unit tests.
|
|
75
|
+
- When the live page changes and parser tests fail against prod, refresh the fixture in the same PR as the parser fix. Never refresh the fixture without updating the parser, and vice versa.
|
|
76
|
+
|
|
77
|
+
</fixture-policy>
|
|
78
|
+
|
|
79
|
+
<scope>
|
|
80
|
+
|
|
81
|
+
## When to use
|
|
82
|
+
|
|
83
|
+
- Building a new HTML extractor / scraper / adapter for an external site.
|
|
84
|
+
- Revising an existing extractor after upstream HTML drift.
|
|
85
|
+
- Locking a response schema for an external-page-derived endpoint.
|
|
86
|
+
- Designing fixture-based unit tests for a parser.
|
|
87
|
+
|
|
88
|
+
## When not to use
|
|
89
|
+
|
|
90
|
+
- The data source is a stable JSON API. Vision adds nothing; the API response is the schema.
|
|
91
|
+
- The page is fully server-rendered HTML with no React/Vue hydration. Raw grep is sufficient — but it costs nothing to spot-check one screenshot anyway.
|
|
92
|
+
- The page is behind authentication that the vision-capture browser can't pass. Resolve the auth path first.
|
|
93
|
+
|
|
94
|
+
</scope>
|
|
95
|
+
|
|
96
|
+
<runtime-vs-design-time>
|
|
97
|
+
|
|
98
|
+
## Design-time only — runtime extraction stays on the project's existing path
|
|
99
|
+
|
|
100
|
+
This skill uses Playwright at design time to capture one fixture and verify a schema. That one-off capture script is not committed and is not part of the runtime adapter.
|
|
101
|
+
|
|
102
|
+
If the host repo prohibits Playwright / Puppeteer / Selenium for runtime extraction (typical for production scraping pipelines that must run through `curl` + a proxy lane for cost / detection / metering reasons), this skill stays compatible: the runtime extractor still uses the project's blessed HTTP client. The vision capture is a one-shot recon tool, not a runtime dependency.
|
|
103
|
+
|
|
104
|
+
State this distinction in the PRD or ADR so future readers don't conflate the two.
|
|
105
|
+
|
|
106
|
+
</runtime-vs-design-time>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup
|
|
3
|
+
description: Scaffolds the per-repo configuration the engineering skills assume — issue tracker (GitHub by default), triage label vocabulary, and domain doc layout. Auto-invoked by `/migrate` during repo onboarding; manual call only when the setup docs are missing or need to be redone.
|
|
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 `CONTEXT.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
|
+
- `CONTEXT.md` and `CONTEXT-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/` — sign that a local-markdown issue tracker convention is already in use
|
|
29
|
+
|
|
30
|
+
### 2. Present findings and ask
|
|
31
|
+
|
|
32
|
+
Summarise what's present and what's missing. Then walk the user through the three decisions **one at a time** — present a section, get the user's answer, then move to the next. Don't dump all three at once.
|
|
33
|
+
|
|
34
|
+
Assume the user does not know what these terms mean. Each section starts with a short explainer (what it is, why these skills need it, what changes if they pick differently). Then show the choices and the default.
|
|
35
|
+
|
|
36
|
+
**Section A — Issue tracker.**
|
|
37
|
+
|
|
38
|
+
> Explainer: The "issue tracker" is where issues live for this repo. Skills like `to-issues`, `triage`, `to-prd`, and `qa` 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.
|
|
39
|
+
|
|
40
|
+
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:
|
|
41
|
+
|
|
42
|
+
- **GitHub** — issues live in the repo's GitHub Issues (uses the `gh` CLI)
|
|
43
|
+
- **GitLab** — issues live in the repo's GitLab Issues (uses the [`glab`](https://gitlab.com/gitlab-org/cli) CLI)
|
|
44
|
+
- **Local markdown** — issues live as files under `.scratch/<feature>/` in this repo (good for solo projects or repos without a remote)
|
|
45
|
+
- **Other** (Jira, Linear, etc.) — ask the user to describe the workflow in one paragraph; the skill will record it as freeform prose
|
|
46
|
+
|
|
47
|
+
**Section B — Triage label vocabulary.**
|
|
48
|
+
|
|
49
|
+
> Explainer: When the `triage` skill processes an incoming issue, it moves it through a state machine — needs evaluation, waiting on reporter, ready for an AFK agent to pick up, ready for a human, or won't fix. To do that, it needs to apply labels (or the equivalent in your issue tracker) that match strings *you've actually configured*. If your repo already uses different label names (e.g. `bug:triage` instead of `needs-triage`), map them here so the skill applies the right ones instead of creating duplicates.
|
|
50
|
+
|
|
51
|
+
The five canonical roles:
|
|
52
|
+
|
|
53
|
+
- `needs-triage` — maintainer needs to evaluate
|
|
54
|
+
- `needs-info` — waiting on reporter
|
|
55
|
+
- `ready-for-agent` — fully specified, AFK-ready (an agent can pick it up with no human context)
|
|
56
|
+
- `ready-for-human` — needs human implementation
|
|
57
|
+
- `wontfix` — will not be actioned
|
|
58
|
+
|
|
59
|
+
Default: each role's string equals its name. Ask the user if they want to override any. If their issue tracker has no existing labels, the defaults are fine.
|
|
60
|
+
|
|
61
|
+
**Section C — Domain docs.**
|
|
62
|
+
|
|
63
|
+
> Explainer: Some skills (`improve-codebase-architecture`, `diagnose`, `tdd`) read a `CONTEXT.md` file to learn the project's domain language, and `docs/adr/` for past architectural decisions. They need to know whether the repo has one global context or multiple (e.g. a monorepo with separate frontend/backend contexts) so they look in the right place.
|
|
64
|
+
|
|
65
|
+
Confirm the layout:
|
|
66
|
+
|
|
67
|
+
- **Single-context** — one `CONTEXT.md` + `docs/adr/` at the repo root. Most repos are this.
|
|
68
|
+
- **Multi-context** — `CONTEXT-MAP.md` at the root pointing to per-context `CONTEXT.md` files (typically a monorepo).
|
|
69
|
+
|
|
70
|
+
### 3. Confirm and edit
|
|
71
|
+
|
|
72
|
+
Show the user a draft of:
|
|
73
|
+
|
|
74
|
+
- The `## Agent skills` block to add to whichever of `CLAUDE.md` / `AGENTS.md` is being edited (see step 4 for selection rules)
|
|
75
|
+
- The contents of `docs/agents/issue-tracker.md`, `docs/agents/triage-labels.md`, `docs/agents/domain.md`
|
|
76
|
+
|
|
77
|
+
Let them edit before writing.
|
|
78
|
+
|
|
79
|
+
### 4. Write
|
|
80
|
+
|
|
81
|
+
**Pick the file to edit:**
|
|
82
|
+
|
|
83
|
+
- If `CLAUDE.md` exists, edit it.
|
|
84
|
+
- Else if `AGENTS.md` exists, edit it.
|
|
85
|
+
- If neither exists, ask the user which one to create — don't pick for them.
|
|
86
|
+
|
|
87
|
+
Never create `AGENTS.md` when `CLAUDE.md` already exists (or vice versa) — always edit the one that's already there.
|
|
88
|
+
|
|
89
|
+
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.
|
|
90
|
+
|
|
91
|
+
The block:
|
|
92
|
+
|
|
93
|
+
```markdown
|
|
94
|
+
## Agent skills
|
|
95
|
+
|
|
96
|
+
### Issue tracker
|
|
97
|
+
|
|
98
|
+
[one-line summary of where issues are tracked]. See `docs/agents/issue-tracker.md`.
|
|
99
|
+
|
|
100
|
+
### Triage labels
|
|
101
|
+
|
|
102
|
+
[one-line summary of the label vocabulary]. See `docs/agents/triage-labels.md`.
|
|
103
|
+
|
|
104
|
+
### Domain docs
|
|
105
|
+
|
|
106
|
+
[one-line summary of layout — "single-context" or "multi-context"]. See `docs/agents/domain.md`.
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Then write the three docs files using the seed templates in this skill folder as a starting point:
|
|
110
|
+
|
|
111
|
+
- [issue-tracker-github.md](./issue-tracker-github.md) — GitHub issue tracker
|
|
112
|
+
- [issue-tracker-gitlab.md](./issue-tracker-gitlab.md) — GitLab issue tracker
|
|
113
|
+
- [issue-tracker-local.md](./issue-tracker-local.md) — local-markdown issue tracker
|
|
114
|
+
- [triage-labels.md](./triage-labels.md) — label mapping
|
|
115
|
+
- [domain.md](./domain.md) — domain doc consumer rules + layout
|
|
116
|
+
|
|
117
|
+
For "other" issue trackers, write `docs/agents/issue-tracker.md` from scratch using the user's description.
|
|
118
|
+
|
|
119
|
+
### 5. Done
|
|
120
|
+
|
|
121
|
+
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,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
|
+
- **`CONTEXT.md`** at the repo root, or
|
|
8
|
+
- **`CONTEXT-MAP.md`** at the repo root if it exists — it points at one `CONTEXT.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 producer skill (`/grill-with-docs`) 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
|
+
├── CONTEXT.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 `CONTEXT-MAP.md` at the root):
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
/
|
|
30
|
+
├── CONTEXT-MAP.md
|
|
31
|
+
├── docs/adr/ ← system-wide decisions
|
|
32
|
+
└── src/
|
|
33
|
+
├── ordering/
|
|
34
|
+
│ ├── CONTEXT.md
|
|
35
|
+
│ └── docs/adr/ ← context-specific decisions
|
|
36
|
+
└── billing/
|
|
37
|
+
├── CONTEXT.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 `CONTEXT.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 `/grill-with-docs`).
|
|
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,22 @@
|
|
|
1
|
+
# Issue tracker: GitHub
|
|
2
|
+
|
|
3
|
+
Issues and PRDs 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> --comments`, filtering comments by `jq` and also fetching labels.
|
|
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
|
+
- **Comment on an issue**: `gh issue comment <number> --body "..."`
|
|
11
|
+
- **Apply / remove labels**: `gh issue edit <number> --add-label "..."` / `--remove-label "..."`
|
|
12
|
+
- **Close**: `gh issue close <number> --comment "..."`
|
|
13
|
+
|
|
14
|
+
Infer the repo from `git remote -v` — `gh` does this automatically when run inside a clone.
|
|
15
|
+
|
|
16
|
+
## When a skill says "publish to the issue tracker"
|
|
17
|
+
|
|
18
|
+
Create a GitHub issue.
|
|
19
|
+
|
|
20
|
+
## When a skill says "fetch the relevant ticket"
|
|
21
|
+
|
|
22
|
+
Run `gh issue view <number> --comments`.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Issue tracker: GitLab
|
|
2
|
+
|
|
3
|
+
Issues and PRDs 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 --state opened -F json` with appropriate `--label` filters. Note that GitLab uses `opened` (not `open`) for the state value.
|
|
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
|
+
## When a skill says "publish to the issue tracker"
|
|
18
|
+
|
|
19
|
+
Create a GitLab issue.
|
|
20
|
+
|
|
21
|
+
## When a skill says "fetch the relevant ticket"
|
|
22
|
+
|
|
23
|
+
Run `glab issue view <number> --comments`.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Issue tracker: Local Markdown
|
|
2
|
+
|
|
3
|
+
Issues and PRDs for this repo live as markdown files in `.scratch/`.
|
|
4
|
+
|
|
5
|
+
## Conventions
|
|
6
|
+
|
|
7
|
+
- One feature per directory: `.scratch/<feature-slug>/`
|
|
8
|
+
- The PRD is `.scratch/<feature-slug>/PRD.md`
|
|
9
|
+
- Implementation issues are `.scratch/<feature-slug>/issues/<NN>-<slug>.md`, numbered from `01`
|
|
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.
|
|
@@ -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 right-hand column to match whatever vocabulary you actually use.
|