@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,105 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from "node:fs";
4
+ import path from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+ const packageRoot = path.resolve(__dirname, "..");
10
+
11
+ const EXCEPTIONS_PATH = path.join(packageRoot, "quality", "token-budget.exceptions.json");
12
+ const TIERS = [
13
+ { label: "tier-1-rules", dirs: [".roo/rules/", ".roo/rules-code-tweaker/", ".roo/rules-system-architect/", ".roo/rules-custom-orchestrator/"], max_bytes: 16000 },
14
+ { label: "tier-2-commands", dirs: [".roo/commands/"], max_bytes: 8000 },
15
+ { label: "tier-3-skills", dirs: [".roo/skills/"], max_bytes: 32000 },
16
+ { label: "tier-4-config", dirs: [".roomodes", ".roo/"], max_bytes: 4000, allow_files: true },
17
+ { label: "tier-5-docs", dirs: ["docs/"], max_bytes: 64000 },
18
+ { label: "tier-6-evidence", dirs: [".zoo-flow/evals/"], max_bytes: 8000 }
19
+ ];
20
+
21
+ const failures = [];
22
+ let exceptions = { overrides: {} };
23
+
24
+ if (fs.existsSync(EXCEPTIONS_PATH)) {
25
+ try {
26
+ exceptions = JSON.parse(fs.readFileSync(EXCEPTIONS_PATH, "utf8"));
27
+ } catch (error) {
28
+ failures.push(`Invalid exceptions file: ${error.message}`);
29
+ }
30
+ }
31
+
32
+ function getExceptionKey(relativePath) {
33
+ return relativePath.replace(/\\/g, "/");
34
+ }
35
+
36
+ function getMaxOverride(relativePath) {
37
+ const key = getExceptionKey(relativePath);
38
+ const override = exceptions.overrides && exceptions.overrides[key];
39
+ return override ? override.max_bytes : null;
40
+ }
41
+
42
+ for (const tier of TIERS) {
43
+ for (const dirPattern of tier.dirs) {
44
+ const absPath = path.join(packageRoot, dirPattern);
45
+ if (!fs.existsSync(absPath)) continue;
46
+
47
+ let tierSize = 0;
48
+
49
+ if (tier.allow_files && fs.statSync(absPath).isFile()) {
50
+ const override = getMaxOverride(dirPattern);
51
+ if (override !== null) continue; // override allows it
52
+ const size = fs.statSync(absPath).size;
53
+ if (size > tier.max_bytes) {
54
+ failures.push(`${dirPattern} (${size} bytes) exceeds tier ${tier.label} limit (${tier.max_bytes})`);
55
+ }
56
+ continue;
57
+ }
58
+
59
+ const walkDir = (dir) => {
60
+ for (const entry of fs.readdirSync(dir)) {
61
+ const full = path.join(dir, entry);
62
+ const stat = fs.statSync(full);
63
+ if (stat.isDirectory()) {
64
+ walkDir(full);
65
+ } else {
66
+ const ext = path.extname(full);
67
+ if (![".md", ".json", ".txt", ".yaml", ".yml", ".jsonl"].includes(ext)) continue;
68
+
69
+ const relative = path.relative(packageRoot, full).replace(/\\/g, "/");
70
+ const override = getMaxOverride(relative);
71
+ if (override !== null) continue; // allowed by exception
72
+
73
+ tierSize += stat.size;
74
+ }
75
+ }
76
+ };
77
+
78
+ walkDir(absPath);
79
+
80
+ if (tierSize > tier.max_bytes) {
81
+ failures.push(`${dirPattern} tree (${tierSize} bytes) exceeds tier ${tier.label} limit (${tier.max_bytes})`);
82
+ }
83
+ }
84
+ }
85
+
86
+ // Also check README and CONTEXT.md sizes
87
+ const readmePath = path.join(packageRoot, "README.md");
88
+ if (fs.existsSync(readmePath)) {
89
+ const size = fs.statSync(readmePath).size;
90
+ const override = getMaxOverride("README.md");
91
+ if (override === null && size > 24000) {
92
+ failures.push(`README.md (${size} bytes) exceeds default limit (24000)`);
93
+ }
94
+ }
95
+
96
+ if (failures.length > 0) {
97
+ console.error("\nToken budget check failed:\n");
98
+ for (const failure of failures) {
99
+ console.error(`- ${failure}`);
100
+ }
101
+ console.error("\nAdd exceptions in quality/token-budget.exceptions.json if this is intentional.\n");
102
+ process.exit(1);
103
+ }
104
+
105
+ console.log("Token budget check passed");
@@ -2,6 +2,6 @@
2
2
  description: "Ultra-compressed communication mode. Cuts token usage ~75% by dropping filler, articles, and pleasantries while keeping full technical accuracy. Use when user says \"caveman mode\", \"talk like caveman\", \"use caveman\", \"less tokens\", \"be brief\", or invokes /caveman."
3
3
  ---
4
4
 
5
- Run skill: `.roo/skills/productivity/caveman/SKILL.md`
5
+ Skill: `.roo/skills/productivity/caveman/SKILL.md`
6
6
 
7
7
  $ARGUMENTS
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  description: "Disciplined diagnosis loop for hard bugs and performance regressions. Reproduce → minimise → hypothesise → instrument → fix → regression-test. Use when user says \"diagnose this\" / \"debug this\", reports a bug, says something is broken/throwing/failing, or describes a performance regression."
3
+ mode: system-architect
3
4
  ---
4
5
 
5
- Run skill: `.roo/skills/engineering/diagnose/SKILL.md`
6
+ Skill: `.roo/skills/engineering/diagnose/SKILL.md`
6
7
 
7
8
  $ARGUMENTS
@@ -16,6 +16,6 @@ EXECUTION RULES (Run sequentially. Wait for user between phases):
16
16
  5. IMPLEMENT (Tweaker):
17
17
  - Architect summarizes issues.
18
18
  - Architect MUST `switch_mode` -> `code-tweaker`.
19
- - Tweaker: For each issue, execute the `/tdd` command workflow (per `.roo/rules/01-command-protocol.md`). After each ships, suggest `/commit-and-document`.
19
+ - Tweaker: For each issue, execute the `/tdd` command workflow (per `.roo/rules/01-command-protocol.md`). After each ships, suggest `/verify`, then `/review`, then `/commit-and-document`. Do not auto-launch.
20
20
 
21
21
  $ARGUMENTS
@@ -15,6 +15,6 @@ EXECUTION RULES:
15
15
  - Tweaker MUST `switch_mode` -> `system-architect`.
16
16
  4. POST-MORTEM (Architect): Execute Phase 6. If architectural rot, suggest `/refactor`.
17
17
  - Architect MUST `switch_mode` -> `code-tweaker`.
18
- 5. COMMIT (Tweaker): Suggest `/commit-and-document`.
18
+ 5. FOLLOW-UP (Tweaker): Suggest `/verify`, then `/review`, then `/commit-and-document`. Do not auto-launch.
19
19
 
20
20
  $ARGUMENTS
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  description: "Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions \"grill me\"."
3
+ mode: system-architect
3
4
  ---
4
5
 
5
- Run skill: `.roo/skills/productivity/grill-me/SKILL.md`
6
+ Skill: `.roo/skills/productivity/grill-me/SKILL.md`
6
7
 
7
8
  $ARGUMENTS
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  description: "Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions."
3
+ mode: system-architect
3
4
  ---
4
5
 
5
- Run skill: `.roo/skills/engineering/grill-with-docs/SKILL.md`
6
+ Skill: `.roo/skills/engineering/grill-with-docs/SKILL.md`
6
7
 
7
8
  $ARGUMENTS
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  description: "Compact the current conversation into a handoff document for another agent to pick up."
3
3
  argument-hint: "What will the next session be used for?"
4
+ mode: system-architect
4
5
  ---
5
6
 
6
- Run skill: `.roo/skills/productivity/handoff/SKILL.md`
7
+ Skill: `.roo/skills/productivity/handoff/SKILL.md`
7
8
 
8
9
  $ARGUMENTS
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  description: "Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in docs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable."
3
+ mode: system-architect
3
4
  ---
4
5
 
5
- Run skill: `.roo/skills/engineering/improve-codebase-architecture/SKILL.md`
6
+ Skill: `.roo/skills/engineering/improve-codebase-architecture/SKILL.md`
6
7
 
7
8
  $ARGUMENTS
@@ -4,6 +4,6 @@ argument-hint: <prototype question or design uncertainty>
4
4
  mode: code-tweaker
5
5
  ---
6
6
 
7
- Run skill: `.roo/skills/engineering/prototype/SKILL.md`
7
+ Skill: `.roo/skills/engineering/prototype/SKILL.md`
8
8
 
9
9
  $ARGUMENTS
@@ -13,6 +13,6 @@ EXECUTION RULES:
13
13
  - Architect summarizes approved plan.
14
14
  - Architect MUST `switch_mode` -> `code-tweaker`.
15
15
  - Tweaker executes the `/tdd` command workflow (per `.roo/rules/01-command-protocol.md`) — new tests at interface, delete old.
16
- - Tweaker suggests `/commit-and-document`.
16
+ - Tweaker suggests `/verify`, then `/review`, then `/commit-and-document`. Do not auto-launch.
17
17
 
18
18
  $ARGUMENTS
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: "Review a diff or branch against the requested spec, project standards, architecture, and likely regressions. Use before committing non-trivial work."
3
+ argument-hint: <optional base ref, files, issue, PRD, or review focus>
4
+ mode: system-architect
5
+ ---
6
+
7
+ Review the current diff or requested target. Follow the skill exactly.
8
+
9
+ Skill: `.roo/skills/engineering/review/SKILL.md`
10
+
11
+ $ARGUMENTS
@@ -3,6 +3,6 @@ description: "Sets up an `## Agent skills` block in AGENTS.md/CLAUDE.md and `doc
3
3
  mode: code-tweaker
4
4
  ---
5
5
 
6
- Run skill: `.roo/skills/engineering/setup-matt-pocock-skills/SKILL.md`
6
+ Skill: `.roo/skills/engineering/setup-matt-pocock-skills/SKILL.md`
7
7
 
8
8
  $ARGUMENTS
@@ -4,6 +4,6 @@ argument-hint: <feature or bug to build>
4
4
  mode: code-tweaker
5
5
  ---
6
6
 
7
- Run skill: `.roo/skills/engineering/tdd/SKILL.md`
7
+ Skill: `.roo/skills/engineering/tdd/SKILL.md`
8
8
 
9
9
  $ARGUMENTS
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  description: "Break a plan, spec, or PRD into independently-grabbable issues on the project issue tracker using tracer-bullet vertical slices. Use when user wants to convert a plan into issues, create implementation tickets, or break down work into issues."
3
+ mode: system-architect
3
4
  ---
4
5
 
5
- Run skill: `.roo/skills/engineering/to-issues/SKILL.md`
6
+ Skill: `.roo/skills/engineering/to-issues/SKILL.md`
6
7
 
7
8
  $ARGUMENTS
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  description: "Turn the current conversation context into a PRD and publish it to the project issue tracker. Use when user wants to create a PRD from the current context."
3
+ mode: system-architect
3
4
  ---
4
5
 
5
- Run skill: `.roo/skills/engineering/to-prd/SKILL.md`
6
+ Skill: `.roo/skills/engineering/to-prd/SKILL.md`
6
7
 
7
8
  $ARGUMENTS
@@ -3,6 +3,6 @@ description: "Triage issues through a state machine driven by triage roles. Use
3
3
  mode: system-architect
4
4
  ---
5
5
 
6
- Run skill: `.roo/skills/engineering/triage/SKILL.md`
6
+ Skill: `.roo/skills/engineering/triage/SKILL.md`
7
7
 
8
8
  $ARGUMENTS
@@ -4,6 +4,6 @@ argument-hint: <what to change>
4
4
  mode: code-tweaker
5
5
  ---
6
6
 
7
- Run skill: `.roo/skills/engineering/tweak/SKILL.md`
7
+ Skill: `.roo/skills/engineering/tweak/SKILL.md`
8
8
 
9
9
  $ARGUMENTS
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: "Run the smallest useful verification checks for the current change: tests, typecheck, lint, build, or targeted project checks. Never claim verified unless checks actually ran."
3
+ argument-hint: <optional focus area, file, test, or command>
4
+ mode: code-tweaker
5
+ ---
6
+
7
+ Verify the current change with the smallest useful checks. Follow the skill exactly.
8
+
9
+ Skill: `.roo/skills/engineering/verify/SKILL.md`
10
+
11
+ $ARGUMENTS
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  description: "Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill."
3
+ mode: code-tweaker
3
4
  ---
4
5
 
5
- Run skill: `.roo/skills/productivity/write-a-skill/SKILL.md`
6
+ Skill: `.roo/skills/productivity/write-a-skill/SKILL.md`
6
7
 
7
8
  $ARGUMENTS
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  description: "Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture."
3
+ mode: system-architect
3
4
  ---
4
5
 
5
- Run skill: `.roo/skills/engineering/zoom-out/SKILL.md`
6
+ Skill: `.roo/skills/engineering/zoom-out/SKILL.md`
6
7
 
7
8
  $ARGUMENTS
@@ -11,7 +11,7 @@ When assigned a slash command, execute its command workflow before task-specific
11
11
  3. Fallback: if `run_slash_command` is unavailable, disabled, rejected, or fails, read `.roo/commands/{command}.md`.
12
12
 
13
13
  4. After command content is loaded:
14
- - If it explicitly contains `Skill: .roo/skills/.../SKILL.md`, read that exact skill and follow it.
14
+ - If it explicitly contains the canonical `Skill:` marker with `.roo/skills/.../SKILL.md`, read that exact skill and follow it.
15
15
  - If it contains direct workflow steps, execute those steps directly.
16
16
  - Do not assume every command has a skill.
17
17
  - Do not read any skill unless the command explicitly references it.
@@ -14,16 +14,14 @@ For long command output, summarize or search the output instead of dumping every
14
14
 
15
15
  ## Domain-doc read gate
16
16
 
17
- Do not read CONTEXT.md, CONTEXT-MAP.md, FLOW.md, APP_MAP.md, ARCHITECTURE.md, or ADRs by default.
17
+ Do not read `.zoo-flow/CONTEXT.md` or `.zoo-flow/docs/adr/` files by default.
18
18
 
19
19
  Read domain docs only when at least one is true:
20
20
 
21
21
  - The task touches domain language or terminology.
22
22
  - The task changes public behavior.
23
23
  - The task changes architecture, module seams, persistence, API shape, auth, payments, security, migrations, or cross-module design.
24
- - The command explicitly requires those docs, such as `/feature`, `/refactor`, `/grill-with-docs`, `/scaffold-context`, or relevant `/update-docs`.
24
+ - The command explicitly requires those docs (e.g. `/feature`, `/refactor`, `/grill-with-docs`, `/scaffold-context`, `/update-docs`).
25
25
  - The user asks for documentation, architecture, product, or domain-context work.
26
26
 
27
- For low-risk localized edits, prefer code search and targeted file reads first.
28
-
29
- Missing CONTEXT.md or ADRs is not an error. Use the slot discovery rule in `.roo/skills/engineering/grill-with-docs/CONTEXT-FORMAT.md` to detect what is present, and proceed silently when nothing is.
27
+ Missing CONTEXT.md or ADRs is not an error. Proceed silently when nothing is present.
@@ -13,11 +13,15 @@ Before any `attempt_completion`, re-read the command body and confirm no later p
13
13
 
14
14
  `attempt_completion` must include:
15
15
 
16
- - what was done
17
- - files changed or inspected
18
- - commands/tests run
19
- - status
20
- - blockers
21
- - recommended next command
22
-
23
- Before running `git commit` or `git push`, halt and wait for explicit user approval. Never push unless explicitly asked.
16
+ - what was done (exact scope)
17
+ - files changed or inspected (paths)
18
+ - commands/tests run (exact commands, pass/fail per command)
19
+ - status (complete / partial / blocked with reason)
20
+ - remaining risk (what was not checked or is uncertain)
21
+ - recommended next command (one only, no auto-launch)
22
+
23
+ Before running `git commit` or `git push`, halt and wait for explicit user approval. Never push unless explicitly asked.
24
+
25
+ For non-trivial `/tdd`, `/fix`, `/feature`, `/refactor`, or R3+ `/tweak` work, recommend `/verify` before `/review` before `/commit-and-document`. Do not auto-launch those commands.
26
+
27
+ If the user explicitly says to remember a project rule, or the same mistake has repeated, ask before appending a short lesson to `.zoo-flow/LESSONS.md`. Do not read or write lessons by default.
@@ -11,9 +11,9 @@ The only valid `new_task` target slugs are:
11
11
 
12
12
  Never delegate to built-in/default modes, including Ask, Code, Debug, Architect, or Orchestrator.
13
13
 
14
- If a task sounds like "ask", "inspect", "review", "analyze", "deep inspection", "investigate", or "reason about safety", route it to `system-architect`.
14
+ If a task sounds like "ask", "inspect", "review", "branch review", "pre-commit review", "analyze", "deep inspection", "investigate", or "reason about safety", route it to `system-architect`.
15
15
 
16
- If a task requires source edits, tests, docs updates, prototypes, or commits, route it to `code-tweaker`.
16
+ If a task requires source edits, tests, verification, docs updates, prototypes, or commits, route it to `code-tweaker`.
17
17
 
18
18
  If neither custom mode is suitable, stop and report that no valid Zoo Flow mode exists. Do not fall back to Ask mode.
19
19
 
@@ -23,7 +23,7 @@ Users are not expected to know slash commands. For free-form requests, infer the
23
23
 
24
24
  ## User-facing workflow names
25
25
 
26
- Slash commands are internal routing labels unless the user explicitly typed one or asked for syntax. For free-form requests, use plain-language workflow names only: small implementation, test-first, diagnosis, feature planning, refactor planning, exploration, documentation update, commit and journal, prototype, issue triage. Never show slash commands as selectable options for free-form requests. Internal delegation may still use the slash command after approval.
26
+ Slash commands are internal routing labels unless the user explicitly typed one or asked for syntax. For free-form requests, use plain-language workflow names only: small implementation, test-first, diagnosis, feature planning, refactor planning, exploration, documentation update, commit and journal, prototype, issue triage, review, verification. Never show slash commands as selectable options for free-form requests. Internal delegation may still use the slash command after approval.
27
27
 
28
28
  ## Routed commands
29
29
 
@@ -37,12 +37,14 @@ Slash commands are internal routing labels unless the user explicitly typed one
37
37
  | diagnosis | `/fix` | system-architect |
38
38
  | feature planning | `/feature` | system-architect |
39
39
  | refactor planning | `/refactor` | system-architect |
40
- | exploration | `/explore` | system-architect |
41
- | issue triage | `/triage` | system-architect |
40
+ | exploration | `/explore` | system-architect |
41
+ | issue triage | `/triage` | system-architect |
42
+ | review | `/review` | system-architect |
43
+ | verification | `/verify` | code-tweaker |
42
44
 
43
45
  ## Routing decision guide
44
46
 
45
- Read intent, not keywords. Top-down: 1. unknown code area or unclear next move → exploration; 2. broken behavior with unknown cause → diagnosis; 3. new capability needing design, PRD, issue slicing, or phase gates → feature planning; 4. working behavior but structure is the problem → refactor planning; 5. small known low-risk change → small implementation; 6. clear behavior and interface, user wants tests first → test-first; 7. throwaway design/state/UI uncertainty → prototype; 8. docs drift from code → documentation update; 9. finished work needs commit/journal → commit and journal; 10. issue creation, sorting, labels, or tracker workflow → issue triage.
47
+ Read intent, not keywords. Top-down: 1. unknown code area or unclear next move → exploration; 2. broken behavior with unknown cause → diagnosis; 3. new capability needing design, PRD, issue slicing, or phase gates → feature planning; 4. working behavior but structure is the problem → refactor planning; 5. small known low-risk change → small implementation; 6. clear behavior and interface, user wants tests first → test-first; 7. throwaway design/state/UI uncertainty → prototype; 8. docs drift from code → documentation update; 9. finished work needs commit/journal → commit and journal; 10. issue creation, sorting, labels, or tracker workflow → issue triage; 11. diff, branch, PR, standards, architecture, or pre-commit inspection → review; 12. check if this passes, run tests for this change, verify the branch, or make sure nothing broke → verification.
46
48
 
47
49
  ## Routing weight
48
50
 
@@ -50,7 +52,7 @@ Prefer the lightest workflow that preserves correctness. Use small implementatio
50
52
 
51
53
  ## Risk levels
52
54
 
53
- Use risk to choose the lightest safe workflow. Risk does not override command intent; explicit slash commands still route as-is. R1 copy/style/doc typo/one-line obvious edit → small implementation. R2 localized code change with known target → small implementation or test-first. R3 behavior change with clear interface → test-first. R4 cross-module change or design tradeoff → feature planning or refactor planning. R5 auth/payments/security/migrations/data loss/external API contracts → strict planning/diagnosis with explicit approval gates.
55
+ Use risk to choose the lightest safe workflow. Risk does not override command intent; explicit slash commands still route as-is. R1 copy/style/doc typo/one-line obvious edit → small implementation. R2 localized code change with known target → small implementation or test-first. R3 behavior change with clear interface → test-first, then suggest verification or review. R4 cross-module change or design tradeoff → feature planning or refactor planning, then suggest verification and review. R5 auth/payments/security/migrations/data loss/external API contracts → strict planning/diagnosis with explicit approval gates, then suggest verification and review.
54
56
 
55
57
  ## Disambiguation
56
58
 
@@ -62,8 +64,20 @@ Explicit slash command from user = approval; route as-is. Clear free-form reques
62
64
 
63
65
  ## Approval gate
64
66
 
65
- The orchestrator proposes; the user approves; then the orchestrator delegates. Explicit slash command = approval; route immediately. Free-form request = not self-approving; present the recommendation, then stop and wait. Treat replies as approval only when they select the proposed workflow by number, option text, or clear restatement. A fresh free-form request restarts routing. If unsure whether the user approved, ask.
67
+ The orchestrator proposes; the user approves; then the orchestrator delegates. Explicit slash command = approval; route immediately. A free-form request is never self-approving; propose a workflow and wait for approval. Present the recommendation, then stop and wait. Treat replies as approval only when they select the proposed workflow by number, option text, or clear restatement. A fresh free-form request restarts routing. If unsure whether the user approved, ask.
66
68
 
67
69
  ## Delegation
68
70
 
69
- Delegate only after the approval gate is satisfied. Choose the safest proceed policy from `01-delegation-message.md`.
71
+ Delegate only after the approval gate is satisfied. Choose the safest proceed policy from `01-delegation-message.md`.
72
+
73
+ ## Follow-up recommendations
74
+
75
+ For non-trivial work, suggest the next command chain only after the current command completes. Do not auto-launch follow-up commands merely because they are mentioned.
76
+
77
+ Recommended chains:
78
+
79
+ - test-first → verification → review → commit and journal
80
+ - diagnosis → verification → review → commit and journal
81
+ - refactor planning → verification → review → commit and journal
82
+ - feature planning → verification → review → commit and journal
83
+ - small implementation → verification or review when risk is R3+
@@ -53,10 +53,14 @@ Defaults:
53
53
  - `/tweak`: proceed automatically after audit if clean
54
54
  - `/tdd`: proceed automatically after audit if clean, unless the public interface, expected behavior, or test target is unclear
55
55
  - `/explore`: proceed automatically; ask only if the target area is ambiguous
56
- - `/update-docs`: proceed automatically after audit if the target doc/area is clear; ask if unclear
57
- - `/prototype`: proceed automatically if prototype branch is clear; ask if logic vs UI is ambiguous
58
- - `/fix`: ask after reproduced hypotheses before instrumentation/fix
59
- - `/feature`: ask at phase gates: Prototype/PRD, prototype verdict, slice approval, issue approval
60
- - `/refactor`: ask before selecting a candidate and before implementation
61
- - `/triage`: ask before publishing, closing, labeling, or making irreversible tracker changes unless the user explicitly requested it
62
- - `/commit-and-document`: always ask before `git commit`, `git push`, or issue close actions
56
+ - `/update-docs`: proceed automatically after audit if the target doc/area is clear; ask if unclear
57
+ - `/prototype`: proceed automatically if prototype branch is clear; ask if logic vs UI is ambiguous
58
+ - `/verify`: proceed automatically after changed scope and project checks are identified; report exact commands run
59
+ - `/review`: stop and report only; do not patch application source
60
+ - `/fix`: ask after reproduced hypotheses before instrumentation/fix
61
+ - `/feature`: ask at phase gates: Prototype/PRD, prototype verdict, slice approval, issue approval
62
+ - `/refactor`: ask before selecting a candidate and before implementation
63
+ - `/triage`: ask before publishing, closing, labeling, or making irreversible tracker changes unless the user explicitly requested it
64
+ - `/commit-and-document`: always ask before `git commit`, `git push`, or issue close actions
65
+
66
+ Do not auto-launch `/verify`, `/review`, or `/commit-and-document` merely because a worker recommended it. Suggest only; wait for explicit approval.
@@ -11,6 +11,10 @@ If you entered this window via `switch_mode` (you are mid-chain, not the entry p
11
11
 
12
12
  Before any `attempt_completion`, re-read the command body and confirm no later phase is assigned to another mode. If one is, `switch_mode` instead.
13
13
 
14
- Do not use `attempt_completion` to avoid required implementation work.
14
+ Do not use `attempt_completion` to avoid required implementation work. Every `attempt_completion` must include evidence of what was produced or discovered, not just summaries.
15
15
 
16
- Halt for explicit user approval before testing a bug hypothesis, finalizing an architecture plan, publishing issues, or making irreversible decisions.
16
+ Halt for explicit user approval before testing a bug hypothesis, finalizing an architecture plan, publishing issues, or making irreversible decisions.
17
+
18
+ For non-trivial completed plans or reviews, recommend the next command only. Typical chain: implementation command -> `/verify` -> `/review` -> `/commit-and-document`. Do not auto-launch those commands.
19
+
20
+ If the user explicitly says to remember a project rule, or the same mistake has repeated, ask before appending a short lesson to `.zoo-flow/LESSONS.md`. Do not read or write lessons by default.
@@ -10,3 +10,5 @@
10
10
  - **[to-prd](./to-prd/SKILL.md)** — Context → PRD issue.
11
11
  - **[zoom-out](./zoom-out/SKILL.md)** — Map modules/callers.
12
12
  - **[prototype](./prototype/SKILL.md)** — Throwaway logic/UI prototype.
13
+ - **[review](./review/SKILL.md)** — Diff/branch review against spec and standards.
14
+ - **[verify](./verify/SKILL.md)** — Targeted tests/typecheck/lint/build evidence.
@@ -123,8 +123,7 @@ Date via `date +%Y-%m-%d`. Create `docs/journal/<YYYY-MM-DD>/` if missing. Write
123
123
  ## 7. Surface stale docs (if any)
124
124
 
125
125
  Read `git diff --cached --stat`. If any staged path overlaps with a path
126
- referenced in `.zoo-flow/CONTEXT.md`, `.zoo-flow/ARCHITECTURE.md`,
127
- `.zoo-flow/APP_MAP.md`, or any nearby `FLOW.md`, output exactly one line
126
+ referenced in `.zoo-flow/CONTEXT.md`, output exactly one line
128
127
  before "Confirm":
129
128
 
130
129
  "Public surface may have drifted. Run /update-docs? (yes / skip)"
@@ -1,6 +1,6 @@
1
1
  # ADR Format
2
2
 
3
- Path: `docs/adr/NNNN-slug.md`. Create dir lazily.
3
+ Path: `.zoo-flow/docs/adr/NNNN-slug.md`. Create dir lazily.
4
4
 
5
5
  ## Template
6
6
 
@@ -24,38 +24,13 @@ _Avoid_: Purchase, transaction
24
24
  - Define term in 1–2 sentences: what it is, not behavior.
25
25
  - Include domain terms only; exclude generic programming terms.
26
26
 
27
- ## Slots
27
+ ## Directory layout
28
28
 
29
- | Slot | File (if present) | Authored by | Default location |
30
- |---|---|---|---|
31
- | Domain language | `CONTEXT.md` | User via /grill-with-docs | `.zoo-flow/CONTEXT.md` |
32
- | Decisions | `docs/adr/<NNNN-slug>.md` | User via /grill-with-docs | `.zoo-flow/docs/adr/` |
33
- | Subsystem flow | `FLOW.md` | Subsystem owner | Next to the code |
34
- | App map | `APP_MAP.md` | User via /update-docs | `.zoo-flow/APP_MAP.md` |
35
- | Architecture | `ARCHITECTURE.md` | User via /update-docs | `.zoo-flow/ARCHITECTURE.md` |
36
- | Setup | `README.md` | Project owner | Project root |
29
+ - `.zoo-flow/CONTEXT.md` domain language glossary
30
+ - `.zoo-flow/docs/adr/<NNNN-slug>.md` — architecture decisions
37
31
 
38
- ## Discovery rule (used by /explore, /update-docs, /grill-with-docs)
32
+ ## Discovery rule
39
33
 
40
- For each slot, in this order:
41
-
42
- 1. If the file exists at the documented location, read it.
43
- 2. If the slot is empty/missing, that is **not an error**. The user has
44
- not authored it yet. Do not invent content. Do not lazy-create unless
45
- the calling command explicitly says so (e.g. /grill-with-docs on a
46
- first resolved term).
47
- 3. If the calling command depends on a populated slot and none exist,
48
- surface once: "Slot `<name>` not yet authored. Run /grill-with-docs
49
- to fill, or continue without."
50
-
51
- ## Multi-context (rare)
52
-
53
- A single project can hold multiple domain contexts when subsystems do
54
- not share language. Use:
55
-
56
- - `.zoo-flow/CONTEXT-MAP.md` — index of contexts.
57
- - `.zoo-flow/contexts/<slug>/CONTEXT.md` — per-context.
58
- - `.zoo-flow/contexts/<slug>/docs/adr/` — per-context ADRs.
59
-
60
- `/grill-with-docs` and `/explore` consult the map first, then the
61
- relevant per-context file.
34
+ 1. If the file exists, read it.
35
+ 2. If the file is missing, that is **not an error**. Do not invent content.
36
+ 3. For commands that depend on populated context, surface once: "No CONTEXT.md or ADRs found yet. Run /grill-with-docs or /scaffold-context to fill, or continue without."
@@ -7,7 +7,7 @@ description: Grilling session that challenges your plan against the existing dom
7
7
 
8
8
  ## Loop
9
9
 
10
- 1. Read relevant `CONTEXT.md`/`CONTEXT-MAP.md` + ADRs.
10
+ 1. Read relevant `.zoo-flow/CONTEXT.md` + ADRs.
11
11
  2. Ask one question at a time.
12
12
  3. Include recommended answer.
13
13
  4. Inspect code instead of asking when code can answer.
@@ -5,11 +5,11 @@ description: Find deepening opportunities in a codebase, informed by the domain
5
5
 
6
6
  # Improve Codebase Architecture
7
7
 
8
- RULE: Use `LANGUAGE.md` terms. Use glossary. Respect ADRs; surface only reopen-worthy conflicts.
8
+ RULE: Use `.zoo-flow/CONTEXT.md` terms. Use glossary. Respect ADRs; surface only reopen-worthy conflicts.
9
9
 
10
10
  ## Explore
11
11
 
12
- 1. Read relevant `CONTEXT.md`/`CONTEXT-MAP.md`.
12
+ 1. Read relevant `.zoo-flow/CONTEXT.md`.
13
13
  2. Read relevant ADRs.
14
14
  3. Explore code organically.
15
15
  4. Find friction:
@@ -52,4 +52,4 @@ Use searches to identify dependency/call patterns before reading full modules. R
52
52
  2. If module name introduces unresolved domain term, update `CONTEXT.md` lazily.
53
53
  3. If term sharpened, update `CONTEXT.md` immediately.
54
54
  4. Durable rejected reason useful later → offer ADR.
55
- 5. Interface options requested → run `INTERFACE-DESIGN.md`.
55
+ 5. Interface options requested → run interface-design workflow.