@fernado03/zoo-flow 0.1.3 → 0.2.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.
- package/README.md +12 -6
- package/bin/zoo-flow.js +31 -1
- package/package.json +1 -1
- package/templates/full/.roo/commands/commit-and-document.md +4 -195
- package/templates/full/.roo/commands/feature.md +1 -5
- package/templates/full/.roo/commands/update-docs.md +5 -115
- package/templates/full/.roo/rules/01-command-protocol.md +15 -17
- package/templates/full/.roo/rules/02-three-failure-rule.md +12 -0
- package/templates/full/.roo/rules/03-manual-reply-protocol.md +15 -16
- package/templates/full/.roo/rules/04-context-economy.md +13 -0
- package/templates/full/.roo/rules-code-tweaker/00-scope.md +5 -1
- package/templates/full/.roo/rules-custom-orchestrator/00-routing.md +2 -0
- package/templates/full/.roo/rules-custom-orchestrator/01-delegation-message.md +27 -1
- package/templates/full/.roo/rules-system-architect/00-scope.md +4 -0
- package/templates/full/.roo/rules-system-architect/02-completion.md +0 -2
- package/templates/full/.roo/skills/engineering/commit-and-document/SKILL.md +143 -0
- package/templates/full/.roo/skills/engineering/diagnose/SKILL.md +12 -1
- package/templates/full/.roo/skills/engineering/grill-with-docs/CONTEXT-FORMAT.md +11 -0
- package/templates/full/.roo/skills/engineering/grill-with-docs/SKILL.md +11 -3
- package/templates/full/.roo/skills/engineering/improve-codebase-architecture/HTML-REPORT.md +1 -2
- package/templates/full/.roo/skills/engineering/improve-codebase-architecture/SKILL.md +12 -0
- package/templates/full/.roo/skills/engineering/prototype/SKILL.md +10 -0
- package/templates/full/.roo/skills/engineering/setup-matt-pocock-skills/domain.md +1 -16
- package/templates/full/.roo/skills/engineering/tdd/SKILL.md +20 -1
- package/templates/full/.roo/skills/engineering/tweak/SKILL.md +12 -0
- package/templates/full/.roo/skills/engineering/update-docs/SKILL.md +66 -0
- package/templates/full/.roo/skills/engineering/zoom-out/SKILL.md +12 -0
- package/templates/full/.roomodes +1 -1
package/README.md
CHANGED
|
@@ -68,9 +68,12 @@ ways to drive Zoo Flow, and the choice matters:
|
|
|
68
68
|
|
|
69
69
|
> /tweak fix the typo in `README`
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
When Zoo Flow asks a workflow question, reply by typing the number,
|
|
72
|
+
for example `1`.
|
|
73
|
+
|
|
74
|
+
Zoo Flow may show numbered options, but those options should be
|
|
75
|
+
plain-language choices only. They should not contain slash commands,
|
|
76
|
+
mode names, or executable routing text. See
|
|
74
77
|
[`docs/troubleshooting.md`](docs/troubleshooting.md#clickable-suggestions-can-route-incorrectly).
|
|
75
78
|
|
|
76
79
|
## Update
|
|
@@ -83,6 +86,10 @@ Backs up your current `.roomodes` and `.roo/` to
|
|
|
83
86
|
`.zoo-flow-backup/<timestamp>/`, then replaces them with the latest
|
|
84
87
|
template. Preview with `--dry-run`.
|
|
85
88
|
|
|
89
|
+
## Context economy
|
|
90
|
+
|
|
91
|
+
Zoo Flow avoids unnecessary token use by asking agents to search or list before broad reads, use targeted line ranges when possible, and avoid re-reading unchanged files. Full-file reads are still allowed when correctness requires complete context.
|
|
92
|
+
|
|
86
93
|
## Modes
|
|
87
94
|
|
|
88
95
|
| Slug | Name | Role | Edits allowed | Delegation |
|
|
@@ -98,9 +105,8 @@ behavior lives in `.roo/rules-{modeSlug}/` folders. See
|
|
|
98
105
|
|
|
99
106
|
## Commands
|
|
100
107
|
|
|
101
|
-
The orchestrator routes the **core** commands. **Helper** commands
|
|
102
|
-
run directly inside `system-architect` or `code-tweaker` when
|
|
103
|
-
need them.
|
|
108
|
+
The orchestrator routes the **core** commands. **Helper** commands are
|
|
109
|
+
run directly inside `system-architect` or `code-tweaker` when needed.
|
|
104
110
|
|
|
105
111
|
### Core (routed by the orchestrator)
|
|
106
112
|
|
package/bin/zoo-flow.js
CHANGED
|
@@ -141,6 +141,34 @@ function validateTemplate(rootDir) {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
// Validate skill-wrapper command references. Each command file in
|
|
145
|
+
// .roo/commands/ may either declare a skill via `Skill:
|
|
146
|
+
// .roo/skills/.../SKILL.md` (skill-wrapper command) or contain its
|
|
147
|
+
// workflow steps directly. Direct-workflow commands are valid; we only
|
|
148
|
+
// verify referenced skills exist.
|
|
149
|
+
if (pathExists(commandsDir)) {
|
|
150
|
+
const skillRefRegex = /^Skill:\s*`?(\.roo\/skills\/[^\s`]+SKILL\.md)`?\s*$/m;
|
|
151
|
+
|
|
152
|
+
for (const entry of fs.readdirSync(commandsDir)) {
|
|
153
|
+
if (!entry.endsWith(".md")) continue;
|
|
154
|
+
|
|
155
|
+
const commandFile = path.join(commandsDir, entry);
|
|
156
|
+
const text = fs.readFileSync(commandFile, "utf8");
|
|
157
|
+
const match = text.match(skillRefRegex);
|
|
158
|
+
|
|
159
|
+
if (!match) continue;
|
|
160
|
+
|
|
161
|
+
const skillRelative = match[1];
|
|
162
|
+
const skillAbsolute = path.join(rootDir, skillRelative);
|
|
163
|
+
|
|
164
|
+
if (!pathExists(skillAbsolute)) {
|
|
165
|
+
failures.push(
|
|
166
|
+
`Command ${path.relative(rootDir, commandFile)} references missing skill: ${skillRelative}`
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
144
172
|
const allFiles = walkFiles(rootDir);
|
|
145
173
|
const textFileExtensions = new Set([".md", ".json", ".txt", ".yaml", ".yml"]);
|
|
146
174
|
|
|
@@ -167,7 +195,9 @@ function validateTemplate(rootDir) {
|
|
|
167
195
|
const requiredRules = [
|
|
168
196
|
".roo/rules/00-paths.md",
|
|
169
197
|
".roo/rules/01-command-protocol.md",
|
|
170
|
-
".roo/rules/
|
|
198
|
+
".roo/rules/02-three-failure-rule.md",
|
|
199
|
+
".roo/rules/03-manual-reply-protocol.md",
|
|
200
|
+
".roo/rules/04-context-economy.md"
|
|
171
201
|
];
|
|
172
202
|
|
|
173
203
|
for (const rule of requiredRules) {
|
package/package.json
CHANGED
|
@@ -1,202 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "
|
|
3
|
-
argument-hint: <
|
|
2
|
+
description: "Stage changes, write a Conventional Commit, link any GitHub issue, and append a dated journal entry under docs/journal/."
|
|
3
|
+
argument-hint: <optional context for the commit message>
|
|
4
4
|
mode: code-tweaker
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Run the **commit + document** procedure: inspect git, propose a Conventional Commit, optionally link a GitHub issue, stage selected files, commit, and write a dated entry under `docs/journal/`. Follow the skill exactly.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Run these three commands and read the output:
|
|
12
|
-
|
|
13
|
-
- `git status --short`
|
|
14
|
-
- `git diff --stat`
|
|
15
|
-
- `git diff --cached --stat` (in case anything is already staged)
|
|
16
|
-
|
|
17
|
-
Summarise to the user what's changed: which files, roughly what the changes do.
|
|
18
|
-
|
|
19
|
-
## Step 2 — Suggest a Conventional Commit message
|
|
20
|
-
|
|
21
|
-
Propose ONE single-line commit message in this exact format:
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
<type>(<scope>): <short, action-focused summary>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
- **type** — one of: `feat`, `fix`, `refactor`, `docs`, `chore`, `test`, `style`, `perf`
|
|
28
|
-
- **scope** — the area of the repo touched (e.g. `chat`, `documents`, `ui`, `core`, or a specific module name). Omit parens if scope is unclear.
|
|
29
|
-
- **summary** — imperative mood, present tense, under 70 chars total. Start with a verb.
|
|
30
|
-
|
|
31
|
-
Show the user the proposed message, the list of files that will be staged, and a separate list of excluded files such as test files, test folders, docs, or secrets. Ask: "Commit with this message? (yes / edit / cancel)"
|
|
32
|
-
|
|
33
|
-
If they say `edit`, take their revised message. If `cancel`, stop the whole procedure and report.
|
|
34
|
-
|
|
35
|
-
## Step 2.5 — Detect or ask for an issue reference
|
|
36
|
-
|
|
37
|
-
This step links the commit to a GitHub issue if one applies. It is opt-in — if no issue applies, skip cleanly.
|
|
38
|
-
|
|
39
|
-
### Pre-checks (silent, fast bail-out)
|
|
40
|
-
|
|
41
|
-
Before asking the user anything, run these silent checks:
|
|
42
|
-
|
|
43
|
-
1. Run `git remote -v` and look for a `github.com` remote.
|
|
44
|
-
2. If no GitHub remote exists, skip this entire step. Do NOT prompt.
|
|
45
|
-
3. If `gh` CLI is not installed (check with `command -v gh`), skip this entire step. Do NOT prompt.
|
|
46
|
-
|
|
47
|
-
### Detection
|
|
48
|
-
|
|
49
|
-
Scan the proposed commit message from Step 2 for issue references:
|
|
50
|
-
|
|
51
|
-
- Closing keywords: `Closes #N`, `Close #N`, `Closed #N`, `Fixes #N`, `Fix #N`, `Fixed #N`, `Resolves #N`, `Resolve #N`, `Resolved #N` (case-insensitive)
|
|
52
|
-
- Bare references: `#N` anywhere in the message
|
|
53
|
-
|
|
54
|
-
### Branch A — Commit message already has a closing keyword
|
|
55
|
-
|
|
56
|
-
Show the user the detected reference and ask:
|
|
57
|
-
|
|
58
|
-
> Detected `Closes #42` in the commit message. After commit, comment on issue #42 and close it? (yes / no)
|
|
59
|
-
|
|
60
|
-
- yes → proceed; remember `{action: close, issue: 42}` for Step 3.5
|
|
61
|
-
- no → proceed without issue actions
|
|
62
|
-
|
|
63
|
-
### Branch B — Commit message has bare `#N` (not a closing keyword)
|
|
64
|
-
|
|
65
|
-
> Detected `#42` in the commit message. After commit, post a progress comment on issue #42? (yes / no / close)
|
|
66
|
-
|
|
67
|
-
- yes → remember `{action: comment, issue: 42}`
|
|
68
|
-
- close → remember `{action: close, issue: 42}`
|
|
69
|
-
- no → no issue actions
|
|
70
|
-
|
|
71
|
-
### Branch C — No reference detected
|
|
72
|
-
|
|
73
|
-
Ask once:
|
|
74
|
-
|
|
75
|
-
> Is this commit related to a GitHub issue? (issue number / no / skip)
|
|
76
|
-
|
|
77
|
-
- A number like `42` → ask one follow-up: "Comment only or close after commit? (comment / close)" — remember the chosen action
|
|
78
|
-
- `no` or `skip` or empty input → no issue actions; do NOT ask again
|
|
79
|
-
- Anything that doesn't parse as a number → treat as `no`
|
|
80
|
-
|
|
81
|
-
### Carry-over
|
|
82
|
-
|
|
83
|
-
Whatever was decided in Branch A / B / C, store it as `issue_action` for Step 3.5 to act on. If nothing was decided, `issue_action` is `none`.
|
|
84
|
-
|
|
85
|
-
## Step 3 — Stage and commit
|
|
86
|
-
|
|
87
|
-
Stage the specific files (not `git add .`). Use `git add <file1> <file2> ...` with the files identified in Step 1.
|
|
88
|
-
|
|
89
|
-
Before staging, exclude:
|
|
90
|
-
- any file or folder under `test/`, `tests/`, `__tests__/`, `spec/`, or `specs/`
|
|
91
|
-
- any test file matching `*.test.*`, `*.spec.*`, `test_*`, or `*_test.*`
|
|
92
|
-
- any file that looks like it contains secrets (`.env`, credentials, tokens)
|
|
93
|
-
|
|
94
|
-
Flag excluded files to the user instead of staging them.
|
|
95
|
-
|
|
96
|
-
Commit with the approved message: `git commit -m "<message>"`.
|
|
97
|
-
|
|
98
|
-
Capture the commit hash from the commit output. The user will need it for Step 6. You can also run `git rev-parse --short HEAD` to get it.
|
|
99
|
-
|
|
100
|
-
## Step 3.5 — Act on the issue reference (if any)
|
|
101
|
-
|
|
102
|
-
If `issue_action` from Step 2.5 is `none`, skip this step entirely.
|
|
103
|
-
|
|
104
|
-
Otherwise, do the following:
|
|
105
|
-
|
|
106
|
-
1. Capture the short commit hash from Step 3.
|
|
107
|
-
2. Construct a comment body:
|
|
108
|
-
|
|
109
|
-
```
|
|
110
|
-
> *This was generated by AI during commit.*
|
|
111
|
-
|
|
112
|
-
Linked from commit `<short-hash>`: <commit message subject line>
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
3. Post the comment with `gh issue comment <N> --body "<body>"`.
|
|
116
|
-
4. If `issue_action.action == "close"`, also run `gh issue close <N>`. Do NOT pass a comment to `gh issue close`; the comment was already posted in step 3.
|
|
117
|
-
5. If either gh command fails (auth missing, issue doesn't exist, network error), DO NOT abort the workflow. Print the error to the user with a clear note: "Issue update failed — commit and journal entry are still complete. Re-run `gh issue comment <N>` manually if needed." Then continue.
|
|
118
|
-
|
|
119
|
-
Safety:
|
|
120
|
-
|
|
121
|
-
- Never use `gh issue close --comment` — comment first, then close, so a closing comment is always posted even if `gh close` later fails.
|
|
122
|
-
- Never close an issue you couldn't successfully comment on.
|
|
123
|
-
- Never push. The commit stays local; gh API calls are separate from `git push`.
|
|
124
|
-
|
|
125
|
-
## Step 4 — Ensure docs/ is gitignored
|
|
126
|
-
|
|
127
|
-
Read [`.gitignore`](.gitignore:1). The repo treats the entire `docs/` tree as local-only — nothing under `docs/` should ever be committed.
|
|
128
|
-
|
|
129
|
-
If `.gitignore` does NOT contain a line matching `docs/` (with or without trailing slash), append this block to the end:
|
|
130
|
-
|
|
131
|
-
```
|
|
132
|
-
# Local documentation — never committed
|
|
133
|
-
docs/
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
If `.gitignore` was modified, tell the user — but do NOT commit the gitignore change as part of this flow.
|
|
137
|
-
|
|
138
|
-
If the user has staged any file under `docs/` in Step 3 by mistake, unstage it (`git restore --staged docs/<path>`) and warn them: "Files under `docs/` should not be committed. Unstaged."
|
|
139
|
-
|
|
140
|
-
## Step 5 — Inspect existing docs/journal/ structure
|
|
141
|
-
|
|
142
|
-
Look at the current shape of `docs/journal/` if it exists:
|
|
143
|
-
|
|
144
|
-
- Run `ls -la docs/journal/` (or list it via tools).
|
|
145
|
-
- Note the existing date subfolders and file naming pattern, if any. Match whatever convention is already in use.
|
|
146
|
-
|
|
147
|
-
If `docs/journal/` does not exist yet, create it.
|
|
148
|
-
|
|
149
|
-
## Step 6 — Create a dated subfolder and write the entry
|
|
150
|
-
|
|
151
|
-
Determine today's date in `YYYY-MM-DD` format using `date +%Y-%m-%d`.
|
|
152
|
-
|
|
153
|
-
Create `docs/journal/<YYYY-MM-DD>/` if it does not exist.
|
|
154
|
-
|
|
155
|
-
Inside that folder, write a new markdown file named `<HH-MM>-<short-slug>.md` where:
|
|
156
|
-
- `<HH-MM>` is the current local time in 24-hour format
|
|
157
|
-
- `<short-slug>` is a kebab-case version of the commit summary (3–6 words max)
|
|
158
|
-
|
|
159
|
-
Use this template for the entry:
|
|
160
|
-
|
|
161
|
-
```md
|
|
162
|
-
# <Commit summary>
|
|
163
|
-
|
|
164
|
-
**Commit:** <full commit hash>
|
|
165
|
-
**Short hash:** <short hash>
|
|
166
|
-
**Date:** <YYYY-MM-DD HH:MM local time>
|
|
167
|
-
|
|
168
|
-
## What changed
|
|
169
|
-
|
|
170
|
-
<2–4 sentences describing what the commit changes. Plain English, not a file list.>
|
|
171
|
-
|
|
172
|
-
## Why
|
|
173
|
-
|
|
174
|
-
<1–3 sentences on the motivation. Pull from the conversation context if available.>
|
|
175
|
-
|
|
176
|
-
## Notes for future me
|
|
177
|
-
|
|
178
|
-
<Any gotchas, follow-ups, or things to revisit. One paragraph max. Skip the section if there's nothing worth saying.>
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
Fill in the placeholders from:
|
|
182
|
-
- The commit hash from Step 3
|
|
183
|
-
- The conversation context for "What changed" and "Why"
|
|
184
|
-
|
|
185
|
-
## Step 7 — Confirm
|
|
186
|
-
|
|
187
|
-
Tell the user:
|
|
188
|
-
- Commit hash and message
|
|
189
|
-
- Path to the journal entry just created
|
|
190
|
-
- Whether `.gitignore` was updated
|
|
191
|
-
- If `issue_action` was acted on: "Issue #N commented and closed." or "Issue #N commented." (whichever applies)
|
|
192
|
-
|
|
193
|
-
End with: "All of `docs/` is gitignored, so this entry stays local."
|
|
194
|
-
|
|
195
|
-
## Safety notes
|
|
196
|
-
|
|
197
|
-
- Never run `git push`. Commits stay local.
|
|
198
|
-
- Never use `--amend`, `--force`, or `reset --hard`.
|
|
199
|
-
- If `git status` shows the working tree is clean, abort early: tell the user there's nothing to commit and skip the rest of the flow.
|
|
200
|
-
- If files look like they contain secrets, flag them and skip staging them.
|
|
9
|
+
Skill: `.roo/skills/engineering/commit-and-document/SKILL.md`
|
|
201
10
|
|
|
202
11
|
$ARGUMENTS
|
|
@@ -6,11 +6,7 @@ mode: system-architect
|
|
|
6
6
|
EXECUTION RULES (Run sequentially. Wait for user between phases):
|
|
7
7
|
1. SHARPEN (Architect): Run skill `.roo/skills/engineering/grill-with-docs/SKILL.md`. Update docs.
|
|
8
8
|
HARD STOP: Ask user to choose: Prototype OR skip to PRD.
|
|
9
|
-
2. PROTOTYPE [Optional]:
|
|
10
|
-
- Architect summarizes the prototype question, constraints, relevant context, and expected decision.
|
|
11
|
-
- Architect MUST `switch_mode` -> `code-tweaker`.
|
|
12
|
-
- Tweaker executes the `/prototype` command workflow using `.roo/rules/01-command-protocol.md`.
|
|
13
|
-
- Tweaker MUST `switch_mode` -> `system-architect` with prototype result, run command/URL if any, files changed, and decision needed.
|
|
9
|
+
2. PROTOTYPE [Optional]: Follow `.roo/rules-system-architect/01-feature-prototype.md` for the architect→tweaker handoff.
|
|
14
10
|
HARD STOP: Wait for user verdict.
|
|
15
11
|
3. PRD (Architect): Run skill `.roo/skills/engineering/to-prd/SKILL.md` using a 3-bullet summary of prior phases.
|
|
16
12
|
HARD STOP: Ask "Ready to slice into issues?". Wait for approval.
|
|
@@ -4,127 +4,17 @@ argument-hint: <doc or area to update>
|
|
|
4
4
|
mode: code-tweaker
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Update repo documentation so it matches the current code. Surgical edits only — read existing docs first, verify claims against code, never rewrite wholesale unless the existing doc is unsalvageable. Follow the skill exactly.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- `FLOW.md` files
|
|
12
|
-
- `APP_MAP.md`
|
|
13
|
-
- `ARCHITECTURE.md`
|
|
14
|
-
- `README.md`
|
|
15
|
-
- Other markdown docs that explain how code works
|
|
9
|
+
Skill: `.roo/skills/engineering/update-docs/SKILL.md`
|
|
16
10
|
|
|
17
11
|
Do NOT use this for:
|
|
18
12
|
|
|
19
|
-
- Domain glossary terms — use `/grill-with-docs`
|
|
20
|
-
- ADRs
|
|
13
|
+
- Domain glossary terms — use `/grill-with-docs`
|
|
14
|
+
- ADRs — use `/grill-with-docs` or `/refactor`
|
|
21
15
|
- Local commit journal entries — use `/commit-and-document`
|
|
22
16
|
- Read-only understanding — use `/explore`
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- `apps/kikonnekt_w_sso/core/chat/FLOW.md`
|
|
27
|
-
- `chat flow`
|
|
28
|
-
- `documents flow`
|
|
29
|
-
- `APP_MAP.md`
|
|
30
|
-
- `ARCHITECTURE.md`
|
|
31
|
-
|
|
32
|
-
If no target is provided, ask once: "Which documentation file or area should I update?"
|
|
33
|
-
|
|
34
|
-
## Phase 1 — Identify target doc
|
|
35
|
-
|
|
36
|
-
Infer or ask for the target documentation file.
|
|
37
|
-
|
|
38
|
-
Prefer existing docs when possible:
|
|
39
|
-
|
|
40
|
-
- For a subsystem flow, look for a nearby `FLOW.md`.
|
|
41
|
-
- For app-wide navigation or module mapping, use `APP_MAP.md`.
|
|
42
|
-
- For system-level structure and constraints, use `ARCHITECTURE.md`.
|
|
43
|
-
- For setup or usage, use `README.md`.
|
|
44
|
-
|
|
45
|
-
If the target doc does not exist, ask before creating it. Do not invent a new doc location silently.
|
|
46
|
-
|
|
47
|
-
## Phase 2 — Read existing docs first
|
|
48
|
-
|
|
49
|
-
Read the target doc fully before editing.
|
|
50
|
-
|
|
51
|
-
Also read nearby related docs, if relevant:
|
|
52
|
-
|
|
53
|
-
- Neighboring `FLOW.md` files
|
|
54
|
-
- `APP_MAP.md`
|
|
55
|
-
- `ARCHITECTURE.md`
|
|
56
|
-
- `README.md`
|
|
57
|
-
- Any module-local docs in the same subtree
|
|
58
|
-
|
|
59
|
-
Goal: match the existing documentation style, section structure, vocabulary, and level of detail.
|
|
60
|
-
|
|
61
|
-
## Phase 3 — Verify against code
|
|
62
|
-
|
|
63
|
-
Inspect the code that the doc claims to describe. Update docs from code reality, not guesses.
|
|
64
|
-
|
|
65
|
-
Check:
|
|
66
|
-
|
|
67
|
-
- Entrypoints
|
|
68
|
-
- Main functions/classes
|
|
69
|
-
- Data flow
|
|
70
|
-
- State changes
|
|
71
|
-
- Side effects
|
|
72
|
-
- Dependencies
|
|
73
|
-
- Error/fallback paths
|
|
74
|
-
- Files involved
|
|
75
|
-
|
|
76
|
-
If a claim cannot be verified, either remove it or move it to an `Open questions` section. Do not present guesses as facts.
|
|
77
|
-
|
|
78
|
-
## Phase 4 — Make surgical edits
|
|
79
|
-
|
|
80
|
-
Do not rewrite the whole doc by default.
|
|
81
|
-
|
|
82
|
-
Prefer surgical edits:
|
|
83
|
-
|
|
84
|
-
- Keep useful existing sections
|
|
85
|
-
- Update stale sections
|
|
86
|
-
- Add missing flows
|
|
87
|
-
- Remove false claims
|
|
88
|
-
- Preserve heading style
|
|
89
|
-
- Preserve existing tone and detail level
|
|
90
|
-
|
|
91
|
-
Only rewrite the whole file if the current doc is too stale to salvage. If doing that, say why before editing.
|
|
92
|
-
|
|
93
|
-
## Phase 5 — Add or update freshness block
|
|
94
|
-
|
|
95
|
-
At the bottom of the doc, add or update this section if it fits the existing style:
|
|
96
|
-
|
|
97
|
-
```md
|
|
98
|
-
## Freshness
|
|
99
|
-
|
|
100
|
-
Last checked against code: YYYY-MM-DD
|
|
101
|
-
Relevant files checked:
|
|
102
|
-
- `path/to/file.py`
|
|
103
|
-
- `path/to/other_file.py`
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
Use today's date. Include only files actually inspected.
|
|
107
|
-
|
|
108
|
-
## Phase 6 — Sanity check
|
|
109
|
-
|
|
110
|
-
After editing:
|
|
111
|
-
|
|
112
|
-
- Re-read the updated doc
|
|
113
|
-
- Check referenced file paths exist
|
|
114
|
-
- Ensure every major claim maps to code or a cited doc
|
|
115
|
-
- Ensure no stale contradiction remains with nearby docs
|
|
116
|
-
- Summarise what changed
|
|
117
|
-
|
|
118
|
-
## Phase 7 — Recommend next step
|
|
119
|
-
|
|
120
|
-
Recommend one next command:
|
|
121
|
-
|
|
122
|
-
- `/explore` if the user still seems unsure how the area works
|
|
123
|
-
- `/feature` if the docs update revealed a feature plan
|
|
124
|
-
- `/refactor` if the docs update revealed tangled-but-working code
|
|
125
|
-
- `/fix` if the docs update revealed a bug
|
|
126
|
-
- `/commit-and-document` if the docs update is complete
|
|
127
|
-
|
|
128
|
-
Do not auto-run the next command. The user chooses.
|
|
18
|
+
If `$ARGUMENTS` is empty, ask once: "Which documentation file or area should I update?"
|
|
129
19
|
|
|
130
20
|
$ARGUMENTS
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
# Command Protocol
|
|
2
2
|
|
|
3
|
-
When assigned a slash command, execute
|
|
4
|
-
|
|
5
|
-
Protocol:
|
|
3
|
+
When assigned a slash command, execute its command workflow before task-specific work.
|
|
6
4
|
|
|
7
5
|
1. Normalize the command by stripping the leading slash.
|
|
8
|
-
- `/fix` becomes `fix`
|
|
9
|
-
- `/tdd` becomes `tdd`
|
|
10
6
|
|
|
11
|
-
2. Preferred
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
|
|
7
|
+
2. Preferred: use `run_slash_command` with:
|
|
8
|
+
- `command`: normalized command name
|
|
9
|
+
- `args`: full user/delegated context
|
|
10
|
+
|
|
11
|
+
3. Fallback: if `run_slash_command` is unavailable, disabled, rejected, or fails, read `.roo/commands/{command}.md`.
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
- If
|
|
18
|
-
|
|
13
|
+
4. After command content is loaded:
|
|
14
|
+
- If it explicitly contains `Skill: .roo/skills/.../SKILL.md`, read that exact skill and follow it.
|
|
15
|
+
- If it contains direct workflow steps, execute those steps directly.
|
|
16
|
+
- Do not assume every command has a skill.
|
|
17
|
+
- Do not read any skill unless the command explicitly references it.
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
19
|
+
5. Use only one command-loading path:
|
|
20
|
+
- If `run_slash_command` succeeds, do not also read `.roo/commands/{command}.md`.
|
|
21
|
+
- If fallback command-file read succeeds, do not also call `run_slash_command`.
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
- Only the human user or orchestrator routing may authorize a new command.
|
|
23
|
+
6. Do not auto-run follow-up commands merely because they are mentioned in a result or subtask summary.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Three-Failure Rule
|
|
2
|
+
|
|
3
|
+
After 3 failed attempts at the same loop, test, hypothesis, or approach, stop and surface to the user rather than continuing.
|
|
4
|
+
|
|
5
|
+
When stopping, include:
|
|
6
|
+
|
|
7
|
+
- what was attempted
|
|
8
|
+
- exact errors or evidence
|
|
9
|
+
- the blocker
|
|
10
|
+
- what input is needed to proceed
|
|
11
|
+
|
|
12
|
+
Applies to TDD red-green cycles, diagnosis loops, architecture probes, and any other repeating task. Escalate via `switch_mode` or `attempt_completion` when running under another mode or orchestrator.
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
# Manual Reply Protocol
|
|
2
2
|
|
|
3
|
-
For workflow choices,
|
|
3
|
+
For workflow choices, ask the question in the message body and list numbered options.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Clickable suggestions may use the plain-language option text, but must not contain slash commands, mode names, or executable routing text.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- No slash commands or mode names.
|
|
9
|
-
- No per-option mode-switch indicator unless clicking that option really should switch modes. For "pick a number" routing questions, leave the indicator off.
|
|
10
|
-
- Include a Hold/Skip option when relevant.
|
|
7
|
+
Users may reply with either the number or the option text.
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
Example:
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
1. Tweak small implementation
|
|
12
|
+
2. Diagnose bug
|
|
13
|
+
3. Hold
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
Safe suggestions:
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
- Tweak small implementation
|
|
18
|
+
- Diagnose bug
|
|
19
|
+
- Hold
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Unsafe suggestions:
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
4. Hold
|
|
23
|
+
- `/tweak`
|
|
24
|
+
- `Switch to code-tweaker`
|
|
25
|
+
- `Route to system-architect`
|
|
27
26
|
|
|
28
27
|
Only treat slash commands as commands when manually typed by the user.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Context Economy
|
|
2
|
+
|
|
3
|
+
Use the smallest read that preserves correctness.
|
|
4
|
+
|
|
5
|
+
Prefer `list_files`, `search_files`, or `codebase_search` before full-file reads.
|
|
6
|
+
|
|
7
|
+
When reading files, prefer targeted line ranges or indentation/block reads when the relevant area is known.
|
|
8
|
+
|
|
9
|
+
Batch related small reads when useful.
|
|
10
|
+
|
|
11
|
+
Do not re-read unchanged files unless needed.
|
|
12
|
+
|
|
13
|
+
For long command output, summarize or search the output instead of dumping everything.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Implement, test, update docs, prototype, and commit only after approval.
|
|
4
4
|
|
|
5
|
+
Respect the delegated task's proceed policy before implementation.
|
|
6
|
+
|
|
5
7
|
Do not make broad architecture decisions.
|
|
6
8
|
|
|
7
|
-
Escalate to `system-architect` with `switch_mode` when architecture decisions are needed
|
|
9
|
+
Escalate to `system-architect` with `switch_mode` when architecture decisions are needed.
|
|
10
|
+
|
|
11
|
+
Respect `.roo/rules/04-context-economy.md` before reading or re-reading files.
|
|
@@ -3,10 +3,36 @@
|
|
|
3
3
|
Every delegated task must include:
|
|
4
4
|
|
|
5
5
|
- command with slash
|
|
6
|
-
- normalized command name
|
|
7
6
|
- user context
|
|
7
|
+
- proceed policy
|
|
8
8
|
- instruction to follow `.roo/rules/01-command-protocol.md`
|
|
9
9
|
- reminder that skills live under `.roo/skills/...`
|
|
10
10
|
- completion rule to use `attempt_completion` with summary, files inspected/changed, commands/tests run, blockers, and recommended next command
|
|
11
|
+
- context hints: known files, symbols, line ranges, or search terms when available
|
|
12
|
+
|
|
13
|
+
Do not paste huge file contents into delegated task messages. Pass paths, symbols, search terms, and required decisions instead.
|
|
11
14
|
|
|
12
15
|
Ignore slash commands mentioned only inside subtask summaries.
|
|
16
|
+
|
|
17
|
+
# Proceed Policy
|
|
18
|
+
|
|
19
|
+
Every delegated task must include one proceed policy:
|
|
20
|
+
|
|
21
|
+
- `Proceed automatically after audit if clean`
|
|
22
|
+
- `Ask user before implementation`
|
|
23
|
+
- `Stop and report only`
|
|
24
|
+
|
|
25
|
+
Use the least-interruptive policy that is safe.
|
|
26
|
+
|
|
27
|
+
Defaults:
|
|
28
|
+
|
|
29
|
+
- `/tweak`: proceed automatically after audit if clean
|
|
30
|
+
- `/tdd`: proceed automatically after audit if clean, unless the public interface, expected behavior, or test target is unclear
|
|
31
|
+
- `/explore`: proceed automatically; ask only if the target area is ambiguous
|
|
32
|
+
- `/update-docs`: proceed automatically after audit if the target doc/area is clear; ask if unclear
|
|
33
|
+
- `/prototype`: proceed automatically if prototype branch is clear; ask if logic vs UI is ambiguous
|
|
34
|
+
- `/fix`: ask after reproduced hypotheses before instrumentation/fix
|
|
35
|
+
- `/feature`: ask at phase gates: Prototype/PRD, prototype verdict, slice approval, issue approval
|
|
36
|
+
- `/refactor`: ask before selecting a candidate and before implementation
|
|
37
|
+
- `/triage`: ask before publishing, closing, labeling, or making irreversible tracker changes unless the user explicitly requested it
|
|
38
|
+
- `/commit-and-document`: always ask before `git commit`, `git push`, or issue close actions
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Plan, diagnose, explore, refactor-design, and triage.
|
|
4
4
|
|
|
5
|
+
Respect the delegated task's proceed policy and explicit phase gates.
|
|
6
|
+
|
|
5
7
|
Do not edit application source code.
|
|
6
8
|
|
|
7
9
|
Edits are limited to Markdown files, `.scratch/`, and `docs/`.
|
|
8
10
|
|
|
9
11
|
Use `switch_mode` to `code-tweaker` for implementation, test-writing, runnable prototypes, or source-code edits.
|
|
12
|
+
|
|
13
|
+
Respect `.roo/rules/04-context-economy.md`: map/search before broad reads, then read only the relevant sections.
|
|
@@ -7,5 +7,3 @@ If created by `custom-orchestrator` via `new_task`, use `attempt_completion` whe
|
|
|
7
7
|
Do not use `attempt_completion` to avoid required implementation work.
|
|
8
8
|
|
|
9
9
|
Halt for explicit user approval before testing a bug hypothesis, finalizing an architecture plan, publishing issues, or making irreversible decisions.
|
|
10
|
-
|
|
11
|
-
If diagnosis fails after 3 attempts, halt and request user intervention with attempts, evidence, and needed input.
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: commit-and-document
|
|
3
|
+
description: Stage selected files, write a Conventional Commit, optionally link a GitHub issue, and append a dated journal entry under docs/journal/. Use when the user wants to commit work and capture a local record of what changed.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Commit and Document
|
|
7
|
+
|
|
8
|
+
Deterministic flow. Execute steps in order; do not deviate.
|
|
9
|
+
|
|
10
|
+
## 1. Inspect git changes
|
|
11
|
+
|
|
12
|
+
Run and read:
|
|
13
|
+
|
|
14
|
+
- `git status --short`
|
|
15
|
+
- `git diff --stat`
|
|
16
|
+
- `git diff --cached --stat`
|
|
17
|
+
|
|
18
|
+
Summarise: which files, what changed.
|
|
19
|
+
|
|
20
|
+
If the working tree is clean, stop and report. Skip the rest.
|
|
21
|
+
|
|
22
|
+
## 2. Propose a Conventional Commit
|
|
23
|
+
|
|
24
|
+
One-line message:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
<type>(<scope>): <short, action-focused summary>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- **type**: `feat`, `fix`, `refactor`, `docs`, `chore`, `test`, `style`, `perf`
|
|
31
|
+
- **scope**: area touched. Omit parens if unclear.
|
|
32
|
+
- **summary**: imperative, present tense, under 70 chars, starts with a verb.
|
|
33
|
+
|
|
34
|
+
Show: proposed message, files to stage, files excluded (tests, docs, secrets). Ask: "Commit with this message? (yes / edit / cancel)". On `cancel`, stop and report.
|
|
35
|
+
|
|
36
|
+
## 2.5 Detect or ask for an issue reference
|
|
37
|
+
|
|
38
|
+
Silent pre-checks first:
|
|
39
|
+
|
|
40
|
+
1. `git remote -v` → bail if no `github.com` remote.
|
|
41
|
+
2. `command -v gh` → bail if `gh` is not installed.
|
|
42
|
+
|
|
43
|
+
Detection on the proposed message:
|
|
44
|
+
|
|
45
|
+
- Closing keywords: `Closes/Close/Closed/Fixes/Fix/Fixed/Resolves/Resolve/Resolved #N` (case-insensitive)
|
|
46
|
+
- Bare `#N` anywhere
|
|
47
|
+
|
|
48
|
+
Branches:
|
|
49
|
+
|
|
50
|
+
- **A — closing keyword present**: ask "After commit, comment on issue #N and close it? (yes / no)". `yes` → `{action: close, issue: N}`.
|
|
51
|
+
- **B — bare `#N`**: ask "After commit, post a progress comment on issue #N? (yes / no / close)". Map to `comment` / `close` / none.
|
|
52
|
+
- **C — no reference**: ask once "Is this commit related to a GitHub issue? (issue number / no / skip)". On a number, ask "Comment only or close after commit? (comment / close)". Anything non-numeric → none.
|
|
53
|
+
|
|
54
|
+
Carry the result as `issue_action` (default `none`).
|
|
55
|
+
|
|
56
|
+
## 3. Stage and commit
|
|
57
|
+
|
|
58
|
+
Stage explicit files with `git add <file>...` (never `git add .`). Exclude:
|
|
59
|
+
|
|
60
|
+
- anything under `test/`, `tests/`, `__tests__/`, `spec/`, `specs/`
|
|
61
|
+
- files matching `*.test.*`, `*.spec.*`, `test_*`, `*_test.*`
|
|
62
|
+
- anything that looks like secrets (`.env`, credentials, tokens)
|
|
63
|
+
|
|
64
|
+
Flag exclusions to the user.
|
|
65
|
+
|
|
66
|
+
Commit with the approved message. Capture the short hash via `git rev-parse --short HEAD`.
|
|
67
|
+
|
|
68
|
+
## 3.5 Act on the issue reference
|
|
69
|
+
|
|
70
|
+
If `issue_action` is `none`, skip.
|
|
71
|
+
|
|
72
|
+
Otherwise build:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
> *This was generated by AI during commit.*
|
|
76
|
+
|
|
77
|
+
Linked from commit `<short-hash>`: <commit subject>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Run `gh issue comment <N> --body "<body>"`. If `action == close`, then run `gh issue close <N>` (never `--comment`; comment first).
|
|
81
|
+
|
|
82
|
+
If either fails, report the error and continue. Do not abort. Do not close an issue you could not comment on.
|
|
83
|
+
|
|
84
|
+
## 4. Ensure docs/ is gitignored
|
|
85
|
+
|
|
86
|
+
Read `.gitignore`. If no line matches `docs/`, append:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
# Local documentation — never committed
|
|
90
|
+
docs/
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Do not commit the gitignore change. If the user accidentally staged anything under `docs/`, unstage it (`git restore --staged docs/<path>`) and warn.
|
|
94
|
+
|
|
95
|
+
## 5. Inspect existing docs/journal/
|
|
96
|
+
|
|
97
|
+
List `docs/journal/` if present; match its existing date/file convention. Create the directory if missing.
|
|
98
|
+
|
|
99
|
+
## 6. Write a dated entry
|
|
100
|
+
|
|
101
|
+
Date via `date +%Y-%m-%d`. Create `docs/journal/<YYYY-MM-DD>/` if missing. Write `<HH-MM>-<short-slug>.md` (kebab-case slug, 3–6 words from the summary). Template:
|
|
102
|
+
|
|
103
|
+
```md
|
|
104
|
+
# <Commit summary>
|
|
105
|
+
|
|
106
|
+
**Commit:** <full hash>
|
|
107
|
+
**Short hash:** <short hash>
|
|
108
|
+
**Date:** <YYYY-MM-DD HH:MM local time>
|
|
109
|
+
|
|
110
|
+
## What changed
|
|
111
|
+
|
|
112
|
+
<2–4 sentences. Plain English, not a file list.>
|
|
113
|
+
|
|
114
|
+
## Why
|
|
115
|
+
|
|
116
|
+
<1–3 sentences on motivation, pulled from conversation context.>
|
|
117
|
+
|
|
118
|
+
## Notes for future me
|
|
119
|
+
|
|
120
|
+
<Gotchas/follow-ups, one paragraph max. Skip if nothing worth saying.>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## 7. Confirm
|
|
124
|
+
|
|
125
|
+
Report: commit hash + message, journal entry path, whether `.gitignore` was updated, and any issue actions taken. Close with: "All of `docs/` is gitignored, so this entry stays local."
|
|
126
|
+
|
|
127
|
+
## Context economy
|
|
128
|
+
|
|
129
|
+
Before broad reads, locate relevant files/symbols with `list_files`, `search_files`, or `codebase_search`.
|
|
130
|
+
|
|
131
|
+
Prefer targeted `read_file` ranges or indentation/block reads once the relevant area is known.
|
|
132
|
+
|
|
133
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
134
|
+
|
|
135
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
136
|
+
|
|
137
|
+
Use `git status --short`, `git diff --stat`, and targeted `git diff -- <file>` rather than dumping the full repo diff at once.
|
|
138
|
+
|
|
139
|
+
## Safety
|
|
140
|
+
|
|
141
|
+
- Never `git push`, `--amend`, `--force`, or `reset --hard`.
|
|
142
|
+
- Flag suspected secrets; do not stage them.
|
|
143
|
+
- If `git status` is clean, abort early.
|
|
@@ -24,7 +24,6 @@ MUST build fast pass/fail loop. Try order:
|
|
|
24
24
|
Rules:
|
|
25
25
|
- MUST make loop faster/sharper/deterministic.
|
|
26
26
|
- Flake: run 100x, parallelise, stress, add sleeps, raise repro rate.
|
|
27
|
-
- 3 failed loop attempts → STOP; ask env/HAR/log/core/screen recording/temp prod instrumentation.
|
|
28
27
|
|
|
29
28
|
## 2. Reproduce
|
|
30
29
|
|
|
@@ -62,6 +61,18 @@ Rules:
|
|
|
62
61
|
6. Watch regression pass.
|
|
63
62
|
7. Rerun original loop.
|
|
64
63
|
|
|
64
|
+
## Context economy
|
|
65
|
+
|
|
66
|
+
Before broad reads, locate relevant files/symbols with `list_files`, `search_files`, or `codebase_search`.
|
|
67
|
+
|
|
68
|
+
Prefer targeted `read_file` ranges or indentation/block reads once the relevant area is known.
|
|
69
|
+
|
|
70
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
71
|
+
|
|
72
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
73
|
+
|
|
74
|
+
For logs or large outputs, search for the failing marker/error first. Read only surrounding ranges needed to prove or disprove a hypothesis.
|
|
75
|
+
|
|
65
76
|
## 6. Cleanup
|
|
66
77
|
|
|
67
78
|
MUST finish:
|
|
@@ -43,3 +43,14 @@ Detection:
|
|
|
43
43
|
2. Else if root `CONTEXT.md`, use it.
|
|
44
44
|
3. Else create root `CONTEXT.md` lazily on first resolved term.
|
|
45
45
|
4. If context ambiguous, ask.
|
|
46
|
+
|
|
47
|
+
## Companion docs
|
|
48
|
+
|
|
49
|
+
Canonical names for code-explanation docs (read by `/explore`, edited by `/update-docs`):
|
|
50
|
+
|
|
51
|
+
- `FLOW.md` — subsystem flow / data path; lives next to the code it describes.
|
|
52
|
+
- `APP_MAP.md` — app-wide module/navigation map; root-level.
|
|
53
|
+
- `ARCHITECTURE.md` — system-level structure, constraints, seams; root-level.
|
|
54
|
+
- `README.md` — setup and usage; root-level.
|
|
55
|
+
|
|
56
|
+
Use these names when creating new docs of these kinds. A subsystem may have its own `FLOW.md`; `APP_MAP.md` and `ARCHITECTURE.md` are typically singular per repo.
|
|
@@ -16,9 +16,17 @@ description: Grilling session that challenges your plan against the existing dom
|
|
|
16
16
|
|
|
17
17
|
## Docs
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
See `CONTEXT-FORMAT.md` for layout and detection. Create docs lazily only when recording needed.
|
|
20
|
+
|
|
21
|
+
## Context economy
|
|
22
|
+
|
|
23
|
+
Before broad reads, locate relevant files/symbols with `list_files`, `search_files`, or `codebase_search`.
|
|
24
|
+
|
|
25
|
+
Prefer targeted `read_file` ranges or indentation/block reads once the relevant area is known.
|
|
26
|
+
|
|
27
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
28
|
+
|
|
29
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
22
30
|
|
|
23
31
|
## MUST
|
|
24
32
|
|
|
@@ -84,5 +84,4 @@ Include candidate name, one-sentence reason, anchor link.
|
|
|
84
84
|
|
|
85
85
|
## Vocabulary
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
Avoid: component, service, unit, API, signature, boundary, layer, wrapper.
|
|
87
|
+
See `LANGUAGE.md`.
|
|
@@ -34,6 +34,18 @@ RULE: Use `LANGUAGE.md` terms. Use glossary. Respect ADRs; surface only reopen-w
|
|
|
34
34
|
9. DO NOT propose interfaces yet.
|
|
35
35
|
10. Ask: `Which of these would you like to explore?`
|
|
36
36
|
|
|
37
|
+
## Context economy
|
|
38
|
+
|
|
39
|
+
Before broad reads, locate relevant files/symbols with `list_files`, `search_files`, or `codebase_search`.
|
|
40
|
+
|
|
41
|
+
Prefer targeted `read_file` ranges or indentation/block reads once the relevant area is known.
|
|
42
|
+
|
|
43
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
44
|
+
|
|
45
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
46
|
+
|
|
47
|
+
Use searches to identify dependency/call patterns before reading full modules. Read full files only for top candidates.
|
|
48
|
+
|
|
37
49
|
## After candidate chosen
|
|
38
50
|
|
|
39
51
|
1. Walk constraints/deps/seam/hidden implementation/surviving tests.
|
|
@@ -14,6 +14,16 @@ RULE: Prototype answers one question. Throw away or absorb after answer.
|
|
|
14
14
|
- Ambiguous → ask.
|
|
15
15
|
- User AFK → infer + state assumption.
|
|
16
16
|
|
|
17
|
+
## Context economy
|
|
18
|
+
|
|
19
|
+
Before broad reads, locate relevant files/symbols with `list_files`, `search_files`, or `codebase_search`.
|
|
20
|
+
|
|
21
|
+
Prefer targeted `read_file` ranges or indentation/block reads once the relevant area is known.
|
|
22
|
+
|
|
23
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
24
|
+
|
|
25
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
26
|
+
|
|
17
27
|
## Rules
|
|
18
28
|
|
|
19
29
|
1. Mark throwaway clearly.
|
|
@@ -11,22 +11,7 @@ If missing, proceed silently.
|
|
|
11
11
|
|
|
12
12
|
## Layouts
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```text
|
|
17
|
-
/CONTEXT.md
|
|
18
|
-
/docs/adr/
|
|
19
|
-
/src/
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Multi-context:
|
|
23
|
-
|
|
24
|
-
```text
|
|
25
|
-
/CONTEXT-MAP.md
|
|
26
|
-
/docs/adr/
|
|
27
|
-
/src/{context}/CONTEXT.md
|
|
28
|
-
/src/{context}/docs/adr/
|
|
29
|
-
```
|
|
14
|
+
See `.roo/skills/engineering/grill-with-docs/CONTEXT-FORMAT.md` for layout and detection.
|
|
30
15
|
|
|
31
16
|
## Rules
|
|
32
17
|
|
|
@@ -33,7 +33,6 @@ Rules:
|
|
|
33
33
|
- Public interface only.
|
|
34
34
|
- Minimal code only.
|
|
35
35
|
- No speculative features.
|
|
36
|
-
- 3 failed green attempts → STOP; show blocker + exact error; ask user.
|
|
37
36
|
|
|
38
37
|
## Refactor
|
|
39
38
|
|
|
@@ -50,3 +49,23 @@ Checklist per cycle:
|
|
|
50
49
|
- [ ] Test survives internal refactor.
|
|
51
50
|
- [ ] Code minimal.
|
|
52
51
|
- [ ] No speculation.
|
|
52
|
+
|
|
53
|
+
## Context economy
|
|
54
|
+
|
|
55
|
+
Before broad reads, locate relevant files/symbols with `list_files`, `search_files`, or `codebase_search`.
|
|
56
|
+
|
|
57
|
+
Prefer targeted `read_file` ranges or indentation/block reads once the relevant area is known.
|
|
58
|
+
|
|
59
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
60
|
+
|
|
61
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
62
|
+
|
|
63
|
+
Read the public interface and nearest existing tests first. Avoid reading unrelated implementation until a failing test or search result points there.
|
|
64
|
+
|
|
65
|
+
## References
|
|
66
|
+
|
|
67
|
+
- `tests.md` — what to assert and what not to.
|
|
68
|
+
- `mocking.md` — when (and when not) to mock.
|
|
69
|
+
- `interface-design.md` — designing testable interfaces.
|
|
70
|
+
- `deep-modules.md` — interface vs implementation depth.
|
|
71
|
+
- `refactoring.md` — refactor candidates after green.
|
|
@@ -15,3 +15,15 @@ Use for small known fixes.
|
|
|
15
15
|
6. DO NOT write new tests unless asked.
|
|
16
16
|
7. Confirm change.
|
|
17
17
|
8. Offer `/commit-and-document` only after user satisfied.
|
|
18
|
+
|
|
19
|
+
## Context economy
|
|
20
|
+
|
|
21
|
+
Before broad reads, locate relevant files/symbols with `list_files`, `search_files`, or `codebase_search`.
|
|
22
|
+
|
|
23
|
+
Prefer targeted `read_file` ranges or indentation/block reads once the relevant area is known.
|
|
24
|
+
|
|
25
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
26
|
+
|
|
27
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
28
|
+
|
|
29
|
+
For small changes, audit only the named files and nearby call sites. Expand search only if the first audit shows hidden dependencies.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: update-docs
|
|
3
|
+
description: Update repo documentation (flow, app map, architecture, README, module docs) so it matches current code. Use when docs are stale and need to be reconciled with the codebase.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Update Docs
|
|
7
|
+
|
|
8
|
+
Edit repo docs that explain how code works (flow docs, app/module maps, architecture overviews, README, module-local markdown). Surgical edits, not rewrites.
|
|
9
|
+
|
|
10
|
+
## 1. Identify target
|
|
11
|
+
|
|
12
|
+
Infer or ask for the target doc. Prefer existing docs over new ones:
|
|
13
|
+
|
|
14
|
+
- Subsystem flow → nearby flow doc.
|
|
15
|
+
- App-wide navigation/module map → app map doc.
|
|
16
|
+
- System-level structure → architecture doc.
|
|
17
|
+
- Setup/usage → `README.md`.
|
|
18
|
+
|
|
19
|
+
If the doc does not exist, ask before creating. Never invent a new doc location silently.
|
|
20
|
+
|
|
21
|
+
## 2. Read first
|
|
22
|
+
|
|
23
|
+
Read the target fully before editing. Also read nearby related docs (neighbouring flow docs, app/architecture docs, README, module-local docs). Match the existing style, structure, vocabulary, and detail level.
|
|
24
|
+
|
|
25
|
+
## 3. Verify against code
|
|
26
|
+
|
|
27
|
+
Inspect the code the doc describes. Update from code reality, not guesses. Check entrypoints, main functions/classes, data flow, state changes, side effects, deps, error/fallback paths, files involved.
|
|
28
|
+
|
|
29
|
+
Unverifiable claims → remove or move to an `Open questions` section. Never present guesses as facts.
|
|
30
|
+
|
|
31
|
+
## 4. Surgical edits
|
|
32
|
+
|
|
33
|
+
Default to small edits: keep useful sections, update stale ones, add missing flows, remove false claims, preserve heading style and tone. Rewrite the whole file only if it is too stale to salvage; if so, say why before editing.
|
|
34
|
+
|
|
35
|
+
## 5. Freshness block
|
|
36
|
+
|
|
37
|
+
If it fits the doc's style, add or update at the bottom:
|
|
38
|
+
|
|
39
|
+
```md
|
|
40
|
+
## Freshness
|
|
41
|
+
|
|
42
|
+
Last checked against code: YYYY-MM-DD
|
|
43
|
+
Relevant files checked:
|
|
44
|
+
- `path/to/file.py`
|
|
45
|
+
- `path/to/other_file.py`
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Use today's date. Include only files actually inspected.
|
|
49
|
+
|
|
50
|
+
## 6. Sanity check
|
|
51
|
+
|
|
52
|
+
After editing: re-read, confirm referenced paths exist, every major claim maps to code or a cited doc, no stale contradiction with nearby docs. Summarise the change.
|
|
53
|
+
|
|
54
|
+
## Context economy
|
|
55
|
+
|
|
56
|
+
Before broad reads, locate relevant files/symbols with `list_files`, `search_files`, or `codebase_search`.
|
|
57
|
+
|
|
58
|
+
Prefer targeted `read_file` ranges or indentation/block reads once the relevant area is known.
|
|
59
|
+
|
|
60
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
61
|
+
|
|
62
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
63
|
+
|
|
64
|
+
## 7. Recommend next step
|
|
65
|
+
|
|
66
|
+
Recommend one: `/explore` (still unclear), `/feature` (plan emerged), `/refactor` (tangled-but-working code), `/fix` (bug found), `/commit-and-document` (done). Do not auto-run.
|
|
@@ -5,3 +5,15 @@ disable-model-invocation: true
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
Zoom out: map relevant modules + callers at higher abstraction. Use glossary vocabulary.
|
|
8
|
+
|
|
9
|
+
## Context economy
|
|
10
|
+
|
|
11
|
+
Before broad reads, locate relevant files/symbols with `list_files`, `search_files`, or `codebase_search`.
|
|
12
|
+
|
|
13
|
+
Prefer targeted `read_file` ranges or indentation/block reads once the relevant area is known.
|
|
14
|
+
|
|
15
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
16
|
+
|
|
17
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
18
|
+
|
|
19
|
+
Start with `list_files` and `search_files`/`codebase_search`. Read representative files and key entrypoints, not every file in the area.
|
package/templates/full/.roomodes
CHANGED
|
@@ -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.",
|
|
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.",
|
|
44
44
|
"groups": []
|
|
45
45
|
}
|
|
46
46
|
]
|