@fernado03/zoo-flow 0.11.1 → 0.11.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/bin/zoo-flow.js +0 -2
- package/package.json +45 -55
- package/templates/claude-code/.claude/commands/explore.md +28 -0
- package/templates/claude-code/.claude/skills/engineering/commit-and-document/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/diagnose/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/explore/SKILL.md +1 -1
- package/templates/claude-code/.claude/skills/engineering/feature/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/fix/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/grill-with-docs/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/improve-codebase-architecture/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/prototype/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/refactor/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/review/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/scaffold-context/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/setup-matt-pocock-skills/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/tdd/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/to-issues/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/to-prd/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/triage/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/tweak/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/update-docs/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/verify/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/engineering/zoom-out/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/in-progress/writing-beats/SKILL.md +32 -0
- package/templates/claude-code/.claude/skills/in-progress/writing-fragments/SKILL.md +45 -0
- package/templates/claude-code/.claude/skills/in-progress/writing-shape/SKILL.md +50 -0
- package/templates/claude-code/.claude/skills/misc/git-guardrails-claude-code/SKILL.md +64 -0
- package/templates/claude-code/.claude/skills/misc/git-guardrails-claude-code/scripts/block-dangerous-git.sh +25 -0
- package/templates/claude-code/.claude/skills/misc/migrate-to-shoehorn/SKILL.md +39 -0
- package/templates/claude-code/.claude/skills/misc/scaffold-exercises/SKILL.md +53 -0
- package/templates/claude-code/.claude/skills/misc/setup-pre-commit/SKILL.md +62 -0
- package/templates/claude-code/.claude/skills/personal/edit-article/SKILL.md +13 -0
- package/templates/claude-code/.claude/skills/personal/obsidian-vault/SKILL.md +39 -0
- package/templates/claude-code/.claude/skills/productivity/grill-me/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/productivity/handoff/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/productivity/teach/SKILL.md +2 -1
- package/templates/claude-code/.claude/skills/productivity/write-a-skill/SKILL.md +2 -1
- package/templates/claude-code/CLAUDE.md +23 -0
- package/docs/architecture.md +0 -380
- package/docs/bloat-control.md +0 -49
- package/docs/command-design.md +0 -38
- package/docs/command-flow.md +0 -133
- package/docs/comparison.md +0 -86
- package/docs/context-packs.md +0 -35
- package/docs/dogfood/01-small-library.md +0 -28
- package/docs/dogfood/02-web-app.md +0 -29
- package/docs/dogfood/03-mixed-monorepo.md +0 -29
- package/docs/mode-rules.md +0 -86
- package/docs/npm-publishing.md +0 -79
- package/docs/out-of-scope/mainstream-issue-trackers-only.md +0 -25
- package/docs/out-of-scope/question-limits.md +0 -18
- package/docs/out-of-scope/setup-skill-verify-mode.md +0 -15
- package/docs/overview.md +0 -61
- package/docs/philosophy.md +0 -73
- package/docs/quality-scorecard.md +0 -23
- package/docs/skill-maintenance.md +0 -32
- package/docs/skills-index.md +0 -64
- package/docs/team-mode.md +0 -46
- package/docs/token-budget.md +0 -22
- package/docs/troubleshooting.md +0 -288
- package/examples/demo-transcripts/01-small-tweak.md +0 -37
- package/examples/demo-transcripts/02-unknown-bug-fix.md +0 -37
- package/examples/demo-transcripts/03-new-feature.md +0 -37
- package/examples/demo-transcripts/04-refactor.md +0 -37
- package/examples/demo-transcripts/05-review-and-verify.md +0 -37
- package/examples/feature-flow.md +0 -117
- package/examples/fix-flow.md +0 -139
- package/quality/scorecard.json +0 -88
- package/quality/token-budget.exceptions.json +0 -13
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scaffold-exercises
|
|
3
|
+
description: Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Scaffold Exercises
|
|
7
|
+
|
|
8
|
+
Goal: create exercise dirs passing `pnpm ai-hero-cli internal lint`, then commit.
|
|
9
|
+
|
|
10
|
+
## Naming
|
|
11
|
+
|
|
12
|
+
- Sections: `exercises/XX-section-name/`.
|
|
13
|
+
- Exercises: `XX.YY-exercise-name/` inside section.
|
|
14
|
+
- Lowercase dash-case.
|
|
15
|
+
|
|
16
|
+
## Variants
|
|
17
|
+
|
|
18
|
+
Each exercise needs ≥1: `problem/`, `solution/`, `explainer/`. Default stub: `explainer/` unless plan says otherwise.
|
|
19
|
+
|
|
20
|
+
## Required files
|
|
21
|
+
|
|
22
|
+
- Each variant folder: non-empty `readme.md`.
|
|
23
|
+
- Minimal readme:
|
|
24
|
+
|
|
25
|
+
```md
|
|
26
|
+
# Exercise Title
|
|
27
|
+
|
|
28
|
+
Description here
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
- If folder has code, `main.ts` >1 line required.
|
|
32
|
+
- Readme-only stubs allowed.
|
|
33
|
+
|
|
34
|
+
## Workflow
|
|
35
|
+
|
|
36
|
+
1. Parse plan into sections/exercises/variants.
|
|
37
|
+
2. Use `Bash` to `mkdir -p` dirs.
|
|
38
|
+
3. Use `Write` to create readme stubs.
|
|
39
|
+
4. Use `Bash` to run `pnpm ai-hero-cli internal lint`.
|
|
40
|
+
5. Fix until pass.
|
|
41
|
+
6. Use `Bash` to move/rename with `git mv`.
|
|
42
|
+
7. Use `Bash` to commit with `git commit`.
|
|
43
|
+
|
|
44
|
+
## Lint constraints
|
|
45
|
+
|
|
46
|
+
- Exercise has subfolder.
|
|
47
|
+
- At least one of `problem/`, `explainer/`, `explainer.1/` exists.
|
|
48
|
+
- Primary readme exists and non-empty.
|
|
49
|
+
- No `.gitkeep`.
|
|
50
|
+
- No `speaker-notes.md`.
|
|
51
|
+
- No broken links.
|
|
52
|
+
- No `pnpm run exercise` in readmes.
|
|
53
|
+
- `main.ts` required only when code present.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup-pre-commit
|
|
3
|
+
description: Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Setup Pre-Commit Hooks
|
|
7
|
+
|
|
8
|
+
Creates Husky pre-commit, lint-staged Prettier, optional typecheck/test.
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
|
|
12
|
+
1. Detect package manager: `package-lock.json`→npm; `pnpm-lock.yaml`→pnpm; `yarn.lock`→yarn; `bun.lockb`→bun; default npm.
|
|
13
|
+
2. Use `Bash` to install dev deps, adapting package manager:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm i -D husky lint-staged prettier
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
3. Use `Bash` to init Husky:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx husky init
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
4. Use `Write` to write `.husky/pre-commit`, adapting package manager; omit missing scripts and tell user:
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
npx lint-staged
|
|
29
|
+
npm run typecheck
|
|
30
|
+
npm run test
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
5. Use `Write` to create `.lintstagedrc`:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"*": "prettier --ignore-unknown --write"
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
6. Use `Write` to create `.prettierrc` only if no Prettier config:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"useTabs": false,
|
|
46
|
+
"tabWidth": 2,
|
|
47
|
+
"printWidth": 80,
|
|
48
|
+
"singleQuote": false,
|
|
49
|
+
"trailingComma": "es5",
|
|
50
|
+
"semi": true,
|
|
51
|
+
"arrowParens": "always"
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
7. Verify: executable `.husky/pre-commit`; `.lintstagedrc`; `prepare` script = `husky`; Prettier config; use `Bash` to run `npx lint-staged`.
|
|
56
|
+
8. Use `Bash` to commit:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
git commit -m "Add pre-commit hooks (husky + lint-staged + prettier)"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
RULE: Wait for explicit user approval before commit if current mode requires HITL.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: edit-article
|
|
3
|
+
description: Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Edit Article
|
|
7
|
+
|
|
8
|
+
1. Use `Read` to divide article by headings.
|
|
9
|
+
2. Identify main point per section.
|
|
10
|
+
3. Reorder sections/content so dependencies flow first.
|
|
11
|
+
4. Confirm section plan with user.
|
|
12
|
+
5. Use `Edit` to rewrite each section for clarity/coherence/flow.
|
|
13
|
+
6. Max 240 chars per paragraph.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: obsidian-vault
|
|
3
|
+
description: Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Obsidian Vault
|
|
7
|
+
|
|
8
|
+
## Vault path
|
|
9
|
+
|
|
10
|
+
1. Use `$OBSIDIAN_VAULT_PATH`.
|
|
11
|
+
2. If unset, STOP and ask absolute vault path.
|
|
12
|
+
|
|
13
|
+
## Naming
|
|
14
|
+
|
|
15
|
+
- Index notes aggregate related topics: `Ralph Wiggum Index.md`.
|
|
16
|
+
- Title Case filenames.
|
|
17
|
+
- No folders for org; use wikilinks/index notes.
|
|
18
|
+
|
|
19
|
+
## Linking
|
|
20
|
+
|
|
21
|
+
- Use `[[wikilinks]]`.
|
|
22
|
+
- Add related/dependency links at bottom.
|
|
23
|
+
- Index notes = wikilink lists.
|
|
24
|
+
|
|
25
|
+
## Commands
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
find "/mnt/d/Obsidian Vault/AI Research/" -name "*.md" | grep -i "keyword"
|
|
29
|
+
grep -rl "keyword" "/mnt/d/Obsidian Vault/AI Research/" --include="*.md"
|
|
30
|
+
grep -rl "\\[\\[Note Title\\]\\]" "/mnt/d/Obsidian Vault/AI Research/"
|
|
31
|
+
find "/mnt/d/Obsidian Vault/AI Research/" -name "*Index*"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Create note
|
|
35
|
+
|
|
36
|
+
1. Title Case filename.
|
|
37
|
+
2. Use `Write` to write one learning unit.
|
|
38
|
+
3. Add related wikilinks at bottom.
|
|
39
|
+
4. If numbered sequence, use hierarchy.
|
|
@@ -14,7 +14,8 @@ description: Interview the user about a plan or design until reaching shared und
|
|
|
14
14
|
|
|
15
15
|
## Complete
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
**COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
|
|
18
|
+
|
|
18
19
|
- decision tree branches resolved (count)
|
|
19
20
|
- key decisions made (summary)
|
|
20
21
|
- status (complete / blocked with reason)
|
|
@@ -15,6 +15,7 @@ argument-hint: "What will the next session be used for?"
|
|
|
15
15
|
|
|
16
16
|
## Complete
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
**COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
|
|
19
|
+
|
|
19
20
|
- handoff file path (OS temp dir)
|
|
20
21
|
- status (complete / blocked with reason)
|
|
@@ -109,7 +109,8 @@ The user will sometimes express preferences of how they want to be taught, or th
|
|
|
109
109
|
|
|
110
110
|
When the user ends the teaching session or says "done" / "stop teaching":
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
**COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
|
|
113
|
+
|
|
113
114
|
- lessons created (count, paths)
|
|
114
115
|
- mission status (created / updated)
|
|
115
116
|
- learning records updated (count)
|
|
@@ -53,7 +53,8 @@ Add when: deterministic op; repeated code; explicit error handling needed.
|
|
|
53
53
|
|
|
54
54
|
## Complete
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
**COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
|
|
57
|
+
|
|
57
58
|
- skill created (name, path)
|
|
58
59
|
- files written (SKILL.md, references, scripts)
|
|
59
60
|
- status (complete / blocked with reason)
|
|
@@ -122,6 +122,29 @@ Agent(
|
|
|
122
122
|
)
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
+
### Agent Completion Protocol
|
|
126
|
+
|
|
127
|
+
**Critical**: When delegating to an agent via the `Agent` tool, the agent must understand how to return its work:
|
|
128
|
+
|
|
129
|
+
1. **Your final text message IS the return value** - The parent agent receives exactly what you write as your last message
|
|
130
|
+
2. **Output the completion summary, then STOP** - Do not call any more tools after writing your completion
|
|
131
|
+
3. **Be complete in your final message** - Include all required information (files changed, status, recommendations)
|
|
132
|
+
|
|
133
|
+
Add this to your agent prompts:
|
|
134
|
+
```
|
|
135
|
+
COMPLETION PROTOCOL:
|
|
136
|
+
Your final text message is your return value to the parent agent.
|
|
137
|
+
When you finish, output a summary with:
|
|
138
|
+
- What was done
|
|
139
|
+
- Status: complete / blocked (with reason)
|
|
140
|
+
- Files changed (if any)
|
|
141
|
+
- Recommended next command (if any)
|
|
142
|
+
|
|
143
|
+
Then STOP - do not call any more tools or take any more actions.
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
This is similar to how ultracode's Workflow tool handles subagent completion.
|
|
147
|
+
|
|
125
148
|
### Multi-Phase Commands
|
|
126
149
|
|
|
127
150
|
Commands like `/fix`, `/feature`, and `/refactor` involve multiple phases:
|
package/docs/architecture.md
DELETED
|
@@ -1,380 +0,0 @@
|
|
|
1
|
-
# Architecture
|
|
2
|
-
|
|
3
|
-
Zoo Flow ships three custom modes, a fixed routing matrix, a small set of
|
|
4
|
-
always-on rules, and a directory layout for slash commands and on-demand
|
|
5
|
-
skills. This document explains what each piece does and why it is shaped
|
|
6
|
-
the way it is.
|
|
7
|
-
|
|
8
|
-
## Components
|
|
9
|
-
|
|
10
|
-
```
|
|
11
|
-
templates/full/
|
|
12
|
-
├── .roomodes # minimal: slug, groups, short pointers
|
|
13
|
-
└── .roo/
|
|
14
|
-
├── rules/ # always-on, every mode, every turn
|
|
15
|
-
│ ├── 00-paths.md
|
|
16
|
-
│ ├── 01-command-protocol.md
|
|
17
|
-
│ ├── 02-three-failure-rule.md
|
|
18
|
-
│ ├── 03-manual-reply-protocol.md
|
|
19
|
-
│ ├── 04-context-economy.md
|
|
20
|
-
│ └── 05-mcp-awareness.md
|
|
21
|
-
├── rules-custom-orchestrator/ # mode-scoped, orchestrator only
|
|
22
|
-
│ ├── 00-routing.md
|
|
23
|
-
│ └── 01-delegation-message.md
|
|
24
|
-
├── rules-system-architect/ # mode-scoped, architect only
|
|
25
|
-
│ ├── 00-scope.md
|
|
26
|
-
│ ├── 01-feature-prototype.md
|
|
27
|
-
│ └── 02-completion.md
|
|
28
|
-
├── rules-code-tweaker/ # mode-scoped, tweaker only
|
|
29
|
-
│ ├── 00-scope.md
|
|
30
|
-
│ └── 01-completion.md
|
|
31
|
-
├── commands/ # slash commands (the public API)
|
|
32
|
-
└── skills/ # on-demand skills, loaded by commands
|
|
33
|
-
├── engineering/
|
|
34
|
-
├── productivity/
|
|
35
|
-
├── misc/
|
|
36
|
-
├── personal/
|
|
37
|
-
└── in-progress/
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
`.roomodes` is intentionally minimal. It declares each mode's slug,
|
|
41
|
-
role, tool groups, and a short `customInstructions` block that points
|
|
42
|
-
at the matching `.roo/rules-{modeSlug}/` folder. All detailed mode
|
|
43
|
-
behavior lives in the rule files inside that folder. See
|
|
44
|
-
[`mode-rules.md`](mode-rules.md) for the full layout rationale.
|
|
45
|
-
|
|
46
|
-
> Zoo Flow uses the preferred `.roo/rules-{modeSlug}/` directory form
|
|
47
|
-
> only. Legacy single-file fallbacks such as `.roorules-{modeSlug}` and
|
|
48
|
-
> `.clinerules-{modeSlug}` are not used by this template.
|
|
49
|
-
|
|
50
|
-
## Modes
|
|
51
|
-
|
|
52
|
-
### `custom-orchestrator`
|
|
53
|
-
|
|
54
|
-
Defined in `templates/full/.roomodes`. Tool groups: **none**. Detailed
|
|
55
|
-
behavior lives in
|
|
56
|
-
[`.roo/rules-custom-orchestrator/`](../templates/full/.roo/rules-custom-orchestrator/)
|
|
57
|
-
(`00-routing.md`, `01-delegation-message.md`).
|
|
58
|
-
|
|
59
|
-
The orchestrator cannot read, edit, run commands, or call MCP tools. It
|
|
60
|
-
exists to do exactly four things:
|
|
61
|
-
|
|
62
|
-
1. Read the user request.
|
|
63
|
-
2. Map it to a command using the routing matrix in its
|
|
64
|
-
`customInstructions`.
|
|
65
|
-
3. Either delegate via `new_task` (when the user supplied an explicit
|
|
66
|
-
slash command) or offer 1-2 numbered workflow choices and halt
|
|
67
|
-
(when they did not).
|
|
68
|
-
4. Summarize the subtask result and halt again.
|
|
69
|
-
|
|
70
|
-
It never uses `switch_mode`. If `new_task` is unavailable, it stops and
|
|
71
|
-
reports — it does not try to do the work itself.
|
|
72
|
-
|
|
73
|
-
### `system-architect`
|
|
74
|
-
|
|
75
|
-
Tool groups: `command`, `mcp`, `read`, and a constrained `edit` that only
|
|
76
|
-
matches Markdown files, `.scratch/`, and `docs/`. The `fileRegex` lives in
|
|
77
|
-
`.roomodes`:
|
|
78
|
-
|
|
79
|
-
```json
|
|
80
|
-
{ "fileRegex": "(.*\\.md$|^\\.scratch/.*|^docs/.*)" }
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Detailed behavior lives in
|
|
84
|
-
[`.roo/rules-system-architect/`](../templates/full/.roo/rules-system-architect/)
|
|
85
|
-
(`00-scope.md`, `01-feature-prototype.md`, `02-completion.md`).
|
|
86
|
-
|
|
87
|
-
The architect plans, diagnoses, refactors, explores, and triages. It cannot
|
|
88
|
-
edit application source code. When implementation is needed, it
|
|
89
|
-
`switch_mode`s to `code-tweaker` inside the same task window.
|
|
90
|
-
|
|
91
|
-
Hard stops are baked in:
|
|
92
|
-
|
|
93
|
-
- 3-strike rule on diagnosis: after three failed attempts, halt and ask
|
|
94
|
-
the user.
|
|
95
|
-
- HITL stop before testing a hypothesis, finalizing a plan, publishing
|
|
96
|
-
issues, or making any irreversible decision.
|
|
97
|
-
- During `/feature`, never run a prototype directly. Summarize and
|
|
98
|
-
switch to the tweaker.
|
|
99
|
-
|
|
100
|
-
### `code-tweaker`
|
|
101
|
-
|
|
102
|
-
Tool groups: `read`, `edit`, `command`, `mcp`. Full repo access within the
|
|
103
|
-
assigned command. Detailed behavior lives in
|
|
104
|
-
[`.roo/rules-code-tweaker/`](../templates/full/.roo/rules-code-tweaker/)
|
|
105
|
-
(`00-scope.md`, `01-completion.md`).
|
|
106
|
-
|
|
107
|
-
The tweaker implements, runs tests, updates docs, builds prototypes, and
|
|
108
|
-
prepares commits.
|
|
109
|
-
|
|
110
|
-
Hard stops:
|
|
111
|
-
|
|
112
|
-
- Auto-escalate to the architect on the **same task window** if the work
|
|
113
|
-
needs major architecture decisions or the same approach fails three times.
|
|
114
|
-
- Git stop: never run `git commit` or `git push` without explicit user
|
|
115
|
-
approval. Pushes only happen when the user asks.
|
|
116
|
-
- Complete the whole chain, not the current phase. `attempt_completion`
|
|
117
|
-
returns to the orchestrator only after the command's **final** phase.
|
|
118
|
-
If a later phase belongs to the architect (e.g. `/fix` post-mortem),
|
|
119
|
-
hand back with `switch_mode` instead of completing early.
|
|
120
|
-
|
|
121
|
-
## Command protocol
|
|
122
|
-
|
|
123
|
-
The protocol is in
|
|
124
|
-
[`templates/full/.roo/rules/01-command-protocol.md`](../templates/full/.roo/rules/01-command-protocol.md).
|
|
125
|
-
It is loaded on every turn for every mode.
|
|
126
|
-
|
|
127
|
-
When a mode is assigned a slash command:
|
|
128
|
-
|
|
129
|
-
1. **Normalize.** `/fix` becomes `fix`.
|
|
130
|
-
2. **Prefer `run_slash_command`.** Pass the normalized name as `command`
|
|
131
|
-
and the full task context as `args`.
|
|
132
|
-
3. **Fall back to the file.** If `run_slash_command` is unavailable,
|
|
133
|
-
disabled, or fails, read `templates/full/.roo/commands/{command}.md`
|
|
134
|
-
and execute its instructions.
|
|
135
|
-
4. **Resolve skills via the file.** If the command references a skill,
|
|
136
|
-
read the exact `.roo/skills/...` path the command provides. Do not
|
|
137
|
-
compute paths from anywhere else.
|
|
138
|
-
5. **Do not chain.** A command suggested inside a subtask summary is
|
|
139
|
-
*not* authorization to run that command. Only the human or the
|
|
140
|
-
orchestrator's routing may launch a new command.
|
|
141
|
-
|
|
142
|
-
The protocol exists to make slash commands work the same way whether the
|
|
143
|
-
host UI exposes a native command runner or only file reads.
|
|
144
|
-
|
|
145
|
-
### Command types
|
|
146
|
-
|
|
147
|
-
Zoo Flow supports two command types:
|
|
148
|
-
|
|
149
|
-
1. **Skill-wrapper commands.** The command file declares a skill via a
|
|
150
|
-
line like:
|
|
151
|
-
|
|
152
|
-
```md
|
|
153
|
-
Skill: `.roo/skills/engineering/tdd/SKILL.md`
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
The worker loads and follows that skill.
|
|
157
|
-
|
|
158
|
-
2. **Direct workflow commands.** The command file contains the
|
|
159
|
-
procedure directly (no `Skill:` line). The worker executes those
|
|
160
|
-
steps directly and must not invent a skill path.
|
|
161
|
-
|
|
162
|
-
This prevents redundant loading and avoids hallucinated skill paths.
|
|
163
|
-
|
|
164
|
-
## Path safety
|
|
165
|
-
|
|
166
|
-
The path-safety contract is in
|
|
167
|
-
[`templates/full/.roo/rules/00-paths.md`](../templates/full/.roo/rules/00-paths.md).
|
|
168
|
-
Two rules:
|
|
169
|
-
|
|
170
|
-
- Skills are at workspace-root paths under `.roo/skills/{bucket}/{skill}/SKILL.md`.
|
|
171
|
-
- Commands are at workspace-root paths under `.roo/commands/{name}.md`.
|
|
172
|
-
|
|
173
|
-
The forbidden form is anything under `.roo/rules/skills/...` or
|
|
174
|
-
`.roo/rules/commands/...`. Modes that try to load skills relative to a
|
|
175
|
-
`rules/` file have produced the most common failure in practice
|
|
176
|
-
(`ENOENT: .roo/rules/skills/...`). The rule blocks it before it happens.
|
|
177
|
-
|
|
178
|
-
## Slash commands
|
|
179
|
-
|
|
180
|
-
Each command is a Markdown file with a YAML front matter and a body. The
|
|
181
|
-
front matter declares the target mode and the argument hint:
|
|
182
|
-
|
|
183
|
-
```markdown
|
|
184
|
-
---
|
|
185
|
-
description: "Direct implementation mode for small, known fixes or UI updates."
|
|
186
|
-
argument-hint: <what to change>
|
|
187
|
-
mode: code-tweaker
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
Skill: `.roo/skills/engineering/tweak/SKILL.md`
|
|
191
|
-
|
|
192
|
-
$ARGUMENTS
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
The body is the actual instruction set. Some commands invoke a single
|
|
196
|
-
skill (`/tweak`, `/prototype`). Others orchestrate a multi-phase chain
|
|
197
|
-
across modes (`/fix`, `/feature`, `/refactor`).
|
|
198
|
-
|
|
199
|
-
A command can:
|
|
200
|
-
|
|
201
|
-
- Reference a skill by its exact `.roo/skills/...` path.
|
|
202
|
-
- Spell out HITL stops between phases.
|
|
203
|
-
- Direct a mode to `switch_mode` to another mode at a specific phase.
|
|
204
|
-
- Substitute `$ARGUMENTS` with the user / delegated context.
|
|
205
|
-
|
|
206
|
-
A command must not:
|
|
207
|
-
|
|
208
|
-
- Compute skill paths dynamically.
|
|
209
|
-
- Bypass the orchestrator when handing the human a choice.
|
|
210
|
-
- Auto-launch a follow-up command from a subtask summary.
|
|
211
|
-
|
|
212
|
-
### Core vs. helper commands
|
|
213
|
-
|
|
214
|
-
The orchestrator's **routing matrix** intentionally only routes a small
|
|
215
|
-
set of core workflow commands:
|
|
216
|
-
|
|
217
|
-
- `/tweak`, `/tdd`, `/update-docs`, `/commit-and-document`, `/prototype`, `/verify`
|
|
218
|
-
→ `code-tweaker`
|
|
219
|
-
- `/fix`, `/feature`, `/refactor`, `/explore`, `/triage`, `/review`
|
|
220
|
-
→ `system-architect`
|
|
221
|
-
|
|
222
|
-
Every other command in `templates/full/.roo/commands/` is a **helper**.
|
|
223
|
-
Helpers are real, working commands. They are run directly inside the
|
|
224
|
-
appropriate mode rather than delegated by the orchestrator. This keeps
|
|
225
|
-
the orchestrator's routing matrix small and predictable, while leaving
|
|
226
|
-
the broader command library available when you want it.
|
|
227
|
-
|
|
228
|
-
If a helper command starts being used often enough to deserve
|
|
229
|
-
delegation, promote it to the routing matrix in `.roomodes` and add it
|
|
230
|
-
to the routed table in [`README.md`](../README.md#commands).
|
|
231
|
-
|
|
232
|
-
## Skills
|
|
233
|
-
|
|
234
|
-
Skills live under `templates/full/.roo/skills/`. Each skill is a folder
|
|
235
|
-
with a `SKILL.md` and any supporting files (templates, scripts, sub-docs).
|
|
236
|
-
They are organized into buckets:
|
|
237
|
-
|
|
238
|
-
- `engineering/` — code work.
|
|
239
|
-
- `productivity/` — non-code workflow.
|
|
240
|
-
- `misc/` — kept around but rarely used.
|
|
241
|
-
- `personal/` — tied to a maintainer's setup, not promoted.
|
|
242
|
-
- `in-progress/` — drafts, not ready to ship.
|
|
243
|
-
|
|
244
|
-
Skills are loaded **only** through commands. There is no "skill autoloader"
|
|
245
|
-
that pulls them on every turn. The orchestrator does not see skills at all;
|
|
246
|
-
it only sees commands.
|
|
247
|
-
|
|
248
|
-
The skills index lives in [`docs/skills-index.md`](skills-index.md).
|
|
249
|
-
It is human-facing reference documentation, intentionally kept outside
|
|
250
|
-
`.roo/rules/` because `.roo/rules/` is injected on every turn. Commands
|
|
251
|
-
load skills directly from explicit `.roo/skills/.../SKILL.md` paths, so
|
|
252
|
-
the index is not required for runtime execution.
|
|
253
|
-
|
|
254
|
-
### Skill output placement
|
|
255
|
-
|
|
256
|
-
Skills that produce throwaway working files share a single convention
|
|
257
|
-
so cleanup is mechanical:
|
|
258
|
-
|
|
259
|
-
- `.scratch/<command>-<slug>.md` — phase checklists for `/fix`,
|
|
260
|
-
`/feature`, `/refactor`; optional `/explore` save-targets under
|
|
261
|
-
`.scratch/explorations/<date>/`; local PRDs and issues from
|
|
262
|
-
`setup-matt-pocock-skills` (`.scratch/{feature-slug}/`).
|
|
263
|
-
- `.scratch/prototypes/<slug>/` — logic, state, and data-model
|
|
264
|
-
prototypes from `/prototype` (`LOGIC.md` branch). UI prototypes stay
|
|
265
|
-
adjacent to the real page they mock up because they need the route,
|
|
266
|
-
data fetching, and auth.
|
|
267
|
-
- `docs/journal/` — entries written by `/commit-and-document`.
|
|
268
|
-
- In-place edits — `/tweak`, `/tdd`, `migrate-to-shoehorn`,
|
|
269
|
-
`update-docs`.
|
|
270
|
-
|
|
271
|
-
`.scratch/` is on the architect's `fileRegex` allowlist, so it is a
|
|
272
|
-
safe edit target for `system-architect` and a natural bulk-cleanup
|
|
273
|
-
target for the user.
|
|
274
|
-
|
|
275
|
-
## Three-folder contract
|
|
276
|
-
|
|
277
|
-
Zoo Flow uses three distinct folders, each with a different lifetime
|
|
278
|
-
and replacement policy. Keeping them separate is intentional:
|
|
279
|
-
|
|
280
|
-
| Folder | Lifetime | Loaded every turn? | Replaced by `init`/`update`? | Gitignored? | Authored by |
|
|
281
|
-
|---|---|---|---|---|---|
|
|
282
|
-
| `.roo/` | Per release | ✅ (rules/) | ✅ (full replace) | No | Template |
|
|
283
|
-
| `.scratch/` | Per chain | ❌ | ❌ | Convention | Worker |
|
|
284
|
-
| `.zoo-flow/` | Per project | ❌ | ❌ (migrated) | ✅ (init appends) | User via /grill-with-docs |
|
|
285
|
-
|
|
286
|
-
**Why three folders, not one.** Each row has a different replacement
|
|
287
|
-
policy and a different authorship model. Collapsing them would force
|
|
288
|
-
the host to grow exception mechanisms (don't auto-load, don't replace
|
|
289
|
-
this subset, don't wipe user content) that defeat the point of having
|
|
290
|
-
a single contract.
|
|
291
|
-
|
|
292
|
-
**Why `.zoo-flow/` instead of root.** Root `CONTEXT.md` and root
|
|
293
|
-
`docs/adr/` polluted every project with files only some projects
|
|
294
|
-
needed. `.zoo-flow/` is hidden, gitignored by default, and houses only
|
|
295
|
-
the universally-essential `CONTEXT.md` placeholder plus user-authored
|
|
296
|
-
ADRs. The other slots (ARCHITECTURE.md, APP_MAP.md, FLOW.md) are
|
|
297
|
-
created on demand and never pre-shipped. The full slot list and
|
|
298
|
-
discovery rule live in
|
|
299
|
-
[`grill-with-docs/CONTEXT-FORMAT.md`](../templates/full/.roo/skills/engineering/grill-with-docs/CONTEXT-FORMAT.md).
|
|
300
|
-
|
|
301
|
-
## Same-window `switch_mode`
|
|
302
|
-
|
|
303
|
-
Used inside a single task window when one mode needs the other for a phase
|
|
304
|
-
of the same workflow. Examples:
|
|
305
|
-
|
|
306
|
-
- `/fix` going architect (diagnose) → tweaker (implement) → architect
|
|
307
|
-
(post-mortem).
|
|
308
|
-
- `/feature` going architect (sharpen) → tweaker (prototype) → architect
|
|
309
|
-
(PRD).
|
|
310
|
-
- `code-tweaker` auto-escalating after a 3-strike test failure.
|
|
311
|
-
|
|
312
|
-
`switch_mode` preserves context. The receiving mode reads the same task
|
|
313
|
-
window and continues. Use it for tight loops where the cost of losing
|
|
314
|
-
context outweighs the benefit of a clean boundary.
|
|
315
|
-
|
|
316
|
-
## Delegated `new_task`
|
|
317
|
-
|
|
318
|
-
Used by the orchestrator only. The orchestrator does not implement
|
|
319
|
-
anything; it hands work off to the architect or the tweaker via
|
|
320
|
-
`new_task`. The delegated message must include:
|
|
321
|
-
|
|
322
|
-
- The slash command, including the leading slash.
|
|
323
|
-
- The user context.
|
|
324
|
-
- A proceed policy. One of: `Proceed automatically after audit if
|
|
325
|
-
clean`, `Ask user before implementation`, or `Stop and report only`.
|
|
326
|
-
- A reminder to follow `.roo/rules/01-command-protocol.md`.
|
|
327
|
-
- A reminder that skills live under `.roo/skills/...`.
|
|
328
|
-
- A completion rule: finish the **whole command chain**, then end with
|
|
329
|
-
`attempt_completion` containing summary, files inspected/changed,
|
|
330
|
-
commands/tests run, blockers, and a recommended next command. Mid-chain
|
|
331
|
-
mode handoffs use `switch_mode`, not `attempt_completion`.
|
|
332
|
-
|
|
333
|
-
`new_task` opens a fresh subtask window. The boundary is the point.
|
|
334
|
-
Mode-internal context, scratch work, and false starts stay in the
|
|
335
|
-
subtask.
|
|
336
|
-
|
|
337
|
-
## Proceed policy
|
|
338
|
-
|
|
339
|
-
Zoo Flow delegated tasks include a proceed policy so workers know when
|
|
340
|
-
to continue and when to ask the user.
|
|
341
|
-
|
|
342
|
-
Policies:
|
|
343
|
-
|
|
344
|
-
- `Proceed automatically after audit if clean`
|
|
345
|
-
- `Ask user before implementation`
|
|
346
|
-
- `Stop and report only`
|
|
347
|
-
|
|
348
|
-
This prevents unnecessary questions during well-specified subtasks,
|
|
349
|
-
while preserving approval gates for hypotheses, architecture decisions,
|
|
350
|
-
commits, issue changes, and irreversible actions.
|
|
351
|
-
|
|
352
|
-
## `attempt_completion`
|
|
353
|
-
|
|
354
|
-
Used at the end of a delegated subtask. It is **not** an escape hatch.
|
|
355
|
-
|
|
356
|
-
A delegated task is the **entire command chain** — every phase and every
|
|
357
|
-
mode switch the command body defines — not the single phase a mode is
|
|
358
|
-
currently running. A worker returns via `attempt_completion` only after
|
|
359
|
-
the command's **final** phase. Mid-chain handoffs between modes use
|
|
360
|
-
`switch_mode`.
|
|
361
|
-
|
|
362
|
-
Specifically, the architect must not use `attempt_completion` to skip
|
|
363
|
-
required implementation work — if the work belongs to the tweaker, the
|
|
364
|
-
architect uses `switch_mode` first. Likewise the tweaker must not complete
|
|
365
|
-
out from under a remaining architect phase (e.g. `/fix` post-mortem); it
|
|
366
|
-
`switch_mode`s back. Before any `attempt_completion`, the worker re-checks
|
|
367
|
-
the command body and confirms no later phase is assigned to another mode.
|
|
368
|
-
The composite commands (`/fix`, `/feature`, `/refactor`) persist a phase
|
|
369
|
-
checklist under `.scratch/` so this survives context growth and mode
|
|
370
|
-
switches.
|
|
371
|
-
|
|
372
|
-
`attempt_completion` returns to the orchestrator with a structured summary.
|
|
373
|
-
The orchestrator then summarizes for the user and halts. It never
|
|
374
|
-
auto-launches the next subtask, even if the summary suggests one.
|
|
375
|
-
|
|
376
|
-
## Context economy
|
|
377
|
-
|
|
378
|
-
Zoo Flow avoids unnecessary token use by asking agents to search or list before broad reads, use targeted line ranges when possible, and avoid re-reading unchanged files.
|
|
379
|
-
|
|
380
|
-
Full-file reads are still allowed when correctness requires complete context.
|
package/docs/bloat-control.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# Bloat Control
|
|
2
|
-
|
|
3
|
-
Zoo Flow must stay small, focused, and hard to break. Every addition
|
|
4
|
-
of a command, doc, rule, or skill must clear a bloat gate.
|
|
5
|
-
|
|
6
|
-
## Bloat gate
|
|
7
|
-
|
|
8
|
-
Before adding any new:
|
|
9
|
-
|
|
10
|
-
- **Command** (composite or routed)
|
|
11
|
-
- **Documentation file** under `docs/`
|
|
12
|
-
- **Global rule** under `.roo/rules/`
|
|
13
|
-
- **Mode-specific rule** under `.roo/rules-{mode}/`
|
|
14
|
-
- **Skill** that ships by default
|
|
15
|
-
|
|
16
|
-
Answer these:
|
|
17
|
-
|
|
18
|
-
1. **Is it needed by most projects?** If not, it should be a
|
|
19
|
-
context pack or a community skill, not a default.
|
|
20
|
-
2. **Does it cross SA/CT boundaries?** If not, prefer a skill or
|
|
21
|
-
helper command over a composite.
|
|
22
|
-
3. **Does it add a new check to doctor?** Every file addition should
|
|
23
|
-
also add a doctor validation for it.
|
|
24
|
-
4. **Does it fit a token budget tier?** Every file has a budget
|
|
25
|
-
(see `docs/token-budget.md`). If it exceeds the tier, add an
|
|
26
|
-
exception with justification.
|
|
27
|
-
5. **Does it require documentation?** Every command and every new
|
|
28
|
-
doc file needs README or docs/ coverage with a link that
|
|
29
|
-
`check-package-links.js` validates.
|
|
30
|
-
|
|
31
|
-
## Guardrails
|
|
32
|
-
|
|
33
|
-
- Do not create optional docs by default. `/scaffold-context` may
|
|
34
|
-
offer them, but they are never written without user confirmation.
|
|
35
|
-
- Do not add composite commands unless they meet all criteria in
|
|
36
|
-
`docs/command-design.md`.
|
|
37
|
-
- Do not weaken approval gates or auto-run `/verify`, `/review`, or
|
|
38
|
-
`/commit-and-document`.
|
|
39
|
-
- Token budgets with explicit exceptions are enforced by
|
|
40
|
-
`scripts/token-budget.js`.
|
|
41
|
-
|
|
42
|
-
## Anti-patterns
|
|
43
|
-
|
|
44
|
-
- Adding a command "because it might be useful" — put it in a skill
|
|
45
|
-
or context pack.
|
|
46
|
-
- Accepting doc bloat "because it clarifies things" — token budget
|
|
47
|
-
will catch it.
|
|
48
|
-
- Creating optional docs as defaults — they are only offered through
|
|
49
|
-
`/scaffold-context` after user confirmation.
|