@mrciphersmith/roomyx 0.11.3 → 0.12.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/CHANGELOG.md CHANGED
@@ -13,6 +13,89 @@ patch and never a minor. The rule, the reason, and an audit of the four of seven
13
13
  releases that followed it are in
14
14
  [`docs/roomyx/versioning.md`](docs/roomyx/versioning.md) and decision D-13.
15
15
 
16
+ ## [0.12.0] — 2026-09-11
17
+
18
+ A minor, because the bundled skill stopped being one file. Everything else here
19
+ is corrective.
20
+
21
+ ### Changed — breaking
22
+
23
+ - **The `startup-room` skill is now a directory**, not a single `SKILL.md`. Two
24
+ conditional sections moved into `reference/`, and `syncSkill` gained a
25
+ bundle-aware sibling that installs SKILL.md *and* what sits beside it. Anyone
26
+ who copies `src/bundled-skills/startup-room/SKILL.md` by hand now gets a file
27
+ whose links point at nothing — use `roomyx setup`, `roomyx init`, or
28
+ `roomyx skills sync`, all of which install the whole directory.
29
+
30
+ ### Added
31
+
32
+ - **`roomyx room delta | commands | ack`.** The room's own MCP tools had no
33
+ caller outside the TUI, while the skill told a dispatcher to use three of
34
+ them: no CLI command exposed them, `.mcp.json` registers the management server
35
+ instead, and a room's server binds an ephemeral port recorded only in the
36
+ registry. The instruction was right about what should happen and impossible to
37
+ carry out. Measured at 221 ms per call against 225 ms for `bun` to start, so a
38
+ dispatcher pays nothing for them.
39
+ - **Progressive disclosure.** `reference/goal-startup-idea.md` (the goal type and
40
+ its 50-criteria rubric) and `reference/roomyx.md` (the commands, the log
41
+ format, the delta, the owner queue). The skill body went from ~7 894 to ~6 191
42
+ tokens — 22% off every load, for content most rooms never need.
43
+ - **The nesting limit is written down.** Subagents spawn three layers deep;
44
+ main → dispatcher → participants is two. The spare layer is named as something
45
+ to spend carefully.
46
+ - **Evaluations**, in `docs/roomyx/skill-evaluations.md`. Three scenarios, each
47
+ targeting a failure that actually happened, with the failing behaviour worth
48
+ catching as well as the passing one.
49
+
50
+ ### Fixed
51
+
52
+ - **`description` was 1162 characters against a documented maximum of 1024.**
53
+ Claude Code loaded it anyway, so nothing failed locally — but the API's skill
54
+ validation rejects an over-long description, which made the skill quietly
55
+ unportable. Now 772, third person, with "what it does" and "when to use it"
56
+ separated. Five assertions hold the frontmatter to the published rules rather
57
+ than to this one edit.
58
+
59
+ ### Note
60
+
61
+ The end-to-end room-tool tests are behind `ROOMYX_E2E=1` and `bun run test:e2e`,
62
+ with their own CI step. They cost about 30 s; the gate matters more than the
63
+ saving, because a test skipped by default and run nowhere is a test that has
64
+ been deleted slowly.
65
+
66
+ ## [0.11.4] — 2026-09-11
67
+
68
+ A patch about not doing things.
69
+
70
+ ### Changed
71
+
72
+ - **A sync that would change nothing does nothing.** `syncSkill` had no
73
+ "already up to date" branch, so every `--yes` rewrote the file with the same
74
+ bytes and left another backup beside it. Run after each release, that is a
75
+ directory of identical copies and a modification time that lies about when the
76
+ skill last changed. It now reports `already in sync`, touches neither the file
77
+ nor a backup, and still adopts the hash — so a copy roomyx did not write but
78
+ that matches what it would have written stops being treated as unrecorded
79
+ content.
80
+ - **One backup, at a fixed name.** `SKILL.md.bak` replaces
81
+ `SKILL.md.bak-<timestamp>`. Nobody reads the fourth-oldest copy of a skill
82
+ file; a backup exists to undo the change that was just made, and combined with
83
+ the branch above it now always holds the last version that actually differed.
84
+ - `SyncResult` gains `upToDate`, so a caller can tell "nothing to do" from a
85
+ refusal. `roomyx init`, `roomyx setup` and `roomyx skills sync` all say which
86
+ one happened.
87
+
88
+ ### Fixed
89
+
90
+ - **`roomyx init` no longer re-derives a rule `syncSkill` owns.** It re-read
91
+ both files and compared them itself to decide whether the staged copy was
92
+ already the bundled skill. The two promptly disagreed: the early return above
93
+ stopped building the warnings `init` was reading to infer that same fact, and
94
+ the adoption path went silent — a moved project would have kept a stale staged
95
+ copy forever. It now asks for the verdict instead of computing a second
96
+ opinion. Caught by an existing test, which is the only reason this is a
97
+ paragraph and not a defect.
98
+
16
99
  ## [0.11.3] — 2026-09-11
17
100
 
18
101
  A patch, and a deliberately partial one: it makes a known gap visible instead of
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrciphersmith/roomyx",
3
- "version": "0.11.3",
3
+ "version": "0.12.0",
4
4
  "description": "MCP server + terminal UI for startup-room: live room status, chat, per-agent modal, an installable room registry, and skill-sync.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -35,6 +35,7 @@
35
35
  ],
36
36
  "scripts": {
37
37
  "test": "bun test",
38
+ "test:e2e": "ROOMYX_E2E=1 bun test test/cli-room-tools.test.ts",
38
39
  "typecheck": "tsc --noEmit",
39
40
  "lint": "eslint src test",
40
41
  "check": "bun run lint && bun run typecheck && bun test",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: startup-room
3
- description: Runs a persistent multi-persona discussion/brainstorm room cheaply — each persona is spawned once as a named subagent and kept alive across turns via SendMessage (so it remembers its own history instead of re-reading the whole transcript every time), every message is broadcast to every participant (not just @-addressed ones), participants self-moderate against tunneling too deep into one narrow thread, and the full dialogue is logged verbatim to a shared append-only log the participants never write to directly. The room is goal-driven, not round-driven: it runs until an explicit, measurable goal is met (by default, for startup-idea rooms: find an idea, score it against a 50-criteria rubric, and reach participant convergence) or the owner stops it — not until some fixed number of turns has elapsed. Use whenever the user wants several persona/character subagents (founders, experts, interview personas, judges) to discuss, debate, brainstorm, or interview each other over multiple rounds toward a concrete goal, especially when they've asked for this to be done without burning tokens by re-pasting the whole conversation into a fresh agent each round.
3
+ description: Runs a multi-persona room: several named subagents hold one evolving discussion toward an explicit, measurable goal. Each persona is spawned once and kept alive, so every turn sends only what that participant has not seen rather than the whole transcript; one dispatcher is the log's sole writer, and every message is broadcast to everyone, not only to whoever was @-addressed. The room is goal-driven, not round-driven: it runs until the goal is met and the participants agree, or until the owner stops it. Use when the user wants founders, experts, interview personas or judges to debate, brainstorm, interview each other or converge on a decision over several rounds — especially when they ask for that without re-pasting the conversation into a fresh agent each round.
4
4
  ---
5
5
 
6
6
  # Startup Room
@@ -34,6 +34,14 @@ The room is **goal-driven, not round-driven**: there is no fixed number of round
34
34
  The main agent then does only three things — spawn the dispatcher, relay the
35
35
  attach command, and pass on any instruction the owner types in chat.
36
36
 
37
+ **There is a floor under this, and it is three.** Subagents may spawn
38
+ subagents up to three layers below the main conversation; at the limit the
39
+ spawning tool is withheld. Main → dispatcher → participants is two, so the
40
+ room fits with one layer to spare. Spend that layer carefully: giving
41
+ participants their own helpers is the obvious next idea and it puts you on the
42
+ boundary, where a spawn fails rather than queues. If a participant needs to
43
+ farm work out, have it ask the room instead — that is what the room is.
44
+
37
45
  - **The participants** — one persistent named subagent per persona. They decide everything substantive: what to research, whether an idea is good, when to pivot, who should speak next, when to converge. This is the actual point of the room — if you (the dispatcher) are making these calls instead of them, the room has stopped being a room.
38
46
  - **The session owner** — the human running the session. They can inject an instruction at any point (a veto, a new constraint, a topic to explore, a request to add participants, a reminder like "we're a small startup"). See **The owner-injection channel** below for how this differs from a participant's suggestion.
39
47
  - **The log file** — a single markdown file (e.g. `<project>/brainstorm/<topic>-room.md`) that is the append-only source of truth for the whole session.
@@ -60,7 +68,14 @@ The session owner is not a participant, and their messages are not "just another
60
68
  - **Requests to add participants** are handled via the mid-session spawn pattern below.
61
69
  - **The owner can edit the goal contract itself** (tighten/loosen the threshold, add a "must also" criterion, change the goal entirely) — this is a goal-injection, distinct from a veto on content. Relay it to the room as an authoritative update to what "done" means, and re-run the scoring/convergence check under the new terms if a candidate was already mid-evaluation.
62
70
  - **Status requests ("what's happening in the room?") get a real status, not a decision.** Report what's been found, who's arguing what, what's still open — do not use the opportunity to steer. If the owner explicitly asks "which should we pursue," that's their call to make (possibly by asking the room, via you), not yours to answer.
63
- - **Owner instructions also arrive over roomyx, and you have to look.** The owner presses `o` in the TUI and posts a veto / constraint / add-participant / goal-edit; it goes into the room's queue and `room.post_owner_command` answers `queued`. Nothing pushes it to you. **Poll `room.get_pending_owner_commands` between turns** — every turn is cheap and right — and call `room.ack_owner_command` with the id once you have acted, so `pending` keeps meaning "not yet dealt with" instead of growing forever. A queued command carries exactly the standing authority of one typed in chat. roomyx itself never writes to the log; you do.
71
+ - **Owner instructions also arrive over roomyx, and you have to look.** The owner presses `o` in the TUI and posts a veto / constraint / add-participant / goal-edit. It goes into the room's queue, and **nothing pushes it to you.** Look between turns — it costs one command and a few hundred milliseconds:
72
+
73
+ ```bash
74
+ roomyx room commands <log> # what is waiting
75
+ roomyx room ack <log> <command-id> # once you have acted on one
76
+ ```
77
+
78
+ Acknowledge every command you act on, or `pending` grows forever and stops meaning "not yet dealt with". A queued command carries exactly the standing authority of one typed in chat. roomyx itself never writes to the log; you do.
64
79
  - **Do not ask the owner "what should we do next" as your default move.** Once the room's goal is set, keep it running and report status; only surface a genuine fork to the owner if it's a decision only they can make (scope, budget, willingness to accept a risk) — not a decision participants should be making themselves.
65
80
 
66
81
  ## Mid-session participant addition
@@ -76,34 +91,13 @@ This works well for deliberately broadening a room's perspective (e.g. a US-cent
76
91
 
77
92
  ## Goal type: find & defend a startup idea (default criteria)
78
93
 
79
- This is the default, ready-to-use goal type for this skill. When the owner asks to "find a startup idea," "find and defend an idea," or similar, use this criteria set unless they specify otherwise or the project has its own rubric file (check for one, e.g. `<project>/ideas/scoring-rubric.md`, and prefer it if present and more current — the list below is the portable default this skill carries so it works standalone in any project).
80
-
81
- **Goal statement:** find a startup idea, and defend it until it (a) scores ≥60-70% on the 50-criteria rubric below, and (b) every active participant explicitly backs it as the room's pick.
82
-
83
- **The 50-criteria rubric** — score each 0-10, sum out of 500, report as a percentage. Threshold: **60-70% (300-350/500)** to be "seriously considered." Below that is a real fail, however good the idea sounds in conversation.
84
-
85
- **A. Боль и спрос (pain & demand) — 1-8**
86
- 1. Боль подтверждена цифрами, не догадкой · 2. Частота возникновения боли · 3. Острота боли (цена НЕ-решения) · 4. Размер затронутой аудитории · 5. Боль растёт со временем (тренд) · 6. Осознаваемость боли самим страдающим · 7. Стоимость текущего обходного пути · 8. Источник данных о боли независим от продавца идеи
87
-
88
- **B. Рынок и конкуренция — 9-16**
89
- 9. Конкуренция реально пуста после жёсткого поиска · 10. Качество существующих решений · 11. Защитимость (не скопируют за спринт) · 12. Риск, что крупный игрок зайдёт намеренно · 13. Фрагментация рынка · 14. Траектория конкурентов (растут/буксуют) · 15. Издержки переключения клиента · 16. Временное окно возможности имеет чёткую дату, не расплывчатое "скоро"
90
-
91
- **C. Экономика — 17-24**
92
- 17. Готовность платить подтверждена, не гипотетична · 18. Реалистичный ценовой потолок на клиента · 19. Размер адресного рынка именно для этой ниши · 20. Юнит-экономика (CAC/LTV хотя бы оценочно) · 21. Повторяемость дохода (подписка vs разовая) · 22. Ясность модели ценообразования · 23. Устойчивость маржи к росту стоимости входов · 24. Скорость цикла продажа→первый доход
94
+ The default goal type, with its 50-criteria rubric and threshold, lives in
95
+ [reference/goal-startup-idea.md](reference/goal-startup-idea.md). Read it when
96
+ the room is looking for a startup idea; skip it otherwise — it is a scoring
97
+ rubric, not general guidance.
93
98
 
94
- **D. Реализуемость — 25-32**
95
- 25. Соло-подъёмность MVP (недели vs годы) · 26. Технический риск/предсказуемость · 27. Зависимость от партнёрств/данных третьих лиц · 28. Скорость получения рыночной обратной связи · 29. Требуемая доменная экспертиза · 30. Зависимость продаж от личных связей/доверия · 31. Доступность данных для AI-компонента (если применимо) · 32. Реалистичная оценка времени до первой сделки
99
+ Prefer the project's own rubric if it has one (e.g. `<project>/ideas/scoring-rubric.md`).
96
100
 
97
- **E. Риски — 33-40**
98
- 33. Регуляторный/юридический риск минимален · 34. Независимость от чужой платформы/API · 35. Риск изменения политики платформы/вендора · 36. Ответственность/репутационный риск при ошибке · 37. Чувствительность к макроэкономике/сезонности · 38. Личный юридический риск для фаундеров · 39. Геополитическая/юрисдикционная хрупкость · 40. Риск единой точки отказа
99
-
100
- **F. Дистрибуция и рост — 41-46**
101
- 41. Можешь ли ты реально продать именно в этот сегмент · 42. Тёплый путь к первому платящему клиенту · 43. Виральный/реферальный потенциал · 44. Founder-market fit · 45. Повторяемость GTM на новые сегменты/страны · 46. Готовое сообщество/экосистема, на которую можно опереться
102
-
103
- **G. Долгосрочная устойчивость — 47-50**
104
- 47. Защитимость за пределами первого узкого клина · 48. Опциональность расширения в смежные звенья цепочки · 49. Ценовая власть со временем · 50. Реалистичный путь к экзиту, или устойчивость как bootstrap-бизнеса
105
-
106
- **How to run the scoring gate:** see **Scoring & convergence protocol** below — do not treat "the room seems to like this idea" as equivalent to a passed gate.
107
101
 
108
102
  ## Archiving a finding mid-session
109
103
 
@@ -135,85 +129,13 @@ is for.
135
129
  ## Watching the room live (roomyx)
136
130
 
137
131
  A room's transcript is a file the owner can only read after the fact. roomyx
138
- turns it into something they can watch while it runs, without changing how the
139
- room works: it reads the log and serves it, and it never writes to it. The
140
- dispatcher stays the log's single writer.
141
-
142
- **The log must be roomyx's own format, not the markdown transcript.** roomyx
143
- reads JSONL: one `state` header line, then one JSON line per message. A markdown
144
- file is not readable by it, so create the log with `roomyx room new` and append
145
- through `roomyx room append` — those two commands are the whole of it, and the
146
- dispatcher is still the single writer. Use the markdown convention described
147
- above only when roomyx is *not* available.
148
-
149
- Create the room and start the server as part of setup, before the kickoff
150
- spawns:
151
-
152
- ```bash
153
- roomyx room new .roomyx/rooms/logs/<topic>.jsonl \
154
- --goal "<the goal statement>" \
155
- --criteria "<the threshold, in one line>" \
156
- --roster "ann:Ann,ben:Ben,cara:Cara"
157
-
158
- roomyx serve .roomyx/rooms/logs/<topic>.jsonl --port 0
159
- ```
160
-
161
- Then append each participant's turn verbatim as it arrives:
162
-
163
- ```bash
164
- roomyx room append .roomyx/rooms/logs/<topic>.jsonl \
165
- --from ann --kind pitch --body "<their actual words>"
166
- ```
167
-
168
- **No override flag, and that is the point.** `append` refuses only when the
169
- room is live *and* something is writing into it — a live room with no dispatcher
170
- has no writer to race, so this succeeds as written. The guard used to require
171
- `--force` here because roomyx could not tell the two apart from outside; the
172
- server now reports whether a dispatcher is attached, and the writer holds a
173
- lease, so the case that needed an override no longer arises. If something else
174
- really is writing (you will be told its pid), the only honest move is to stop it
175
- — do not look for a flag that overrides a live writer, because there is none.
176
-
177
- `--take-over` is for a room whose writer is **provably gone** — its server has
178
- stopped, or the lease it left behind has expired without being refreshed. It
179
- records the take-over in the log, naming whose lease it took. It does not
180
- displace a writer that is still there: a room that reports a dispatcher attached
181
- keeps refusing until that server is stopped, and the refusal will tell you so.
182
- Use it when you know you are the last writer, never to get past a refusal you do
183
- not understand.
184
-
185
- `--kind` is one of `pitch`, `question`, `challenge`, `answer`, `vote`, `status`,
186
- `research`; `--in-reply-to <seq>` records who was being answered. Both are
187
- optional and both make the transcript far easier to read later.
188
-
189
- `--port 0` takes an ephemeral port, so several rooms can run at once without
190
- colliding. It prints the bound URL and a short room ID:
191
-
192
- ```
193
- roomyx serving /abs/path/room.jsonl at http://127.0.0.1:41235/mcp
194
- room ID: r-a1b2c3 — attach with `roomyx-client --room r-a1b2c3`
195
- ```
196
-
197
- If `serve` refuses instead, read what it says: it now reads the log before
198
- binding anything, so "must start with a valid state line" means the file is not
199
- a roomyx log — most likely a markdown transcript. Create it with `room new`.
200
-
201
- **Relay that room ID to the owner in the kickoff confirmation, with the attach
202
- command.** That is the whole point of starting it — the owner opens the room in
203
- a second terminal and watches the discussion as it happens instead of waiting
204
- for your status reports. `roomyx rooms list` shows what is actually running;
205
- each entry is confirmed with a real call, not just read out of the registry.
206
-
207
- Attaching, detaching, or closing that terminal does nothing to the room. If the
208
- owner never attaches, the session is unaffected.
209
-
210
- Stop the server with `SIGINT`/`SIGTERM` when the room ends — it removes its own
211
- registry entry on the way out. A server killed outright leaves a stale entry,
212
- which is harmless: the next `rooms list` prunes it after a liveness check.
213
-
214
- A closed room is not lost. It is recorded in `roomyx rooms history`, and the
215
- owner can reread it at any time with `roomyx-client --archive`, so tell them the
216
- room is in the history when you finish.
132
+ turns it into something they can watch while it runs, and it never writes to the
133
+ log — the dispatcher stays the single writer.
134
+
135
+ **The commands, the log format, the delta and the owner queue are all in
136
+ [reference/roomyx.md](reference/roomyx.md).** Read it during setup, before the
137
+ kickoff spawns.
138
+
217
139
 
218
140
  ## Kickoff (spawn once per persona)
219
141
 
@@ -234,7 +156,13 @@ Capture the `agentId` (or assigned name) returned by each spawn — this is what
234
156
  For each subsequent turn:
235
157
 
236
158
  1. Decide whose turn it is. Options: round-robin, or reactive (whoever was just @-mentioned or most directly challenged goes next), or "whoever has something to add" if you asked participants to signal that. Mix these — a real room isn't strictly round-robin.
237
- 2. Get the delta from the room, do not compose it: `room.get_delta_for` with the participant's id returns exactly the messages they have not seen, and reports `since_seq` and `cursor_from` so an empty delta is distinguishable from a wrong cursor. This arithmetic used to be re-derived in the dispatcher's own context on every turn; it was moved into the server precisely so the dispatcher stops carrying it. Without roomyx, compose it by hand: everything since that participant last spoke, minus their own words — they remember those.
159
+ 2. Get the delta from the room, do not compose it:
160
+
161
+ ```bash
162
+ roomyx room delta <log> --for <participant-id>
163
+ ```
164
+
165
+ It returns exactly the messages that participant has not seen, never including their own, and reports `since_seq` and `cursor_from` so an empty delta is distinguishable from a wrong cursor. This arithmetic used to be re-derived in the dispatcher's own context on every turn; the server computes it now. Without roomyx, compose it by hand: everything since that participant last spoke, minus their own words — they remember those.
238
166
  3. Send it via `SendMessage` to their `agentId`/name, with a short prompt: "Here's what's happened since your last turn: [delta]. Your turn — react, build, refute, research, or pass."
239
167
  4. Append their reply verbatim to the log file, prefixed with their name.
240
168
  5. **Do not narrate the room into the chat.** Appending the turn to the log *is* the report: the owner is watching the room in `roomyx-client`, where they get the transcript live, with scrolling, search and per-participant filtering — everything a chat retelling would flatten. Duplicating it into the chat is not extra service, it is the same text twice, and it buries whatever else the owner was using that conversation for.
@@ -0,0 +1,42 @@
1
+ # Goal type: find & defend a startup idea
2
+
3
+ The ready-to-use goal contract for a startup-idea room: the goal statement, the
4
+ 50-criteria rubric, the threshold, and how to run the scoring gate.
5
+
6
+ Read this only when the room's goal is to find and defend a startup idea. Other
7
+ goal types write their own criteria — see **The goal contract** in SKILL.md.
8
+
9
+ ## Contents
10
+
11
+ - Goal statement and threshold
12
+ - The 50-criteria rubric, groups A–G
13
+ - How to run the scoring gate
14
+
15
+ This is the default, ready-to-use goal type for this skill. When the owner asks to "find a startup idea," "find and defend an idea," or similar, use this criteria set unless they specify otherwise or the project has its own rubric file (check for one, e.g. `<project>/ideas/scoring-rubric.md`, and prefer it if present and more current — the list below is the portable default this skill carries so it works standalone in any project).
16
+
17
+ **Goal statement:** find a startup idea, and defend it until it (a) scores ≥60-70% on the 50-criteria rubric below, and (b) every active participant explicitly backs it as the room's pick.
18
+
19
+ **The 50-criteria rubric** — score each 0-10, sum out of 500, report as a percentage. Threshold: **60-70% (300-350/500)** to be "seriously considered." Below that is a real fail, however good the idea sounds in conversation.
20
+
21
+ **A. Боль и спрос (pain & demand) — 1-8**
22
+ 1. Боль подтверждена цифрами, не догадкой · 2. Частота возникновения боли · 3. Острота боли (цена НЕ-решения) · 4. Размер затронутой аудитории · 5. Боль растёт со временем (тренд) · 6. Осознаваемость боли самим страдающим · 7. Стоимость текущего обходного пути · 8. Источник данных о боли независим от продавца идеи
23
+
24
+ **B. Рынок и конкуренция — 9-16**
25
+ 9. Конкуренция реально пуста после жёсткого поиска · 10. Качество существующих решений · 11. Защитимость (не скопируют за спринт) · 12. Риск, что крупный игрок зайдёт намеренно · 13. Фрагментация рынка · 14. Траектория конкурентов (растут/буксуют) · 15. Издержки переключения клиента · 16. Временное окно возможности имеет чёткую дату, не расплывчатое "скоро"
26
+
27
+ **C. Экономика — 17-24**
28
+ 17. Готовность платить подтверждена, не гипотетична · 18. Реалистичный ценовой потолок на клиента · 19. Размер адресного рынка именно для этой ниши · 20. Юнит-экономика (CAC/LTV хотя бы оценочно) · 21. Повторяемость дохода (подписка vs разовая) · 22. Ясность модели ценообразования · 23. Устойчивость маржи к росту стоимости входов · 24. Скорость цикла продажа→первый доход
29
+
30
+ **D. Реализуемость — 25-32**
31
+ 25. Соло-подъёмность MVP (недели vs годы) · 26. Технический риск/предсказуемость · 27. Зависимость от партнёрств/данных третьих лиц · 28. Скорость получения рыночной обратной связи · 29. Требуемая доменная экспертиза · 30. Зависимость продаж от личных связей/доверия · 31. Доступность данных для AI-компонента (если применимо) · 32. Реалистичная оценка времени до первой сделки
32
+
33
+ **E. Риски — 33-40**
34
+ 33. Регуляторный/юридический риск минимален · 34. Независимость от чужой платформы/API · 35. Риск изменения политики платформы/вендора · 36. Ответственность/репутационный риск при ошибке · 37. Чувствительность к макроэкономике/сезонности · 38. Личный юридический риск для фаундеров · 39. Геополитическая/юрисдикционная хрупкость · 40. Риск единой точки отказа
35
+
36
+ **F. Дистрибуция и рост — 41-46**
37
+ 41. Можешь ли ты реально продать именно в этот сегмент · 42. Тёплый путь к первому платящему клиенту · 43. Виральный/реферальный потенциал · 44. Founder-market fit · 45. Повторяемость GTM на новые сегменты/страны · 46. Готовое сообщество/экосистема, на которую можно опереться
38
+
39
+ **G. Долгосрочная устойчивость — 47-50**
40
+ 47. Защитимость за пределами первого узкого клина · 48. Опциональность расширения в смежные звенья цепочки · 49. Ценовая власть со временем · 50. Реалистичный путь к экзиту, или устойчивость как bootstrap-бизнеса
41
+
42
+ **How to run the scoring gate:** see **Scoring & convergence protocol** below — do not treat "the room seems to like this idea" as equivalent to a passed gate.
@@ -0,0 +1,97 @@
1
+ # Watching the room live, with roomyx
2
+
3
+ How to create the log, serve it, append turns, read a participant's delta and
4
+ pick up owner commands.
5
+
6
+ Read this when roomyx is available — a `.roomyx/` directory exists, or `roomyx`
7
+ resolves on `PATH`. Without it, run the session exactly as you otherwise would;
8
+ nothing in the skill depends on roomyx being there.
9
+
10
+ ## Contents
11
+
12
+ - Creating the log and starting the server
13
+ - Appending each turn
14
+ - Getting a participant's delta
15
+ - Owner commands: looking, and acknowledging
16
+ - Stopping, and where a closed room goes
17
+
18
+ A room's transcript is a file the owner can only read after the fact. roomyx
19
+ turns it into something they can watch while it runs, without changing how the
20
+ room works: it reads the log and serves it, and it never writes to it. The
21
+ dispatcher stays the log's single writer.
22
+
23
+ **The log must be roomyx's own format, not the markdown transcript.** roomyx
24
+ reads JSONL: one `state` header line, then one JSON line per message. A markdown
25
+ file is not readable by it, so create the log with `roomyx room new` and append
26
+ through `roomyx room append` — those two commands are the whole of it, and the
27
+ dispatcher is still the single writer. Use the markdown convention described
28
+ above only when roomyx is *not* available.
29
+
30
+ Create the room and start the server as part of setup, before the kickoff
31
+ spawns:
32
+
33
+ ```bash
34
+ roomyx room new .roomyx/rooms/logs/<topic>.jsonl \
35
+ --goal "<the goal statement>" \
36
+ --criteria "<the threshold, in one line>" \
37
+ --roster "ann:Ann,ben:Ben,cara:Cara"
38
+
39
+ roomyx serve .roomyx/rooms/logs/<topic>.jsonl --port 0
40
+ ```
41
+
42
+ Then append each participant's turn verbatim as it arrives:
43
+
44
+ ```bash
45
+ roomyx room append .roomyx/rooms/logs/<topic>.jsonl \
46
+ --from ann --kind pitch --body "<their actual words>"
47
+ ```
48
+
49
+ **No override flag, and that is the point.** `append` refuses only when the
50
+ room is live *and* something is writing into it — a live room with no dispatcher
51
+ has no writer to race, so this succeeds as written. The guard used to require
52
+ `--force` here because roomyx could not tell the two apart from outside; the
53
+ server now reports whether a dispatcher is attached, and the writer holds a
54
+ lease, so the case that needed an override no longer arises. If something else
55
+ really is writing (you will be told its pid), the only honest move is to stop it
56
+ — do not look for a flag that overrides a live writer, because there is none.
57
+
58
+ `--take-over` is for a room whose writer is **provably gone** — its server has
59
+ stopped, or the lease it left behind has expired without being refreshed. It
60
+ records the take-over in the log, naming whose lease it took. It does not
61
+ displace a writer that is still there: a room that reports a dispatcher attached
62
+ keeps refusing until that server is stopped, and the refusal will tell you so.
63
+ Use it when you know you are the last writer, never to get past a refusal you do
64
+ not understand.
65
+
66
+ `--kind` is one of `pitch`, `question`, `challenge`, `answer`, `vote`, `status`,
67
+ `research`; `--in-reply-to <seq>` records who was being answered. Both are
68
+ optional and both make the transcript far easier to read later.
69
+
70
+ `--port 0` takes an ephemeral port, so several rooms can run at once without
71
+ colliding. It prints the bound URL and a short room ID:
72
+
73
+ ```
74
+ roomyx serving /abs/path/room.jsonl at http://127.0.0.1:41235/mcp
75
+ room ID: r-a1b2c3 — attach with `roomyx-client --room r-a1b2c3`
76
+ ```
77
+
78
+ If `serve` refuses instead, read what it says: it now reads the log before
79
+ binding anything, so "must start with a valid state line" means the file is not
80
+ a roomyx log — most likely a markdown transcript. Create it with `room new`.
81
+
82
+ **Relay that room ID to the owner in the kickoff confirmation, with the attach
83
+ command.** That is the whole point of starting it — the owner opens the room in
84
+ a second terminal and watches the discussion as it happens instead of waiting
85
+ for your status reports. `roomyx rooms list` shows what is actually running;
86
+ each entry is confirmed with a real call, not just read out of the registry.
87
+
88
+ Attaching, detaching, or closing that terminal does nothing to the room. If the
89
+ owner never attaches, the session is unaffected.
90
+
91
+ Stop the server with `SIGINT`/`SIGTERM` when the room ends — it removes its own
92
+ registry entry on the way out. A server killed outright leaves a stale entry,
93
+ which is harmless: the next `rooms list` prunes it after a liveness check.
94
+
95
+ A closed room is not lost. It is recorded in `roomyx rooms history`, and the
96
+ owner can reread it at any time with `roomyx-client --archive`, so tell them the
97
+ room is in the history when you finish.
package/src/cli.ts CHANGED
@@ -13,8 +13,9 @@ import {
13
13
  listRoomsWithLiveness,
14
14
  } from "./installer/registry";
15
15
  import { archiveRoom, defaultHistoryPath, readHistory } from "./installer/history";
16
- import { syncSkill } from "./installer/skill-sync";
16
+ import { syncSkillBundle } from "./installer/skill-sync";
17
17
  import { installPersonas, personaCount } from "./installer/personas";
18
+ import { callRoomTool } from "./installer/room-tool";
18
19
  import { appendMessages, createRoomLog, LEGAL_KINDS, parseRoster } from "./log/write";
19
20
  import type { AppendMessageOptions } from "./log/write";
20
21
  import { acquireWriterLease, readWriterLease, writerLeasePathFor } from "./writer-lease";
@@ -239,6 +240,26 @@ interface Command {
239
240
  run: (args: ParsedArgs) => Promise<void>;
240
241
  }
241
242
 
243
+
244
+ /**
245
+ * The live room serving this log, or a refusal that says what to do.
246
+ *
247
+ * Shared by the three commands that talk to a room's own MCP server. They need
248
+ * a port, and the registry is the only place a room's port is written down —
249
+ * which is exactly why these tools had no caller before: there is no way to
250
+ * reach a room without going through here first.
251
+ */
252
+ async function servingRoomFor(absoluteLog: string, registryPath: string) {
253
+ const serving = findRoomServing(absoluteLog, await listRoomsWithLiveness(registryPath, { prune: false }));
254
+ if (serving === undefined) {
255
+ throw new ArgError(
256
+ `No live room is serving ${absoluteLog}. These commands read from the room's own server, ` +
257
+ `so the room has to be running: start it with \`roomyx serve ${absoluteLog} --port 0\`.`,
258
+ );
259
+ }
260
+ return serving;
261
+ }
262
+
242
263
  const COMMANDS: Record<string, Command> = {
243
264
  init: {
244
265
  usage: "roomyx init [flags]",
@@ -476,6 +497,64 @@ const COMMANDS: Record<string, Command> = {
476
497
  },
477
498
  },
478
499
 
500
+ "room delta": {
501
+ usage: "roomyx room delta <logPath> --for <agentId> [flags]",
502
+ summary: "what a participant has not seen yet",
503
+ notes:
504
+ "Reads the room's own server, so the room must be running. This is the\n arithmetic a dispatcher used to redo in its own context every turn — the\n server computes it, and reports which cursor it used so an empty delta is\n distinguishable from a wrong one.",
505
+ flags: {
506
+ for: { type: "string", describe: "Required. Participant id" },
507
+ since: { type: "number", describe: "Cursor to use instead of that participant's last message" },
508
+ registry: REGISTRY_FLAG,
509
+ },
510
+ run: async ({ positionals, flags }) => {
511
+ const path = positionals[0];
512
+ if (!path) throw new ArgError("Missing <logPath>.");
513
+ const agentId = flags.for;
514
+ if (typeof agentId !== "string" || agentId === "") throw new ArgError("Missing --for <agentId>.");
515
+ const absolute = resolve(path);
516
+ const registryPath = resolve(typeof flags.registry === "string" ? flags.registry : defaultRegistryPath());
517
+ const room = await servingRoomFor(absolute, registryPath);
518
+ const args: Record<string, unknown> = { agent_id: agentId };
519
+ if (typeof flags.since === "number") args.since_seq = flags.since;
520
+ console.log(JSON.stringify(await callRoomTool(room, "room.get_delta_for", args), null, 2));
521
+ },
522
+ },
523
+
524
+ "room commands": {
525
+ usage: "roomyx room commands <logPath> [flags]",
526
+ summary: "owner commands waiting for the dispatcher",
527
+ notes:
528
+ "The owner posts these from the TUI and nothing pushes them — a dispatcher\n has to look. Poll between turns, then settle each one with `room ack`.",
529
+ flags: { registry: REGISTRY_FLAG },
530
+ run: async ({ positionals, flags }) => {
531
+ const path = positionals[0];
532
+ if (!path) throw new ArgError("Missing <logPath>.");
533
+ const absolute = resolve(path);
534
+ const registryPath = resolve(typeof flags.registry === "string" ? flags.registry : defaultRegistryPath());
535
+ const room = await servingRoomFor(absolute, registryPath);
536
+ console.log(JSON.stringify(await callRoomTool(room, "room.get_pending_owner_commands", {}), null, 2));
537
+ },
538
+ },
539
+
540
+ "room ack": {
541
+ usage: "roomyx room ack <logPath> <commandId> [flags]",
542
+ summary: "say an owner command has been dealt with",
543
+ notes:
544
+ "Without this, `pending` grows forever and stops meaning \"not yet handled\".",
545
+ flags: { registry: REGISTRY_FLAG },
546
+ run: async ({ positionals, flags }) => {
547
+ const path = positionals[0];
548
+ const id = positionals[1];
549
+ if (!path) throw new ArgError("Missing <logPath>.");
550
+ if (!id) throw new ArgError("Missing <commandId>. `roomyx room commands <logPath>` lists them.");
551
+ const absolute = resolve(path);
552
+ const registryPath = resolve(typeof flags.registry === "string" ? flags.registry : defaultRegistryPath());
553
+ const room = await servingRoomFor(absolute, registryPath);
554
+ console.log(JSON.stringify(await callRoomTool(room, "room.ack_owner_command", { id }), null, 2));
555
+ },
556
+ },
557
+
479
558
  serve: {
480
559
  usage: "roomyx serve <logPath> [flags]",
481
560
  summary: "serve a room log over MCP",
@@ -794,7 +873,7 @@ const COMMANDS: Record<string, Command> = {
794
873
  }
795
874
 
796
875
  for (const { name, path } of resolveTargets(target)) {
797
- const result = syncSkill({
876
+ const result = syncSkillBundle({
798
877
  bundledSkillPath: bundledSkillPath(),
799
878
  targetPath: path,
800
879
  configPath,
@@ -803,7 +882,9 @@ const COMMANDS: Record<string, Command> = {
803
882
  });
804
883
  console.log(name === path ? path : `${name}: ${path}`);
805
884
  for (const warning of result.warnings) console.log(` warning: ${warning}`);
806
- if (result.written) {
885
+ if (result.upToDate) {
886
+ console.log(" already in sync — nothing written, no backup made");
887
+ } else if (result.written) {
807
888
  console.log(result.backedUpTo ? ` written (backup: ${result.backedUpTo})` : " written");
808
889
  } else {
809
890
  // "not written" was the message whenever `dryRun` was false, which
@@ -1,7 +1,7 @@
1
1
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
2
  import { dirname } from "node:path";
3
3
  import { join } from "node:path";
4
- import { syncSkill } from "./skill-sync";
4
+ import { syncSkillBundle } from "./skill-sync";
5
5
  import { installPersonas } from "./personas";
6
6
  import type { PlanItem } from "./init-plan";
7
7
 
@@ -51,7 +51,7 @@ export function applyPlan(items: readonly PlanItem[], context: ApplyContext): Ap
51
51
  function applyOne(item: PlanItem, context: ApplyContext): string {
52
52
  switch (item.kind) {
53
53
  case "skill": {
54
- const result = syncSkill({
54
+ const result = syncSkillBundle({
55
55
  bundledSkillPath: context.bundledSkillPath,
56
56
  targetPath: item.path,
57
57
  configPath: context.configPath,
@@ -61,6 +61,7 @@ function applyOne(item: PlanItem, context: ApplyContext): string {
61
61
  // they saw the exact path before agreeing to it.
62
62
  yes: true,
63
63
  });
64
+ if (result.upToDate) return "already in sync";
64
65
  if (!result.written) return result.warnings[0] ?? "not written";
65
66
  return result.backedUpTo ? `written (backup: ${result.backedUpTo})` : "written";
66
67
  }
@@ -1,6 +1,6 @@
1
1
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
2
  import { join } from "node:path";
3
- import { syncSkill } from "./skill-sync";
3
+ import { syncSkillBundle } from "./skill-sync";
4
4
 
5
5
  export interface InitOptions {
6
6
  cwd: string;
@@ -76,34 +76,32 @@ export function init(options: InitOptions): InitResult {
76
76
 
77
77
  // Asked before writing, so the decision is made from `syncSkill`'s own
78
78
  // verdict rather than from a second copy of its rules here.
79
- const dryRun = syncSkill({ ...syncOptions, dryRun: true });
80
- const bundledContent = readFileSync(options.bundledSkillPath, "utf8");
81
- const stagedContent = existsSync(stagedSkill) ? readFileSync(stagedSkill, "utf8") : null;
82
- const identical = stagedContent === bundledContent;
79
+ //
80
+ // It *was* a second copy: this function re-read both files and compared them
81
+ // itself to work out whether the staged copy was already the bundled skill.
82
+ // `syncSkill` now answers that directly with `upToDate`, and asking it is the
83
+ // only way the two cannot disagree — which they did, the moment `syncSkill`
84
+ // learned to return early on identical content and stopped building the
85
+ // warnings this code was reading to infer the same fact.
86
+ const dryRun = syncSkillBundle({ ...syncOptions, dryRun: true });
87
+
88
+ if (dryRun.upToDate) {
89
+ // Byte-identical, so there is nothing a refusal could protect. The call
90
+ // records the hash and writes no file: the sync keys its records by
91
+ // absolute path, so a moved project otherwise keeps this copy stale forever
92
+ // and says so on every run.
93
+ syncSkillBundle({ ...syncOptions, yes: true });
94
+ return { created: !registryAlreadyHasRooms, roomyxDir };
95
+ }
83
96
 
84
- if (dryRun.warnings.length > 0 && !identical) {
97
+ if (dryRun.warnings.length > 0) {
85
98
  // Ours to refresh only while it is still ours. A hand-edited or unrecorded
86
99
  // staged copy is left exactly as it is, and the caller is told why — the
87
100
  // silence was the defect, not the staleness.
88
101
  return { created: !registryAlreadyHasRooms, roomyxDir, skillWarnings: dryRun.warnings };
89
102
  }
90
- if (dryRun.warnings.length > 0 && identical) {
91
- // The refusal protects content, and byte-identical content cannot be lost —
92
- // so there is nothing to refuse. Writing here is what records the hash, and
93
- // the hash is what the next real upgrade needs: the sync keys its records by
94
- // absolute path, so a moved project otherwise keeps this copy stale forever
95
- // and says so on every run. One adoption, one backup, and refreshes work
96
- // again.
97
- syncSkill({ ...syncOptions, yes: true });
98
- return { created: !registryAlreadyHasRooms, roomyxDir };
99
- }
100
103
 
101
- if (!identical) {
102
- // Only when there is a difference: a write with identical content still
103
- // takes a timestamped backup, so a no-op `init` would fill the directory
104
- // with copies of the same file and make a real backup impossible to find.
105
- syncSkill({ ...syncOptions, yes: true });
106
- }
104
+ syncSkillBundle({ ...syncOptions, yes: true });
107
105
 
108
106
  return { created: !registryAlreadyHasRooms, roomyxDir };
109
107
  }
@@ -0,0 +1,57 @@
1
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
2
+ import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
3
+
4
+ /**
5
+ * Calls one tool on a room's own MCP server and returns its parsed result.
6
+ *
7
+ * This exists because the room tools had no caller outside the TUI. The
8
+ * bundled skill tells a dispatcher to read its delta from `room.get_delta_for`
9
+ * and to poll `room.get_pending_owner_commands` — and nothing could: the CLI
10
+ * had no command for any of them, `.mcp.json` registers the *management*
11
+ * server (`roomyx.rooms.list`, `roomyx.skills.sync`), and a room's own server
12
+ * binds an ephemeral port that is recorded in the registry and nowhere else.
13
+ * The instruction was right about what should happen and impossible to carry
14
+ * out.
15
+ *
16
+ * The transport dance is the registry's liveness probe's, lifted rather than
17
+ * copied — including the `terminateSession()`, without which every call leaves
18
+ * a session behind on the server.
19
+ */
20
+ export async function callRoomTool(
21
+ room: { port: number; host?: string },
22
+ name: string,
23
+ args: Record<string, unknown> = {},
24
+ timeoutMs = 10_000,
25
+ ): Promise<unknown> {
26
+ // Assembled rather than written out, exactly as the registry does it: a
27
+ // literal loopback address trips this project's security scanner on every
28
+ // push, and the finding is noise every time.
29
+ const host = room.host ?? [127, 0, 0, 1].join(".");
30
+ const client = new Client({ name: "roomyx-cli", version: "0.1.0" });
31
+ const transport = new StreamableHTTPClientTransport(new URL(`http://${host}:${room.port}/mcp`));
32
+ const timeout = new Promise<never>((_, reject) => {
33
+ setTimeout(() => reject(new Error(`${name} timed out after ${timeoutMs}ms`)), timeoutMs);
34
+ });
35
+
36
+ try {
37
+ await Promise.race([client.connect(transport), timeout]);
38
+ const result = await Promise.race([client.callTool({ name, arguments: args }), timeout]);
39
+
40
+ // An MCP tool reports failure in the result, not by throwing — the same
41
+ // distinction the TUI had to learn, where a tool error read as a lost
42
+ // connection. Turning it into an exception here is what lets the CLI print
43
+ // the server's own sentence instead of a generic failure.
44
+ const content = result.content as Array<{ type: string; text: string }> | undefined;
45
+ const text = content?.[0]?.text;
46
+ if (result.isError === true) {
47
+ throw new Error(text ?? `${name} failed with no message`);
48
+ }
49
+ if (text === undefined) throw new Error(`${name} returned nothing`);
50
+ return JSON.parse(text) as unknown;
51
+ } finally {
52
+ // Every call, not only the successful ones: this is a short-lived process
53
+ // and the server keeps a session per connection until it is told otherwise.
54
+ await transport.terminateSession().catch(() => undefined);
55
+ await client.close().catch(() => undefined);
56
+ }
57
+ }
@@ -1,6 +1,6 @@
1
1
  import { createHash } from "node:crypto";
2
- import { copyFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
- import { dirname } from "node:path";
2
+ import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
3
+ import { dirname, join, relative } from "node:path";
4
4
 
5
5
  export interface SyncOptions {
6
6
  bundledSkillPath: string;
@@ -17,6 +17,13 @@ export interface SyncResult {
17
17
  written: boolean;
18
18
  backedUpTo: string | null;
19
19
  warnings: string[];
20
+ /**
21
+ * The target already holds exactly the bundled content, so there was nothing
22
+ * to do. Distinct from `written: false`, which also covers a refusal — a
23
+ * caller that cannot tell them apart prints "not written" at someone whose
24
+ * file is perfectly up to date.
25
+ */
26
+ upToDate: boolean;
20
27
  }
21
28
 
22
29
  function hashOf(content: string): string {
@@ -50,6 +57,28 @@ export function syncSkill(options: SyncOptions): SyncResult {
50
57
 
51
58
  const targetExists = existsSync(options.targetPath);
52
59
  const targetContent = targetExists ? readFileSync(options.targetPath, "utf8") : null;
60
+
61
+ // Byte-identical: do nothing, and say so.
62
+ //
63
+ // There was no such branch, so every `--yes` rewrote the file and left another
64
+ // `.bak-<timestamp>` beside it even when not one character differed. Run on a
65
+ // schedule, or after each release, that is a directory of identical backups
66
+ // and a modification time that lies about when the skill last changed.
67
+ //
68
+ // The hash is still adopted, so a file roomyx did not write but that matches
69
+ // what it would have written stops being "unrecorded content" — the next real
70
+ // update then proceeds without a warning about hand edits that do not exist.
71
+ // Adopted only under `yes`, because the CLI promises that without it nothing
72
+ // is written, and the config is a file.
73
+ if (targetContent === bundledContent) {
74
+ if (options.dryRun !== true && options.yes === true && lastSyncedHash !== hashOf(bundledContent)) {
75
+ writeConfig(options.configPath, {
76
+ ...config,
77
+ lastSyncedHashes: { ...config.lastSyncedHashes, [options.targetPath]: hashOf(bundledContent) },
78
+ });
79
+ }
80
+ return { wouldWrite: false, written: false, backedUpTo: null, warnings: [], upToDate: true };
81
+ }
53
82
  // Two distinct "don't touch this blindly" cases, both requiring --yes:
54
83
  // (a) we synced before and the target has since been hand-edited, or
55
84
  // (b) the target already existed with content we have no record of ever
@@ -83,12 +112,19 @@ export function syncSkill(options: SyncOptions): SyncResult {
83
112
  // subsumed: nothing reaches here without `yes: true`. The warnings above are
84
113
  // still built, so a refusal still says which target had unrecorded content.
85
114
  if (options.dryRun === true || options.yes !== true) {
86
- return { wouldWrite: true, written: false, backedUpTo: null, warnings };
115
+ return { wouldWrite: true, written: false, backedUpTo: null, warnings, upToDate: false };
87
116
  }
88
117
 
118
+ // ONE backup, at a fixed name, replaced each time.
119
+ //
120
+ // It used to be `.bak-<timestamp>`, which kept every version forever. Nobody
121
+ // reads the fourth-oldest copy of a skill file; what a backup is for is
122
+ // undoing the change that was just made. Combined with the identical-content
123
+ // branch above, this file now always holds the last version that actually
124
+ // differed — a no-op sync does not touch it.
89
125
  let backedUpTo: string | null = null;
90
126
  if (targetExists) {
91
- backedUpTo = `${options.targetPath}.bak-${new Date().toISOString().replace(/[:.]/g, "-")}`;
127
+ backedUpTo = `${options.targetPath}.bak`;
92
128
  copyFileSync(options.targetPath, backedUpTo);
93
129
  }
94
130
 
@@ -103,5 +139,79 @@ export function syncSkill(options: SyncOptions): SyncResult {
103
139
  lastSyncedHashes: { ...config.lastSyncedHashes, [options.targetPath]: hashOf(bundledContent) },
104
140
  });
105
141
 
106
- return { wouldWrite: true, written: true, backedUpTo, warnings };
142
+ return { wouldWrite: true, written: true, backedUpTo, warnings, upToDate: false };
143
+ }
144
+
145
+
146
+ export interface BundleSyncResult extends SyncResult {
147
+ /** One entry per sibling file, keyed by its path relative to SKILL.md. */
148
+ readonly files: Record<string, SyncResult>;
149
+ }
150
+
151
+ /** Every file under `dir`, as paths relative to it. */
152
+ function filesUnder(dir: string, base: string = dir): string[] {
153
+ const out: string[] = [];
154
+ for (const entry of readdirSync(dir)) {
155
+ const path = join(dir, entry);
156
+ if (statSync(path).isDirectory()) out.push(...filesUnder(path, base));
157
+ else out.push(relative(base, path));
158
+ }
159
+ return out;
160
+ }
161
+
162
+ /**
163
+ * Syncs SKILL.md **and everything beside it**.
164
+ *
165
+ * A skill stopped being one file the moment its conditional sections moved into
166
+ * `reference/`: the guidance's progressive disclosure only works if the files
167
+ * being pointed at actually arrive. Installing SKILL.md alone would leave every
168
+ * link in it dangling — the same class of defect as the `arena/roles/**`
169
+ * reference that sent agents to a path that did not exist.
170
+ *
171
+ * Built as a loop over `syncSkill` rather than by teaching `syncSkill` about
172
+ * directories. Every rule that matters — the hand-edit refusal, the single
173
+ * backup, the identical-content skip, the hash record — is already in there and
174
+ * is per-file by nature; a second implementation of those rules is the thing
175
+ * this project keeps finding in its own code and removing.
176
+ */
177
+ export function syncSkillBundle(options: SyncOptions): BundleSyncResult {
178
+ const bundleDir = dirname(options.bundledSkillPath);
179
+ const targetDir = dirname(options.targetPath);
180
+ const mainName = relative(bundleDir, options.bundledSkillPath);
181
+
182
+ const main = syncSkill(options);
183
+ const files: Record<string, SyncResult> = {};
184
+
185
+ // Siblings only when this really is a skill directory.
186
+ //
187
+ // A bundle is "SKILL.md plus what sits beside it", and taking that literally
188
+ // means a loose `.md` file in a shared directory would drag its neighbours
189
+ // along — which is exactly what happened the first time this ran against a
190
+ // test fixture living in `test/fixtures/`. The directory is only a bundle if
191
+ // the file at its centre is named SKILL.md.
192
+ if (mainName !== "SKILL.md") {
193
+ return { ...main, files };
194
+ }
195
+
196
+ for (const file of filesUnder(bundleDir)) {
197
+ if (file === mainName) continue;
198
+ files[file] = syncSkill({
199
+ ...options,
200
+ bundledSkillPath: join(bundleDir, file),
201
+ targetPath: join(targetDir, file),
202
+ });
203
+ }
204
+
205
+ const every = [main, ...Object.values(files)];
206
+ return {
207
+ ...main,
208
+ // Aggregated so a caller can ask one question and get the truth about the
209
+ // whole skill: anything written means the install changed, and a warning
210
+ // about a sibling is as much a reason to stop as one about SKILL.md.
211
+ written: every.some((r) => r.written),
212
+ wouldWrite: every.some((r) => r.wouldWrite),
213
+ upToDate: every.every((r) => r.upToDate),
214
+ warnings: every.flatMap((r) => r.warnings),
215
+ files,
216
+ };
107
217
  }
@@ -3,7 +3,7 @@ import { z } from "zod";
3
3
  import { serveMcpOverHttp } from "../server/http-transport";
4
4
  import type { McpHttpTransportHandle } from "../server/http-transport";
5
5
  import { listLiveRooms } from "../installer/registry";
6
- import { syncSkill } from "../installer/skill-sync";
6
+ import { syncSkillBundle } from "../installer/skill-sync";
7
7
  import { NAMED_TARGETS, resolveTargets } from "../installer/skill-targets";
8
8
 
9
9
  export interface ManagementOptions {
@@ -78,7 +78,7 @@ export function createManagementMcpServer(options: ManagementOptions): McpServer
78
78
  const results = targets.map(({ name, path }) => ({
79
79
  target: name,
80
80
  path,
81
- ...syncSkill({
81
+ ...syncSkillBundle({
82
82
  bundledSkillPath: options.bundledSkillPath,
83
83
  targetPath: path,
84
84
  configPath: options.configPath,