@fernado03/zoo-flow 0.5.3 → 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.
Files changed (127) hide show
  1. package/README.md +102 -79
  2. package/bin/zoo-flow.js +398 -50
  3. package/docs/architecture.md +380 -0
  4. package/docs/bloat-control.md +49 -0
  5. package/docs/command-design.md +38 -0
  6. package/docs/command-flow.md +133 -0
  7. package/docs/comparison.md +86 -0
  8. package/docs/context-packs.md +35 -0
  9. package/docs/dogfood/01-small-library.md +28 -0
  10. package/docs/dogfood/02-web-app.md +29 -0
  11. package/docs/dogfood/03-mixed-monorepo.md +29 -0
  12. package/docs/mode-rules.md +86 -0
  13. package/docs/npm-publishing.md +79 -0
  14. package/docs/out-of-scope/mainstream-issue-trackers-only.md +25 -0
  15. package/docs/out-of-scope/question-limits.md +18 -0
  16. package/docs/out-of-scope/setup-skill-verify-mode.md +15 -0
  17. package/docs/overview.md +61 -0
  18. package/docs/philosophy.md +73 -0
  19. package/docs/quality-scorecard.md +23 -0
  20. package/docs/skill-maintenance.md +32 -0
  21. package/docs/skills-index.md +61 -0
  22. package/docs/team-mode.md +46 -0
  23. package/docs/token-budget.md +22 -0
  24. package/docs/troubleshooting.md +288 -0
  25. package/examples/demo-transcripts/01-small-tweak.md +37 -0
  26. package/examples/demo-transcripts/02-unknown-bug-fix.md +37 -0
  27. package/examples/demo-transcripts/03-new-feature.md +37 -0
  28. package/examples/demo-transcripts/04-refactor.md +37 -0
  29. package/examples/demo-transcripts/05-review-and-verify.md +37 -0
  30. package/examples/feature-flow.md +117 -0
  31. package/examples/fix-flow.md +139 -0
  32. package/package.json +16 -5
  33. package/quality/scorecard.json +88 -0
  34. package/quality/token-budget.exceptions.json +13 -0
  35. package/scripts/bundle.ps1 +135 -0
  36. package/scripts/check-golden-transcripts.js +69 -0
  37. package/scripts/check-package-links.js +72 -0
  38. package/scripts/check-package-manifest.js +70 -0
  39. package/scripts/eval-routing.js +149 -0
  40. package/scripts/score-quality.js +292 -0
  41. package/scripts/test-doctor.js +107 -0
  42. package/scripts/test-project-shapes.js +99 -0
  43. package/scripts/token-budget.js +105 -0
  44. package/templates/full/.roo/commands/caveman.md +1 -1
  45. package/templates/full/.roo/commands/diagnose.md +2 -1
  46. package/templates/full/.roo/commands/feature.md +1 -1
  47. package/templates/full/.roo/commands/fix.md +1 -1
  48. package/templates/full/.roo/commands/grill-me.md +2 -1
  49. package/templates/full/.roo/commands/grill-with-docs.md +2 -1
  50. package/templates/full/.roo/commands/handoff.md +2 -1
  51. package/templates/full/.roo/commands/improve-codebase-architecture.md +2 -1
  52. package/templates/full/.roo/commands/prototype.md +1 -1
  53. package/templates/full/.roo/commands/refactor.md +1 -1
  54. package/templates/full/.roo/commands/review.md +11 -0
  55. package/templates/full/.roo/commands/setup-matt-pocock-skills.md +1 -1
  56. package/templates/full/.roo/commands/tdd.md +1 -1
  57. package/templates/full/.roo/commands/to-issues.md +2 -1
  58. package/templates/full/.roo/commands/to-prd.md +2 -1
  59. package/templates/full/.roo/commands/triage.md +1 -1
  60. package/templates/full/.roo/commands/tweak.md +1 -1
  61. package/templates/full/.roo/commands/verify.md +11 -0
  62. package/templates/full/.roo/commands/write-a-skill.md +2 -1
  63. package/templates/full/.roo/commands/zoom-out.md +2 -1
  64. package/templates/full/.roo/rules/01-command-protocol.md +1 -1
  65. package/templates/full/.roo/rules/04-context-economy.md +3 -5
  66. package/templates/full/.roo/rules-code-tweaker/01-completion.md +12 -8
  67. package/templates/full/.roo/rules-custom-orchestrator/00-routing.md +23 -9
  68. package/templates/full/.roo/rules-custom-orchestrator/01-delegation-message.md +11 -7
  69. package/templates/full/.roo/rules-system-architect/02-completion.md +6 -2
  70. package/templates/full/.roo/skills/engineering/README.md +2 -0
  71. package/templates/full/.roo/skills/engineering/commit-and-document/SKILL.md +1 -2
  72. package/templates/full/.roo/skills/engineering/grill-with-docs/ADR-FORMAT.md +1 -1
  73. package/templates/full/.roo/skills/engineering/grill-with-docs/CONTEXT-FORMAT.md +7 -32
  74. package/templates/full/.roo/skills/engineering/grill-with-docs/SKILL.md +1 -1
  75. package/templates/full/.roo/skills/engineering/improve-codebase-architecture/SKILL.md +3 -3
  76. package/templates/full/.roo/skills/engineering/review/SKILL.md +111 -0
  77. package/templates/full/.roo/skills/engineering/scaffold-context/SKILL.md +66 -0
  78. package/templates/full/.roo/skills/engineering/scaffold-context/templates/writing-patterns.md +17 -0
  79. package/templates/full/.roo/skills/engineering/setup-matt-pocock-skills/SKILL.md +3 -3
  80. package/templates/full/.roo/skills/engineering/setup-matt-pocock-skills/domain.md +2 -3
  81. package/templates/full/.roo/skills/engineering/tdd/SKILL.md +2 -0
  82. package/templates/full/.roo/skills/engineering/tweak/SKILL.md +2 -1
  83. package/templates/full/.roo/skills/engineering/verify/SKILL.md +80 -0
  84. package/templates/full/.roo/skills/in-progress/README.md +0 -1
  85. package/templates/full/.roomodes +3 -3
  86. package/templates/full/.zoo-flow/evals/no-regression-checklist.md +4 -2
  87. package/templates/full/.zoo-flow/evals/routing-cases.jsonl +20 -0
  88. package/templates/full/.zoo-flow/evals/routing-cases.md +27 -3
  89. package/templates/full/.zoo-flow/project-profile.json +24 -0
  90. package/tests/fixtures/bad-routing-cases/bad-json.jsonl +1 -0
  91. package/tests/fixtures/bad-routing-cases/bad-mode.jsonl +1 -0
  92. package/tests/fixtures/bad-routing-cases/missing-command.jsonl +1 -0
  93. package/tests/fixtures/doctor/bad-built-in-delegation/fixture.json +1 -0
  94. package/tests/fixtures/doctor/bad-mode-slug/fixture.json +1 -0
  95. package/tests/fixtures/doctor/bad-skill-wrapper/fixture.json +1 -0
  96. package/tests/fixtures/doctor/bad-zoo-path/fixture.json +1 -0
  97. package/tests/fixtures/doctor/helper-missing-mode/fixture.json +1 -0
  98. package/tests/fixtures/doctor/helper-not-permitted/fixture.json +1 -0
  99. package/tests/fixtures/doctor/manual-good-template/fixture.json +1 -0
  100. package/tests/fixtures/doctor/missing-command/fixture.json +1 -0
  101. package/tests/fixtures/doctor/missing-roomodes/fixture.json +1 -0
  102. package/tests/fixtures/doctor/missing-skill/fixture.json +1 -0
  103. package/tests/fixtures/project-shapes/cli-tool/cmd/root.go +1 -0
  104. package/tests/fixtures/project-shapes/cli-tool/fixture.json +1 -0
  105. package/tests/fixtures/project-shapes/cli-tool/package.json +1 -0
  106. package/tests/fixtures/project-shapes/data-pipeline/fixture.json +1 -0
  107. package/tests/fixtures/project-shapes/data-pipeline/pipelines/invoices.py +1 -0
  108. package/tests/fixtures/project-shapes/data-pipeline/pyproject.toml +2 -0
  109. package/tests/fixtures/project-shapes/library/fixture.json +1 -0
  110. package/tests/fixtures/project-shapes/library/package.json +1 -0
  111. package/tests/fixtures/project-shapes/library/src/index.ts +1 -0
  112. package/tests/fixtures/project-shapes/monorepo/fixture.json +1 -0
  113. package/tests/fixtures/project-shapes/monorepo/package.json +1 -0
  114. package/tests/fixtures/project-shapes/monorepo/packages/core/index.ts +1 -0
  115. package/tests/fixtures/project-shapes/monorepo/packages/web/index.ts +1 -0
  116. package/tests/fixtures/project-shapes/serverless/fixture.json +1 -0
  117. package/tests/fixtures/project-shapes/serverless/functions/webhook.ts +1 -0
  118. package/tests/fixtures/project-shapes/serverless/package.json +1 -0
  119. package/tests/fixtures/project-shapes/web-app/app/routes/index.tsx +1 -0
  120. package/tests/fixtures/project-shapes/web-app/fixture.json +1 -0
  121. package/tests/fixtures/project-shapes/web-app/package.json +1 -0
  122. package/tests/golden-transcripts/01-small-tweak-golden.md +21 -0
  123. package/tests/golden-transcripts/02-diagnosis-golden.md +26 -0
  124. package/tests/golden-transcripts/03-verification-golden.md +24 -0
  125. package/tests/golden-transcripts/04-review-golden.md +26 -0
  126. package/tests/golden-transcripts/05-feature-planning-golden.md +23 -0
  127. package/templates/full/.roo/skills/in-progress/review/SKILL.md +0 -39
package/README.md CHANGED
@@ -1,11 +1,13 @@
1
1
  # Zoo Flow
2
2
 
3
- > **Workflow control plane for [Zoo Code](https://docs.zoocode.dev/).**
4
-
5
- A small, opinionated template that turns Zoo Code into a predictable
6
- mode + command + skill orchestrator. Three modes, a fixed routing
7
- matrix, a command protocol, and path-safety rules. Drop it into a
8
- workspace and your AI assistant stops freelancing.
3
+ > **Workflow control plane for [Zoo Code](https://docs.zoocode.dev/).**
4
+
5
+ Zoo Flow is a Zoo Code workflow-control template.
6
+
7
+ It does not try to be a giant skills pack. It makes Zoo Code predictable:
8
+ free-form requests are routed through Custom Orchestrator, risky work gets
9
+ planning gates, implementation stays in Code Tweaker, architecture stays in
10
+ System Architect, and every command follows a small command/skill contract.
9
11
 
10
12
  For the deeper rationale, see [`docs/overview.md`](docs/overview.md)
11
13
  and [`docs/philosophy.md`](docs/philosophy.md).
@@ -34,54 +36,53 @@ npx @fernado03/zoo-flow@latest init --force
34
36
  A timestamped backup is always written to `.zoo-flow-backup/` before
35
37
  overwrite.
36
38
 
37
- After install, reload VS Code (Command Palette → **Developer: Reload
38
- Window**) and open Zoo Code.
39
+ After install, reload VS Code (Command Palette → **Developer: Reload
40
+ Window**) and open Zoo Code.
41
+
42
+ ## Validate Install
43
+
44
+ Use this inside a project after install or update:
45
+
46
+ ```bash
47
+ npx @fernado03/zoo-flow@latest doctor
48
+ ```
39
49
 
40
50
  > **Note**: `.roomodes`, `.roo/commands/`, and `.roo/rules-{mode-slug}/`
41
51
  > are kept as-is because they are the official Zoo Code configuration
42
52
  > paths. Zoo Flow does not introduce a `.zoo/` directory.
43
53
 
44
- ## Using Zoo Flow
45
-
46
- After installing this template, read:
47
-
48
- [`.zoo-flow/START_HERE.md`](templates/full/.zoo-flow/START_HERE.md)
49
-
50
- That file explains first-run initialization, when to run
51
- `/scaffold-context`, when to run `/setup-matt-pocock-skills`, and how
52
- to start normal work from Custom Orchestrator mode.
53
-
54
- For daily use, start in Custom Orchestrator mode and describe the
55
- task normally. Slash commands are optional power-user shortcuts.
56
-
57
- ## Using it
58
-
59
- Zoo Code switches modes automatically when you type a slash command,
60
- based on the `mode:` field in the command file. That gives you two
61
- ways to drive Zoo Flow, and the choice matters:
62
-
63
- - **Free-form request from `custom-orchestrator`** (no leading slash).
64
- The orchestrator picks a workflow, proposes it as a numbered choice,
65
- and delegates only after you confirm. Use this when you want the
66
- router to think first. This is how `custom-orchestrator` is
67
- designed to work.
68
-
69
- > change a harmless comment in `README`
70
-
71
- - **Direct slash command from any mode.** The host switches you to
72
- the command's configured mode and runs it, bypassing the
73
- orchestrator entirely. Use this when you already know which
74
- workflow you want.
75
-
76
- > /tweak fix the typo in `README`
77
-
78
- When Zoo Flow asks a workflow question, reply by typing the number,
79
- for example `1`.
80
-
81
- Zoo Flow may show numbered options, but those options should be
82
- plain-language choices only. They should not contain slash commands,
83
- mode names, or executable routing text. See
84
- [`docs/troubleshooting.md`](docs/troubleshooting.md#clickable-suggestions-can-route-incorrectly).
54
+ ## Using Zoo Flow
55
+
56
+ First run:
57
+
58
+ - Read [`.zoo-flow/START_HERE.md`](templates/full/.zoo-flow/START_HERE.md).
59
+ - Run `/scaffold-context` when the project needs local context docs.
60
+ - Run `/setup-matt-pocock-skills` when tracker or triage config is needed.
61
+
62
+ Daily use:
63
+
64
+ - Start in `custom-orchestrator`.
65
+ - Describe the task normally.
66
+ - The orchestrator proposes a plain-language workflow.
67
+ - Approve by number or option text.
68
+
69
+ Power-user path:
70
+
71
+ - Type a slash command directly when you already know the workflow.
72
+ - Zoo Code switches mode from the command file's `mode:` field.
73
+
74
+ Safety:
75
+
76
+ - Workflow choices must be plain language.
77
+ - Clickable choices must not include slash commands or mode names.
78
+ - Explicit slash commands count as approval.
79
+ - Free-form requests do not self-approve.
80
+
81
+ When Zoo Flow asks a workflow question, reply by typing the number, for
82
+ example `1`. See
83
+ [`docs/troubleshooting.md`](docs/troubleshooting.md#clickable-suggestions-can-route-incorrectly).
84
+
85
+ For team usage and deciding what to commit, see `docs/team-mode.md`.
85
86
 
86
87
  ## Update
87
88
 
@@ -97,13 +98,17 @@ template. Preview with `--dry-run`.
97
98
 
98
99
  Zoo Flow avoids unnecessary token use by asking agents to search or list before broad reads, use targeted line ranges when possible, and avoid re-reading unchanged files. Full-file reads are still allowed when correctness requires complete context.
99
100
 
101
+ ## Token discipline
102
+
103
+ Domain docs (`.zoo-flow/CONTEXT.md`, `.zoo-flow/docs/adr/`) are never read by default. They are loaded only when the task touches domain language, changes public behavior, or crosses architecture/auth/persistence seams. All runtime files (rules, commands, skills) have tiered token budgets enforced by `scripts/token-budget.js`.
104
+
100
105
  ## Modes
101
106
 
102
- | Slug | Name | Role | Edits allowed | Delegation |
103
- | --------------------- | --------------------- | ---------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------- |
104
- | `custom-orchestrator` | 🪃 Custom Orchestrator | Router. Picks workflow, delegates, waits for the user. | None | `new_task` to architect or tweaker |
105
- | `system-architect` | 🏗️ System Architect | Planning, diagnosis, refactor design, exploration, triage. | Markdown, `.scratch/`, `docs/` | `switch_mode` to tweaker in same window |
106
- | `code-tweaker` | ⚡ Code Tweaker | Implementation, TDD, docs updates, prototypes, commits. | Full repo edits within the assigned command | `switch_mode` to architect in same window |
107
+ | Slug | Name | Role | Edits allowed | Delegation |
108
+ | --------------------- | --------------------- | ---------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------- |
109
+ | `custom-orchestrator` | 🪃 Custom Orchestrator | Router. Picks workflow, delegates, waits for the user. | None | `new_task` to Zoo Flow modes only |
110
+ | `system-architect` | 🏗️ System Architect | Planning, diagnosis, refactor design, exploration, review. | Markdown, `.scratch/`, `docs/` | `switch_mode` to `code-tweaker` |
111
+ | `code-tweaker` | ⚡ Code Tweaker | Implementation, TDD, verify, docs, prototypes, commits. | Full repo edits within the assigned command | `switch_mode` to `system-architect` |
107
112
 
108
113
  Modes are defined in
109
114
  [`templates/full/.roomodes`](templates/full/.roomodes). The detailed
@@ -123,12 +128,14 @@ run directly inside `system-architect` or `code-tweaker` when needed.
123
128
  | `/tdd` | `code-tweaker` | Test-first implementation loop. |
124
129
  | `/prototype` | `code-tweaker` | Throwaway prototype to settle a design uncertainty. |
125
130
  | `/update-docs` | `code-tweaker` | Reconcile docs with code reality. |
126
- | `/commit-and-document` | `code-tweaker` | Stage, message, commit, journal — pauses for approval. |
127
- | `/fix` | `system-architect` | Diagnose implement post-mortem chain. |
128
- | `/feature` | `system-architect` | Sharpenoptional prototype PRD → issues → TDD chain. |
129
- | `/refactor` | `system-architect` | Plan and stage architecture changes. |
130
- | `/explore` | `system-architect` | Map unfamiliar code before touching it. |
131
- | `/triage` | `system-architect` | Clean and prioritize an issue queue. |
131
+ | `/commit-and-document` | `code-tweaker` | Stage, message, commit, journal — pauses for approval. |
132
+ | `/verify` | `code-tweaker` | Run targeted tests, typecheck, lint, or build checks. |
133
+ | `/fix` | `system-architect` | Diagnoseimplementpost-mortem chain. |
134
+ | `/feature` | `system-architect` | Sharpen optional prototype → PRD → issues → TDD chain. |
135
+ | `/refactor` | `system-architect` | Plan and stage architecture changes. |
136
+ | `/explore` | `system-architect` | Map unfamiliar code before touching it. |
137
+ | `/triage` | `system-architect` | Clean and prioritize an issue queue. |
138
+ | `/review` | `system-architect` | Review a diff or branch before commit. |
132
139
 
133
140
  ### Helper (run directly when needed)
134
141
 
@@ -140,27 +147,31 @@ run directly inside `system-architect` or `code-tweaker` when needed.
140
147
  | `/to-prd` | `system-architect` | Turn sharpened context into a PRD. |
141
148
  | `/to-issues` | `system-architect` | Slice a PRD into issues. |
142
149
  | `/zoom-out` | `system-architect` | Pull back to architectural altitude. |
143
- | `/handoff` | either | Produce a clean handoff package for another agent or human. |
144
- | `/grill-me` | either | Adversarial Q&A to sharpen an idea. |
145
- | `/caveman` | either | Ultra-compressed communication mode. |
150
+ | `/handoff` | `system-architect` | Produce a clean handoff package for another agent or human. |
151
+ | `/grill-me` | `system-architect` | Adversarial Q&A to sharpen an idea. |
152
+ | `/caveman` | modeless | Ultra-compressed communication style utility. |
146
153
  | `/write-a-skill` | `code-tweaker` | Author a new skill following the bucket layout. |
147
154
  | `/setup-matt-pocock-skills` | `code-tweaker` | One-shot setup helper for the bundled skill set. |
148
155
 
149
- Command files live in
150
- [`templates/full/.roo/commands/`](templates/full/.roo/commands).
156
+ Command files live in
157
+ [`templates/full/.roo/commands/`](templates/full/.roo/commands).
158
+ `/caveman` intentionally has no `mode:` because it changes communication style, not workflow authority.
151
159
 
152
160
  ## Worked examples
153
161
 
154
- - [`examples/fix-flow.md`](examples/fix-flow.md)
155
- - [`examples/feature-flow.md`](examples/feature-flow.md)
162
+ - [`examples/fix-flow.md`](examples/fix-flow.md)
163
+ - [`examples/feature-flow.md`](examples/feature-flow.md)
164
+ - [`examples/demo-transcripts/`](examples/demo-transcripts/)
156
165
 
157
166
  ## How this is different
158
167
 
159
- Zoo Flow is not a methodology and not a giant skills pack. It is a
160
- thin Zoo-native control plane: three modes, a routing matrix, and a
161
- path-safety contract that turn into a predictable workflow. For a
162
- longer comparison with adjacent projects, see
163
- [`docs/comparison.md`](docs/comparison.md).
168
+ Zoo Flow is not a methodology and not a giant skills pack. It is a
169
+ thin Zoo-native control plane: three modes, a routing matrix, and a
170
+ path-safety contract that turn into a predictable workflow. For a
171
+ longer comparison with adjacent projects, see
172
+ [`docs/comparison.md`](docs/comparison.md).
173
+
174
+ For command-addition rules, see [`docs/command-design.md`](docs/command-design.md).
164
175
 
165
176
  ## Manual install
166
177
 
@@ -168,13 +179,25 @@ If you would rather copy the template by hand:
168
179
 
169
180
  ```sh
170
181
  git clone https://github.com/Fernado03/zoo-flow.git /tmp/zoo-flow
171
- cp /tmp/zoo-flow/templates/full/.roomodes .
172
- cp -R /tmp/zoo-flow/templates/full/.roo .
173
- cp -R /tmp/zoo-flow/templates/full/.zoo-flow .
174
- grep -qxF ".zoo-flow/" .gitignore 2>/dev/null || printf "\n.zoo-flow/\n" >> .gitignore
175
- ```
176
-
177
- Windows uses `git clone ... C:\Temp\zoo-flow` and `Copy-Item` (including `Copy-Item -Recurse` for `.zoo-flow\`) instead.
182
+ cp /tmp/zoo-flow/templates/full/.roomodes .
183
+ cp -R /tmp/zoo-flow/templates/full/.roo .
184
+ cp -R /tmp/zoo-flow/templates/full/.zoo-flow .
185
+ touch .gitignore
186
+ grep -qxF "# Zoo Flow — generated config (never committed)" .gitignore 2>/dev/null || {
187
+ printf "\n# Zoo Flow — generated config (never committed)\n" >> .gitignore
188
+ printf ".roomodes\n.roo/\n.zoo-flow/\n" >> .gitignore
189
+ }
190
+ ```
191
+
192
+ Windows uses `git clone ... C:\Temp\zoo-flow` and `Copy-Item` (including `Copy-Item -Recurse` for `.roo\` and `.zoo-flow\`) instead. Add `.roomodes`, `.roo/`, and `.zoo-flow/` to `.gitignore`.
193
+
194
+ ## Development
195
+
196
+ Before publishing, run:
197
+
198
+ ```bash
199
+ npm run release:check
200
+ ```
178
201
 
179
202
  ## Migration
180
203