@fernado03/zoo-flow 0.11.3 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/bin/zoo-flow.js +25 -25
  2. package/package.json +1 -1
  3. package/templates/full/.roo/commands/{explore.md → zoo-explore.md} +18 -18
  4. package/templates/full/.roo/commands/{scaffold-context.md → zoo-scaffold-context.md} +16 -16
  5. package/templates/full/.roo/commands/{setup-matt-pocock-skills.md → zoo-setup-matt-pocock-skills.md} +7 -7
  6. package/templates/full/.roo/commands/{update-docs.md → zoo-update-docs.md} +22 -22
  7. package/templates/full/.roo/rules-custom-orchestrator/00-routing.md +22 -22
  8. package/templates/full/.roo/skills/engineering/commit-and-document/SKILL.md +163 -163
  9. package/templates/full/.roo/skills/engineering/diagnose/SKILL.md +3 -3
  10. package/templates/full/.roo/skills/engineering/grill-with-docs/SKILL.md +1 -1
  11. package/templates/full/.roo/skills/engineering/improve-codebase-architecture/SKILL.md +1 -1
  12. package/templates/full/.roo/skills/engineering/prototype/SKILL.md +47 -47
  13. package/templates/full/.roo/skills/engineering/review/SKILL.md +7 -7
  14. package/templates/full/.roo/skills/engineering/scaffold-context/SKILL.md +228 -228
  15. package/templates/full/.roo/skills/engineering/setup-matt-pocock-skills/SKILL.md +2 -2
  16. package/templates/full/.roo/skills/engineering/tdd/SKILL.md +1 -1
  17. package/templates/full/.roo/skills/engineering/to-issues/SKILL.md +2 -2
  18. package/templates/full/.roo/skills/engineering/to-prd/SKILL.md +66 -66
  19. package/templates/full/.roo/skills/engineering/triage/SKILL.md +2 -2
  20. package/templates/full/.roo/skills/engineering/tweak/SKILL.md +1 -1
  21. package/templates/full/.roo/skills/engineering/update-docs/SKILL.md +76 -76
  22. package/templates/full/.roo/skills/engineering/verify/SKILL.md +2 -2
  23. package/templates/full/.roo/skills/engineering/zoom-out/SKILL.md +1 -1
  24. package/templates/full/.roo/skills/productivity/caveman/SKILL.md +1 -1
  25. package/templates/full/.roo/skills/productivity/teach/SKILL.md +119 -119
  26. package/templates/full/.roomodes +3 -3
  27. /package/templates/claude-code/.claude/commands/{caveman.md → zoo-caveman.md} +0 -0
  28. /package/templates/claude-code/.claude/commands/{commit-and-document.md → zoo-commit-and-document.md} +0 -0
  29. /package/templates/claude-code/.claude/commands/{diagnose.md → zoo-diagnose.md} +0 -0
  30. /package/templates/claude-code/.claude/commands/{explore.md → zoo-explore.md} +0 -0
  31. /package/templates/claude-code/.claude/commands/{feature.md → zoo-feature.md} +0 -0
  32. /package/templates/claude-code/.claude/commands/{fix.md → zoo-fix.md} +0 -0
  33. /package/templates/claude-code/.claude/commands/{grill-me.md → zoo-grill-me.md} +0 -0
  34. /package/templates/claude-code/.claude/commands/{grill-with-docs.md → zoo-grill-with-docs.md} +0 -0
  35. /package/templates/claude-code/.claude/commands/{handoff.md → zoo-handoff.md} +0 -0
  36. /package/templates/claude-code/.claude/commands/{improve-codebase-architecture.md → zoo-improve-codebase-architecture.md} +0 -0
  37. /package/templates/claude-code/.claude/commands/{prototype.md → zoo-prototype.md} +0 -0
  38. /package/templates/claude-code/.claude/commands/{refactor.md → zoo-refactor.md} +0 -0
  39. /package/templates/claude-code/.claude/commands/{review.md → zoo-review.md} +0 -0
  40. /package/templates/claude-code/.claude/commands/{scaffold-context.md → zoo-scaffold-context.md} +0 -0
  41. /package/templates/claude-code/.claude/commands/{setup-matt-pocock-skills.md → zoo-setup-matt-pocock-skills.md} +0 -0
  42. /package/templates/claude-code/.claude/commands/{tdd.md → zoo-tdd.md} +0 -0
  43. /package/templates/claude-code/.claude/commands/{teach.md → zoo-teach.md} +0 -0
  44. /package/templates/claude-code/.claude/commands/{to-issues.md → zoo-to-issues.md} +0 -0
  45. /package/templates/claude-code/.claude/commands/{to-prd.md → zoo-to-prd.md} +0 -0
  46. /package/templates/claude-code/.claude/commands/{triage.md → zoo-triage.md} +0 -0
  47. /package/templates/claude-code/.claude/commands/{tweak.md → zoo-tweak.md} +0 -0
  48. /package/templates/claude-code/.claude/commands/{update-docs.md → zoo-update-docs.md} +0 -0
  49. /package/templates/claude-code/.claude/commands/{verify.md → zoo-verify.md} +0 -0
  50. /package/templates/claude-code/.claude/commands/{write-a-skill.md → zoo-write-a-skill.md} +0 -0
  51. /package/templates/claude-code/.claude/commands/{zoom-out.md → zoo-zoom-out.md} +0 -0
  52. /package/templates/full/.roo/commands/{caveman.md → zoo-caveman.md} +0 -0
  53. /package/templates/full/.roo/commands/{commit-and-document.md → zoo-commit-and-document.md} +0 -0
  54. /package/templates/full/.roo/commands/{diagnose.md → zoo-diagnose.md} +0 -0
  55. /package/templates/full/.roo/commands/{feature.md → zoo-feature.md} +0 -0
  56. /package/templates/full/.roo/commands/{fix.md → zoo-fix.md} +0 -0
  57. /package/templates/full/.roo/commands/{grill-me.md → zoo-grill-me.md} +0 -0
  58. /package/templates/full/.roo/commands/{grill-with-docs.md → zoo-grill-with-docs.md} +0 -0
  59. /package/templates/full/.roo/commands/{handoff.md → zoo-handoff.md} +0 -0
  60. /package/templates/full/.roo/commands/{improve-codebase-architecture.md → zoo-improve-codebase-architecture.md} +0 -0
  61. /package/templates/full/.roo/commands/{prototype.md → zoo-prototype.md} +0 -0
  62. /package/templates/full/.roo/commands/{refactor.md → zoo-refactor.md} +0 -0
  63. /package/templates/full/.roo/commands/{review.md → zoo-review.md} +0 -0
  64. /package/templates/full/.roo/commands/{tdd.md → zoo-tdd.md} +0 -0
  65. /package/templates/full/.roo/commands/{teach.md → zoo-teach.md} +0 -0
  66. /package/templates/full/.roo/commands/{to-issues.md → zoo-to-issues.md} +0 -0
  67. /package/templates/full/.roo/commands/{to-prd.md → zoo-to-prd.md} +0 -0
  68. /package/templates/full/.roo/commands/{triage.md → zoo-triage.md} +0 -0
  69. /package/templates/full/.roo/commands/{tweak.md → zoo-tweak.md} +0 -0
  70. /package/templates/full/.roo/commands/{verify.md → zoo-verify.md} +0 -0
  71. /package/templates/full/.roo/commands/{write-a-skill.md → zoo-write-a-skill.md} +0 -0
  72. /package/templates/full/.roo/commands/{zoom-out.md → zoo-zoom-out.md} +0 -0
@@ -1,47 +1,47 @@
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 (only after explicit user approval)/ADR/issue/`NOTES.md`; delete or fold into real code.
38
-
39
- ## Complete
40
-
41
- Call `attempt_completion` with:
42
- - question answered
43
- - prototype location (`.scratch/prototypes/<slug>/` or real module path)
44
- - outcome (absorbed / discarded / needs decision)
45
- - recommended next command
46
-
47
- Do NOT end the task with `ask_followup_question` or write results as plain text without calling the tool.
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 (only after explicit user approval)/ADR/issue/`NOTES.md`; delete or fold into real code.
38
+
39
+ ## Complete
40
+
41
+ Call `attempt_completion` with:
42
+ - question answered
43
+ - prototype location (`.scratch/prototypes/<slug>/` or real module path)
44
+ - outcome (absorbed / discarded / needs decision)
45
+ - recommended next command
46
+
47
+ Do NOT end the task with `ask_followup_question` or write results as plain text without calling the tool.
@@ -41,7 +41,7 @@ Read relevant specs, issues, PRDs, standards, docs, ADRs, security notes, or pro
41
41
 
42
42
  ## 3. Review axes (multi-pass with working memory)
43
43
 
44
- Initialize session: `.scratch/reviews/<YYYY-MM-DD>/review-<slug>/`
44
+ Initialize session: `.scratch/reviews/<YYYY-MM-DD>/zoo-review-<slug>/`
45
45
 
46
46
  Write `<session-dir>/session.md` with review target, base ref, scope.
47
47
 
@@ -136,11 +136,11 @@ Do NOT use `ask_followup_question` or write results as plain text without callin
136
136
 
137
137
  If fixes are needed, recommend one next command only:
138
138
 
139
- - small fix -> `/tweak`
140
- - behavior fix -> `/tdd`
141
- - unknown cause -> `/fix`
142
- - design issue -> `/refactor`
143
- - ready for evidence -> `/verify`
144
- - ready to commit -> `/commit-and-document`
139
+ - small fix -> `/zoo-tweak`
140
+ - behavior fix -> `/zoo-tdd`
141
+ - unknown cause -> `/zoo-fix`
142
+ - design issue -> `/zoo-refactor`
143
+ - ready for evidence -> `/zoo-verify`
144
+ - ready to commit -> `/zoo-commit-and-document`
145
145
 
146
146
  Do not auto-launch any follow-up command.
@@ -1,228 +1,228 @@
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
- ```
219
-
220
- ## Complete
221
-
222
- Call `attempt_completion` with:
223
- - file paths written (CONTEXT.md, ADRs, optional docs)
224
- - terms added (count)
225
- - status (complete / blocked with reason)
226
- - recommended next command
227
-
228
- Do NOT use `ask_followup_question` or write results as plain text without calling the tool.
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/zoo-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
+ ```
219
+
220
+ ## Complete
221
+
222
+ Call `attempt_completion` with:
223
+ - file paths written (CONTEXT.md, ADRs, optional docs)
224
+ - terms added (count)
225
+ - status (complete / blocked with reason)
226
+ - recommended next command
227
+
228
+ Do NOT use `ask_followup_question` or write results as plain text without calling the tool.
@@ -40,7 +40,7 @@ C. Domain docs:
40
40
  Show:
41
41
  1. `## Agent skills` block.
42
42
  2. `docs/agents/issue-tracker.md`.
43
- 3. `docs/agents/triage-labels.md`.
43
+ 3. `docs/agents/zoo-triage-labels.md`.
44
44
  4. `docs/agents/domain.md`.
45
45
 
46
46
  ## Write
@@ -63,7 +63,7 @@ Block:
63
63
 
64
64
  ### Triage labels
65
65
 
66
- [one-line summary]. See `docs/agents/triage-labels.md`.
66
+ [one-line summary]. See `docs/agents/zoo-triage-labels.md`.
67
67
 
68
68
  ### Domain docs
69
69
 
@@ -50,7 +50,7 @@ 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.
53
+ After green, suggest `/zoo-verify`, then `/zoo-review`, then `/zoo-commit-and-document` for non-trivial work. Do not auto-launch follow-up commands.
54
54
 
55
55
  ## Complete
56
56
 
@@ -5,7 +5,7 @@ description: Break a plan, spec, or PRD into independently-grabbable issues on t
5
5
 
6
6
  # To Issues
7
7
 
8
- Issue tracker + label vocabulary should exist; run `/setup-matt-pocock-skills` if missing.
8
+ Issue tracker + label vocabulary should exist; run `/zoo-setup-matt-pocock-skills` if missing.
9
9
 
10
10
  ## Process
11
11
 
@@ -49,6 +49,6 @@ If no blockers: `None - can start immediately`.
49
49
  Call `attempt_completion` with:
50
50
  - issues created (count and tracker URLs or `.scratch/{feature-slug}/issues/` path)
51
51
  - status (complete / blocked with reason)
52
- - recommended next command (`/tweak` or `/tdd` to start implementing the first issue)
52
+ - recommended next command (`/zoo-tweak` or `/zoo-tdd` to start implementing the first issue)
53
53
 
54
54
  Do NOT use `ask_followup_question` or write results as plain text without calling the tool.