@fernado03/zoo-flow 0.5.1 → 0.5.3
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/README.md +3 -11
- package/bin/zoo-flow.js +7 -6
- package/package.json +1 -1
- package/templates/full/.roo/commands/explore.md +13 -13
- package/templates/full/.roo/commands/scaffold-context.md +13 -13
- package/templates/full/.roo/commands/setup-matt-pocock-skills.md +8 -8
- package/templates/full/.roo/commands/update-docs.md +22 -22
- package/templates/full/.roo/rules/04-context-economy.md +29 -29
- package/templates/full/.roo/rules-custom-orchestrator/00-routing.md +69 -69
- package/templates/full/.roo/rules-custom-orchestrator/01-delegation-message.md +62 -62
- package/templates/full/.roo/skills/engineering/grill-with-docs/CONTEXT-FORMAT.md +61 -63
- package/templates/full/.roo/skills/engineering/prototype/SKILL.md +37 -37
- package/templates/full/.roo/skills/engineering/scaffold-context/SKILL.md +152 -152
- package/templates/full/.roo/skills/engineering/to-prd/SKILL.md +57 -57
- package/templates/full/.roo/skills/in-progress/teach/SKILL.md +26 -7
- package/templates/full/.roomodes +47 -47
- package/templates/full/.zoo-flow/CONTEXT.md +8 -8
- package/templates/full/.zoo-flow/START_HERE.md +61 -61
- package/templates/full/.zoo-flow/docs/adr/0001-record-architecture-decisions.md +22 -22
- package/templates/full/.zoo-flow/evals/no-regression-checklist.md +26 -26
- package/templates/full/.zoo-flow/evals/routing-cases.md +203 -203
|
@@ -1,63 +1,61 @@
|
|
|
1
|
-
# CONTEXT.md Format
|
|
2
|
-
|
|
3
|
-
## Shape
|
|
4
|
-
|
|
5
|
-
```md
|
|
6
|
-
# {Context Name}
|
|
7
|
-
|
|
8
|
-
{1-2 sentences: context purpose.}
|
|
9
|
-
|
|
10
|
-
## Language
|
|
11
|
-
|
|
12
|
-
**Order**:
|
|
13
|
-
{1-2 sentence definition}
|
|
14
|
-
_Avoid_: Purchase, transaction
|
|
15
|
-
|
|
16
|
-
## Flagged ambiguities
|
|
17
|
-
|
|
18
|
-
**Account** means Customer here, not User.
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Rules
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
|
32
|
-
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
- `.zoo-flow/
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
`/grill-with-docs` and `/explore` consult the map first, then the
|
|
63
|
-
relevant per-context file.
|
|
1
|
+
# CONTEXT.md Format
|
|
2
|
+
|
|
3
|
+
## Shape
|
|
4
|
+
|
|
5
|
+
```md
|
|
6
|
+
# {Context Name}
|
|
7
|
+
|
|
8
|
+
{1-2 sentences: context purpose.}
|
|
9
|
+
|
|
10
|
+
## Language
|
|
11
|
+
|
|
12
|
+
**Order**:
|
|
13
|
+
{1-2 sentence definition}
|
|
14
|
+
_Avoid_: Purchase, transaction
|
|
15
|
+
|
|
16
|
+
## Flagged ambiguities
|
|
17
|
+
|
|
18
|
+
**Account** means Customer here, not User.
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Rules
|
|
22
|
+
|
|
23
|
+
- **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others under `_Avoid`.
|
|
24
|
+
- Define term in 1–2 sentences: what it is, not behavior.
|
|
25
|
+
- Include domain terms only; exclude generic programming terms.
|
|
26
|
+
|
|
27
|
+
## Slots
|
|
28
|
+
|
|
29
|
+
| Slot | File (if present) | Authored by | Default location |
|
|
30
|
+
|---|---|---|---|
|
|
31
|
+
| Domain language | `CONTEXT.md` | User via /grill-with-docs | `.zoo-flow/CONTEXT.md` |
|
|
32
|
+
| Decisions | `docs/adr/<NNNN-slug>.md` | User via /grill-with-docs | `.zoo-flow/docs/adr/` |
|
|
33
|
+
| Subsystem flow | `FLOW.md` | Subsystem owner | Next to the code |
|
|
34
|
+
| App map | `APP_MAP.md` | User via /update-docs | `.zoo-flow/APP_MAP.md` |
|
|
35
|
+
| Architecture | `ARCHITECTURE.md` | User via /update-docs | `.zoo-flow/ARCHITECTURE.md` |
|
|
36
|
+
| Setup | `README.md` | Project owner | Project root |
|
|
37
|
+
|
|
38
|
+
## Discovery rule (used by /explore, /update-docs, /grill-with-docs)
|
|
39
|
+
|
|
40
|
+
For each slot, in this order:
|
|
41
|
+
|
|
42
|
+
1. If the file exists at the documented location, read it.
|
|
43
|
+
2. If the slot is empty/missing, that is **not an error**. The user has
|
|
44
|
+
not authored it yet. Do not invent content. Do not lazy-create unless
|
|
45
|
+
the calling command explicitly says so (e.g. /grill-with-docs on a
|
|
46
|
+
first resolved term).
|
|
47
|
+
3. If the calling command depends on a populated slot and none exist,
|
|
48
|
+
surface once: "Slot `<name>` not yet authored. Run /grill-with-docs
|
|
49
|
+
to fill, or continue without."
|
|
50
|
+
|
|
51
|
+
## Multi-context (rare)
|
|
52
|
+
|
|
53
|
+
A single project can hold multiple domain contexts when subsystems do
|
|
54
|
+
not share language. Use:
|
|
55
|
+
|
|
56
|
+
- `.zoo-flow/CONTEXT-MAP.md` — index of contexts.
|
|
57
|
+
- `.zoo-flow/contexts/<slug>/CONTEXT.md` — per-context.
|
|
58
|
+
- `.zoo-flow/contexts/<slug>/docs/adr/` — per-context ADRs.
|
|
59
|
+
|
|
60
|
+
`/grill-with-docs` and `/explore` consult the map first, then the
|
|
61
|
+
relevant per-context file.
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: prototype
|
|
3
|
-
description: Build a throwaway prototype to flesh out a design before committing to it. Routes between two branches — a runnable terminal app for state/business-logic questions, or several radically different UI variations toggleable from one route. Use when the user wants to prototype, sanity-check a data model or state machine, mock up a UI, explore design options, or says "prototype this", "let me play with it", "try a few designs".
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Prototype
|
|
7
|
-
|
|
8
|
-
RULE: Prototype answers one question. Throw away or absorb after answer.
|
|
9
|
-
|
|
10
|
-
## Branch
|
|
11
|
-
|
|
12
|
-
- Logic/state/data-model → `LOGIC.md`.
|
|
13
|
-
- Visual/layout/UI → `UI.md`.
|
|
14
|
-
- Ambiguous → ask.
|
|
15
|
-
- User AFK → infer + state assumption.
|
|
16
|
-
|
|
17
|
-
## Context economy
|
|
18
|
-
|
|
19
|
-
Before broad reads, locate relevant files/symbols with `list_files`, `search_files`, or `codebase_search`.
|
|
20
|
-
|
|
21
|
-
Prefer targeted `read_file` ranges or indentation/block reads once the relevant area is known.
|
|
22
|
-
|
|
23
|
-
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
24
|
-
|
|
25
|
-
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
26
|
-
|
|
27
|
-
## Rules
|
|
28
|
-
|
|
29
|
-
1. Mark throwaway clearly.
|
|
30
|
-
2. Place under `.scratch/prototypes/<slug>/` (logic/state/data-model) or near the real module/page (UI). UI prototypes need the real route, data fetching, and auth, so they stay adjacent to the page they mock up; logic prototypes have no such constraint, so they go in `.scratch/` with the other throwaway work.
|
|
31
|
-
3. Follow existing routing/tooling.
|
|
32
|
-
4. Provide one run command.
|
|
33
|
-
5. Default no persistence; state in memory.
|
|
34
|
-
6. Persistence target → scratch DB/file named `PROTOTYPE — wipe me` in the prototype folder.
|
|
35
|
-
7. No polish: no tests, minimal errors, no abstractions.
|
|
36
|
-
8. Surface full relevant state after each action/variant switch.
|
|
37
|
-
9. Done → capture answer in commit/ADR/issue/`NOTES.md`; delete or fold into real code.
|
|
1
|
+
---
|
|
2
|
+
name: prototype
|
|
3
|
+
description: Build a throwaway prototype to flesh out a design before committing to it. Routes between two branches — a runnable terminal app for state/business-logic questions, or several radically different UI variations toggleable from one route. Use when the user wants to prototype, sanity-check a data model or state machine, mock up a UI, explore design options, or says "prototype this", "let me play with it", "try a few designs".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Prototype
|
|
7
|
+
|
|
8
|
+
RULE: Prototype answers one question. Throw away or absorb after answer.
|
|
9
|
+
|
|
10
|
+
## Branch
|
|
11
|
+
|
|
12
|
+
- Logic/state/data-model → `LOGIC.md`.
|
|
13
|
+
- Visual/layout/UI → `UI.md`.
|
|
14
|
+
- Ambiguous → ask.
|
|
15
|
+
- User AFK → infer + state assumption.
|
|
16
|
+
|
|
17
|
+
## Context economy
|
|
18
|
+
|
|
19
|
+
Before broad reads, locate relevant files/symbols with `list_files`, `search_files`, or `codebase_search`.
|
|
20
|
+
|
|
21
|
+
Prefer targeted `read_file` ranges or indentation/block reads once the relevant area is known.
|
|
22
|
+
|
|
23
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
24
|
+
|
|
25
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
26
|
+
|
|
27
|
+
## Rules
|
|
28
|
+
|
|
29
|
+
1. Mark throwaway clearly.
|
|
30
|
+
2. Place under `.scratch/prototypes/<slug>/` (logic/state/data-model) or near the real module/page (UI). UI prototypes need the real route, data fetching, and auth, so they stay adjacent to the page they mock up; logic prototypes have no such constraint, so they go in `.scratch/` with the other throwaway work.
|
|
31
|
+
3. Follow existing routing/tooling.
|
|
32
|
+
4. Provide one run command.
|
|
33
|
+
5. Default no persistence; state in memory.
|
|
34
|
+
6. Persistence target → scratch DB/file named `PROTOTYPE — wipe me` in the prototype folder.
|
|
35
|
+
7. No polish: no tests, minimal errors, no abstractions.
|
|
36
|
+
8. Surface full relevant state after each action/variant switch.
|
|
37
|
+
9. Done → capture answer in commit/ADR/issue/`NOTES.md`; delete or fold into real code.
|
|
@@ -1,152 +1,152 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: scaffold-context
|
|
3
|
-
description: Bootstrap .zoo-flow/CONTEXT.md from an existing codebase by detecting project shape and scanning for domain terms and cross-cutting decisions. Proposes 5-12 terms + 0-2 ADRs, asks for confirm before writing. Use on projects with no CONTEXT.md, or to expand a thin one.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Scaffold Context
|
|
7
|
-
|
|
8
|
-
## Loop
|
|
9
|
-
|
|
10
|
-
1. Read existing context via slot discovery rule (see `CONTEXT-FORMAT.md`).
|
|
11
|
-
2. Detect project shape (see Detection).
|
|
12
|
-
3. Scan codebase for terms (see Detection).
|
|
13
|
-
4. Propose 5-12 terms with one-line definitions + evidence (file:line counts).
|
|
14
|
-
5. Show inline, ask: confirm / edit / cancel.
|
|
15
|
-
6. On confirm, write to `.zoo-flow/CONTEXT.md` (preserve any existing entries in merge mode).
|
|
16
|
-
7. If 1-2 cross-cutting decisions are visible in code, propose ADRs (see ADR gate).
|
|
17
|
-
8. Show ADR draft(s) inline, ask confirm per ADR.
|
|
18
|
-
9. On confirm, write to `.zoo-flow/docs/adr/NNNN-slug.md` using `ADR-FORMAT.md` numbering.
|
|
19
|
-
10. Report what was written, with file paths.
|
|
20
|
-
|
|
21
|
-
## Detection
|
|
22
|
-
|
|
23
|
-
### Step 1: Detect project shape
|
|
24
|
-
|
|
25
|
-
Inspect (in order):
|
|
26
|
-
- `package.json` `keywords`, `name`, `scripts` (Node/JS)
|
|
27
|
-
- `pyproject.toml` / `setup.py` / `setup.cfg` (Python)
|
|
28
|
-
- `Cargo.toml` (Rust)
|
|
29
|
-
- `go.mod` (Go)
|
|
30
|
-
- Top-level folder names
|
|
31
|
-
- `README.md` first paragraph
|
|
32
|
-
|
|
33
|
-
Pick the dominant shape:
|
|
34
|
-
|
|
35
|
-
| Signal folders / files | Shape | Priority sources for terms |
|
|
36
|
-
|---|---|---|
|
|
37
|
-
| `app/`, `pages/`, `routes/`, `controllers/`, `api/` | web app | API routes, page names, URL paths, model types |
|
|
38
|
-
| `lib/`, `pkg/`, `src/` (no `app/`) | library | exported types, public API surface |
|
|
39
|
-
| `cmd/`, `bin/`, `commands/`, `cli/` | CLI tool | subcommand names, flag names |
|
|
40
|
-
| `workers/`, `jobs/`, `tasks/`, `etl/`, `pipelines/` | data pipeline | job/queue/event names |
|
|
41
|
-
| `services/`, `lambda/`, `functions/`, `handlers/` | serverless | function names, event sources, triggers |
|
|
42
|
-
| `services/` + `web/` + `workers/` | monorepo | treat each top-level as a sub-shape; ask user if unclear |
|
|
43
|
-
|
|
44
|
-
If signals are mixed, prefer the shape that owns the entry point (`main.*`, `index.*`, `server.*`).
|
|
45
|
-
|
|
46
|
-
### Step 2: Extract candidate terms
|
|
47
|
-
|
|
48
|
-
For the chosen shape, prefer:
|
|
49
|
-
- **Web app**: route paths (`/accounts/:id`), controller class names, view/component names
|
|
50
|
-
- **Library**: exported type/class/interface names
|
|
51
|
-
- **CLI**: subcommand names, top-level argument names
|
|
52
|
-
- **Data pipeline**: job names, queue names, event types
|
|
53
|
-
- **Serverless**: function names, event source names
|
|
54
|
-
|
|
55
|
-
Universal signals (any shape):
|
|
56
|
-
- Type/class/struct/interface definitions with noun names
|
|
57
|
-
- Database table/model names (migrations, `schema.prisma`, `models/`, SQL files)
|
|
58
|
-
- Top-level module/folder names that are nouns
|
|
59
|
-
- README/docs that state purpose ("we manage X for Y")
|
|
60
|
-
|
|
61
|
-
### Step 3: Filter
|
|
62
|
-
|
|
63
|
-
Drop without showing:
|
|
64
|
-
- Generic: `utils`, `helpers`, `common`, `base`, `lib`, `core`, `misc`, `types`, `models`, `helpers`, `shared`, `internal`, `errors`, `tests`
|
|
65
|
-
- Single-letter or unexpanded acronym: `T`, `M`, `VM`, `DTO` (unless defined in code)
|
|
66
|
-
- Already-defined terms in existing `CONTEXT.md` (merge mode)
|
|
67
|
-
- Framework-required boilerplate: `App`, `Server`, `Router`, `Config`
|
|
68
|
-
|
|
69
|
-
Keep candidates that:
|
|
70
|
-
- Appear in 2+ distinct files OR
|
|
71
|
-
- Appear in 1 file but are central (entry point, root config, README)
|
|
72
|
-
- Are domain nouns (Account, Order, Tenant, Invoice) over technical nouns (Worker, Queue)
|
|
73
|
-
|
|
74
|
-
### Step 4: Score and rank
|
|
75
|
-
|
|
76
|
-
For each kept candidate, count:
|
|
77
|
-
- Type/def files where it appears
|
|
78
|
-
- Route/file references
|
|
79
|
-
- DB schema references
|
|
80
|
-
|
|
81
|
-
Take the top 5-12. Show the count in the proposal so the user can judge.
|
|
82
|
-
|
|
83
|
-
## ADR gate
|
|
84
|
-
|
|
85
|
-
Propose an ADR only if ALL:
|
|
86
|
-
- You can point at code: a single pattern/import/module used across N+ files
|
|
87
|
-
- The pattern is not obvious from the framework (e.g. "uses Express" is obvious, "all errors go through `Result<T, AppError>`" is not)
|
|
88
|
-
- A reasonable engineer would be surprised to learn it from scratch
|
|
89
|
-
- It maps to `ADR-FORMAT.md` "Qualifies" criteria (hard to reverse, real trade-off)
|
|
90
|
-
|
|
91
|
-
Do NOT propose ADRs for:
|
|
92
|
-
- Framework defaults
|
|
93
|
-
- Single-file patterns
|
|
94
|
-
- Speculative "this might be a decision" guesses
|
|
95
|
-
- Anything where the README doesn't hint at reasoning
|
|
96
|
-
|
|
97
|
-
Cap at 0-2 ADRs per scaffold. Zero is fine. Better to ship no ADR than a wrong one.
|
|
98
|
-
|
|
99
|
-
## MUST
|
|
100
|
-
|
|
101
|
-
- Ask confirm before writing `CONTEXT.md` (show full proposed list + diff against existing)
|
|
102
|
-
- Ask confirm per ADR before writing
|
|
103
|
-
- Never overwrite non-empty `CONTEXT.md` without explicit "replace"
|
|
104
|
-
- Never invent cross-cutting decisions; only propose ADRs you can point at code
|
|
105
|
-
- Keep `CONTEXT.md` glossary-only; no impl/spec notes
|
|
106
|
-
- Use `ADR-FORMAT.md` for any proposed ADR (template + numbering)
|
|
107
|
-
- Report file paths and section headers at the end
|
|
108
|
-
- In merge mode, append new terms below existing ones; do not reorder
|
|
109
|
-
|
|
110
|
-
## Context economy
|
|
111
|
-
|
|
112
|
-
Before broad reads, locate candidates with `list_files`, `search_files`, or `codebase_search`.
|
|
113
|
-
|
|
114
|
-
Prefer targeted `read_file` ranges or block reads once the candidate area is known.
|
|
115
|
-
|
|
116
|
-
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
117
|
-
|
|
118
|
-
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
119
|
-
|
|
120
|
-
## Output shape (for the inline confirm step)
|
|
121
|
-
|
|
122
|
-
```
|
|
123
|
-
## Proposed CONTEXT.md entries (N)
|
|
124
|
-
|
|
125
|
-
1. **Account** — a tenant-scoped record of a customer relationship.
|
|
126
|
-
Evidence: 12 type defs, 4 routes, 1 DB table.
|
|
127
|
-
2. **Order** — a request to purchase one or more SKUs.
|
|
128
|
-
Evidence: 8 type defs, 3 routes, 1 DB table.
|
|
129
|
-
...
|
|
130
|
-
|
|
131
|
-
Confirm? (yes / edit / cancel)
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
```
|
|
135
|
-
## Proposed ADR (1 of N)
|
|
136
|
-
|
|
137
|
-
# Use Result type for all fallible operations
|
|
138
|
-
|
|
139
|
-
We use a Rust-style `Result<T, AppError>` for all operations that can
|
|
140
|
-
fail, instead of throwing exceptions. This is enforced by a linter
|
|
141
|
-
rule and visible in every service module.
|
|
142
|
-
|
|
143
|
-
Considered Options:
|
|
144
|
-
- Exceptions
|
|
145
|
-
- Error codes (Go-style)
|
|
146
|
-
- Result type (chosen)
|
|
147
|
-
|
|
148
|
-
Consequences: easier to reason about error paths; verbose for happy
|
|
149
|
-
paths.
|
|
150
|
-
|
|
151
|
-
Confirm? (yes / edit / cancel)
|
|
152
|
-
```
|
|
1
|
+
---
|
|
2
|
+
name: scaffold-context
|
|
3
|
+
description: Bootstrap .zoo-flow/CONTEXT.md from an existing codebase by detecting project shape and scanning for domain terms and cross-cutting decisions. Proposes 5-12 terms + 0-2 ADRs, asks for confirm before writing. Use on projects with no CONTEXT.md, or to expand a thin one.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Scaffold Context
|
|
7
|
+
|
|
8
|
+
## Loop
|
|
9
|
+
|
|
10
|
+
1. Read existing context via slot discovery rule (see `CONTEXT-FORMAT.md`).
|
|
11
|
+
2. Detect project shape (see Detection).
|
|
12
|
+
3. Scan codebase for terms (see Detection).
|
|
13
|
+
4. Propose 5-12 terms with one-line definitions + evidence (file:line counts).
|
|
14
|
+
5. Show inline, ask: confirm / edit / cancel.
|
|
15
|
+
6. On confirm, write to `.zoo-flow/CONTEXT.md` (preserve any existing entries in merge mode).
|
|
16
|
+
7. If 1-2 cross-cutting decisions are visible in code, propose ADRs (see ADR gate).
|
|
17
|
+
8. Show ADR draft(s) inline, ask confirm per ADR.
|
|
18
|
+
9. On confirm, write to `.zoo-flow/docs/adr/NNNN-slug.md` using `ADR-FORMAT.md` numbering.
|
|
19
|
+
10. Report what was written, with file paths.
|
|
20
|
+
|
|
21
|
+
## Detection
|
|
22
|
+
|
|
23
|
+
### Step 1: Detect project shape
|
|
24
|
+
|
|
25
|
+
Inspect (in order):
|
|
26
|
+
- `package.json` `keywords`, `name`, `scripts` (Node/JS)
|
|
27
|
+
- `pyproject.toml` / `setup.py` / `setup.cfg` (Python)
|
|
28
|
+
- `Cargo.toml` (Rust)
|
|
29
|
+
- `go.mod` (Go)
|
|
30
|
+
- Top-level folder names
|
|
31
|
+
- `README.md` first paragraph
|
|
32
|
+
|
|
33
|
+
Pick the dominant shape:
|
|
34
|
+
|
|
35
|
+
| Signal folders / files | Shape | Priority sources for terms |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| `app/`, `pages/`, `routes/`, `controllers/`, `api/` | web app | API routes, page names, URL paths, model types |
|
|
38
|
+
| `lib/`, `pkg/`, `src/` (no `app/`) | library | exported types, public API surface |
|
|
39
|
+
| `cmd/`, `bin/`, `commands/`, `cli/` | CLI tool | subcommand names, flag names |
|
|
40
|
+
| `workers/`, `jobs/`, `tasks/`, `etl/`, `pipelines/` | data pipeline | job/queue/event names |
|
|
41
|
+
| `services/`, `lambda/`, `functions/`, `handlers/` | serverless | function names, event sources, triggers |
|
|
42
|
+
| `services/` + `web/` + `workers/` | monorepo | treat each top-level as a sub-shape; ask user if unclear |
|
|
43
|
+
|
|
44
|
+
If signals are mixed, prefer the shape that owns the entry point (`main.*`, `index.*`, `server.*`).
|
|
45
|
+
|
|
46
|
+
### Step 2: Extract candidate terms
|
|
47
|
+
|
|
48
|
+
For the chosen shape, prefer:
|
|
49
|
+
- **Web app**: route paths (`/accounts/:id`), controller class names, view/component names
|
|
50
|
+
- **Library**: exported type/class/interface names
|
|
51
|
+
- **CLI**: subcommand names, top-level argument names
|
|
52
|
+
- **Data pipeline**: job names, queue names, event types
|
|
53
|
+
- **Serverless**: function names, event source names
|
|
54
|
+
|
|
55
|
+
Universal signals (any shape):
|
|
56
|
+
- Type/class/struct/interface definitions with noun names
|
|
57
|
+
- Database table/model names (migrations, `schema.prisma`, `models/`, SQL files)
|
|
58
|
+
- Top-level module/folder names that are nouns
|
|
59
|
+
- README/docs that state purpose ("we manage X for Y")
|
|
60
|
+
|
|
61
|
+
### Step 3: Filter
|
|
62
|
+
|
|
63
|
+
Drop without showing:
|
|
64
|
+
- Generic: `utils`, `helpers`, `common`, `base`, `lib`, `core`, `misc`, `types`, `models`, `helpers`, `shared`, `internal`, `errors`, `tests`
|
|
65
|
+
- Single-letter or unexpanded acronym: `T`, `M`, `VM`, `DTO` (unless defined in code)
|
|
66
|
+
- Already-defined terms in existing `CONTEXT.md` (merge mode)
|
|
67
|
+
- Framework-required boilerplate: `App`, `Server`, `Router`, `Config`
|
|
68
|
+
|
|
69
|
+
Keep candidates that:
|
|
70
|
+
- Appear in 2+ distinct files OR
|
|
71
|
+
- Appear in 1 file but are central (entry point, root config, README)
|
|
72
|
+
- Are domain nouns (Account, Order, Tenant, Invoice) over technical nouns (Worker, Queue)
|
|
73
|
+
|
|
74
|
+
### Step 4: Score and rank
|
|
75
|
+
|
|
76
|
+
For each kept candidate, count:
|
|
77
|
+
- Type/def files where it appears
|
|
78
|
+
- Route/file references
|
|
79
|
+
- DB schema references
|
|
80
|
+
|
|
81
|
+
Take the top 5-12. Show the count in the proposal so the user can judge.
|
|
82
|
+
|
|
83
|
+
## ADR gate
|
|
84
|
+
|
|
85
|
+
Propose an ADR only if ALL:
|
|
86
|
+
- You can point at code: a single pattern/import/module used across N+ files
|
|
87
|
+
- The pattern is not obvious from the framework (e.g. "uses Express" is obvious, "all errors go through `Result<T, AppError>`" is not)
|
|
88
|
+
- A reasonable engineer would be surprised to learn it from scratch
|
|
89
|
+
- It maps to `ADR-FORMAT.md` "Qualifies" criteria (hard to reverse, real trade-off)
|
|
90
|
+
|
|
91
|
+
Do NOT propose ADRs for:
|
|
92
|
+
- Framework defaults
|
|
93
|
+
- Single-file patterns
|
|
94
|
+
- Speculative "this might be a decision" guesses
|
|
95
|
+
- Anything where the README doesn't hint at reasoning
|
|
96
|
+
|
|
97
|
+
Cap at 0-2 ADRs per scaffold. Zero is fine. Better to ship no ADR than a wrong one.
|
|
98
|
+
|
|
99
|
+
## MUST
|
|
100
|
+
|
|
101
|
+
- Ask confirm before writing `CONTEXT.md` (show full proposed list + diff against existing)
|
|
102
|
+
- Ask confirm per ADR before writing
|
|
103
|
+
- Never overwrite non-empty `CONTEXT.md` without explicit "replace"
|
|
104
|
+
- Never invent cross-cutting decisions; only propose ADRs you can point at code
|
|
105
|
+
- Keep `CONTEXT.md` glossary-only; no impl/spec notes
|
|
106
|
+
- Use `ADR-FORMAT.md` for any proposed ADR (template + numbering)
|
|
107
|
+
- Report file paths and section headers at the end
|
|
108
|
+
- In merge mode, append new terms below existing ones; do not reorder
|
|
109
|
+
|
|
110
|
+
## Context economy
|
|
111
|
+
|
|
112
|
+
Before broad reads, locate candidates with `list_files`, `search_files`, or `codebase_search`.
|
|
113
|
+
|
|
114
|
+
Prefer targeted `read_file` ranges or block reads once the candidate area is known.
|
|
115
|
+
|
|
116
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
117
|
+
|
|
118
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
119
|
+
|
|
120
|
+
## Output shape (for the inline confirm step)
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
## Proposed CONTEXT.md entries (N)
|
|
124
|
+
|
|
125
|
+
1. **Account** — a tenant-scoped record of a customer relationship.
|
|
126
|
+
Evidence: 12 type defs, 4 routes, 1 DB table.
|
|
127
|
+
2. **Order** — a request to purchase one or more SKUs.
|
|
128
|
+
Evidence: 8 type defs, 3 routes, 1 DB table.
|
|
129
|
+
...
|
|
130
|
+
|
|
131
|
+
Confirm? (yes / edit / cancel)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
## Proposed ADR (1 of N)
|
|
136
|
+
|
|
137
|
+
# Use Result type for all fallible operations
|
|
138
|
+
|
|
139
|
+
We use a Rust-style `Result<T, AppError>` for all operations that can
|
|
140
|
+
fail, instead of throwing exceptions. This is enforced by a linter
|
|
141
|
+
rule and visible in every service module.
|
|
142
|
+
|
|
143
|
+
Considered Options:
|
|
144
|
+
- Exceptions
|
|
145
|
+
- Error codes (Go-style)
|
|
146
|
+
- Result type (chosen)
|
|
147
|
+
|
|
148
|
+
Consequences: easier to reason about error paths; verbose for happy
|
|
149
|
+
paths.
|
|
150
|
+
|
|
151
|
+
Confirm? (yes / edit / cancel)
|
|
152
|
+
```
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: to-prd
|
|
3
|
-
description: Turn the current conversation context into a PRD and publish it to the project issue tracker. Use when user wants to create a PRD from the current context.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# To PRD
|
|
7
|
-
|
|
8
|
-
Issue tracker + label vocabulary should exist; run `/setup-matt-pocock-skills` if missing.
|
|
9
|
-
|
|
10
|
-
RULE: Do not interview user. Synthesize current context.
|
|
11
|
-
|
|
12
|
-
## Process
|
|
13
|
-
|
|
14
|
-
1. Explore repo if needed; use glossary; respect ADRs.
|
|
15
|
-
2. Sketch test
|
|
16
|
-
3. Check with user
|
|
17
|
-
4. Write PRD.
|
|
18
|
-
5. Publish to issue tracker.
|
|
19
|
-
6. Apply `ready-for-agent`.
|
|
20
|
-
|
|
21
|
-
## PRD template
|
|
22
|
-
|
|
23
|
-
```markdown
|
|
24
|
-
## Problem Statement
|
|
25
|
-
|
|
26
|
-
{user-facing problem}
|
|
27
|
-
|
|
28
|
-
## Solution
|
|
29
|
-
|
|
30
|
-
{user-facing solution}
|
|
31
|
-
|
|
32
|
-
## User Stories
|
|
33
|
-
|
|
34
|
-
1. As a {actor}, I want {feature}, so that {benefit}
|
|
35
|
-
|
|
36
|
-
## Implementation Decisions
|
|
37
|
-
|
|
38
|
-
- Modules/interfaces changed.
|
|
39
|
-
- Technical clarifications.
|
|
40
|
-
- Architecture/schema/API/contracts/interactions.
|
|
41
|
-
- No file paths.
|
|
42
|
-
- Prototype snippets allowed only if decision-rich and trimmed.
|
|
43
|
-
|
|
44
|
-
## Testing Decisions
|
|
45
|
-
|
|
46
|
-
- Good tests verify external behaviour, not implementation.
|
|
47
|
-
- Seams to test; prefer existing/highest seam.
|
|
48
|
-
- Similar tests/prior art.
|
|
49
|
-
|
|
50
|
-
## Out of Scope
|
|
51
|
-
|
|
52
|
-
{excluded work}
|
|
53
|
-
|
|
54
|
-
## Further Notes
|
|
55
|
-
|
|
56
|
-
{other notes}
|
|
57
|
-
```
|
|
1
|
+
---
|
|
2
|
+
name: to-prd
|
|
3
|
+
description: Turn the current conversation context into a PRD and publish it to the project issue tracker. Use when user wants to create a PRD from the current context.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# To PRD
|
|
7
|
+
|
|
8
|
+
Issue tracker + label vocabulary should exist; run `/setup-matt-pocock-skills` if missing.
|
|
9
|
+
|
|
10
|
+
RULE: Do not interview user. Synthesize current context.
|
|
11
|
+
|
|
12
|
+
## Process
|
|
13
|
+
|
|
14
|
+
1. Explore repo if needed; use glossary; respect ADRs.
|
|
15
|
+
2. Sketch out the seams at which you're going to test the feature. Existing seams should be preferred to new ones. Use the highest seam possible. If new seams are needed, propose them at the highest point you can.
|
|
16
|
+
3. Check with the user that these seams match their expectations.
|
|
17
|
+
4. Write PRD.
|
|
18
|
+
5. Publish to issue tracker.
|
|
19
|
+
6. Apply `ready-for-agent`.
|
|
20
|
+
|
|
21
|
+
## PRD template
|
|
22
|
+
|
|
23
|
+
```markdown
|
|
24
|
+
## Problem Statement
|
|
25
|
+
|
|
26
|
+
{user-facing problem}
|
|
27
|
+
|
|
28
|
+
## Solution
|
|
29
|
+
|
|
30
|
+
{user-facing solution}
|
|
31
|
+
|
|
32
|
+
## User Stories
|
|
33
|
+
|
|
34
|
+
1. As a {actor}, I want {feature}, so that {benefit}
|
|
35
|
+
|
|
36
|
+
## Implementation Decisions
|
|
37
|
+
|
|
38
|
+
- Modules/interfaces changed.
|
|
39
|
+
- Technical clarifications.
|
|
40
|
+
- Architecture/schema/API/contracts/interactions.
|
|
41
|
+
- No file paths.
|
|
42
|
+
- Prototype snippets allowed only if decision-rich and trimmed.
|
|
43
|
+
|
|
44
|
+
## Testing Decisions
|
|
45
|
+
|
|
46
|
+
- Good tests verify external behaviour, not implementation.
|
|
47
|
+
- Seams to test; prefer existing/highest seam.
|
|
48
|
+
- Similar tests/prior art.
|
|
49
|
+
|
|
50
|
+
## Out of Scope
|
|
51
|
+
|
|
52
|
+
{excluded work}
|
|
53
|
+
|
|
54
|
+
## Further Notes
|
|
55
|
+
|
|
56
|
+
{other notes}
|
|
57
|
+
```
|