better-grill 0.1.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 (21) hide show
  1. package/.claude-plugin/plugin.json +18 -0
  2. package/LICENSE +21 -0
  3. package/README.md +142 -0
  4. package/package.json +41 -0
  5. package/skills/better-grill/SKILL.md +167 -0
  6. package/skills/better-grill/dist/cli.js +84 -0
  7. package/skills/better-grill/dist/server.js +69 -0
  8. package/skills/better-grill/dist/web/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  9. package/skills/better-grill/dist/web/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  10. package/skills/better-grill/dist/web/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  11. package/skills/better-grill/dist/web/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  12. package/skills/better-grill/dist/web/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  13. package/skills/better-grill/dist/web/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  14. package/skills/better-grill/dist/web/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  15. package/skills/better-grill/dist/web/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  16. package/skills/better-grill/dist/web/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  17. package/skills/better-grill/dist/web/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  18. package/skills/better-grill/dist/web/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  19. package/skills/better-grill/dist/web/assets/index-DFidMC-C.js +39 -0
  20. package/skills/better-grill/dist/web/assets/index-XcpPYDgs.css +2 -0
  21. package/skills/better-grill/dist/web/index.html +22 -0
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "better-grill",
3
+ "version": "0.1.0",
4
+ "description": "Run grill sessions in a local browser UI instead of the terminal: rounds of questions with options and a recommendation, a discussion thread per question, driven by your open Claude Code session.",
5
+ "author": {
6
+ "name": "Jakub Stastny",
7
+ "url": "https://github.com/devbaj-stastny-jakub"
8
+ },
9
+ "homepage": "https://github.com/devbaj-stastny-jakub/better-grill",
10
+ "repository": "https://github.com/devbaj-stastny-jakub/better-grill",
11
+ "license": "MIT",
12
+ "keywords": [
13
+ "grill",
14
+ "interview",
15
+ "planning",
16
+ "browser-ui"
17
+ ]
18
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jakub Stastny
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,142 @@
1
+ # better grill
2
+
3
+ Run grill sessions in a browser instead of the terminal. Claude posts rounds of questions with options and a recommendation; you lock in each question when ready (pick, type your own answer, or both), or open a discussion thread per question. When everything is locked in, **Send to Claude** sends the round; discussion messages go right away. From a discussion, Claude can resolve, edit, drop or add questions in the UI. Everything runs through your open Claude Code session, so it uses your Claude Code subscription. No API key.
4
+
5
+ ## Requirements
6
+
7
+ - [Claude Code](https://code.claude.com)
8
+ - [Node.js](https://nodejs.org) 20 or newer on your `PATH`
9
+ - Matt Pocock's `grilling` skill from [mattpocock/skills](https://github.com/mattpocock/skills). better-grill brings the UI; `grilling` brings the method (design tree, frontier, recommended answers).
10
+
11
+ ## Install
12
+
13
+ In Claude Code:
14
+
15
+ ```
16
+ /plugin marketplace add devbaj-stastny-jakub/better-grill
17
+ /plugin install better-grill@better-grill
18
+ ```
19
+
20
+ Then, in any session:
21
+
22
+ ```
23
+ /better-grill:better-grill <what you want grilled>
24
+ ```
25
+
26
+ Your browser opens on the session. Claude keeps the terminal quiet and talks to you in the UI until you confirm the final summary.
27
+
28
+ Several Claude sessions can grill at the same time; each gets its own bridge, port and browser tab.
29
+
30
+ ## How it talks to Claude Code
31
+
32
+ Claude Code has no port or socket to call, so the browser cannot reach it. A small local **bridge** sits between them:
33
+
34
+ ```
35
+ Claude Code session bridge (node, 127.0.0.1) browser
36
+ ─────────────────── ──────────────────────── ───────
37
+ grill round ── POST /api/rounds ─▶ session state ── SSE /api/stream ─▶ UI
38
+ grill wait ── GET /api/wait ───▶ (held open)
39
+ ◀── POST answer / chat ──────────── click
40
+ ◀── events JSON ───── releases the wait
41
+ grill reply ── POST /reply ──────▶ ── SSE ────────────────────────────▶ chat thread
42
+ ```
43
+
44
+ - Claude drives the bridge with the `grill` CLI from its Bash tool.
45
+ - `grill wait` is a long-poll Claude runs in the background. It returns when you press Send or write in a discussion, and Claude Code wakes the session with the events.
46
+ - The bridge never calls Claude. It only holds state and releases waits.
47
+ - A bridge exits on its own after 30 minutes with no wait running, no browser tab open and no requests.
48
+
49
+ ### Security
50
+
51
+ The bridge listens on `127.0.0.1` only and:
52
+
53
+ - refuses requests whose `Host` isn't localhost (DNS rebinding),
54
+ - refuses requests whose `Origin` isn't the page it serves, and requires JSON bodies, so other websites open in your browser can't post into the session,
55
+ - refuses Claude-side calls without its session id (see below).
56
+
57
+ ## CLI
58
+
59
+ The plugin runs it as `node <skill dir>/dist/cli.js`; outside Claude Code it is also `npx better-grill`.
60
+
61
+ ```
62
+ grill start [--title T] [--port N] [--no-open] # prints {"session":"62950-a1b2c3","url","log"}
63
+ grill round -s SESSION < round.json
64
+ grill add -s SESSION < questions.json # into the latest round, while unsent
65
+ grill wait -s SESSION
66
+ grill reply -s SESSION Q3 < text.md
67
+ grill resolve -s SESSION Q3 < resolution.json # {"options":[1],"text":"…"}
68
+ grill edit -s SESSION Q3 < patch.json
69
+ grill drop -s SESSION Q3 < reason.txt
70
+ grill summary -s SESSION < summary.md
71
+ grill state -s SESSION
72
+ grill stop -s SESSION
73
+ ```
74
+
75
+ Each `grill start` runs its own bridge on a free port. The session handle is `<port>-<id>`: the CLI sends the id in an `x-grill-session` header and the bridge refuses Claude-side calls whose id doesn't match, so a session that mixes up ports gets an error instead of writing into someone else's grill.
76
+
77
+ Exit codes: 0 ok, 1 bridge rejected the input, 2 usage error or bridge unreachable.
78
+
79
+ ## Development
80
+
81
+ Needs Node 24 (`.nvmrc`) and pnpm.
82
+
83
+ ```sh
84
+ pnpm install
85
+ pnpm dev # bridge from TypeScript on :4777 as session 4777-dev (node --watch) + Vite on :5173 proxying /api
86
+ pnpm demo # fake Claude: posts rounds, echoes chat replies, ends in a summary
87
+ pnpm check-types
88
+ pnpm build # web UI + bridge bundle into skills/better-grill/dist
89
+ ```
90
+
91
+ Open http://localhost:5173 after `pnpm dev`, then run `pnpm demo` in a second terminal.
92
+
93
+ To use your checkout from real Claude Code sessions, either load it as a plugin with `claude --plugin-dir .`, or symlink the skill:
94
+
95
+ ```sh
96
+ ln -s "$PWD/skills/better-grill" ~/.claude/skills/better-grill
97
+ ```
98
+
99
+ The skill runs the bundle in `skills/better-grill/dist`, so rebuild after bridge changes (`pnpm --filter @better-grill/bridge build:watch` keeps it fresh).
100
+
101
+ ### Layout
102
+
103
+ | Path | What |
104
+ | ----------------------- | ----------------------------------------------------------------------------- |
105
+ | `packages/protocol` | Zod schemas and types shared by bridge and UI: rounds, answers, events |
106
+ | `apps/bridge` | Node server (`server.ts`), session logic, `grill` CLI, demo and build scripts |
107
+ | `apps/web` | Vite + React + Tailwind + shadcn/ui (Base UI) UI |
108
+ | `skills/better-grill` | `SKILL.md`, plus the built `dist/` (bridge bundle and web UI) it runs |
109
+ | `.claude-plugin` | Plugin manifest and the marketplace that points at the npm package |
110
+
111
+ In development the bridge runs TypeScript directly with Node's type stripping. For release, esbuild bundles it into dependency-free JS for Node 20+.
112
+
113
+ `apps/web/src` follows [bulletproof-react](https://github.com/alan2207/bulletproof-react/blob/master/docs/project-structure.md):
114
+
115
+ | Path | What |
116
+ | -------------------- | ----------------------------------------------------------------------------------- |
117
+ | `app/` | Providers and `session-screen.tsx`, which composes the features |
118
+ | `features/<name>/` | `session`, `rounds`, `discussion`, `navigation`, `summary`: each with `api/`, `components/`, `hooks/`, `utils/` as needed |
119
+ | `components/ui/` | shadcn components (Base UI, `base-nova` style). Add more with `pnpm dlx shadcn@latest add <name>` in `apps/web` |
120
+ | `components/` | Shared app components: markdown, errors, feedback notes, brand, theme toggle |
121
+ | `hooks/` `lib/` `utils/` `types/` `config/` | Shared hooks, bridge client + theme + lock, pure helpers, types, constants |
122
+
123
+ Features never import from each other; only `app/` combines them. Theme tokens (stone + orange accent, light and dark) live in `src/index.css`.
124
+
125
+ ### Releasing
126
+
127
+ The plugin ships as the `better-grill` npm package; the marketplace in `.claude-plugin/marketplace.json` points at it, so nothing built is committed.
128
+
129
+ ```sh
130
+ npm version patch # bumps package.json and .claude-plugin/plugin.json together
131
+ npm publish # prepublishOnly runs check-types and build
132
+ git push --follow-tags
133
+ ```
134
+
135
+ ## Known limits
136
+
137
+ - State lives in bridge memory. Browser refresh is fine; a bridge crash loses the session.
138
+ - One Claude session per bridge. Events queue while Claude is busy and arrive as one batch.
139
+
140
+ ## License
141
+
142
+ [MIT](LICENSE)
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "better-grill",
3
+ "version": "0.1.0",
4
+ "description": "Run grill sessions in a local browser UI instead of the terminal, driven by your open Claude Code session.",
5
+ "keywords": [
6
+ "claude-code",
7
+ "claude-code-plugin",
8
+ "grill",
9
+ "interview",
10
+ "planning"
11
+ ],
12
+ "license": "MIT",
13
+ "author": "Jakub Stastny (https://github.com/devbaj-stastny-jakub)",
14
+ "homepage": "https://github.com/devbaj-stastny-jakub/better-grill",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/devbaj-stastny-jakub/better-grill.git"
18
+ },
19
+ "bugs": "https://github.com/devbaj-stastny-jakub/better-grill/issues",
20
+ "type": "module",
21
+ "packageManager": "pnpm@10.11.1",
22
+ "engines": {
23
+ "node": ">=20"
24
+ },
25
+ "bin": {
26
+ "better-grill": "skills/better-grill/dist/cli.js"
27
+ },
28
+ "files": [
29
+ ".claude-plugin/plugin.json",
30
+ "skills/better-grill/SKILL.md",
31
+ "skills/better-grill/dist"
32
+ ],
33
+ "scripts": {
34
+ "dev": "pnpm --parallel --filter @better-grill/bridge --filter @better-grill/web dev",
35
+ "demo": "pnpm --filter @better-grill/bridge demo",
36
+ "build": "pnpm --filter @better-grill/web build && pnpm --filter @better-grill/bridge build",
37
+ "check-types": "pnpm -r check-types",
38
+ "prepublishOnly": "pnpm check-types && pnpm build",
39
+ "version": "node -e \"const f='.claude-plugin/plugin.json',fs=require('fs'),p=JSON.parse(fs.readFileSync(f));p.version=process.env.npm_package_version;fs.writeFileSync(f,JSON.stringify(p,null,2)+'\\n')\" && git add .claude-plugin/plugin.json"
40
+ }
41
+ }
@@ -0,0 +1,167 @@
1
+ ---
2
+ name: better-grill
3
+ description: Run a grill-me session in a local browser UI instead of the terminal. Rounds, options, free-text answers and a discussion thread per question, all driven from this Claude Code session.
4
+ disable-model-invocation: true
5
+ allowed-tools: Bash(node "${CLAUDE_SKILL_DIR}/dist/cli.js" *)
6
+ ---
7
+
8
+ # Better Grill
9
+
10
+ Grill the user exactly like the `grilling` skill, but every question, answer and discussion goes through a local browser UI. The terminal stays quiet.
11
+
12
+ Every command below is `node "${CLAUDE_SKILL_DIR}/dist/cli.js" …`, written exactly like that so it runs without a permission prompt. In prose it is called `grill`.
13
+
14
+ ## 1. Load the method
15
+
16
+ Call the Skill tool with `grilling`. If no such skill exists, stop and tell the user that better-grill needs Matt Pocock's `grilling` skill installed first (https://github.com/mattpocock/skills), then end.
17
+
18
+ Follow its method: design tree, frontier, recommended answers, facts found by you (sub-agents), decisions made by the user, done when the frontier is empty.
19
+
20
+ Ignore two things from it and from any memory or instruction elsewhere:
21
+
22
+ - its text round format, and
23
+ - any rule to ask through AskUserQuestion.
24
+
25
+ In this session the UI is the only channel for questions. Never print questions in the terminal.
26
+
27
+ ## 2. Start the bridge
28
+
29
+ ```bash
30
+ node "${CLAUDE_SKILL_DIR}/dist/cli.js" start --title "<short topic>"
31
+ ```
32
+
33
+ If `node` is not found or the command says Node is too old, stop and tell the user to install Node.js 20 or newer (https://nodejs.org), then end.
34
+
35
+ It opens the browser and prints `{"session": "62950-a1b2c3", "url": …, "log": …}`. Remember the session handle: every later command takes `-s SESSION`, exactly as printed. Other Claude sessions may run their own bridges at the same time; the handle is what keeps you on yours. Tell the user the URL in one line.
36
+
37
+ ## 3. Post a round
38
+
39
+ Pipe JSON on stdin with a quoted heredoc:
40
+
41
+ ```bash
42
+ node "${CLAUDE_SKILL_DIR}/dist/cli.js" round -s SESSION <<'EOF'
43
+ {
44
+ "title": "Optional round title",
45
+ "questions": [
46
+ {
47
+ "title": "Short question, ends with ?",
48
+ "body": "Markdown. Context, why it matters, what hangs off it.",
49
+ "options": [
50
+ { "label": "Option", "description": "What it means, trade-off" }
51
+ ],
52
+ "recommended": 0,
53
+ "recommendation": "Markdown. Your recommended answer and why.",
54
+ "multiSelect": false
55
+ }
56
+ ]
57
+ }
58
+ EOF
59
+ ```
60
+
61
+ - The bridge numbers questions `Q1`, `Q2`, … across the whole session and prints the ids. Use them in later commands.
62
+ - `recommended` is an index into `options`. Do not write "(Recommended)" into labels; the UI marks it.
63
+ - Do not add an "Other" option. The user can always type an own answer and open a discussion.
64
+ - `options` may be empty for an open question.
65
+
66
+ ## 4. Wait for the user
67
+
68
+ ```bash
69
+ node "${CLAUDE_SKILL_DIR}/dist/cli.js" wait -s SESSION
70
+ ```
71
+
72
+ **Always run it with `run_in_background: true`.** It blocks until the user does something, which can take hours. You are notified when it exits; then read its output. Keep exactly one wait running: after handling events, start the next wait straight away. While a wait runs you may do other work (sub-agents for facts).
73
+
74
+ Output:
75
+
76
+ ```json
77
+ {
78
+ "events": [
79
+ { "type": "answer", "questionId": "Q2", "title": "…", "choices": ["Label"], "text": "note or own answer", "revised": false, "by": "user" },
80
+ { "type": "chat", "questionId": "Q3", "title": "…", "text": "user message" }
81
+ ],
82
+ "open": [{ "id": "Q3", "title": "…" }]
83
+ }
84
+ ```
85
+
86
+ `open` lists questions still unanswered after these events. A wait that returns only `chat` events means the round is still in progress: handle the chat, then wait again.
87
+
88
+ ## 5. Handle events
89
+
90
+ - **answer**: the user pressed **Send**, which only works when every question is answered, so answers arrive together as one complete round. Recompute the frontier and post the next round, exactly as in `grilling`.
91
+ - `by: "claude"`: your own resolution (below), which the user sent back unchanged.
92
+ - `revised: true`: the user changed an answer you already had. Re-check everything that depended on it.
93
+ - **chat**: the user wants to talk about that question. Reply in its thread:
94
+
95
+ ```bash
96
+ node "${CLAUDE_SKILL_DIR}/dist/cli.js" reply -s SESSION Q3 <<'EOF'
97
+ Markdown reply.
98
+ EOF
99
+ ```
100
+
101
+ Keep replies conversational and short. Then act on what the talk settled (next section). Never tell the user to go lock in an answer the two of you already agreed on.
102
+ - **summary_confirmed / summary_rejected / ended**: see step 6.
103
+
104
+ ## 5b. Shape questions from the discussion
105
+
106
+ The UI is yours to keep accurate. After a chat, change the questions to match what was said:
107
+
108
+ - **Settled in the discussion** → resolve it for the user. Pick option indexes, write text, or both. Use text alone when the agreed answer is none of the options (a custom solution). The user sees "resolved by Claude" and can still change it before Send.
109
+
110
+ ```bash
111
+ node "${CLAUDE_SKILL_DIR}/dist/cli.js" resolve -s SESSION Q6 <<'EOF'
112
+ { "options": [1], "text": "TanStack Query, and the SSE stream writes into the `['session']` cache." }
113
+ EOF
114
+ ```
115
+
116
+ - **Question was framed wrong, or options need changing** → edit it. Send only the fields that change. `null` clears `recommended` / `recommendation`. Sending `options` clears any answer on it, because the answer may point at old options.
117
+
118
+ ```bash
119
+ node "${CLAUDE_SKILL_DIR}/dist/cli.js" edit -s SESSION Q4 <<'EOF'
120
+ { "title": "Better title?", "options": [{ "label": "A" }, { "label": "B" }], "recommended": 0 }
121
+ EOF
122
+ ```
123
+
124
+ - **No longer matters** → drop it (it stays visible, struck through, with your reason):
125
+
126
+ ```bash
127
+ node "${CLAUDE_SKILL_DIR}/dist/cli.js" drop -s SESSION Q4 <<'EOF'
128
+ Moot: you chose memory-only state.
129
+ EOF
130
+ ```
131
+
132
+ - **Discussion surfaced a new question for this round** → add it to the current round instead of starting a new one. Fails once the user has sent that round; then it belongs in the next round.
133
+
134
+ ```bash
135
+ node "${CLAUDE_SKILL_DIR}/dist/cli.js" add -s SESSION <<'EOF'
136
+ { "questions": [{ "title": "…?", "body": "…", "options": [] }] }
137
+ EOF
138
+ ```
139
+
140
+ In the thread, say in one line what you changed ("Resolved Q6 as TanStack Query + SSE cache.").
141
+
142
+ ## 6. Finish
143
+
144
+ When the frontier is empty and `open` is empty, post a summary of every settled decision (by question id) and remaining risks, then wait:
145
+
146
+ ```bash
147
+ node "${CLAUDE_SKILL_DIR}/dist/cli.js" summary -s SESSION <<'EOF'
148
+ ### Settled
149
+ - **Q1 First user:** solo developers
150
+ EOF
151
+ ```
152
+
153
+ - `summary_confirmed`: run `grill stop -s SESSION`, then print the summary in the terminal as your final output. Act on it only if the user asks.
154
+ - `summary_rejected`: its `text` is new input. Keep grilling, then post a new summary.
155
+ - `ended` (user closed the session in the UI, at any time): run `grill stop -s SESSION` and print what was settled so far.
156
+
157
+ ## Terminal etiquette
158
+
159
+ Between tool calls print at most one short line (for example "Round 3 posted."). All content belongs in the UI.
160
+
161
+ ## Troubleshooting
162
+
163
+ - `No bridge for session …` (exit 2): the bridge is gone. It exits on its own after 30 minutes with no wait running and no browser tab open, and it can crash. Start a new one; the old session state is gone.
164
+ - `Wrong session: …` (exit 1): you used a handle that isn't yours, and it reached another session's bridge. Find the `session` your own `grill start` printed and retry with it. Never take a handle from `ps`, a log file or another session. If you can't find yours, start a new bridge.
165
+ - Exit 1 with a validation message: fix the JSON and post again.
166
+ - `grill state -s SESSION` prints the full session state.
167
+ - Bridge log path is printed by `grill start`.