@fernado03/zoo-flow 0.3.0 → 0.3.3

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fernado03/zoo-flow",
3
3
  "description": "Workflow control plane for Zoo Code.",
4
- "version": "0.3.0",
4
+ "version": "0.3.3",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "zoo-flow": "bin/zoo-flow.js"
@@ -4,6 +4,7 @@ argument-hint: <describe the feature>
4
4
  mode: system-architect
5
5
  ---
6
6
  EXECUTION RULES (Run sequentially. Wait for user between phases):
7
+ 0. TRACK: At start, write a phase checklist to `.scratch/feature-<slug>.md` (phases 1-5, each unchecked). Before any `switch_mode` or `attempt_completion`, update it. Do NOT `attempt_completion` while any phase is unchecked — `switch_mode` to the phase's owner instead.
7
8
  1. SHARPEN (Architect): Run skill `.roo/skills/engineering/grill-with-docs/SKILL.md`. Update docs.
8
9
  HARD STOP: Ask user to choose: Prototype OR skip to PRD.
9
10
  2. PROTOTYPE [Optional]: Follow `.roo/rules-system-architect/01-feature-prototype.md` for the architect→tweaker handoff.
@@ -4,6 +4,7 @@ argument-hint: <describe the bug or error>
4
4
  mode: system-architect
5
5
  ---
6
6
  EXECUTION RULES:
7
+ 0. TRACK: At start, write a phase checklist to `.scratch/fix-<slug>.md` (phases 1-5, each unchecked). Before any `switch_mode` or `attempt_completion`, update it. Do NOT `attempt_completion` while any phase is unchecked — `switch_mode` to the phase's owner instead.
7
8
  1. DIAGNOSE (Architect): Run skill `.roo/skills/engineering/diagnose/SKILL.md`. Run phases 1-3.
8
9
  HARD STOP: Present hypotheses. Wait for user selection. Ignore internal AFK rules.
9
10
  2. INSTRUMENT (Architect): Run phase 4 on chosen hypothesis. Find root cause.
@@ -4,6 +4,7 @@ argument-hint: <area to refactor>
4
4
  mode: system-architect
5
5
  ---
6
6
  EXECUTION RULES:
7
+ 0. TRACK: At start, write a phase checklist to `.scratch/refactor-<slug>.md` (phases 1-3, each unchecked). Before any `switch_mode` or `attempt_completion`, update it. Do NOT `attempt_completion` while any phase is unchecked — `switch_mode` to the phase's owner instead.
7
8
  1. FIND (Architect): Run skill `.roo/skills/engineering/improve-codebase-architecture/SKILL.md`. List candidates.
8
9
  HARD STOP: Ask user which candidate to explore.
9
10
  2. GRILL (Architect): Run grilling loop. Update CONTEXT/ADRs inline.
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: "Triage issues through a state machine driven by triage roles. Use when user wants to create an issue, triage issues, review incoming bugs or feature requests, prepare issues for an AFK agent, or manage issue workflow."
3
+ mode: system-architect
3
4
  ---
4
5
 
5
6
  Run skill: `.roo/skills/engineering/triage/SKILL.md`
@@ -0,0 +1,7 @@
1
+ # MCP Awareness
2
+
3
+ If MCP tools are available, prefer them when they match the task better than built-in tools.
4
+
5
+ Do not assume specific MCP servers exist. Check what is available before attempting a call.
6
+
7
+ If no MCP servers are configured, ignore this rule.
@@ -0,0 +1,16 @@
1
+ # Tool Parameter Safety
2
+
3
+ All required parameters must be present in every tool call. Never invoke a tool with missing or empty required fields.
4
+
5
+ ## On rejection
6
+
7
+ After a missing-parameter or schema error:
8
+
9
+ 1. Do **not** retry unchanged — that counts toward the three-failure cap (`02-three-failure-rule.md`).
10
+ 2. Either supply the missing value in the next call, or surface the blocker to the user.
11
+
12
+ ## Write-tool guard (`write_to_file`, `apply_diff`, etc.)
13
+
14
+ - Compose the full content **before** calling the tool.
15
+ - If content exceeds ~150 lines, split: first `write_to_file` (initial chunk), then `append_to_file` for the rest.
16
+ - If splitting is impractical, output the content in the response body and ask the user to confirm or save.
@@ -1,8 +1,17 @@
1
1
  # Code Tweaker Completion
2
2
 
3
- If created by `custom-orchestrator` via `new_task`, use `attempt_completion` when done or blocked.
3
+ A delegated task is the **entire command chain**, including every phase and mode switch the command body defines — not the single phase you are currently running.
4
4
 
5
- Include:
5
+ Choose your exit by where you are in that chain:
6
+
7
+ - **More phases remain** (a later phase is assigned to `system-architect`, e.g. post-mortem, or control returns to it): use `switch_mode` back to `system-architect`. Never `attempt_completion` mid-chain.
8
+ - **You are running the command's final phase** and it is complete or blocked: use `attempt_completion` to return to the orchestrator.
9
+
10
+ If you entered this window via `switch_mode` (you are mid-chain, not the entry point) and any phase remains, you hand back with `switch_mode`. Only the command's final phase returns to the orchestrator.
11
+
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
+
14
+ `attempt_completion` must include:
6
15
 
7
16
  - what was done
8
17
  - files changed or inspected
@@ -4,13 +4,76 @@ The orchestrator is a router only.
4
4
 
5
5
  Do not inspect implementation files, edit files, run shell commands, or answer technical implementation questions directly.
6
6
 
7
- If the user gives a technical request without an explicit command, offer 1-2 numbered workflow choices and ask for a typed number.
8
-
9
- Delegate only with `new_task` to:
7
+ Delegate only with `new_task` to these exact slugs:
10
8
 
11
9
  - `code-tweaker`
12
10
  - `system-architect`
13
11
 
14
- When delegating, choose the safest proceed policy from `01-delegation-message.md`.
12
+ The planning/architecture mode slug is always `system-architect`. Never use `architect`.
15
13
 
16
14
  After a subtask returns, summarize and stop. Do not auto-launch another subtask.
15
+
16
+ ## Routed commands
17
+
18
+ | Command | Mode | Routed when the user wants to… |
19
+ | ---------------------- | ---------------- | --------------------------------------------------------------------- |
20
+ | `/tweak` | code-tweaker | Make a small, known, low-risk change. Cause is understood. |
21
+ | `/tdd` | code-tweaker | Build a unit of behavior test-first, red-green-refactor. |
22
+ | `/update-docs` | code-tweaker | Align existing docs with current code. |
23
+ | `/commit-and-document` | code-tweaker | Stage, write a Conventional Commit, journal the change. |
24
+ | `/prototype` | code-tweaker | Throw away code to resolve a design uncertainty. |
25
+ | `/fix` | system-architect | Resolve a bug whose cause is unknown. Diagnose → fix → post-mortem. |
26
+ | `/feature` | system-architect | Add new capability needing planning. Sharpen → PRD → slice → build. |
27
+ | `/refactor` | system-architect | Improve working code's structure without changing behavior. |
28
+ | `/explore` | system-architect | Map unfamiliar code before deciding what to do. |
29
+ | `/triage` | system-architect | Create, sort, or prepare issues in a tracker. |
30
+
31
+ ## Routing decision guide
32
+
33
+ Read the request for intent, not keywords. Work top-down:
34
+
35
+ 1. **Unfamiliar territory?** User is unsure where the code lives, how it works, or what the right move is → `/explore` first. It produces a written map and recommends the next command.
36
+ 2. **Something is broken and the cause is unknown?** Error, crash, regression, "it used to work", flaky, slow → `/fix`. The diagnosis loop lives inside it.
37
+ 3. **New capability that needs planning?** Net-new behavior, multiple unknowns, or design questions → `/feature`.
38
+ 4. **Working code, structure is the problem?** "Clean up", "decouple", "this is getting hard to change", no behavior change intended → `/refactor`.
39
+ 5. **Small and well-understood?** Cause known, scope tight, no design questions → `/tweak`.
40
+ 6. **Test-first unit of behavior, cause/interface clear?** → `/tdd`.
41
+ 7. **Design uncertainty worth throwing code at?** → `/prototype`.
42
+ 8. **Docs drifted from code?** → `/update-docs`.
43
+ 9. **Ready to record finished work?** → `/commit-and-document`.
44
+ 10. **Issue/tracker management?** → `/triage`.
45
+
46
+ ## Disambiguation
47
+
48
+ These pairs overlap. Choose by the distinguishing signal, not surface wording.
49
+
50
+ - `/fix` vs `/tweak`: unknown cause needing diagnosis → `/fix`. Known cause, mechanical change → `/tweak`. If the user can name the exact line/function to change, it is `/tweak`.
51
+ - `/fix` vs `/refactor`: behavior is wrong → `/fix`. Behavior is fine, structure hurts → `/refactor`.
52
+ - `/feature` vs `/tdd`: needs sharpening, a PRD, or issue slicing → `/feature`. Interface and scope already clear, just build it test-first → `/tdd`.
53
+ - `/feature` vs `/prototype`: committing to a real implementation → `/feature`. Resolving an open design question with throwaway code → `/prototype`.
54
+ - `/refactor` vs `/tweak`: cross-cutting structural change with design tradeoffs → `/refactor`. One-spot localized edit → `/tweak`.
55
+ - `/update-docs` vs `/commit-and-document`: aligning doc content with code → `/update-docs`. Recording a change you just made (commit + journal) → `/commit-and-document`.
56
+ - Any of the above when the target area is unknown: route `/explore` first.
57
+
58
+ ## Confidence and presentation
59
+
60
+ - If the user typed an explicit slash command, route it as-is. Do not second-guess it.
61
+ - If one command clearly fits a free-form request, offer it as the single top choice with a one-line reason, plus one safe alternative when a near-tie exists.
62
+ - If two commands genuinely tie, offer both as numbered choices and let the user pick.
63
+ - Prefer the lighter-weight workflow when impact is comparable (`/tweak` over `/fix`, `/tdd` over `/feature`) — but never trade away a needed diagnosis or planning phase just to save tokens.
64
+ - When suggesting choices, follow `.roo/rules/03-manual-reply-protocol.md`: plain-language numbered options, no slash commands or mode names in the suggestion text.
65
+
66
+ ## Approval gate
67
+
68
+ The orchestrator proposes; the user approves; only then does the orchestrator delegate.
69
+
70
+ - An explicitly typed slash command is itself the approval. Route it immediately.
71
+ - A free-form request is never self-approving. Present the proposed workflow (single top choice or numbered options), then **stop and wait** for the user to pick. Do not call `new_task` on the same turn you propose a workflow.
72
+ - Treat a free-form message as approval only when it selects a workflow you already proposed — by number, option text, or an unambiguous restatement. A fresh free-form request restarts the propose-and-wait cycle.
73
+ - If you are unsure whether the user approved, ask. Never assume approval from silence, enthusiasm, or a restated problem description.
74
+
75
+ ## Delegation
76
+
77
+ Delegate only after the approval gate is satisfied: the user typed an explicit slash command, or selected a workflow you proposed.
78
+
79
+ When delegating, choose the safest proceed policy from `01-delegation-message.md`.
@@ -1,5 +1,7 @@
1
1
  # Delegation Message
2
2
 
3
+ A delegated task is the **entire command chain** — every phase and mode switch the command body defines, run to its final phase. A worker returns via `attempt_completion` only after that final phase. Mid-chain handoffs between modes use `switch_mode`, not `attempt_completion`.
4
+
3
5
  Every delegated task must include:
4
6
 
5
7
  - command with slash
@@ -1,8 +1,15 @@
1
1
  # System Architect Completion
2
2
 
3
- Use `switch_mode` to `code-tweaker` for same-window implementation handoffs.
3
+ A delegated task is the **entire command chain**, including every phase and every mode switch the command body defines — not the single phase you are currently running.
4
4
 
5
- If created by `custom-orchestrator` via `new_task`, use `attempt_completion` when the delegated task is complete or blocked.
5
+ Choose your exit by where you are in that chain:
6
+
7
+ - **More phases remain** (this or a later phase is assigned to `code-tweaker`, or control returns to you afterward): use `switch_mode`. Never `attempt_completion`. Writing a plan, diagnosis, or `.scratch/` notes is not "done" — it is a handoff. Switch to `code-tweaker` to implement.
8
+ - **You are running the command's final phase** and it is complete or blocked: use `attempt_completion` to return to the orchestrator.
9
+
10
+ If you entered this window via `switch_mode` (you are mid-chain, not the entry point) and any phase remains, you hand back with `switch_mode`. Only the command's final phase returns to the orchestrator.
11
+
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.
6
13
 
7
14
  Do not use `attempt_completion` to avoid required implementation work.
8
15
 
@@ -12,12 +12,11 @@ RULE: Do not interview user. Synthesize current context.
12
12
  ## Process
13
13
 
14
14
  1. Explore repo if needed; use glossary; respect ADRs.
15
- 2. Sketch major modules to build/modify.
16
- 3. Find deep modules testable in isolation.
17
- 4. Check with user: modules match expectations? which modules need tests?
18
- 5. Write PRD.
19
- 6. Publish to issue tracker.
20
- 7. Apply `ready-for-agent`.
15
+ 2. Sketch test seams. Prefer existing seams; use highest seam possible. Propose new seams at highest point.
16
+ 3. Check with user: seams match expectations?
17
+ 4. Write PRD.
18
+ 5. Publish to issue tracker.
19
+ 6. Apply `ready-for-agent`.
21
20
 
22
21
  ## PRD template
23
22
 
@@ -45,7 +44,7 @@ RULE: Do not interview user. Synthesize current context.
45
44
  ## Testing Decisions
46
45
 
47
46
  - Good tests verify external behaviour, not implementation.
48
- - Modules to test.
47
+ - Seams to test; prefer existing/highest seam.
49
48
  - Similar tests/prior art.
50
49
 
51
50
  ## Out of Scope
@@ -40,7 +40,7 @@ User says "I already know X" → record in `learning-records/`.
40
40
  ## Knowledge loop
41
41
 
42
42
  1. Pull from `RESOURCES.md`.
43
- 2. Write HTML explainer to local file. Beautiful, glossary-correct.
43
+ 2. Write HTML explainer to local file. Beautiful, glossary-correct. Litter with citations linking external resources backing every claim. Interactive: "try this" callouts to apply the knowledge.
44
44
  3. Give one-line CLI command to open it.
45
45
  4. Take questions; amend explainer or write a new one.
46
46
  5. Once user clearly owns the term, add to `GLOSSARY.md`.
@@ -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 for initial task planning, choosing slash commands, routing work, or discussing workflow.",
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:\n\n- /tweak, /tdd, /update-docs, /commit-and-document, /prototype -> code-tweaker\n- /fix, /feature, /refactor, /explore, /triage -> system-architect\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.",
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.",
44
44
  "groups": []
45
45
  }
46
46
  ]