@rmrdeveloper/sideroom-pi 7.0.1 → 8.0.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 CHANGED
@@ -1,162 +1,199 @@
1
- # Sideroom Pi
1
+ # Sideroom Pi — the side room your agent was missing
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@rmrdeveloper/sideroom-pi?label=npm&logo=npm)](https://www.npmjs.com/package/@rmrdeveloper/sideroom-pi)
4
4
  [![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
5
  [![npm license](https://img.shields.io/npm/l/@rmrdeveloper/sideroom-pi?label=license)](https://www.npmjs.com/package/@rmrdeveloper/sideroom-pi)
6
6
 
7
- Sideroom Pi is a global [Pi package](https://pi.dev/docs/latest/packages). It
8
- registers two parent-agent tools: `sideroom_ask`, a TUI questionnaire for
9
- clarifying decisions, and `sideroom_todo`, a live work board shown above the
10
- editor. It also shows a session-scoped list of files successfully edited by Pi,
11
- and steers write/edit toward packaged coding guidelines. It writes no `.pi`
12
- configuration, task graph, or other Sideroom files into the repository you are
13
- working in.
7
+ > Coding agents fail in predictable ways: they guess instead of asking, they
8
+ > bury progress in chat scroll, they litter your repo with `TODO.md` files,
9
+ > and every session writes code in a slightly different style.
10
+ >
11
+ > **Sideroom fixes all four — without touching your repository.**
12
+
13
+ Sideroom Pi is a global [Pi package](https://pi.dev/docs/latest/packages)
14
+ that gives the parent agent a *side room* next to your code: a place to ask
15
+ sharp questions, show live progress, track what changed, and stay honest
16
+ about code quality. The room lives in the Pi session, not in your repo. No
17
+ `.pi` config, no task graph, no Sideroom files left behind.
18
+
19
+ ## Why Sideroom exists
20
+
21
+ Every long agent session drifts toward the same failure modes:
22
+
23
+ 1. **Silent guessing.** The agent hits an ambiguous decision and picks
24
+ something instead of asking — because asking in plain chat is awkward
25
+ and easy to ignore.
26
+ 2. **Invisible work.** "What is it doing? Which step is it on? Did it skip
27
+ something?" Progress disappears into thousands of lines of transcript.
28
+ 3. **Repo pollution.** Workarounds appear as `todos.json`, scratch notes,
29
+ and half-abandoned plans committed next to real code.
30
+ 4. **Style drift.** Each session reinvents conventions: nesting depth, error
31
+ handling, naming, validation. Review becomes cleanup.
32
+
33
+ Sideroom answers each one with a small, opinionated surface:
34
+
35
+ | Failure | Sideroom answer |
36
+ | --- | --- |
37
+ | Silent guessing | `sideroom_ask` — questions with an opinion, one batch at a time |
38
+ | Invisible work | `sideroom_todo` — a live board above the editor, always one step in focus |
39
+ | Repo pollution | Session-branch state — the board and history die with the session, never with a commit |
40
+ | Style drift | A pre-edit gate + the on-demand `sideroom-guidelines` skill |
41
+ | Vague plans | `sideroom-grill` — an interview that settles the words before the work |
42
+
43
+ ## What it feels like
44
+
45
+ You ask the agent for something non-trivial. Instead of vanishing into a
46
+ wall of tool calls, it:
47
+
48
+ - **Asks like a senior would.** A clean TUI questionnaire appears — tabs for
49
+ several questions, a simple list for one. Every question carries a
50
+ recommendation, you can always answer *Out of scope* or write your own,
51
+ and everything is written in your language. Escape cancels the whole
52
+ batch. No guessing, no twenty follow-up clarifications in chat.
53
+ - **Works in the open.** A compact board sits above the editor:
54
+ `pending → in_progress → completed`. Exactly one step is active at a
55
+ time; the agent completes the current step and starts the next one in the
56
+ same move, so skipped steps become structurally hard. The board survives
57
+ reload, tree navigation, and compaction.
58
+ - **Shows its traces.** Below the board, the last edited files appear as
59
+ clickable `file://` links. `F8` opens the full session history; `R` clears
60
+ it. Only successful Pi `write`/`edit` calls are tracked — no guesses from
61
+ shell output, Git, or subagents.
62
+ - **Writes code that reads the same every time.** Before the first edit in
63
+ each agent run, the agent must read the shared contract and the one complete
64
+ guide matching the target language. Premature `write`/`edit` calls are
65
+ blocked. The guides cover guard clauses, braced conditionals, fail-fast
66
+ errors, focused units, and all 19 canonical rules without dumping them into
67
+ the system prompt.
68
+
69
+ ## What's inside
70
+
71
+ ### `sideroom_ask` — decisions, not interrogations
72
+
73
+ One call is one 1–N question batch. Each question needs an `id`, a `prompt`,
74
+ at least two `{ value, label }` options, and a `recommendationIndex` pointing
75
+ at the recommended option. The UI adds the rest: the recommended mark, the
76
+ always-on *Out of scope* row, and a custom answer.
77
+
78
+ TUI-only by design. In print, JSON, or RPC modes it fails fast with
79
+ `UI not available` instead of hanging.
80
+
81
+ ### `sideroom_todo` — a board, not a bureaucracy
82
+
83
+ A display-only, ordered work board. The agent maintains it; you steer through
84
+ chat. It never creates a repository task file or a `/todos` command.
85
+
86
+ - `propose` replaces the full board (interactive TUI only).
87
+ - `update` patches `{ id, status?, content? }` items and works everywhere,
88
+ including headless modes.
89
+ - Invariant: while anything is pending, exactly one item is `in_progress`.
90
+
91
+ ### Edited files — proof, not promises
92
+
93
+ Automatic tracking of successful `write` and `edit` results for the active
94
+ session. The compact view shows at most five recent paths below an active
95
+ board; the extended `F8` view scrolls through everything. Paths outside the
96
+ project are labelled `external`. A new session starts clean.
97
+
98
+ ### Grill — settle the words first
99
+
100
+ An on-demand skill for fuzzy plans. It interviews you in `sideroom_ask`
101
+ rounds — reading the codebase first so it never asks what the code already
102
+ says — until you share one understanding. Resolved terms land in
103
+ `CONTEXT.md` the moment they resolve; hard decisions land as ADRs under
104
+ `docs/adr/`. Everything else stays in the conversation, ready to become a
105
+ spec or an implementation. Vocabulary sharpening during the rounds follows
106
+ the companion `sideroom-domain-modeling` skill, which also runs on its own
107
+ whenever the words — not the plan — are the problem. And when there is no
108
+ one to interview at all, `sideroom-domain-scaffold` reads the central
109
+ domain code as source of truth, builds or completes `CONTEXT.md` on its
110
+ own, and grills the conflicting terms once, at the end.
111
+
112
+ ### Guidelines — a gate, not a novel
113
+
114
+ A short system-prompt contract points at the packaged
115
+ `sideroom-guidelines` skill. Before `write` or `edit`, a guard requires a
116
+ full read of the packaged skill and, for supported targets, the one complete
117
+ language guide under `skills/sideroom-guidelines/references/languages/`.
118
+ Each guide mirrors all 19 rules in the canonical seed with idiomatic examples.
119
+ The seed, `assets/artifacts/GUIDELINES_TEMPLATE.md`, is never pasted into the
120
+ system prompt.
14
121
 
15
122
  ## Quick path
16
123
 
17
- 1. Install globally from npm. Pi writes this installation to your user
18
- settings, so do not use `-l`.
124
+ 1. Install globally from npm. Pi records this in your user settings, so do
125
+ not use `-l`.
19
126
 
20
127
  ```bash
21
128
  pi install npm:@rmrdeveloper/sideroom-pi
22
129
  ```
23
130
 
24
131
  2. Start Pi in the repository you want to work in.
25
- 3. Ask the parent agent a question that needs a decision or a visible work
26
- board. It can call `sideroom_ask` or `sideroom_todo` in the TUI.
132
+ 3. Ask the parent agent something that needs a decision or a visible plan.
133
+ It calls `sideroom_ask` or `sideroom_todo` in the TUI.
27
134
 
28
- For a reproducible environment, pin a release. A pinned version does not move
29
- when you run Pi's package update command.
135
+ Pin for reproducibility — a pinned version does not move on Pi's package
136
+ update:
30
137
 
31
138
  ```bash
32
139
  pi install npm:@rmrdeveloper/sideroom-pi@7.0.0
33
140
  ```
34
141
 
35
- To update an unpinned installation:
142
+ Update an unpinned installation with:
36
143
 
37
144
  ```bash
38
145
  pi update --extension npm:@rmrdeveloper/sideroom-pi
39
146
  ```
40
147
 
41
- ## Details
148
+ ## Reference
42
149
 
43
- | Topic | Decision |
44
- | --- | --- |
45
- | Surface | Two LLM-callable tools: `sideroom_ask` and `sideroom_todo`. No `/sideroom` command. |
46
- | Questionnaire | One `sideroom_ask` call is one 1–N question batch; every question has `recommendationIndex`. |
47
- | Always-on rows | The questionnaire UI adds Out of scope and a custom answer. Do not send those options. |
48
- | Work board | `sideroom_todo propose` replaces a visible board; `update` patches items by id. |
49
- | Headless | `sideroom_todo update` works in print, JSON, and RPC. `propose` and `sideroom_ask` return `Error: UI not available` there. |
50
- | Edited files | Successful `write` and `edit` results appear below an active work board; `F8` opens the full list. |
51
- | Session state | The work board and edited-file history live in the Pi session branch, not in the target repository. |
52
- | Coding guidelines | A short system-prompt reminder points at the `sideroom-guidelines` skill. Language deltas load on demand. |
53
- | Seed artifact | `assets/artifacts/GUIDELINES_TEMPLATE.md` is the canonical seed; it is not dumped into the prompt. |
54
-
55
- ## Tool
56
-
57
- `sideroom_ask` follows Pi's questionnaire UI: a simple list for one question,
58
- tabs plus Submit for several. Write prompts, tab labels, and option copy in
59
- the language the user is speaking; ids, option values, and TUI chrome stay
60
- English. Each question needs:
61
-
62
- - `id`
63
- - `prompt`
64
- - at least two `{ value, label, description? }` options
65
- - `recommendationIndex` pointing at the recommended option
66
- - optional `label` for the tab bar (defaults to `Q1`, `Q2`, …)
67
-
68
- The recommended option is marked in the list. Escape cancels the batch.
69
-
70
- ## Work board
71
-
72
- `sideroom_todo` keeps an ordered, display-only board above the editor. The
73
- agent maintains it and the user steers through chat. It never creates a
74
- repository task file or a `/todos` command.
75
-
76
- - `propose` replaces the full board and is available only in the interactive
77
- TUI.
78
- - `update` applies one or more `{ id, status?, content? }` patches and works in
79
- every Pi mode.
80
- - Items have stable string ids, short content, and one of `pending`,
81
- `in_progress`, `completed`, or `cancelled`.
82
- - While items are pending, exactly one item must be `in_progress`. Complete the
83
- current item and start the next one in the same update.
84
- - Snapshots are stored in the active session branch. The board is rebuilt after
85
- session navigation and compaction.
86
-
87
- ## Edited files
88
-
89
- The package automatically records successful Pi `write` and `edit` calls for
90
- the active session. It does not infer filesystem changes from shell commands,
91
- Git, people, or subagents. The compact list is shown below the work board when
92
- one is active and contains at most five recent paths.
93
-
94
- - `F8` opens or closes the extended, scrollable list; press `R` there
95
- to clear the current session's history.
96
- - Every path is an OSC 8 `file://` link. Your terminal determines whether that
97
- is a click, Ctrl+click, or another modifier-assisted action.
98
- - Paths outside the active project are labelled `external`.
99
- - A new session starts with a new list; the current session's history survives
100
- reload, tree navigation, and compaction.
150
+ ### Questionnaire contract
101
151
 
102
- ## Coding guidelines
152
+ Each batch accepts one to four questions, with two to four caller-provided
153
+ options per question. Tab labels accept at most 16 characters and option
154
+ labels at most 60. Inputs that exceed a limit are rejected rather than
155
+ truncated.
103
156
 
104
- Before `write` or `edit`, the parent agent is reminded to read the packaged
105
- `sideroom-guidelines` skill. That skill holds the shared Do/Don't table. For
106
- `.java`, `.php`, `.ts`/`.tsx`, `.py`, `.go`, and `.rs`, the agent also reads one
107
- matching file under `skills/sideroom-guidelines/references/languages/`. Other
108
- languages follow the shared table only.
157
+ Write prompts, tab labels, and option copy in the language the user is
158
+ speaking; keep ids, option values, and TUI chrome in English. Do not send
159
+ *Out of scope* or custom-answer rows yourself — the UI always adds them.
109
160
 
110
- ## Development
161
+ ### Board contract
111
162
 
112
- ```bash
113
- npm install
114
- npm run check
115
- ```
163
+ Items have stable string ids, short content, and one of `pending`,
164
+ `in_progress`, `completed`, or `cancelled`. Complete the current item and
165
+ start the next one in the same `update` call. Snapshots live in the active
166
+ session branch and are rebuilt after navigation and compaction.
116
167
 
117
- Biome is the sole formatter and linter. Pi loads TypeScript from `extensions/`
118
- directly; do not bundle. Pi provides `@earendil-works/pi-coding-agent`,
119
- `@earendil-works/pi-tui`, and `typebox` as peer dependencies.
168
+ A forked session inherits the board visible at its fork point. Later board
169
+ updates are reconstructed from each session's active branch, so the fork and
170
+ the original session evolve independently.
120
171
 
121
- ## Releases and commits
172
+ ### Edited-files contract
122
173
 
123
- Commit messages must follow the Conventional Commits format. The existing
124
- Husky `commit-msg` hook validates each local commit with Commitlint, for
125
- example `feat: mark the recommended sideroom_ask option`.
174
+ - Trigger: only successful Pi `write`/`edit` results.
175
+ - Compact widget: max five paths, reapplied below the board.
176
+ - Extended view: `F8` toggles, `R` clears session history.
177
+ - Links: OSC 8 `file://` — click behavior depends on your terminal.
126
178
 
127
- Every user-visible package change needs a Changeset. Create one with:
179
+ ### Guidelines contract
128
180
 
129
- ```bash
130
- npm run changeset
131
- ```
181
+ In each agent run, fully read the exact packaged skill path before the first
182
+ `write`/`edit`. For Java, PHP/Laravel, TypeScript/TSX, Python, Go, or Rust,
183
+ also fully read the packaged guide matching the target path. Reads with
184
+ `offset` or `limit`, failed reads, and same-named files elsewhere do not count.
185
+ The extension blocks the mutation until the required reads succeed; unsupported
186
+ languages use the shared table. Do not route around
187
+ the gate through Bash or another file-mutation path. Before finishing, review
188
+ the diff against the loaded guide and run the relevant project checks.
132
189
 
133
- Review pending release work with `npm run changeset:status`. When Changesets
134
- are merged to `main`, the `Release` workflow creates or updates a reviewable
135
- Changesets version PR. That PR contains the generated `package.json`,
136
- `package-lock.json`, and `CHANGELOG.md` updates. Merge the version PR only after
137
- review; its merge runs `npm ci` and `npm run check`, then uses
138
- npm 11.5.1 and npm Trusted Publishing (GitHub OIDC) to publish. Changesets then
139
- pushes the release Git tag and creates the GitHub Release automatically.
140
-
141
- Never run `npm publish`, create release tags, or create GitHub Releases locally.
142
- Publishing is allowed only through the merged Changesets version PR and the
143
- `Release` workflow. The npm package's Trusted Publisher must be configured for
144
- this GitHub repository, the workflow filename `release.yml` (not its path),
145
- and the `npm` environment; configure the matching GitHub `npm` environment
146
- before the first release.
147
-
148
- ## Layout
149
-
150
- ```text
151
- extensions/
152
- ask/ sideroom_ask (index.ts, execute.ts, model.ts, ui.ts)
153
- todo/ sideroom_todo (index.ts, execute.ts, session.ts,
154
- guards.ts, model.ts, ui.ts)
155
- modified-files/ session-backed edited-file tracker and view
156
- guidelines/ short write/edit reminder
157
- skills/sideroom-guidelines/ on-demand checklist and language deltas
158
- assets/artifacts/ GUIDELINES_TEMPLATE.md seed
159
- ```
190
+ ### Grill contract
191
+
192
+ Load the skill at the start of a change with a fuzzy plan.
193
+ Single-session scope only. Files are created lazily: nothing exists until
194
+ the first term or decision crystallises. A session with a sharper glossary
195
+ and zero ADRs is working as designed.
196
+
197
+ ## License
160
198
 
161
- Add another tool as `extensions/<name>/index.ts`. Pi discovers
162
- `extensions/*/index.ts`; helpers in that folder are not loaded as extensions.
199
+ MIT.