@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
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: review
3
+ description: Review a diff, branch, PR, or work-in-progress change against the requested spec, repo standards, architecture, and likely regressions. Use before committing non-trivial work.
4
+ ---
5
+
6
+ # Review
7
+
8
+ Purpose: answer whether the diff matches the spec, standards, architecture, and project intent.
9
+
10
+ Review only. Do not patch application source. As `system-architect`, edits are limited to Markdown, `.scratch/`, and `docs/`.
11
+
12
+ ## 1. Identify target
13
+
14
+ Use the narrowest target that fits the request:
15
+
16
+ - User-provided base ref, PR, issue, files, or review focus.
17
+ - Staged diff when staged changes exist.
18
+ - Unstaged diff when unstaged changes exist.
19
+ - Branch diff against the likely base (`main`, `master`, or merge-base) when asked to review a branch.
20
+ - Specific files/specs/PRDs when provided.
21
+
22
+ If the target is unclear, ask one short question and stop.
23
+
24
+ ## 2. Read needed context only
25
+
26
+ Start with:
27
+
28
+ - `git status --short`
29
+ - `git diff --stat`
30
+ - `git diff --cached --stat` when staged changes exist
31
+
32
+ Then read targeted diffs only:
33
+
34
+ - `git diff -- <file>`
35
+ - `git diff --cached -- <file>`
36
+ - `git diff <base>...HEAD -- <file>`
37
+
38
+ Read relevant specs, issues, PRDs, standards, docs, ADRs, security notes, or project conventions only when they affect the changed area or the user requested that axis.
39
+
40
+ ## 3. Review axes
41
+
42
+ Standards axis:
43
+
44
+ - style
45
+ - architecture
46
+ - test quality
47
+ - maintainability
48
+ - security
49
+ - project conventions
50
+
51
+ Spec axis:
52
+
53
+ - did it solve the requested problem?
54
+ - did it change public behavior unexpectedly?
55
+ - did it miss edge cases?
56
+ - did it violate PRD, issue, or user intent?
57
+
58
+ Security/Risk axis:
59
+
60
+ - does the change touch auth, payments, PII, session data, or external API contracts?
61
+ - does it introduce new dependencies or entitlements?
62
+ - are there error paths that could leak information?
63
+ - is there a regression path that would be hard to detect?
64
+ - does the change affect audit logs or compliance obligations?
65
+
66
+ For every Security/Risk finding, include the severity and a concrete
67
+ mitigation suggestion. Omitting this axis is allowed when the change
68
+ clearly cannot affect security (copy changes, comment fixes, test-only
69
+ additions, docs-only updates).
70
+
71
+ ## 4. Findings
72
+
73
+ Order findings by severity:
74
+
75
+ - Blocker
76
+ - High
77
+ - Medium
78
+ - Low
79
+ - Nit
80
+
81
+ For every finding include:
82
+
83
+ - file/path
84
+ - line or symbol when possible
85
+ - problem
86
+ - why it matters
87
+ - suggested fix
88
+
89
+ Prefer concrete findings over commentary. If no findings exist for a severity, omit that severity.
90
+
91
+ ## 5. Result
92
+
93
+ End with exactly one result line:
94
+
95
+ - `Review result: approve`
96
+ - `Review result: approve with nits`
97
+ - `Review result: changes requested`
98
+ - `Review result: blocked`
99
+
100
+ ## Recommended next command
101
+
102
+ If fixes are needed, recommend one next command only:
103
+
104
+ - small fix -> `/tweak`
105
+ - behavior fix -> `/tdd`
106
+ - unknown cause -> `/fix`
107
+ - design issue -> `/refactor`
108
+ - ready for evidence -> `/verify`
109
+ - ready to commit -> `/commit-and-document`
110
+
111
+ Do not auto-launch any follow-up command.
@@ -96,10 +96,76 @@ Do NOT propose ADRs for:
96
96
 
97
97
  Cap at 0-2 ADRs per scaffold. Zero is fine. Better to ship no ADR than a wrong one.
98
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
+
99
164
  ## MUST
100
165
 
101
166
  - Ask confirm before writing `CONTEXT.md` (show full proposed list + diff against existing)
102
167
  - Ask confirm per ADR before writing
168
+ - Ask confirm per optional doc before writing
103
169
  - Never overwrite non-empty `CONTEXT.md` without explicit "replace"
104
170
  - Never invent cross-cutting decisions; only propose ADRs you can point at code
105
171
  - Keep `CONTEXT.md` glossary-only; no impl/spec notes
@@ -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. Root `CONTEXT.md`, `CONTEXT-MAP.md`.
18
- 5. `docs/adr/`, `src/*/docs/adr/`.
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 root `CONTEXT.md` + `docs/adr/`; multi-context `CONTEXT-MAP.md` → per-context docs.
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. Root `CONTEXT.md`, or root `CONTEXT-MAP.md` then relevant context docs.
7
- 2. Relevant root `docs/adr/` ADRs.
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`.
@@ -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. Offer `/commit-and-document` only after user satisfied.
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.
@@ -6,7 +6,7 @@
6
6
  "roleDefinition": "You are an Execution Specialist. You implement, test, update docs, prototype, and commit when explicitly approved.",
7
7
  "whenToUse": "Use for small or well-understood implementation, CSS/UI changes, TDD loops, documentation updates, runnable prototypes, known fixes, and approved commits. Do not make broad architecture decisions.",
8
8
  "description": "Fast execution for tweaks, TDD, docs, prototypes, and approved commits.",
9
- "customInstructions": "Use `.roo/rules-code-tweaker/` for mode-specific behavior.\n\nPermitted commands: /tweak, /tdd, /update-docs, /commit-and-document, /prototype, /scaffold-context.\n\nFollow `.roo/rules/01-command-protocol.md` to load and execute commands. Follow `.roo/rules/00-paths.md` for path safety. Follow `.roo/rules/03-manual-reply-protocol.md` when asking the user to choose, approve, or continue.\n\nIf assigned any other command, stop and report the routing error.",
9
+ "customInstructions": "Use `.roo/rules-code-tweaker/` for mode-specific behavior.\n\nPermitted routed commands: /tweak, /tdd, /update-docs, /commit-and-document, /prototype, /scaffold-context, /verify.\n\nPermitted direct helper commands: /write-a-skill, /setup-matt-pocock-skills.\n\nFollow `.roo/rules/01-command-protocol.md` to load and execute commands. Follow `.roo/rules/00-paths.md` for path safety. Follow `.roo/rules/03-manual-reply-protocol.md` when asking the user to choose, approve, or continue.\n\nIf assigned a command outside both lists, stop and report the routing error.",
10
10
  "groups": [
11
11
  "read",
12
12
  "edit",
@@ -20,7 +20,7 @@
20
20
  "roleDefinition": "You are a System Architect. You plan, diagnose, explore, triage, and design. You do NOT write implementation code.",
21
21
  "whenToUse": "Use for unknown bugs, feature planning, architecture/refactor design, codebase exploration, and issue triage. Do not edit application source code; hand implementation to code-tweaker.",
22
22
  "description": "Planning, diagnosis, refactor design, exploration, and triage.",
23
- "customInstructions": "Use `.roo/rules-system-architect/` for mode-specific behavior.\n\nPermitted commands: /feature, /fix, /refactor, /explore, /triage.\n\nFollow `.roo/rules/01-command-protocol.md` to load and execute commands. Follow `.roo/rules/00-paths.md` for path safety. Follow `.roo/rules/03-manual-reply-protocol.md` when asking the user to choose, approve, or continue.\n\nIf assigned any other command, stop and report the routing error.",
23
+ "customInstructions": "Use `.roo/rules-system-architect/` for mode-specific behavior.\n\nPermitted routed commands: /feature, /fix, /refactor, /explore, /triage, /review.\n\nPermitted direct helper commands: /diagnose, /grill-with-docs, /improve-codebase-architecture, /to-prd, /to-issues, /zoom-out, /handoff, /grill-me.\n\nFollow `.roo/rules/01-command-protocol.md` to load and execute commands. Follow `.roo/rules/00-paths.md` for path safety. Follow `.roo/rules/03-manual-reply-protocol.md` when asking the user to choose, approve, or continue.\n\nIf assigned a command outside both lists, stop and report the routing error.",
24
24
  "groups": [
25
25
  "command",
26
26
  "mcp",
@@ -40,7 +40,7 @@
40
40
  "roleDefinition": "You are a PM and router. You choose workflows and delegate subtasks. You NEVER inspect implementation files, write code, or use switch_mode.",
41
41
  "whenToUse": "Use as the default entry mode for normal user requests. Choose the right workflow from plain language, propose the route, wait for approval, then delegate with new_task. Use slash commands only when the user explicitly invokes them.",
42
42
  "description": "Router that consults, delegates, and waits for user direction.",
43
- "customInstructions": "Use `.roo/rules-custom-orchestrator/` for mode-specific behavior.\n\nRoute only these commands. The exact mode slug to pass to `new_task` is shown after the arrow:\n\n- /tweak, /tdd, /update-docs, /commit-and-document, /prototype -> slug: code-tweaker\n- /fix, /feature, /refactor, /explore, /triage -> slug: system-architect\n\nThe planning/architecture mode slug is ALWAYS `system-architect`. Never use `architect`.\n\nPropose, then wait for approval before delegating. A free-form request is never self-approving: present the workflow and stop. Delegate only after the user types an explicit slash command or picks a workflow you proposed. See `.roo/rules-custom-orchestrator/00-routing.md` (Approval gate).\n\nUse `new_task` only. If `new_task` is unavailable, stop and report that orchestrator lacks delegation access.\n\nFollow `.roo/rules/03-manual-reply-protocol.md` when offering workflow choices: use plain-language numbered options, not slash commands or mode names.\n\nNever use built-in/default modes for new_task. Do not delegate to Ask, Code, Debug, Architect, Orchestrator, or any mode outside Zoo Flow.\n\nFor analysis/review/inspection tasks, use slug: system-architect.\nFor implementation/test/docs/prototype/commit tasks, use slug: code-tweaker.",
43
+ "customInstructions": "Use `.roo/rules-custom-orchestrator/` for mode-specific behavior.\n\nRoute only these commands. The exact mode slug to pass to `new_task` is shown after the arrow:\n\n- /tweak, /tdd, /update-docs, /commit-and-document, /prototype, /verify -> slug: code-tweaker\n- /fix, /feature, /refactor, /explore, /triage, /review -> slug: system-architect\n\nThe planning/architecture mode slug is ALWAYS `system-architect`. Never use `architect`.\n\nPropose, then wait for approval before delegating. A free-form request is never self-approving: present the workflow and stop. Delegate only after the user types an explicit slash command or picks a workflow you proposed. See `.roo/rules-custom-orchestrator/00-routing.md` (Approval gate).\n\nUse `new_task` only. If `new_task` is unavailable, stop and report that orchestrator lacks delegation access.\n\nFollow `.roo/rules/03-manual-reply-protocol.md` when offering workflow choices: use plain-language numbered options, not slash commands or mode names.\n\nNever use built-in/default modes for new_task. Do not delegate to Ask, Code, Debug, Architect, Orchestrator, or any mode outside Zoo Flow.\n\nFor analysis/review/inspection tasks, use slug: system-architect.\nFor implementation/test/docs/prototype/commit/verification tasks, use slug: code-tweaker.",
44
44
  "groups": []
45
45
  }
46
46
  ]
@@ -22,5 +22,7 @@ Before accepting workflow changes, verify:
22
22
  - [ ] `.zoo-flow/START_HERE.md` remains the source of truth for first-run initialization.
23
23
  - [ ] First-run guidance explains `/scaffold-context` and `/setup-matt-pocock-skills`.
24
24
  - [ ] Custom Orchestrator never delegates to built-in/default Ask mode.
25
- - [ ] Analysis, review, inspection, and safety-check subtasks route to `system-architect`.
26
- - [ ] Implementation, tests, docs, prototype, and commit subtasks route to `code-tweaker`.
25
+ - [ ] Analysis, review, inspection, and safety-check subtasks route to `system-architect`.
26
+ - [ ] Implementation, tests, docs, prototype, and commit subtasks route to `code-tweaker`.
27
+ - [ ] Verification requests route to `code-tweaker`.
28
+ - [ ] Non-trivial work suggests `/verify` and `/review` before `/commit-and-document` but does not auto-launch them.
@@ -0,0 +1,20 @@
1
+ {"name":"small implementation","user":"Fix typo in README heading","expected_workflow":"small implementation","expected_command":"/tweak","expected_mode":"code-tweaker","must_require_approval":true,"must_not_include":["/tweak","code-tweaker","Ask mode"],"risk":"R1","context_required":false}
2
+ {"name":"test-first","user":"Add a slugify helper for article URLs. I want it test-first.","expected_workflow":"test-first","expected_command":"/tdd","expected_mode":"code-tweaker","must_require_approval":true,"must_not_include":["/tdd","code-tweaker","Ask mode"],"risk":"R2","context_required":false}
3
+ {"name":"documentation update","user":"The architecture docs describe an old checkout flow. Bring them in line with code.","expected_workflow":"documentation update","expected_command":"/update-docs","expected_mode":"code-tweaker","must_require_approval":true,"must_not_include":["/update-docs","code-tweaker","Ask mode"],"risk":"R2","context_required":true}
4
+ {"name":"commit and journal","user":"Commit the finished change and add a journal entry.","expected_workflow":"commit and journal","expected_command":"/commit-and-document","expected_mode":"code-tweaker","must_require_approval":true,"must_not_include":["/commit-and-document","code-tweaker","Ask mode"],"risk":"R1","context_required":false}
5
+ {"name":"prototype","user":"I am not sure if search ranking should run inline or in a queue. Try both.","expected_workflow":"prototype","expected_command":"/prototype","expected_mode":"code-tweaker","must_require_approval":true,"must_not_include":["/prototype","code-tweaker","Ask mode"],"risk":"R2","context_required":false}
6
+ {"name":"diagnosis","user":"Checkout randomly crashes after payment. It used to work.","expected_workflow":"diagnosis","expected_command":"/fix","expected_mode":"system-architect","must_require_approval":true,"must_not_include":["/fix","system-architect","Ask mode"],"risk":"R3","context_required":true}
7
+ {"name":"feature planning","user":"Add team invitations with email invites and pending invite states.","expected_workflow":"feature planning","expected_command":"/feature","expected_mode":"system-architect","must_require_approval":true,"must_not_include":["/feature","system-architect","Ask mode"],"risk":"R4","context_required":true}
8
+ {"name":"refactor planning","user":"The auth module is hard to change. Decouple provider-specific logic.","expected_workflow":"refactor planning","expected_command":"/refactor","expected_mode":"system-architect","must_require_approval":true,"must_not_include":["/refactor","system-architect","Ask mode"],"risk":"R4","context_required":true}
9
+ {"name":"exploration","user":"I need to change billing but I do not know where that logic lives.","expected_workflow":"exploration","expected_command":"/explore","expected_mode":"system-architect","must_require_approval":true,"must_not_include":["/explore","system-architect","Ask mode"],"risk":"R2","context_required":false}
10
+ {"name":"issue triage","user":"Triage these incoming support bugs into tracker issues.","expected_workflow":"issue triage","expected_command":"/triage","expected_mode":"system-architect","must_require_approval":true,"must_not_include":["/triage","system-architect","Ask mode"],"risk":"R2","context_required":false}
11
+ {"name":"review","user":"Review this branch before I commit it.","expected_workflow":"review","expected_command":"/review","expected_mode":"system-architect","must_require_approval":true,"must_not_include":["/review","system-architect","Ask mode"],"risk":"R2","context_required":true}
12
+ {"name":"verification","user":"Run tests for this change and make sure nothing broke.","expected_workflow":"verification","expected_command":"/verify","expected_mode":"code-tweaker","must_require_approval":true,"must_not_include":["/verify","code-tweaker","Ask mode"],"risk":"R2","context_required":false}
13
+ {"name":"R5 auth security migration","user":"Migrate auth session storage and preserve existing user sessions.","expected_workflow":"feature planning","expected_command":"/feature","expected_mode":"system-architect","must_require_approval":true,"must_not_include":["/feature","system-architect","Ask mode","Code mode"],"risk":"R5","context_required":true}
14
+ {"name":"deep inspection no Ask","user":"Do you think these changes are beneficial? Inspect deeply if it affects the system.","expected_workflow":"review","expected_command":"/review","expected_mode":"system-architect","must_require_approval":true,"must_not_include":["Ask mode","Architect mode","ask"],"risk":"R3","context_required":true}
15
+ {"name":"explicit slash command approval","user":"/tweak rename the cancel button to close.","expected_workflow":"small implementation","expected_command":"/tweak","expected_mode":"code-tweaker","must_require_approval":false,"must_not_include":["approval pending","Ask mode"],"risk":"R1","context_required":false}
16
+ {"name":"free-form approval required","user":"Rename the cancel button to close.","expected_workflow":"small implementation","expected_command":"/tweak","expected_mode":"code-tweaker","must_require_approval":true,"must_not_include":["/tweak","code-tweaker","Ask mode"],"risk":"R1","context_required":false}
17
+ {"name":"R4 cross-module design","user":"Split the monolith billing module into three services.","expected_workflow":"refactor planning","expected_command":"/refactor","expected_mode":"system-architect","must_require_approval":true,"must_not_include":["/refactor","system-architect","Ask mode"],"risk":"R4","context_required":true,"forbidden_followups":["/tweak","/tdd"]}
18
+ {"name":"R3 behavior change with clear interface","user":"Add a rate limiter to the public API. 100 req/min per key.","expected_workflow":"test-first","expected_command":"/tdd","expected_mode":"code-tweaker","must_require_approval":true,"must_not_include":["/tdd","code-tweaker","Ask mode"],"risk":"R3","context_required":true,"recommended_followup":"/verify"}
19
+ {"name":"no doc bloat for small tweak","user":"Change the Save button text to Submit.","expected_workflow":"small implementation","expected_command":"/tweak","expected_mode":"code-tweaker","must_require_approval":true,"must_not_include":["architecture docs","domain docs","CONTEXT.md"],"risk":"R1","context_required":false,"no_doc_bloat":true}
20
+ {"name":"diagnosis with cause unknown","user":"The payment webhook stopped firing after the last deploy.","expected_workflow":"diagnosis","expected_command":"/fix","expected_mode":"system-architect","must_require_approval":true,"must_not_include":["/fix","system-architect","Ask mode"],"risk":"R4","context_required":true}
@@ -198,6 +198,30 @@ Delegation target after approval:
198
198
  `system-architect`
199
199
 
200
200
  Must not:
201
- - Delegate to Ask mode.
202
- - Delegate to default Architect mode.
203
- - Use any mode other than `system-architect` or `code-tweaker`.
201
+ - Delegate to Ask mode.
202
+ - Delegate to default Architect mode.
203
+ - Use any mode other than `system-architect` or `code-tweaker`.
204
+
205
+ ## Case — Review
206
+
207
+ User:
208
+ "Review this branch before I commit it."
209
+
210
+ Expected:
211
+ Recommend the review workflow.
212
+
213
+ Must:
214
+ - Route to `system-architect` after approval.
215
+ - Report findings by severity.
216
+
217
+ ## Case — Verification
218
+
219
+ User:
220
+ "Run tests for this change and make sure nothing broke."
221
+
222
+ Expected:
223
+ Recommend the verification workflow.
224
+
225
+ Must:
226
+ - Route to `code-tweaker` after approval.
227
+ - Report exact commands run and results.
@@ -0,0 +1,24 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "projectShape": null,
4
+ "packageManager": null,
5
+ "issueTracker": {
6
+ "kind": null,
7
+ "project": null
8
+ },
9
+ "verification": {
10
+ "targetedTest": null,
11
+ "typecheck": null,
12
+ "lint": null,
13
+ "build": null,
14
+ "fullTest": null
15
+ },
16
+ "docsPolicy": {
17
+ "localContext": ".zoo-flow/",
18
+ "sharedDocs": ["AGENTS.md", "docs/adr/", "docs/architecture/"]
19
+ },
20
+ "commitPolicy": {
21
+ "conventionalCommits": true,
22
+ "journal": "docs/journal/"
23
+ }
24
+ }
@@ -0,0 +1 @@
1
+ {"name":"bad json","user":"oops",
@@ -0,0 +1 @@
1
+ {"name":"bad mode","user":"Review this","expected_workflow":"review","expected_command":"/review","expected_mode":"architect","must_require_approval":true,"must_not_include":[]}
@@ -0,0 +1 @@
1
+ {"name":"missing command","user":"Do nonexistent thing","expected_workflow":"small implementation","expected_command":"/does-not-exist","expected_mode":"code-tweaker","must_require_approval":true,"must_not_include":[]}
@@ -0,0 +1 @@
1
+ {"expect":"fail","mutation":"bad-built-in-delegation","message":"Built-in/default delegation target"}
@@ -0,0 +1 @@
1
+ {"expect":"fail","mutation":"bad-mode-slug","message":"uses invalid mode: architect"}
@@ -0,0 +1 @@
1
+ {"expect":"fail","mutation":"bad-skill-wrapper","message":"non-canonical skill wrapper"}
@@ -0,0 +1 @@
1
+ {"expect":"fail","mutation":"bad-zoo-path","message":"Bad pattern \".zoo/\""}
@@ -0,0 +1 @@
1
+ {"expect":"fail","mutation":"helper-missing-mode","message":"must declare mode: system-architect"}
@@ -0,0 +1 @@
1
+ {"expect":"fail","mutation":"helper-not-permitted","message":"does not permit documented command /diagnose"}
@@ -0,0 +1 @@
1
+ {"expect":"pass","mutation":"none","message":"doctor passed"}
@@ -0,0 +1 @@
1
+ {"expect":"fail","mutation":"missing-command","message":"missing command file"}
@@ -0,0 +1 @@
1
+ {"expect":"fail","mutation":"missing-roomodes","message":"Missing .roomodes"}
@@ -0,0 +1 @@
1
+ {"expect":"fail","mutation":"missing-skill","message":"references missing skill"}
@@ -0,0 +1 @@
1
+ package main; func main() { println("hello") }
@@ -0,0 +1 @@
1
+ {"expected_shape": "cli-tool", "keywords": ["cli"]}
@@ -0,0 +1 @@
1
+ {"name": "test-cli", "keywords": ["cli"]}
@@ -0,0 +1 @@
1
+ {"expected_shape": "data-pipeline", "keywords": ["data-pipeline"]}
@@ -0,0 +1 @@
1
+ def run_invoice_pipeline(): pass
@@ -0,0 +1,2 @@
1
+ [project]
2
+ name = "test-pipeline"
@@ -0,0 +1 @@
1
+ {"expected_shape": "library", "keywords": ["library"]}
@@ -0,0 +1 @@
1
+ {"name": "test-lib", "keywords": ["library"]}
@@ -0,0 +1 @@
1
+ export const greet = (name: string) => `Hello, ${name}`;
@@ -0,0 +1 @@
1
+ {"expected_shape": "monorepo", "keywords": ["monorepo"]}
@@ -0,0 +1 @@
1
+ {"name": "test-monorepo", "keywords": ["monorepo"]}
@@ -0,0 +1 @@
1
+ export const core = "core";
@@ -0,0 +1 @@
1
+ export const web = "web";
@@ -0,0 +1 @@
1
+ {"expected_shape": "serverless", "keywords": ["serverless"]}
@@ -0,0 +1 @@
1
+ export const handler = async () => ({ statusCode: 200 });
@@ -0,0 +1 @@
1
+ {"name": "test-serverless", "keywords": ["serverless"]}
@@ -0,0 +1 @@
1
+ export default function Home() { return <div>Home</div>; }
@@ -0,0 +1 @@
1
+ {"expected_shape": "web-app", "keywords": ["web-app"]}
@@ -0,0 +1 @@
1
+ {"name": "test-webapp", "keywords": ["web-app"]}
@@ -0,0 +1,21 @@
1
+ # Golden: Small Tweak
2
+
3
+ ## User
4
+ Change the Save button text to Submit.
5
+
6
+ ## Workflow
7
+ small implementation -> /tweak -> code-tweaker
8
+
9
+ ## Expected structure
10
+ 1. Orchestrator proposes "small implementation" in plain language.
11
+ 2. User approves.
12
+ 3. Orchestrator delegates /tweak to code-tweaker.
13
+ 4. Code Tweaker reads the command, applies the change.
14
+ 5. Code Tweaker reports: files changed, what changed, status.
15
+ 6. Code Tweaker uses attempt_completion with evidence.
16
+
17
+ ## Must not include
18
+ - /tweak in user-facing options
19
+ - code-tweaker as a clickable choice
20
+ - Architecture doc reads
21
+ - Domain doc reads