You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/skills/bloom-automation/SKILL.md
+21-23Lines changed: 21 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,9 +21,9 @@ Use the real embedded WebView2 inside Bloom.exe as the automation target. Determ
21
21
## Default Assumptions
22
22
- Current repo root is derived automatically by the checked-in helper.
23
23
- Bloom project path is `src/BloomExe/BloomExe.csproj`.
24
-
- The helper launch script chooses an explicit port block by default instead of relying on Bloom's standard search. It allocates HTTP bases from `18089`, `18099`, `18109`, ... and uses `http`, `http+1`, and `http+2`, with CDP on `http+2`.
24
+
- Fresh automation launches start Bloom with `--automation`, letting Bloom choose its own standard HTTP port block while still bypassing the normal single-instance token.
25
+
- In automation mode Bloom writes a machine-readable `BLOOM_AUTOMATION_READY {...}` line to the console as soon as it knows its HTTP, CDP, and process IDs.
25
26
- Running Bloom reports its actual HTTP and CDP ports through `http://localhost:<port>/bloom/api/common/instanceInfo`.
26
-
- Bloom's embedded WebView2 uses the reserved `http+2` port for CDP when Bloom's HTTP port is known.
Reports Bloom.exe processes, detected repo roots, attributable `dotnet watch` parents, ambiguous watchers, and whether the workspace API and CDP endpoint are reachable.
@@ -63,7 +63,7 @@ Use `--http-port <port>` when you launched Bloom through `watchBloomExe.mjs` and
These helpers always launch through `dotnet watch run`, compute the repo root, acquire a lock on a non-overlapping port block, pass an explicit `--http-port` argument to Bloom, derive CDP from `http+2`, and print the `dotnet` PID immediately plus the Bloom PID once `common/instanceInfo` becomes reachable.
81
+
These helpers always launch through `dotnet watch run`, compute the repo root, pass `--automation` to Bloom, and print the `dotnet` PID immediately. Bloom then emits `BLOOM_AUTOMATION_READY {...}` once it has chosen ports, and the helper prints a `Bloom ready. HTTP ..., CDP ..., Bloom PID ...` summary line based on that startup record.
83
82
`watchBloomExe.mjs` is intentionally long-lived: for normal launches it keeps running under `dotnet watch run` until the launch session ends. If Bloom reports ready and then dies shortly afterward, the helper reports that as a failed launch instead of silently succeeding.
84
83
85
84
Agent workflow for `watchBloomExe.mjs`:
86
85
- Start it in a background terminal.
87
-
- Do not wait for the command to finish. A successful launch is the `Bloom ready. HTTP ..., websocket ..., CDP ..., Bloom PID ...` line, not process exit.
86
+
- Do not wait for the command to finish. A successful launch is the latest `Bloom ready. HTTP ..., CDP ..., Bloom PID ...` line, not process exit.
88
87
- If the helper later reports that the Bloom PID exited shortly after reporting ready, treat that as a failed launch and do not target that HTTP port.
89
88
- After starting it, read or poll that background terminal's output until the `Bloom ready.` line appears, then use the reported HTTP port as the identity of the new instance.
90
89
- After you have the HTTP port, continue with `bloomProcessStatus.mjs --http-port <port> --json`, `webview2Targets.mjs --http-port <port> --json --wait`, or `switchWorkspaceTab.mjs --http-port <port> --tab ...`.
91
-
- Keep the background terminal open for the lifetime of that Bloom instance. The helper may outlive the `dotnet` process because it continues tracking the actual Bloom PID and holding the port lease.
90
+
- Keep the background terminal open for the lifetime of that Bloom instance. If `dotnet watch` restarts Bloom, target the most recent `Bloom ready.` line because Bloom may choose a different HTTP port on the restart.
This helper attaches to the reported WebView2 target over CDP, clicks the real top bar tab, waits for `workspace/tabs` to report it active, and prints the resulting state.
@@ -143,7 +142,7 @@ Notes:
143
142
3. Copy the printed HTTP and CDP ports. If you need the exact PID later, run `node .github/skills/bloom-automation/bloomProcessStatus.mjs --http-port <httpPort> --json`.
144
143
4. If you instead want to reuse a current-worktree instance that Bloom found by itself, only then use repo-root matching and `--only-mismatched` cleanup.
145
144
5. Run `node .github/skills/bloom-automation/webview2Targets.mjs --http-port <httpPort> --json --wait` to discover the live WebView2 target for that exact instance when you need debugging detail.
146
-
6. Use `node .github/skills/bloom-automation/switchWorkspaceTab.mjs --http-port <httpPort> --tab <collection|edit|publish>` for top bar interactions, or attach another confirmed client to the reported `cdpOrigin` if you need lower-level inspection.
145
+
6. Use `node .github/skills/bloom-automation/switchWorkspaceTab.mjs --http-port <httpPort> --tab <collection|edit|publish>` for top bar interactions, or attach another confirmed client to `http://localhost:<cdpPort>` if you need lower-level inspection.
147
146
7. Manipulate the UI by clicking or typing in the attached browser context. Do not use Bloom API endpoints to simulate the user action itself.
148
147
8. Use browser-native inspection for DOM, console, and network.
149
148
9. If the task is test-related, run the exe-backed Playwright suite with `BLOOM_HTTP_PORT=<httpPort> yarn playwright test --config playwright.bloom-exe.config.ts`.
@@ -155,7 +154,7 @@ Use this when the user says to reuse the already-running Bloom.
155
154
2. If no running Bloom instance is reported, tell the user there is no running Bloom to reuse.
156
155
3. If one is reported, do not kill or restart it because of worktree mismatch.
157
156
4. Use `node .github/skills/bloom-automation/switchWorkspaceTab.mjs --running-bloom --tab <collection|edit|publish>` for top bar actions, or `node .github/skills/bloom-automation/webview2Targets.mjs --running-bloom --json --wait` when you need CDP target detail.
158
-
5. Attach to the reported instance and work only against the ports it reported about itself.
157
+
5. Attach to the reported instance and work only against the `httpPort` and `cdpPort` it reported about itself.
159
158
160
159
## Rules
161
160
@@ -174,7 +173,7 @@ Use this when the user says to reuse the already-running Bloom.
174
173
- Start it from the current worktree.
175
174
- Use `node scripts/watchBloomExe.mjs` for fresh automation-owned launches.
176
175
- Treat the printed HTTP port as the identity of that instance. Use `bloomProcessStatus.mjs --http-port <port>`, `webview2Targets.mjs --http-port <port>`, and `killBloomProcess.mjs --http-port <port>` to target it precisely.
177
-
- Never wait for `watchBloomExe.mjs` to exit as a readiness signal. It is a long-lived launcher. Wait for the `Bloom ready.` line in the background terminal output instead, and treat a later `Bloom PID ... exited shortly after reporting ready` message as a failed launch.
176
+
- Never wait for `watchBloomExe.mjs` to exit as a readiness signal. It is a long-lived launcher. Wait for the latest `Bloom ready.` line in the background terminal output instead, and treat a later `Bloom PID ... exited shortly after reporting ready` message as a failed launch.
178
177
179
178
### Reuse the running Bloom when the user asks for it
180
179
- Run `node .github/skills/bloom-automation/bloomProcessStatus.mjs --running-bloom --json`.
@@ -186,18 +185,18 @@ Use this when the user says to reuse the already-running Bloom.
186
185
- Show the CDP target from `node .github/skills/bloom-automation/webview2Targets.mjs --json --wait`.
187
186
- Attach with Playwright.
188
187
- Demonstrate reading `body.className`, the top-bar iframe, console messages, and the `workspace/selectTab` request.
189
-
- For multi-instance work, prefer `webview2Targets.mjs --http-port <port> --json --wait` and the matching `cdpOrigin` it reports.
188
+
- For multi-instance work, prefer `webview2Targets.mjs --http-port <port> --json --wait` and the matching `cdpPort` it reports.
190
189
191
190
### Verified two-instance smoke path
192
-
- Launch one instance on `--http-port 18089`.
193
-
- Launch a second instance on `--http-port 18099`.
194
-
- Target the first instance with `switchWorkspaceTab.mjs --http-port 18089 --tab edit`.
195
-
- Target the second instance with `switchWorkspaceTab.mjs --http-port 18099 --tab publish`.
196
-
- Use explicit ports throughout; do not mix `--running-bloom` with this workflow.
191
+
- Launch one instance with `node scripts/watchBloomExe.mjs` and record the HTTP port from its `Bloom ready.` line.
192
+
- Launch a second instance with `node scripts/watchBloomExe.mjs` and record the HTTP port from its `Bloom ready.` line.
193
+
- Target the first instance with `switchWorkspaceTab.mjs --http-port <firstPort> --tab edit`.
194
+
- Target the second instance with `switchWorkspaceTab.mjs --http-port <secondPort> --tab publish`.
195
+
- Use the reported ports throughout; do not mix `--running-bloom` with this workflow.
197
196
198
197
## Confirmed Path
199
198
200
-
-`playwright` Node library via the `cdpOrigin` reported by `common/instanceInfo` or `webview2Targets.mjs`
199
+
-`playwright` Node library via `http://localhost:<cdpPort>` using the `cdpPort` reported by `common/instanceInfo` or `webview2Targets.mjs`
201
200
-`@playwright/test` runner via the exe-backed suite in `src/BloomBrowserUI/react_components/component-tester`
202
201
203
202
Not confirmed here:
@@ -216,8 +215,7 @@ These tests attach to the real Bloom.exe target over CDP and verify tab switchin
216
215
## Notes
217
216
- Prefer the Node helpers over PowerShell. The Node scripts use `wmic`, `taskkill`, and `dotnet` directly because the PowerShell path proved too brittle.
218
217
- Prefer the checked-in Node helper commands over raw Windows shell commands. Subagents should normally run `node .github/skills/bloom-automation/bloomProcessStatus.mjs --json`, `node .github/skills/bloom-automation/killBloomProcess.mjs --only-mismatched`, `node scripts/watchBloomExe.mjs`, `node .github/skills/bloom-automation/webview2Targets.mjs --json --wait`, and `node .github/skills/bloom-automation/switchWorkspaceTab.mjs --running-bloom --tab edit`, not ad hoc `wmic` commands.
219
-
-`watchBloomExe.mjs` keeps a lightweight lease file for the chosen HTTP block while it is running so concurrent agents do not both choose the same automation ports.
220
-
- For agent-driven launches, the background terminal is part of the control plane. Leave it running and poll its output for `Bloom ready.` instead of waiting for command completion. The helper may keep running after `dotnet` exits because it is tracking the actual Bloom process.
218
+
- For agent-driven launches, the background terminal is part of the control plane. Leave it running and poll its output for the latest `Bloom ready.` line instead of waiting for command completion.
221
219
- Exact-target cleanup is intentionally strict: `killBloomProcess.mjs --http-port <port>` should only kill the instance that actually reports that HTTP port, and should fail without killing anything if that target cannot be resolved.
222
220
- When reporting work, include the helper commands you used so reviewers can confirm the workflow stayed on the supported path.
223
221
- Wrong-worktree detection is authoritative when a real `Bloom.exe` child exists or when `dotnet watch` was started with an absolute `--project` path.
@@ -228,7 +226,7 @@ These tests attach to the real Bloom.exe target over CDP and verify tab switchin
228
226
- Bloom's status is known: not running, running from current worktree, or running from different worktree.
229
227
- Any mismatched Bloom instance has been stopped before running the current worktree, unless you intentionally started a separate explicit-port instance.
230
228
- The chosen HTTP port returns `common/instanceInfo`, including the exact Bloom PID and CDP port.
231
-
- The reported CDP endpoint responds at `<cdpOrigin>/json/version`.
229
+
- The reported CDP endpoint responds at `http://localhost:<cdpPort>/json/version`.
232
230
-`node .github/skills/bloom-automation/webview2Targets.mjs --http-port <httpPort> --json --wait` returns a real Bloom target.
233
231
- The automation client can read DOM state and interact with the embedded top bar.
234
232
- If tests were requested, the exe-backed Playwright suite passes.
0 commit comments