@fernado03/zoo-flow 0.1.2 → 0.1.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Zoo Flow
2
2
 
3
- > **Smoke-tested workflow control plane for [Zoo Code](https://docs.zoocode.dev/).**
3
+ > **Workflow control plane for [Zoo Code](https://docs.zoocode.dev/).**
4
4
 
5
5
  A small, opinionated template that turns Zoo Code into a predictable
6
6
  mode + command + skill orchestrator. Three modes, a fixed routing
@@ -32,15 +32,7 @@ A timestamped backup is always written to `.zoo-flow-backup/` before
32
32
  overwrite.
33
33
 
34
34
  After install, reload VS Code (Command Palette → **Developer: Reload
35
- Window**), open Zoo Code, switch to `custom-orchestrator`, and try a
36
- small request like:
37
-
38
- > change a harmless comment in `README`
39
-
40
- Numbered choices are safe to click or type. Suggestions never carry
41
- slash commands or mode names, so they will not route you into another
42
- mode — see
43
- [`docs/troubleshooting.md`](docs/troubleshooting.md#clickable-suggestions-can-route-incorrectly).
35
+ Window**) and open Zoo Code.
44
36
 
45
37
  > **Note**: `.roomodes`, `.roo/commands/`, and `.roo/rules-{mode-slug}/`
46
38
  > are kept as-is because they are the official Zoo Code configuration
@@ -55,6 +47,35 @@ skills know your tracker, labels, and domain layout. Skip it if you
55
47
  only plan to use `/tweak`, `/fix`, `/explore`, `/refactor`,
56
48
  `/diagnose`, `/prototype`, `/update-docs`, or `/commit-and-document`.
57
49
 
50
+ ## Using it
51
+
52
+ Zoo Code switches modes automatically when you type a slash command,
53
+ based on the `mode:` field in the command file. That gives you two
54
+ ways to drive Zoo Flow, and the choice matters:
55
+
56
+ - **Free-form request from `custom-orchestrator`** (no leading slash).
57
+ The orchestrator picks a workflow, proposes it as a numbered choice,
58
+ and delegates only after you confirm. Use this when you want the
59
+ router to think first. This is how `custom-orchestrator` is
60
+ designed to work.
61
+
62
+ > change a harmless comment in `README`
63
+
64
+ - **Direct slash command from any mode.** The host switches you to
65
+ the command's configured mode and runs it, bypassing the
66
+ orchestrator entirely. Use this when you already know which
67
+ workflow you want.
68
+
69
+ > /tweak fix the typo in `README`
70
+
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
77
+ [`docs/troubleshooting.md`](docs/troubleshooting.md#clickable-suggestions-can-route-incorrectly).
78
+
58
79
  ## Update
59
80
 
60
81
  ```bash
@@ -118,13 +139,8 @@ need them.
118
139
  Command files live in
119
140
  [`templates/full/.roo/commands/`](templates/full/.roo/commands).
120
141
 
121
- ## Smoke tests
122
-
123
- A short, fixed set of smoke tests in
124
- [`docs/smoke-tests.md`](docs/smoke-tests.md) verifies routing, mode
125
- boundaries, and skill loading. Worked examples:
142
+ ## Worked examples
126
143
 
127
- - [`examples/tweak-smoke-test.md`](examples/tweak-smoke-test.md)
128
144
  - [`examples/fix-flow.md`](examples/fix-flow.md)
129
145
  - [`examples/feature-flow.md`](examples/feature-flow.md)
130
146
 
package/bin/zoo-flow.js CHANGED
@@ -246,7 +246,7 @@ ${didBackup ? `Backup:\n ${backupDir}\n` : ""}Next:
246
246
  1. Reload VS Code
247
247
  2. Open Zoo Code
248
248
  3. Switch to custom-orchestrator
249
- 4. Smoke test:
249
+ 4. Try a small request, e.g.:
250
250
  change a harmless comment in README
251
251
 
252
252
  When workflow choices appear, type the number manually, e.g. 1.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fernado03/zoo-flow",
3
- "version": "0.1.2",
4
- "description": "Smoke-tested workflow control plane for Zoo Code.",
3
+ "version": "0.1.4",
4
+ "description": "Workflow control plane for Zoo Code.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "zoo-flow": "bin/zoo-flow.js"
@@ -1,202 +1,11 @@
1
1
  ---
2
- description: "Update repo documentation so it matches the current code."
3
- argument-hint: <doc or area to update>
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
- You are running the **commit + document** procedure. This is a deterministic flow, not a skill execute the steps in order. Do not deviate.
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
- ## Step 1 — Inspect git changes
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
- You are guiding the user through the **Update Docs** workflow. Use this when the goal is to make repo documentation match the current code.
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
- This command edits repo docs such as:
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` instead
20
- - ADRs / architectural decisions — use `/grill-with-docs` or `/refactor` so ADRs are offered properly
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
- The user may pass a target doc or area as `$ARGUMENTS`, e.g.:
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
@@ -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,27 +1,15 @@
1
1
  # Manual Reply Protocol
2
2
 
3
- For workflow choices, put options in the suggestions, not in the question body. Map the chosen number back to a command privately.
3
+ For workflow choices, ask the question in the message body and put only safe numbered options in suggestions.
4
4
 
5
- Suggestions:
5
+ Safe options:
6
6
 
7
- - Descriptive labels OK.
8
- - No slash commands or mode names.
9
- - Include a Hold/Skip option when relevant.
7
+ 1. Tweak small implementation
8
+ 2. Diagnose bug
9
+ 3. Hold
10
10
 
11
- Question body:
11
+ Do not put slash commands, mode names, or executable routing text in suggestions.
12
12
 
13
- - One short prompt. Real newlines only; never the literal `\n`.
14
- - Do not restate the options.
15
-
16
- Typed numeric reply is always valid.
17
-
18
- Example:
19
-
20
- Question: Pick a regression test option.
21
-
22
- 1. Import-time smoke test
23
- 2. Extract helper and unit-test
24
- 3. AST guard test
25
- 4. Hold
13
+ Users may reply by typing the number.
26
14
 
27
15
  Only treat slash commands as commands when manually typed by the user.
@@ -4,4 +4,4 @@ Implement, test, update docs, prototype, and commit only after approval.
4
4
 
5
5
  Do not make broad architecture decisions.
6
6
 
7
- Escalate to `system-architect` with `switch_mode` when architecture decisions are needed or the same test/approach fails 3 times.
7
+ Escalate to `system-architect` with `switch_mode` when architecture decisions are needed.
@@ -2,11 +2,7 @@
2
2
 
3
3
  Every delegated task must include:
4
4
 
5
- - command with slash
6
- - normalized command name
5
+ - command with slash (e.g. `/refactor`)
7
6
  - user context
8
- - instruction to follow `.roo/rules/01-command-protocol.md`
9
- - reminder that skills live under `.roo/skills/...`
10
- - completion rule to use `attempt_completion` with summary, files inspected/changed, commands/tests run, blockers, and recommended next command
11
7
 
12
8
  Ignore slash commands mentioned only inside subtask summaries.
@@ -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,131 @@
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
+ ## Safety
128
+
129
+ - Never `git push`, `--amend`, `--force`, or `reset --hard`.
130
+ - Flag suspected secrets; do not stage them.
131
+ - 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
 
@@ -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,7 @@ description: Grilling session that challenges your plan against the existing dom
16
16
 
17
17
  ## Docs
18
18
 
19
- - Single-context: root `CONTEXT.md`, root `docs/adr/`.
20
- - Multi-context: root `CONTEXT-MAP.md` → per-context `CONTEXT.md` + ADRs.
21
- - Create docs lazily only when recording needed.
19
+ See `CONTEXT-FORMAT.md` for layout and detection. Create docs lazily only when recording needed.
22
20
 
23
21
  ## MUST
24
22
 
@@ -84,5 +84,4 @@ Include candidate name, one-sentence reason, anchor link.
84
84
 
85
85
  ## Vocabulary
86
86
 
87
- Use: module, interface, implementation, depth, deep, shallow, seam, adapter, leverage, locality.
88
- Avoid: component, service, unit, API, signature, boundary, layer, wrapper.
87
+ See `LANGUAGE.md`.
@@ -11,22 +11,7 @@ If missing, proceed silently.
11
11
 
12
12
  ## Layouts
13
13
 
14
- Single-context:
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,11 @@ Checklist per cycle:
50
49
  - [ ] Test survives internal refactor.
51
50
  - [ ] Code minimal.
52
51
  - [ ] No speculation.
52
+
53
+ ## References
54
+
55
+ - `tests.md` — what to assert and what not to.
56
+ - `mocking.md` — when (and when not) to mock.
57
+ - `interface-design.md` — designing testable interfaces.
58
+ - `deep-modules.md` — interface vs implementation depth.
59
+ - `refactoring.md` — refactor candidates after green.
@@ -0,0 +1,56 @@
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
+ ## 7. Recommend next step
55
+
56
+ Recommend one: `/explore` (still unclear), `/feature` (plan emerged), `/refactor` (tangled-but-working code), `/fix` (bug found), `/commit-and-document` (done). Do not auto-run.