@fernado03/zoo-flow 0.5.2 → 0.7.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.
- package/README.md +105 -90
- package/bin/zoo-flow.js +405 -56
- package/docs/architecture.md +380 -0
- package/docs/bloat-control.md +49 -0
- package/docs/command-design.md +38 -0
- package/docs/command-flow.md +133 -0
- package/docs/comparison.md +86 -0
- package/docs/context-packs.md +35 -0
- package/docs/dogfood/01-small-library.md +28 -0
- package/docs/dogfood/02-web-app.md +29 -0
- package/docs/dogfood/03-mixed-monorepo.md +29 -0
- package/docs/mode-rules.md +86 -0
- package/docs/npm-publishing.md +79 -0
- package/docs/out-of-scope/mainstream-issue-trackers-only.md +25 -0
- package/docs/out-of-scope/question-limits.md +18 -0
- package/docs/out-of-scope/setup-skill-verify-mode.md +15 -0
- package/docs/overview.md +61 -0
- package/docs/philosophy.md +73 -0
- package/docs/quality-scorecard.md +23 -0
- package/docs/skill-maintenance.md +32 -0
- package/docs/skills-index.md +61 -0
- package/docs/team-mode.md +46 -0
- package/docs/token-budget.md +22 -0
- package/docs/troubleshooting.md +288 -0
- package/examples/demo-transcripts/01-small-tweak.md +37 -0
- package/examples/demo-transcripts/02-unknown-bug-fix.md +37 -0
- package/examples/demo-transcripts/03-new-feature.md +37 -0
- package/examples/demo-transcripts/04-refactor.md +37 -0
- package/examples/demo-transcripts/05-review-and-verify.md +37 -0
- package/examples/feature-flow.md +117 -0
- package/examples/fix-flow.md +139 -0
- package/package.json +16 -5
- package/quality/scorecard.json +88 -0
- package/quality/token-budget.exceptions.json +13 -0
- package/scripts/bundle.ps1 +135 -0
- package/scripts/check-golden-transcripts.js +69 -0
- package/scripts/check-package-links.js +72 -0
- package/scripts/check-package-manifest.js +70 -0
- package/scripts/eval-routing.js +149 -0
- package/scripts/score-quality.js +292 -0
- package/scripts/test-doctor.js +107 -0
- package/scripts/test-project-shapes.js +99 -0
- package/scripts/token-budget.js +105 -0
- package/templates/full/.roo/commands/caveman.md +1 -1
- package/templates/full/.roo/commands/diagnose.md +2 -1
- package/templates/full/.roo/commands/explore.md +13 -13
- package/templates/full/.roo/commands/feature.md +1 -1
- package/templates/full/.roo/commands/fix.md +1 -1
- package/templates/full/.roo/commands/grill-me.md +2 -1
- package/templates/full/.roo/commands/grill-with-docs.md +2 -1
- package/templates/full/.roo/commands/handoff.md +2 -1
- package/templates/full/.roo/commands/improve-codebase-architecture.md +2 -1
- package/templates/full/.roo/commands/prototype.md +1 -1
- package/templates/full/.roo/commands/refactor.md +1 -1
- package/templates/full/.roo/commands/review.md +11 -0
- 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/tdd.md +1 -1
- package/templates/full/.roo/commands/to-issues.md +2 -1
- package/templates/full/.roo/commands/to-prd.md +2 -1
- package/templates/full/.roo/commands/triage.md +1 -1
- package/templates/full/.roo/commands/tweak.md +1 -1
- package/templates/full/.roo/commands/update-docs.md +22 -22
- package/templates/full/.roo/commands/verify.md +11 -0
- package/templates/full/.roo/commands/write-a-skill.md +2 -1
- package/templates/full/.roo/commands/zoom-out.md +2 -1
- package/templates/full/.roo/rules/01-command-protocol.md +1 -1
- package/templates/full/.roo/rules/04-context-economy.md +27 -29
- package/templates/full/.roo/rules-code-tweaker/01-completion.md +12 -8
- package/templates/full/.roo/rules-custom-orchestrator/00-routing.md +77 -63
- package/templates/full/.roo/rules-custom-orchestrator/01-delegation-message.md +59 -55
- package/templates/full/.roo/rules-system-architect/02-completion.md +6 -2
- package/templates/full/.roo/skills/engineering/README.md +2 -0
- package/templates/full/.roo/skills/engineering/commit-and-document/SKILL.md +1 -2
- package/templates/full/.roo/skills/engineering/grill-with-docs/ADR-FORMAT.md +1 -1
- package/templates/full/.roo/skills/engineering/grill-with-docs/CONTEXT-FORMAT.md +36 -61
- package/templates/full/.roo/skills/engineering/grill-with-docs/SKILL.md +1 -1
- package/templates/full/.roo/skills/engineering/improve-codebase-architecture/SKILL.md +3 -3
- package/templates/full/.roo/skills/engineering/prototype/SKILL.md +37 -37
- package/templates/full/.roo/skills/engineering/review/SKILL.md +111 -0
- package/templates/full/.roo/skills/engineering/scaffold-context/SKILL.md +218 -152
- package/templates/full/.roo/skills/engineering/scaffold-context/templates/writing-patterns.md +17 -0
- package/templates/full/.roo/skills/engineering/setup-matt-pocock-skills/SKILL.md +3 -3
- package/templates/full/.roo/skills/engineering/setup-matt-pocock-skills/domain.md +2 -3
- package/templates/full/.roo/skills/engineering/tdd/SKILL.md +2 -0
- package/templates/full/.roo/skills/engineering/to-prd/SKILL.md +57 -57
- package/templates/full/.roo/skills/engineering/tweak/SKILL.md +2 -1
- package/templates/full/.roo/skills/engineering/verify/SKILL.md +80 -0
- package/templates/full/.roo/skills/in-progress/README.md +0 -1
- 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 -24
- package/templates/full/.zoo-flow/evals/routing-cases.jsonl +20 -0
- package/templates/full/.zoo-flow/evals/routing-cases.md +213 -189
- package/templates/full/.zoo-flow/project-profile.json +24 -0
- package/tests/fixtures/bad-routing-cases/bad-json.jsonl +1 -0
- package/tests/fixtures/bad-routing-cases/bad-mode.jsonl +1 -0
- package/tests/fixtures/bad-routing-cases/missing-command.jsonl +1 -0
- package/tests/fixtures/doctor/bad-built-in-delegation/fixture.json +1 -0
- package/tests/fixtures/doctor/bad-mode-slug/fixture.json +1 -0
- package/tests/fixtures/doctor/bad-skill-wrapper/fixture.json +1 -0
- package/tests/fixtures/doctor/bad-zoo-path/fixture.json +1 -0
- package/tests/fixtures/doctor/helper-missing-mode/fixture.json +1 -0
- package/tests/fixtures/doctor/helper-not-permitted/fixture.json +1 -0
- package/tests/fixtures/doctor/manual-good-template/fixture.json +1 -0
- package/tests/fixtures/doctor/missing-command/fixture.json +1 -0
- package/tests/fixtures/doctor/missing-roomodes/fixture.json +1 -0
- package/tests/fixtures/doctor/missing-skill/fixture.json +1 -0
- package/tests/fixtures/project-shapes/cli-tool/cmd/root.go +1 -0
- package/tests/fixtures/project-shapes/cli-tool/fixture.json +1 -0
- package/tests/fixtures/project-shapes/cli-tool/package.json +1 -0
- package/tests/fixtures/project-shapes/data-pipeline/fixture.json +1 -0
- package/tests/fixtures/project-shapes/data-pipeline/pipelines/invoices.py +1 -0
- package/tests/fixtures/project-shapes/data-pipeline/pyproject.toml +2 -0
- package/tests/fixtures/project-shapes/library/fixture.json +1 -0
- package/tests/fixtures/project-shapes/library/package.json +1 -0
- package/tests/fixtures/project-shapes/library/src/index.ts +1 -0
- package/tests/fixtures/project-shapes/monorepo/fixture.json +1 -0
- package/tests/fixtures/project-shapes/monorepo/package.json +1 -0
- package/tests/fixtures/project-shapes/monorepo/packages/core/index.ts +1 -0
- package/tests/fixtures/project-shapes/monorepo/packages/web/index.ts +1 -0
- package/tests/fixtures/project-shapes/serverless/fixture.json +1 -0
- package/tests/fixtures/project-shapes/serverless/functions/webhook.ts +1 -0
- package/tests/fixtures/project-shapes/serverless/package.json +1 -0
- package/tests/fixtures/project-shapes/web-app/app/routes/index.tsx +1 -0
- package/tests/fixtures/project-shapes/web-app/fixture.json +1 -0
- package/tests/fixtures/project-shapes/web-app/package.json +1 -0
- package/tests/golden-transcripts/01-small-tweak-golden.md +21 -0
- package/tests/golden-transcripts/02-diagnosis-golden.md +26 -0
- package/tests/golden-transcripts/03-verification-golden.md +24 -0
- package/tests/golden-transcripts/04-review-golden.md +26 -0
- package/tests/golden-transcripts/05-feature-planning-golden.md +23 -0
- package/templates/full/.roo/skills/in-progress/review/SKILL.md +0 -39
|
@@ -1,152 +1,218 @@
|
|
|
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
|
-
##
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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
|
+
## Context-pack selector
|
|
100
|
+
|
|
101
|
+
After detecting project shape and proposing CONTEXT.md terms + ADRs, recommend the smallest useful set of optional context docs.
|
|
102
|
+
|
|
103
|
+
Rules:
|
|
104
|
+
|
|
105
|
+
- Templates live under `.roo/skills/engineering/scaffold-context/templates/` (candidates only, never installed by default).
|
|
106
|
+
- Missing optional docs are **not an error**.
|
|
107
|
+
- Recommend a doc only when code evidence shows it would change future agent behavior.
|
|
108
|
+
- Prefer one compact doc over many thin docs.
|
|
109
|
+
- Better to create zero optional docs than wrong docs.
|
|
110
|
+
- Ask for confirmation before writing any optional doc.
|
|
111
|
+
|
|
112
|
+
Consider optional docs only with code evidence:
|
|
113
|
+
|
|
114
|
+
| Doc | When to recommend |
|
|
115
|
+
|---|---|
|
|
116
|
+
| `TESTING.md` | unusual verification setup, multiple test layers, important seams |
|
|
117
|
+
| `DATA_MODEL.md` | schemas, lifecycle states, ownership, migrations visible in code |
|
|
118
|
+
| `API_CONTRACTS.md` | public routes, SDK exports, webhooks, event payloads |
|
|
119
|
+
| `RUNBOOK.md` | deploys, jobs, queues, cron, recovery procedures |
|
|
120
|
+
| `SECURITY_NOTES.md` | auth, permissions, tenant isolation, secrets, payments |
|
|
121
|
+
| `INTEGRATIONS.md` | third-party APIs, OAuth, Stripe, email, queues, LLM providers |
|
|
122
|
+
| `MONOREPO_MAP.md` | multiple apps/packages/services with different responsibilities |
|
|
123
|
+
|
|
124
|
+
### Output shape
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
## Suggested context pack
|
|
128
|
+
|
|
129
|
+
Detected shape: <shape>
|
|
130
|
+
|
|
131
|
+
Recommended:
|
|
132
|
+
1. `.zoo-flow/CONTEXT.md`
|
|
133
|
+
Reason: repeated domain terms found.
|
|
134
|
+
2. `.zoo-flow/DATA_MODEL.md`
|
|
135
|
+
Reason: schema migration logic found in 4 files.
|
|
136
|
+
|
|
137
|
+
Maybe:
|
|
138
|
+
1. `.zoo-flow/SECURITY_NOTES.md`
|
|
139
|
+
Reason: auth middleware exists, but permission model appears simple.
|
|
140
|
+
|
|
141
|
+
Skipped:
|
|
142
|
+
- `RUNBOOK.md` — no deployment or operational recovery surface found.
|
|
143
|
+
- `DATA_MODEL.md` — schema is simple; terms fit in CONTEXT.md.
|
|
144
|
+
|
|
145
|
+
Choose:
|
|
146
|
+
1. Create recommended only
|
|
147
|
+
2. Choose manually
|
|
148
|
+
3. Cancel
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Selection matrix by shape
|
|
152
|
+
|
|
153
|
+
| Shape | Likely recommended | Likely maybe | Likely skipped |
|
|
154
|
+
|---|---|---|---|
|
|
155
|
+
| web app | CONTEXT.md | SECURITY_NOTES.md, INTEGRATIONS.md | RUNBOOK.md, MONOREPO_MAP.md |
|
|
156
|
+
| library | CONTEXT.md, API_CONTRACTS.md | TESTING.md | RUNBOOK.md, MONOREPO_MAP.md |
|
|
157
|
+
| CLI tool | CONTEXT.md | RUNBOOK.md | DATA_MODEL.md, MONOREPO_MAP.md |
|
|
158
|
+
| data pipeline | CONTEXT.md, DATA_MODEL.md | RUNBOOK.md | API_CONTRACTS.md |
|
|
159
|
+
| serverless | CONTEXT.md, INTEGRATIONS.md | SECURITY_NOTES.md | MONOREPO_MAP.md |
|
|
160
|
+
| monorepo | CONTEXT.md, MONOREPO_MAP.md | INTEGRATIONS.md, API_CONTRACTS.md | RUNBOOK.md |
|
|
161
|
+
|
|
162
|
+
Do not let this selector delay the core CONTEXT.md + ADR proposal. Present the pack selection after the main confirm flow.
|
|
163
|
+
|
|
164
|
+
## MUST
|
|
165
|
+
|
|
166
|
+
- Ask confirm before writing `CONTEXT.md` (show full proposed list + diff against existing)
|
|
167
|
+
- Ask confirm per ADR before writing
|
|
168
|
+
- Ask confirm per optional doc before writing
|
|
169
|
+
- Never overwrite non-empty `CONTEXT.md` without explicit "replace"
|
|
170
|
+
- Never invent cross-cutting decisions; only propose ADRs you can point at code
|
|
171
|
+
- Keep `CONTEXT.md` glossary-only; no impl/spec notes
|
|
172
|
+
- Use `ADR-FORMAT.md` for any proposed ADR (template + numbering)
|
|
173
|
+
- Report file paths and section headers at the end
|
|
174
|
+
- In merge mode, append new terms below existing ones; do not reorder
|
|
175
|
+
|
|
176
|
+
## Context economy
|
|
177
|
+
|
|
178
|
+
Before broad reads, locate candidates with `list_files`, `search_files`, or `codebase_search`.
|
|
179
|
+
|
|
180
|
+
Prefer targeted `read_file` ranges or block reads once the candidate area is known.
|
|
181
|
+
|
|
182
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
183
|
+
|
|
184
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
185
|
+
|
|
186
|
+
## Output shape (for the inline confirm step)
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
## Proposed CONTEXT.md entries (N)
|
|
190
|
+
|
|
191
|
+
1. **Account** — a tenant-scoped record of a customer relationship.
|
|
192
|
+
Evidence: 12 type defs, 4 routes, 1 DB table.
|
|
193
|
+
2. **Order** — a request to purchase one or more SKUs.
|
|
194
|
+
Evidence: 8 type defs, 3 routes, 1 DB table.
|
|
195
|
+
...
|
|
196
|
+
|
|
197
|
+
Confirm? (yes / edit / cancel)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
## Proposed ADR (1 of N)
|
|
202
|
+
|
|
203
|
+
# Use Result type for all fallible operations
|
|
204
|
+
|
|
205
|
+
We use a Rust-style `Result<T, AppError>` for all operations that can
|
|
206
|
+
fail, instead of throwing exceptions. This is enforced by a linter
|
|
207
|
+
rule and visible in every service module.
|
|
208
|
+
|
|
209
|
+
Considered Options:
|
|
210
|
+
- Exceptions
|
|
211
|
+
- Error codes (Go-style)
|
|
212
|
+
- Result type (chosen)
|
|
213
|
+
|
|
214
|
+
Consequences: easier to reason about error paths; verbose for happy
|
|
215
|
+
paths.
|
|
216
|
+
|
|
217
|
+
Confirm? (yes / edit / cancel)
|
|
218
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: writing-patterns
|
|
3
|
+
description: "Optional context pack for writing/editorial projects. Adds shapes, beats, and fragments skills for structured content creation."
|
|
4
|
+
selector: project-shape
|
|
5
|
+
match-keywords: ["writing", "content", "editorial", "blog", "documentation", "docs-site"]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Writing Patterns Context Pack
|
|
9
|
+
|
|
10
|
+
This pack adds structured writing workflows:
|
|
11
|
+
|
|
12
|
+
- **Shapes** — reusable content architecture templates
|
|
13
|
+
- **Beats** — narrative/argument sequencing patterns
|
|
14
|
+
- **Fragments** — reusable content components
|
|
15
|
+
|
|
16
|
+
None of these are activated by default. Run `/scaffold-context` and
|
|
17
|
+
select "writing-patterns" to install.
|
|
@@ -14,8 +14,8 @@ Read/check:
|
|
|
14
14
|
1. `git remote -v` + `.git/config`.
|
|
15
15
|
2. Root `AGENTS.md`, `CLAUDE.md`.
|
|
16
16
|
3. Existing `## Agent skills` blocks.
|
|
17
|
-
4.
|
|
18
|
-
5.
|
|
17
|
+
4. `.zoo-flow/CONTEXT.md`.
|
|
18
|
+
5. `.zoo-flow/docs/adr/`.
|
|
19
19
|
6. `docs/agents/`.
|
|
20
20
|
7. `.scratch/`.
|
|
21
21
|
|
|
@@ -33,7 +33,7 @@ B. Triage labels:
|
|
|
33
33
|
|
|
34
34
|
C. Domain docs:
|
|
35
35
|
- Explain: skills read `CONTEXT.md` + ADRs.
|
|
36
|
-
- Choices: single-context
|
|
36
|
+
- Choices: single-context `.zoo-flow/CONTEXT.md` + `.zoo-flow/docs/adr/`; multi-context index → per-context docs.
|
|
37
37
|
|
|
38
38
|
## Confirm before write
|
|
39
39
|
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
## Read before work
|
|
4
4
|
|
|
5
5
|
If present:
|
|
6
|
-
1.
|
|
7
|
-
2.
|
|
8
|
-
3. If multi-context, relevant `src/{context}/docs/adr/`.
|
|
6
|
+
1. `.zoo-flow/CONTEXT.md`.
|
|
7
|
+
2. `.zoo-flow/docs/adr/` ADRs.
|
|
9
8
|
|
|
10
9
|
If missing, proceed silently.
|
|
11
10
|
|
|
@@ -50,6 +50,8 @@ Checklist per cycle:
|
|
|
50
50
|
- [ ] Code minimal.
|
|
51
51
|
- [ ] No speculation.
|
|
52
52
|
|
|
53
|
+
After green, suggest `/verify`, then `/review`, then `/commit-and-document` for non-trivial work. Do not auto-launch follow-up commands.
|
|
54
|
+
|
|
53
55
|
## Context economy
|
|
54
56
|
|
|
55
57
|
Before broad reads, locate relevant files/symbols with `list_files`, `search_files`, or `codebase_search`.
|
|
@@ -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 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
|
-
```
|
|
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
|
+
```
|
|
@@ -14,7 +14,8 @@ Use for small known fixes.
|
|
|
14
14
|
5. If existing test covers touched area, run it.
|
|
15
15
|
6. DO NOT write new tests unless asked.
|
|
16
16
|
7. Confirm change.
|
|
17
|
-
8.
|
|
17
|
+
8. For R3+ risk, suggest `/verify` or `/review` before commit. Otherwise offer `/commit-and-document` only after user satisfied.
|
|
18
|
+
9. Do not auto-launch follow-up commands.
|
|
18
19
|
|
|
19
20
|
## Context economy
|
|
20
21
|
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verify
|
|
3
|
+
description: Run the smallest useful checks for the current change and report exactly what passed, failed, was partial, or was blocked.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Verify
|
|
7
|
+
|
|
8
|
+
Purpose: answer what checks actually passed. Never claim verified unless commands ran and passed.
|
|
9
|
+
|
|
10
|
+
## 1. Inspect project type
|
|
11
|
+
|
|
12
|
+
Look for obvious build/test config before choosing commands:
|
|
13
|
+
|
|
14
|
+
- `package.json`
|
|
15
|
+
- `pyproject.toml`
|
|
16
|
+
- `Cargo.toml`
|
|
17
|
+
- `go.mod`
|
|
18
|
+
- other build, lint, or test config in the changed area
|
|
19
|
+
|
|
20
|
+
## 2. Inspect changed files
|
|
21
|
+
|
|
22
|
+
Run:
|
|
23
|
+
|
|
24
|
+
- `git status --short`
|
|
25
|
+
- `git diff --stat`
|
|
26
|
+
- `git diff --cached --stat` when staged changes exist
|
|
27
|
+
|
|
28
|
+
## 3. Pick smallest useful checks first
|
|
29
|
+
|
|
30
|
+
Prefer, in order:
|
|
31
|
+
|
|
32
|
+
- targeted test for the changed area
|
|
33
|
+
- related test file
|
|
34
|
+
- typecheck
|
|
35
|
+
- lint
|
|
36
|
+
- build
|
|
37
|
+
- full test suite only when appropriate
|
|
38
|
+
|
|
39
|
+
Use package scripts and project conventions when available. If the user provides a command, prefer it unless unsafe.
|
|
40
|
+
|
|
41
|
+
## 4. Run checks
|
|
42
|
+
|
|
43
|
+
Run the chosen commands. Capture enough output to prove pass/fail without dumping noise.
|
|
44
|
+
|
|
45
|
+
If no verification command is available, report blocked.
|
|
46
|
+
|
|
47
|
+
## 5. Output format
|
|
48
|
+
|
|
49
|
+
```md
|
|
50
|
+
## Verification result
|
|
51
|
+
|
|
52
|
+
Status: pass | fail | partial | blocked
|
|
53
|
+
|
|
54
|
+
## Commands run
|
|
55
|
+
|
|
56
|
+
- `<command>` — pass/fail
|
|
57
|
+
|
|
58
|
+
## Evidence
|
|
59
|
+
|
|
60
|
+
<short summary of relevant output>
|
|
61
|
+
|
|
62
|
+
## Remaining risk
|
|
63
|
+
|
|
64
|
+
<what was not checked>
|
|
65
|
+
|
|
66
|
+
## Recommended next step
|
|
67
|
+
|
|
68
|
+
<none | /review | /tweak | /tdd | /fix | /commit-and-document>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Hard rule: never say `verified`, `all good`, or `tests pass` unless commands actually ran and passed.
|
|
72
|
+
|
|
73
|
+
If no checks are available, use:
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
Status: blocked
|
|
77
|
+
Reason: no verification command found
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Do not auto-launch any follow-up command.
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Draft skills. Excluded from plugin/top README until stable.
|
|
4
4
|
|
|
5
|
-
- **[review](./review/SKILL.md)** — Review diff on Standards + Spec axes.
|
|
6
5
|
- **[teach](./teach/SKILL.md)** — Stateful teaching workspace (mission, glossary, resources, learning records).
|
|
7
6
|
- **[writing-beats](./writing-beats/SKILL.md)** — Assemble article beat-by-beat.
|
|
8
7
|
- **[writing-fragments](./writing-fragments/SKILL.md)** — Capture raw writing fragments.
|