@fernado03/zoo-flow 0.5.3 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/README.md +81 -78
  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/explore.md +2 -2
  47. package/templates/full/.roo/commands/feature.md +1 -1
  48. package/templates/full/.roo/commands/fix.md +1 -1
  49. package/templates/full/.roo/commands/grill-me.md +2 -1
  50. package/templates/full/.roo/commands/grill-with-docs.md +2 -1
  51. package/templates/full/.roo/commands/handoff.md +2 -1
  52. package/templates/full/.roo/commands/improve-codebase-architecture.md +2 -1
  53. package/templates/full/.roo/commands/prototype.md +1 -1
  54. package/templates/full/.roo/commands/refactor.md +1 -1
  55. package/templates/full/.roo/commands/review.md +11 -0
  56. package/templates/full/.roo/commands/setup-matt-pocock-skills.md +1 -1
  57. package/templates/full/.roo/commands/tdd.md +1 -1
  58. package/templates/full/.roo/commands/to-issues.md +2 -1
  59. package/templates/full/.roo/commands/to-prd.md +2 -1
  60. package/templates/full/.roo/commands/triage.md +1 -1
  61. package/templates/full/.roo/commands/tweak.md +1 -1
  62. package/templates/full/.roo/commands/update-docs.md +1 -1
  63. package/templates/full/.roo/commands/verify.md +11 -0
  64. package/templates/full/.roo/commands/write-a-skill.md +2 -1
  65. package/templates/full/.roo/commands/zoom-out.md +2 -1
  66. package/templates/full/.roo/rules/01-command-protocol.md +1 -1
  67. package/templates/full/.roo/rules/04-context-economy.md +3 -5
  68. package/templates/full/.roo/rules-code-tweaker/01-completion.md +14 -8
  69. package/templates/full/.roo/rules-custom-orchestrator/00-routing.md +43 -11
  70. package/templates/full/.roo/rules-custom-orchestrator/01-delegation-message.md +11 -7
  71. package/templates/full/.roo/rules-system-architect/02-completion.md +6 -2
  72. package/templates/full/.roo/skills/engineering/README.md +2 -0
  73. package/templates/full/.roo/skills/engineering/commit-and-document/SKILL.md +1 -2
  74. package/templates/full/.roo/skills/engineering/grill-with-docs/ADR-FORMAT.md +1 -1
  75. package/templates/full/.roo/skills/engineering/grill-with-docs/CONTEXT-FORMAT.md +7 -32
  76. package/templates/full/.roo/skills/engineering/grill-with-docs/SKILL.md +1 -1
  77. package/templates/full/.roo/skills/engineering/improve-codebase-architecture/SKILL.md +3 -3
  78. package/templates/full/.roo/skills/engineering/review/SKILL.md +111 -0
  79. package/templates/full/.roo/skills/engineering/scaffold-context/SKILL.md +66 -0
  80. package/templates/full/.roo/skills/engineering/scaffold-context/templates/writing-patterns.md +17 -0
  81. package/templates/full/.roo/skills/engineering/setup-matt-pocock-skills/SKILL.md +3 -3
  82. package/templates/full/.roo/skills/engineering/setup-matt-pocock-skills/domain.md +2 -3
  83. package/templates/full/.roo/skills/engineering/tdd/SKILL.md +2 -0
  84. package/templates/full/.roo/skills/engineering/tweak/SKILL.md +2 -1
  85. package/templates/full/.roo/skills/engineering/verify/SKILL.md +80 -0
  86. package/templates/full/.roo/skills/in-progress/README.md +0 -1
  87. package/templates/full/.roomodes +3 -3
  88. package/templates/full/.zoo-flow/START_HERE.md +8 -61
  89. package/templates/full/.zoo-flow/evals/no-regression-checklist.md +4 -2
  90. package/templates/full/.zoo-flow/evals/routing-cases.jsonl +20 -0
  91. package/templates/full/.zoo-flow/evals/routing-cases.md +27 -3
  92. package/templates/full/.zoo-flow/project-profile.json +24 -0
  93. package/tests/fixtures/bad-routing-cases/bad-json.jsonl +1 -0
  94. package/tests/fixtures/bad-routing-cases/bad-mode.jsonl +1 -0
  95. package/tests/fixtures/bad-routing-cases/missing-command.jsonl +1 -0
  96. package/tests/fixtures/doctor/bad-built-in-delegation/fixture.json +1 -0
  97. package/tests/fixtures/doctor/bad-mode-slug/fixture.json +1 -0
  98. package/tests/fixtures/doctor/bad-skill-wrapper/fixture.json +1 -0
  99. package/tests/fixtures/doctor/bad-zoo-path/fixture.json +1 -0
  100. package/tests/fixtures/doctor/helper-missing-mode/fixture.json +1 -0
  101. package/tests/fixtures/doctor/helper-not-permitted/fixture.json +1 -0
  102. package/tests/fixtures/doctor/manual-good-template/fixture.json +1 -0
  103. package/tests/fixtures/doctor/missing-command/fixture.json +1 -0
  104. package/tests/fixtures/doctor/missing-roomodes/fixture.json +1 -0
  105. package/tests/fixtures/doctor/missing-skill/fixture.json +1 -0
  106. package/tests/fixtures/project-shapes/cli-tool/cmd/root.go +1 -0
  107. package/tests/fixtures/project-shapes/cli-tool/fixture.json +1 -0
  108. package/tests/fixtures/project-shapes/cli-tool/package.json +1 -0
  109. package/tests/fixtures/project-shapes/data-pipeline/fixture.json +1 -0
  110. package/tests/fixtures/project-shapes/data-pipeline/pipelines/invoices.py +1 -0
  111. package/tests/fixtures/project-shapes/data-pipeline/pyproject.toml +2 -0
  112. package/tests/fixtures/project-shapes/library/fixture.json +1 -0
  113. package/tests/fixtures/project-shapes/library/package.json +1 -0
  114. package/tests/fixtures/project-shapes/library/src/index.ts +1 -0
  115. package/tests/fixtures/project-shapes/monorepo/fixture.json +1 -0
  116. package/tests/fixtures/project-shapes/monorepo/package.json +1 -0
  117. package/tests/fixtures/project-shapes/monorepo/packages/core/index.ts +1 -0
  118. package/tests/fixtures/project-shapes/monorepo/packages/web/index.ts +1 -0
  119. package/tests/fixtures/project-shapes/serverless/fixture.json +1 -0
  120. package/tests/fixtures/project-shapes/serverless/functions/webhook.ts +1 -0
  121. package/tests/fixtures/project-shapes/serverless/package.json +1 -0
  122. package/tests/fixtures/project-shapes/web-app/app/routes/index.tsx +1 -0
  123. package/tests/fixtures/project-shapes/web-app/fixture.json +1 -0
  124. package/tests/fixtures/project-shapes/web-app/package.json +1 -0
  125. package/tests/golden-transcripts/01-small-tweak-golden.md +21 -0
  126. package/tests/golden-transcripts/02-diagnosis-golden.md +26 -0
  127. package/tests/golden-transcripts/03-verification-golden.md +24 -0
  128. package/tests/golden-transcripts/04-review-golden.md +26 -0
  129. package/tests/golden-transcripts/05-feature-planning-golden.md +23 -0
  130. 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,37 @@ 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
54
+ ## Using Zoo Flow
55
+
56
+ First run:
58
57
 
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:
58
+ - Run `/scaffold-context` when the project needs local context docs.
59
+ - Run `/setup-matt-pocock-skills` when tracker or triage config is needed.
60
+
61
+ Daily use:
62
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.
63
+ - Start in `custom-orchestrator`, describe the task normally.
64
+ - The orchestrator proposes a plain-language workflow; approve by number.
65
+ - Or type a slash command directly (`/tweak`, `/fix`, etc.) to bypass routing.
66
+ - Explicit slash commands count as approval. Free-form requests do not.
67
+ - **Clickable choices must not include slash commands or mode names.**
68
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).
69
+ For team usage, see `docs/team-mode.md`.
85
70
 
86
71
  ## Update
87
72
 
@@ -93,17 +78,17 @@ Backs up your current `.roomodes` and `.roo/` to
93
78
  `.zoo-flow-backup/<timestamp>/`, then replaces them with the latest
94
79
  template. Preview with `--dry-run`.
95
80
 
96
- ## Context economy
81
+ ## Token discipline
97
82
 
98
- 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.
83
+ Zoo Flow keeps always-loaded rules small. Domain docs (`.zoo-flow/CONTEXT.md`, `.zoo-flow/docs/adr/`) are never read by default only when the task touches domain language, public behavior, or architecture seams. Agents search before broad reads, use targeted line ranges when possible, and avoid re-reading unchanged files. All runtime files have tiered token budgets enforced by `scripts/token-budget.js`.
99
84
 
100
85
  ## Modes
101
86
 
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 |
87
+ | Slug | Name | Role | Edits allowed | Delegation |
88
+ | --------------------- | --------------------- | ---------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------- |
89
+ | `custom-orchestrator` | 🪃 Custom Orchestrator | Router. Picks workflow, delegates, waits for the user. | None | `new_task` to Zoo Flow modes only |
90
+ | `system-architect` | 🏗️ System Architect | Planning, diagnosis, refactor design, exploration, review. | Markdown, `.scratch/`, `docs/` | `switch_mode` to `code-tweaker` |
91
+ | `code-tweaker` | ⚡ Code Tweaker | Implementation, TDD, verify, docs, prototypes, commits. | Full repo edits within the assigned command | `switch_mode` to `system-architect` |
107
92
 
108
93
  Modes are defined in
109
94
  [`templates/full/.roomodes`](templates/full/.roomodes). The detailed
@@ -123,12 +108,14 @@ run directly inside `system-architect` or `code-tweaker` when needed.
123
108
  | `/tdd` | `code-tweaker` | Test-first implementation loop. |
124
109
  | `/prototype` | `code-tweaker` | Throwaway prototype to settle a design uncertainty. |
125
110
  | `/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. |
111
+ | `/commit-and-document` | `code-tweaker` | Stage, message, commit, journal — pauses for approval. |
112
+ | `/verify` | `code-tweaker` | Run targeted tests, typecheck, lint, or build checks. |
113
+ | `/fix` | `system-architect` | Diagnoseimplementpost-mortem chain. |
114
+ | `/feature` | `system-architect` | Sharpen optional prototype → PRD → issues → TDD chain. |
115
+ | `/refactor` | `system-architect` | Plan and stage architecture changes. |
116
+ | `/explore` | `system-architect` | Map unfamiliar code before touching it. |
117
+ | `/triage` | `system-architect` | Clean and prioritize an issue queue. |
118
+ | `/review` | `system-architect` | Review a diff or branch before commit. |
132
119
 
133
120
  ### Helper (run directly when needed)
134
121
 
@@ -140,27 +127,31 @@ run directly inside `system-architect` or `code-tweaker` when needed.
140
127
  | `/to-prd` | `system-architect` | Turn sharpened context into a PRD. |
141
128
  | `/to-issues` | `system-architect` | Slice a PRD into issues. |
142
129
  | `/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. |
130
+ | `/handoff` | `system-architect` | Produce a clean handoff package for another agent or human. |
131
+ | `/grill-me` | `system-architect` | Adversarial Q&A to sharpen an idea. |
132
+ | `/caveman` | modeless | Ultra-compressed communication style utility. |
146
133
  | `/write-a-skill` | `code-tweaker` | Author a new skill following the bucket layout. |
147
134
  | `/setup-matt-pocock-skills` | `code-tweaker` | One-shot setup helper for the bundled skill set. |
148
135
 
149
- Command files live in
150
- [`templates/full/.roo/commands/`](templates/full/.roo/commands).
136
+ Command files live in
137
+ [`templates/full/.roo/commands/`](templates/full/.roo/commands).
138
+ `/caveman` intentionally has no `mode:` because it changes communication style, not workflow authority.
151
139
 
152
140
  ## Worked examples
153
141
 
154
- - [`examples/fix-flow.md`](examples/fix-flow.md)
155
- - [`examples/feature-flow.md`](examples/feature-flow.md)
142
+ - [`examples/fix-flow.md`](examples/fix-flow.md)
143
+ - [`examples/feature-flow.md`](examples/feature-flow.md)
144
+ - [`examples/demo-transcripts/`](examples/demo-transcripts/)
156
145
 
157
146
  ## How this is different
158
147
 
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).
148
+ Zoo Flow is not a methodology and not a giant skills pack. It is a
149
+ thin Zoo-native control plane: three modes, a routing matrix, and a
150
+ path-safety contract that turn into a predictable workflow. For a
151
+ longer comparison with adjacent projects, see
152
+ [`docs/comparison.md`](docs/comparison.md).
153
+
154
+ For command-addition rules, see [`docs/command-design.md`](docs/command-design.md).
164
155
 
165
156
  ## Manual install
166
157
 
@@ -168,13 +159,25 @@ If you would rather copy the template by hand:
168
159
 
169
160
  ```sh
170
161
  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.
162
+ cp /tmp/zoo-flow/templates/full/.roomodes .
163
+ cp -R /tmp/zoo-flow/templates/full/.roo .
164
+ cp -R /tmp/zoo-flow/templates/full/.zoo-flow .
165
+ touch .gitignore
166
+ grep -qxF "# Zoo Flow — generated config (never committed)" .gitignore 2>/dev/null || {
167
+ printf "\n# Zoo Flow — generated config (never committed)\n" >> .gitignore
168
+ printf ".roomodes\n.roo/\n.zoo-flow/\n" >> .gitignore
169
+ }
170
+ ```
171
+
172
+ 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`.
173
+
174
+ ## Development
175
+
176
+ Before publishing, run:
177
+
178
+ ```bash
179
+ npm run release:check
180
+ ```
178
181
 
179
182
  ## Migration
180
183