@rmrdeveloper/sideroom-pi 8.11.0 → 8.13.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.
Files changed (64) hide show
  1. package/README.md +49 -5
  2. package/assets/artifacts/GUIDELINES_TEMPLATE.md +3 -3
  3. package/assets/visual-context/browser/INSTALL.md +69 -0
  4. package/assets/visual-context/browser/background.js +578 -0
  5. package/assets/visual-context/browser/content.js +198 -0
  6. package/assets/visual-context/browser/icons/README.md +9 -0
  7. package/assets/visual-context/browser/icons/icon-128.png +0 -0
  8. package/assets/visual-context/browser/icons/icon-16.png +0 -0
  9. package/assets/visual-context/browser/icons/icon-32.png +0 -0
  10. package/assets/visual-context/browser/icons/icon-48.png +0 -0
  11. package/assets/visual-context/browser/manifest.json +20 -0
  12. package/assets/visual-context/browser/popup.css +19 -0
  13. package/assets/visual-context/browser/popup.html +27 -0
  14. package/assets/visual-context/browser/popup.js +141 -0
  15. package/extensions/done/guard.ts +42 -37
  16. package/extensions/done/index.ts +3 -2
  17. package/extensions/done/model.ts +1 -5
  18. package/extensions/explain/guard.ts +13 -11
  19. package/extensions/explain/model.ts +2 -25
  20. package/extensions/guidelines/review.ts +31 -13
  21. package/extensions/jev/client.ts +22 -1
  22. package/extensions/jev/context.ts +36 -3
  23. package/extensions/jev/guard.ts +113 -34
  24. package/extensions/jev/model.ts +90 -12
  25. package/extensions/jev/workflow.ts +188 -0
  26. package/extensions/persona/execute.ts +4 -6
  27. package/extensions/persona/index.ts +3 -2
  28. package/extensions/persona/model.ts +1 -31
  29. package/extensions/persona/prompt.ts +3 -1
  30. package/extensions/shared/settle.ts +63 -13
  31. package/extensions/visual-context/bridge.ts +240 -0
  32. package/extensions/visual-context/broker.ts +292 -0
  33. package/extensions/visual-context/envelope.ts +34 -0
  34. package/extensions/visual-context/index.ts +328 -0
  35. package/extensions/visual-context/literal.ts +34 -0
  36. package/extensions/visual-context/markup.ts +104 -0
  37. package/extensions/visual-context/match.ts +222 -0
  38. package/extensions/visual-context/model.ts +180 -0
  39. package/extensions/visual-context/pairing.ts +114 -0
  40. package/extensions/visual-context/parse-astro.ts +166 -0
  41. package/extensions/visual-context/parse-html.ts +72 -0
  42. package/extensions/visual-context/parse-jsx.ts +157 -0
  43. package/extensions/visual-context/parse-svelte.ts +128 -0
  44. package/extensions/visual-context/parse-vue.ts +133 -0
  45. package/extensions/visual-context/session.ts +192 -0
  46. package/extensions/visual-context/source.ts +197 -0
  47. package/extensions/visual-context/ui.ts +57 -0
  48. package/package.json +16 -7
  49. package/skills/sideroom-architecture/SKILL.md +5 -3
  50. package/skills/sideroom-codebase-design/LICENSE.txt +21 -0
  51. package/skills/sideroom-codebase-design/SKILL.md +151 -0
  52. package/skills/sideroom-codebase-design/references/growth.md +62 -0
  53. package/skills/sideroom-domain-modeling/SKILL.md +1 -1
  54. package/skills/sideroom-domain-scaffold/SKILL.md +6 -4
  55. package/skills/sideroom-grill/SKILL.md +6 -4
  56. package/skills/sideroom-guidelines/SKILL.md +9 -7
  57. package/skills/sideroom-guidelines/references/languages/go.md +3 -3
  58. package/skills/sideroom-guidelines/references/languages/java.md +3 -3
  59. package/skills/sideroom-guidelines/references/languages/javascript.md +25 -3
  60. package/skills/sideroom-guidelines/references/languages/php-laravel.md +3 -3
  61. package/skills/sideroom-guidelines/references/languages/python.md +3 -3
  62. package/skills/sideroom-guidelines/references/languages/rust.md +3 -3
  63. package/skills/sideroom-guidelines/references/languages/typescript.md +27 -3
  64. package/skills/sideroom-persona/SKILL.md +15 -4
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Sideroom Pi — the side room your agent was missing
2
2
 
3
+ <p align="center">
4
+ <img src="https://raw.githubusercontent.com/RMRdeveloper/sideroom-pi/main/media/logo.png" alt="The Sideroom Pi mark" width="640">
5
+ </p>
6
+
3
7
  [![npm version](https://img.shields.io/npm/v/@rmrdeveloper/sideroom-pi?label=npm&logo=npm)](https://www.npmjs.com/package/@rmrdeveloper/sideroom-pi)
4
8
  [![npm monthly downloads](https://img.shields.io/npm/dm/@rmrdeveloper/sideroom-pi?label=downloads&logo=npm)](https://www.npmjs.com/package/@rmrdeveloper/sideroom-pi)
5
9
  [![npm license](https://img.shields.io/npm/l/@rmrdeveloper/sideroom-pi?label=license)](https://www.npmjs.com/package/@rmrdeveloper/sideroom-pi)
@@ -54,6 +58,7 @@ Sideroom answers each one with a small, opinionated surface:
54
58
  | Style drift | A pre-edit gate + the on-demand `sideroom-guidelines` skill + an end-of-turn review steer |
55
59
  | Invisible monorepo skills | `monorepo-skills` — trusted child folders join Pi's available skill list |
56
60
  | Vague plans | `sideroom-grill` — an interview that settles the words before the work |
61
+ | Costly growth and refactors | `sideroom-codebase-design` — evidenced improvements to module design, tests, and long-term scaling |
57
62
  | Unapplied guidelines | `sideroom_rules` — mechanical checks that block or flag the lines you add |
58
63
  | Unchecked judgment rules | `jev` — asks a decision model about guide rules with visible evidence |
59
64
  | Unclear answers | `sideroom_persona` — one voice: direct, plain, and free of unnecessary technical words |
@@ -136,6 +141,22 @@ session. The compact view shows at most five recent paths below an active
136
141
  board; the extended `F8` view scrolls through everything. Paths outside the
137
142
  project are labelled `external`. A new session starts clean.
138
143
 
144
+ ### Browser context — point to the element
145
+
146
+ Press `F7` to authorize the bundled browser companion once per Pi installation.
147
+ It reconnects automatically and remembers Windows and WSL independently; choose
148
+ a destination if several Pi sessions are open. Press `Alt+Shift+S` to select
149
+ several elements without opening the popup; Escape or the shortcut exits.
150
+ Review their local source candidates in Pi and send your
151
+ instruction. The click prepares context; it never starts the agent. No project
152
+ configuration or framework plugin is needed. Source ranges are real, but the
153
+ DOM-to-source relationship is inferred and stays labelled as a candidate.
154
+ Download [the companion ZIP](https://github.com/RMRdeveloper/sideroom-pi/releases/latest/download/sideroom-browser-extension.zip)
155
+ from GitHub Releases, extract it, and load its folder in your browser's developer mode.
156
+ No extension store is required; installation and updates are manual. The same
157
+ companion ships in the npm package. See [browser context](docs/extensions/visual-context.md)
158
+ for installation, Windows/WSL pairing and supported source searches.
159
+
139
160
  ### Grill — settle the words first
140
161
 
141
162
  An on-demand skill for fuzzy plans. It interviews you in `sideroom_ask`
@@ -154,6 +175,18 @@ one to interview at all, `sideroom-domain-scaffold` reads the central
154
175
  domain code as source of truth, builds or completes `CONTEXT.md` on its
155
176
  own, and grills the conflicting terms once, at the end.
156
177
 
178
+ ### Codebase design — improve how the code grows
179
+
180
+ `sideroom-codebase-design` reviews existing code, identifies where changes or
181
+ growth create friction, and designs improvements with small interfaces and
182
+ clear responsibilities. It considers growing features, teams, traffic, and
183
+ data, using known needs and evidence rather than hypothetical infrastructure.
184
+ Each recommendation explains the problem, benefit, cost, confidence, migration,
185
+ and verification in text. It produces no diagrams or HTML reports. A review
186
+ stays a review; when implementation is requested, it follows the authorized
187
+ scope and preserves behavior and compatibility. See
188
+ [skill activation](docs/skills.md) for routing and examples.
189
+
157
190
  ### Guidelines — a gate, not a novel
158
191
 
159
192
  A short system-prompt contract points at the packaged
@@ -197,13 +230,18 @@ Reading the guide covers the mechanical rules. `jev` makes one optional call
197
230
  to TypeSafe's decision model about the changed file and, when available, up to
198
231
  four directly related source files. It checks guard clauses, fail fast,
199
232
  command/query separation, null handling, immutability, repeated validation,
200
- responsibility, dependency direction, and comments only when the supplied
233
+ responsibility, dependency direction, comments, testability, redundant
234
+ abstractions, consumer compatibility and test quality only when the supplied
201
235
  files support the question. An answer above the cutoff travels with the
202
236
  end-of-run guidelines review instead of interrupting each edit. READMEs, JSON,
203
237
  lockfiles, deletion-only edits, and files outside the project are never sent.
204
238
 
205
239
  It never blocks and never enters the system prompt. No conversation or session
206
- content leaves the machine. Related source excludes ignored, hidden, sensitive-
240
+ history leaves the machine. Successful questionnaires also send their question
241
+ wording and options, without user answers. Newly completed tasks may send their
242
+ descriptions, up to four observed changed files and a check status, without
243
+ commands or logs. These additional calls review explicit contradictions and
244
+ ambiguous choices. Related source excludes ignored, hidden, sensitive-
207
245
  named and symlinked paths; a normal source file can still contain a secret.
208
246
  The footer counts the calls the session made, and `F10` shows the same count
209
247
  beside the key source. Without a key nothing is called, and when Jev runs out of
@@ -365,7 +403,12 @@ itself.
365
403
  prompt.
366
404
  - One request per successful `write`/`edit` of a project file in a supported
367
405
  language that added lines, with applicable `noul` questions on the complete
368
- changed file and up to four directly related source files.
406
+ changed file and up to four directly related source files, prioritizing tests
407
+ and production consumers before imports.
408
+ - One additional request per successful, non-cancelled questionnaire and per
409
+ eligible completion update. Only validated question wording or targeted
410
+ completion descriptions and bounded observed evidence travel; no answers,
411
+ conversation history or command output. All requests share the same limits.
369
412
  - The official 32k-token state-plus-longest-question and 64k-token request
370
413
  limits are observed conservatively using 32,000 and 64,000 UTF-8 bytes.
371
414
  Oversized neighbours are omitted whole; if the changed file cannot fit,
@@ -433,8 +476,9 @@ and zero ADRs is working as designed.
433
476
 
434
477
  ### Coexisting with other grilling skills
435
478
 
436
- Pi routes skills by description, not by name, so several grilling skills can
437
- be installed at once. `sideroom-grill` claims non-trivial plans before
479
+ See [skill activation](docs/skills.md) for selection boundaries and discovery
480
+ diagnostics. Pi routes skills by description, not by name, so several grilling
481
+ skills can be installed at once. `sideroom-grill` claims non-trivial plans before
438
482
  implementation and states precedence over other grilling, interview, and spec
439
483
  skills. If a third-party skill still wins, remove it from routing by adding
440
484
  `disable-model-invocation: true` to its frontmatter, or exclude its path with
@@ -181,7 +181,7 @@ async function createUser(data) {
181
181
  ```
182
182
 
183
183
  ### 12. DRY (real duplication only)
184
- RULE: Extract when at least 2 of 3 hold: (a) the logic appears 3+ times, (b) a future rule change would need to touch all occurrences at once, (c) the copies represent the same domain concept. Do not extract on the first or second occurrence, and do not extract look-alike code that belongs to different concepts (a user's email validation vs a vendor's) — they will diverge.
184
+ RULE: Extract when at least 2 of 3 hold: (a) the logic appears 3+ times, (b) a future rule change would need to touch all occurrences at once, (c) the copies represent the same domain concept. Do not extract solely to anticipate reuse on the first or second occurrence, and do not extract look-alike code that belongs to different concepts (a user's email validation vs a vendor's) — they will diverge. Extraction for a present responsibility, clear contract, or testability is valid even with one caller.
185
185
  ```ts
186
186
  // bad — extracted after one real use
187
187
  function formatName(x: string) { return x.trim().toUpperCase(); }
@@ -190,7 +190,7 @@ function normalizeTicketStatus(status: string): TicketStatus { /* ... */ }
190
190
  ```
191
191
 
192
192
  ### 13. KISS
193
- RULE: Ship the simplest solution for the current, real requirement. No configurability, hooks, or layers added "just in case."
193
+ RULE: Choose the simplest design that fully satisfies the current requirements and preserves required behavior. Avoid configurability, hooks, or layers without a demonstrated need; do not remove necessary structure just to reduce code size.
194
194
  ```js
195
195
  // bad
196
196
  function formatPrice(value, { currency = 'USD', locale = 'en-US', showSymbol = true } = {}) { /* ... */ }
@@ -199,7 +199,7 @@ function formatPrice(value) { return `$${value.toFixed(2)}`; }
199
199
  ```
200
200
 
201
201
  ### 14. YAGNI
202
- RULE: Don't add fields, params, or branches for a use case that hasn't arrived. (Differs from KISS: KISS simplifies the chosen solution; YAGNI stops you building the unrequested one.)
202
+ RULE: Avoid capabilities for hypothetical future use cases without evidence. User requirements, established project contracts, required error handling, compatibility, and meaningful tests are current needs, not speculation. Never use YAGNI to omit them or remove existing supported behavior. Apply it to the proposed change, not as a reason to refactor unrelated code.
203
203
  ```js
204
204
  // bad
205
205
  function createInvoice(order, { supportsRecurring = false, supportsMultiCurrency = false } = {}) { /* ... */ }
@@ -0,0 +1,69 @@
1
+ # Sideroom Visual Context
2
+
3
+ ## English
4
+
5
+ This is a manually installed companion for Chromium-based browsers 116 or
6
+ later, such as Chrome, Edge or Brave. It is not a store installation. Firefox is
7
+ not supported.
8
+
9
+ 1. Extract the ZIP. Keep the `sideroom-browser-extension` folder in a permanent
10
+ location; the browser loads the extension from this directory.
11
+ 2. Open `chrome://extensions` (or `edge://extensions`), enable developer mode,
12
+ choose **Load unpacked**, and select the folder containing `manifest.json`.
13
+ 3. Install Sideroom Pi with `pi install npm:@rmrdeveloper/sideroom-pi`. Start Pi
14
+ in your project, press `F7`, and choose **Pair browser**.
15
+ 4. Open the companion, paste the private pairing address from Pi, and choose
16
+ **Connect to Pi**. Keep that address private. Choose a destination if several
17
+ Pi sessions are open. Repeat pairing for a separate Windows or WSL installation.
18
+ 5. On a normal web page, press `Alt+Shift+S` to start selecting. Click several
19
+ elements. Press the shortcut again or Escape to return to normal browsing.
20
+ Review pending elements with `F7` in Pi, then send your instruction.
21
+
22
+ Change or assign the shortcut in `chrome://extensions/shortcuts` or
23
+ `edge://extensions/shortcuts`. Browser and operating-system shortcuts can take
24
+ priority. Internal browser pages and other protected pages cannot be inspected.
25
+ Managed browsers can prohibit developer mode.
26
+
27
+ Updates are manual. Download the ZIP from the new Sideroom GitHub Release,
28
+ replace the files in the same folder, and reload the extension from the browser's
29
+ extensions page. Do not remove and reinstall it unless you want to pair again.
30
+ The extension connects only to authorized local Pi installations; it captures
31
+ DOM descriptions, not form values or editable text. Source locations are inferred
32
+ candidates, never proven mappings.
33
+
34
+ ## Español
35
+
36
+ Esta extensión se instala manualmente en navegadores basados en Chromium 116 o
37
+ posterior, como Chrome, Edge o Brave. No se instala desde una tienda. Firefox no
38
+ está soportado.
39
+
40
+ 1. Descomprime el ZIP. Guarda la carpeta `sideroom-browser-extension` en una
41
+ ubicación permanente; el navegador carga la extensión desde esa carpeta.
42
+ 2. Abre `chrome://extensions` (o `edge://extensions`), activa el modo
43
+ desarrollador, elige **Cargar desempaquetada** y selecciona la carpeta que
44
+ contiene `manifest.json`.
45
+ 3. Instala Sideroom Pi con `pi install npm:@rmrdeveloper/sideroom-pi`. Inicia Pi
46
+ en tu proyecto, pulsa `F7` y elige **Pair browser**.
47
+ 4. Abre la extensión, pega la dirección privada de emparejamiento de Pi y elige
48
+ **Connect to Pi**. No compartas esa dirección. Elige un destino si hay varias
49
+ sesiones abiertas. Repite el emparejamiento para otra instalación de Windows o WSL.
50
+ 5. En una página web normal, pulsa `Alt+Shift+S` para seleccionar. Haz clic en
51
+ varios elementos. Pulsa de nuevo el atajo o Escape para navegar normalmente.
52
+ Revisa los elementos con `F7` en Pi y envía tu instrucción.
53
+
54
+ Cambia o asigna el atajo en `chrome://extensions/shortcuts` o
55
+ `edge://extensions/shortcuts`. Los atajos del navegador o del sistema pueden
56
+ tener prioridad. No puedes seleccionar elementos de páginas internas del
57
+ navegador ni de otras páginas protegidas. Un navegador administrado puede
58
+ prohibir el modo desarrollador.
59
+
60
+ Las actualizaciones son manuales. Descarga el ZIP de la nueva versión de Sideroom
61
+ en GitHub Releases, reemplaza los archivos en la misma carpeta y recarga la
62
+ extensión desde la página de extensiones del navegador. No la elimines y
63
+ reinstales salvo que quieras volver a emparejarla.
64
+ La extensión solo se conecta a instalaciones locales de Pi que hayas autorizado;
65
+ recoge descripciones de los elementos, no valores de formularios ni texto editable.
66
+ Los archivos de origen son candidatos inferidos, no correspondencias demostradas.
67
+
68
+ Full guide / Guía completa:
69
+ https://github.com/RMRdeveloper/sideroom-pi/blob/main/docs/extensions/visual-context.md