← Commit history
README.md+4−4
@@ -237,7 +237,7 @@ works (MediaRecorder, WebAudio, Canvas, WebGL, fetch, etc.) but remember: - **No cookies / no localStorage expectations**, webviews are fresh every   session. Persist state to disk via your CLI, not the browser. -### 6. Graceful shutdown, self-shutdown, and caller identity+### 6. Graceful shutdown, self-shutdown, and the ai-thread name  Apps should have a `/shutdown` endpoint (or equivalent) that the UI can call when the user is done. On receiving it, the server:@@ -255,13 +255,13 @@ AI-thread name from every caller (refusing anonymous calls with a teaching reprimand), require a `reason` on disruptive verbs, and register itself so `<app> ls` finds it and `start` reuses a live instance instead of spawning a duplicate. These rules live in the sub-skill family below; read-**`app-creator-server-lifecycle`** and **`app-creator-caller-identity`**+**`app-creator-server-lifecycle`** and **`app-creator-ai-thread-name`** before wiring any server's main loop.  ### The sub-skill family -- **`app-creator-caller-identity`**: every caller names its AI thread-  (`--ai-thread`, `X-Adom-Thread` / `aiThread`), anonymous state-changing+- **`app-creator-ai-thread-name`**: every caller gives its ai-thread name+  (the global `--ai-thread` CLI flag on every verb, forwarded as `aiThread`), anonymous state-changing   calls get the `caller_identity_required` teaching refusal, identity is   attribution and never authorization, and identity is forwarded (with a   delegate name) when your app calls other services. Modeled on ab and pup,
SKILL.md+1−1
@@ -10,7 +10,7 @@ Use when the user wants to build a new Adom "app", a mini web server that render  | Sub-skill | Covers | Load when | |---|---|---|-| `app-creator-caller-identity` | Mandatory `--ai-thread` at spawn, `X-Adom-Thread` / `aiThread` on state-changing calls, the `caller_identity_required` teaching refusal, forwarding identity downstream | Building ANY server; a call refused with `caller_identity_required` |+| `app-creator-ai-thread-name` | The ai-thread name: global `--ai-thread` CLI flag on every verb (forwarded as `aiThread`), the `caller_identity_required` teaching refusal, forwarding identity downstream | Building ANY server; a call refused with `caller_identity_required` | | `app-creator-reason-gating` | Hints, teaching refusals, and reason-gated verbs: out-of-the-norm actions (foreground, delete, publish, kill) refuse until re-called with a written `reason` | Designing endpoints; a call refused with `reason_required` | | `app-creator-server-lifecycle` | 24h idle reaper with lossless per-thread snapshots, instance registry, `<app> ls`, reuse-instead-of-respawn, `--port auto`, version drift | Building ANY server; a container full of zombie servers | | `app-creator-settings` | The (almost) mandatory Settings window: gear icon, server-side persistence, `GET/POST /settings`, standard entries | Scaffolding any UI |
install.sh+1−1
@@ -13,4 +13,4 @@ for skill_dir in "$PKG_DIR/skills"/*/; do   mkdir -p "$SKILLS_DIR/$skill_name"   cp -r "$skill_dir"* "$SKILLS_DIR/$skill_name/" done-echo "Installed app-creator (+ sub-skills: caller-identity, reason-gating, server-lifecycle, settings, surfaces, live-channel)"+echo "Installed app-creator (+ sub-skills: ai-thread-name, reason-gating, server-lifecycle, settings, surfaces, live-channel)"
package.json+4−2
@@ -1,6 +1,6 @@ {   "slug": "app-creator",-  "version": "1.3.0",+  "version": "1.3.1",   "type": "skill",   "description": "Use when the user wants to build a new Adom \"app\", a mini web server that renders its UI in a Hydrogen webview tab.",   "dependencies": {},@@ -41,7 +41,9 @@     "drive the frontend from the cli",     "reason gating",     "teaching refusal",-    "foreground needs a reason"+    "foreground needs a reason",+    "ai-thread name",+    "ai thread name for callers"   ],   "discovery_pitch": "Build a new Adom app (a mini web server with a Hydrogen webview UI) following the required conventions: brand, AI-drivability, and server lifecycle (idle self-shutdown, AI-thread caller identity, instance registry).",   "sample_prompts": [
page.json+11−3
@@ -4,7 +4,7 @@   "slug": "app-creator",   "title": "App Creator",   "brief": "Use when the user wants to build a new Adom \"app\", a mini web server that renders its UI in a Hydrogen webview tab.",-  "version": "1.3.0",+  "version": "1.3.1",   "tags": [     "skill",     "app",@@ -66,7 +66,9 @@     "drive the frontend from the cli",     "reason gating",     "teaching refusal",-    "foreground needs a reason"+    "foreground needs a reason",+    "ai-thread name",+    "ai thread name for callers"   ],   "discovery_pitch": "Build a new Adom app (a mini web server with a Hydrogen webview UI) following the required conventions: brand, AI-drivability, and server lifecycle (idle self-shutdown, AI-thread caller identity, instance registry).",   "metadata": {},@@ -74,5 +76,11 @@   "updated_at": "2026-05-28T05:29:45.880Z",   "sub_skills": [],   "parent_app": null,-  "org": "adom"+  "org": "adom",+  "description": "Use when the user wants to build a new Adom \"app\", a mini web server that renders its UI in a Hydrogen webview tab.",+  "dependencies": {},+  "scripts": {+    "install": "./install.sh",+    "uninstall": "./uninstall.sh"+  } }\ No newline at end of file
skills/app-creator-ai-thread-name/SKILL.mdadded+141
@@ -0,0 +1,141 @@+---+name: app-creator-ai-thread-name+description: >+  Every Adom app CLI takes an ai-thread name on every call: a global+  --ai-thread flag, exactly like adom-bridge-cli. The CLI forwards it to the+  app's server, anonymous state-changing calls get a teaching refusal+  (caller_identity_required, same code ab uses), and the name keys logs,+  registry entries, and snapshots. Read when building any app server or CLI,+  or when a call is refused with caller_identity_required. Trigger words:+  ai-thread, ai thread name, --ai-thread, aiThread, name your thread, who is+  calling, caller identity, caller_identity_required, thread attribution,+  anonymous caller, identify your thread.+---+Parent skill: **app-creator**++# The ai-thread name: every call says which conversation is asking++Adom Bridge (ab) and pup already refuse calls that do not name their AI+thread. Most Adom apps do not yet, and that is a gap: this skill makes the+pattern standard for every new app. (ab's own docs call this pattern+"caller identity"; see `adom-bridge-caller-identity` for the origin story.+In app-land, just say **ai-thread name**.)++## The term is SETTLED: "ai-thread name", nothing else++This vocabulary has been settled by John, and drift is a recurring+irritation: pup at one point called this concept a "session" / "sessionId",+and it caused nonstop confusion. Do not call it a session, session id,+thread id, caller id, agent name, or client name. The flag is `--ai-thread`,+the JSON field is `aiThread`, and the concept in prose is the **ai-thread+name**. If your app has its own real notion of a session (pup's `sessionId`+is a browser-window handle, hero-studio has poses), that is a DIFFERENT+thing: name it after what it actually is, and never overload it with the+ai-thread name.++## Why++A typical Adom user runs roughly 20 AI conversation tabs against one+container and one desktop. Without the ai-thread name, every server log and+activity line says "some AI did something": the user cannot tell the tab+doing useful background work from the tab that went off the rails, and your+server cannot manage per-thread instances or state (see+`app-creator-server-lifecycle`). One name, chosen once per conversation and+sent on every call, fixes all of it.++## The contract: CLI variables, like ab++The AI talks to your app through its CLI (`app-creator-live-channel`), so+the ai-thread name travels as a **global CLI flag**, exactly the way+`adom-bridge-cli --ai-thread "..."` works. It goes before any verb and+works on every verb:++```bash+hero-studio --ai-thread "kicad-bridge dev" start+hero-studio --ai-thread "kicad-bridge dev" pose --title "Adom USB"+hero-studio --ai-thread "kicad-bridge dev" shutdown+```++- **The flag is required on every verb that talks to the server.** The CLI+  forwards it as a top-level `aiThread` field in the JSON it POSTs, so the+  server always knows the owning thread. No custom headers: the CLI flag+  and the `aiThread` JSON field are the whole mechanism.+- **Callers that skip the CLI** (a raw curl during debugging) pass the same+  `aiThread` field in the request body themselves.+- **Read-only verbs and endpoints stay open** (`state`, `console`,+  `settings`, `version`): observation and debugging are never gated.+- **Precedence** (mirror ab): an explicit `aiThread` in the call's args,+  then the `--ai-thread` flag, then the `ADOM_AI_THREAD` env var. The env+  var is acceptable ONLY in single-agent containers (CI, dedicated boxes):+  in a shared container every concurrent thread would claim the same name,+  which is worse than no name at all.++## The refusal (see also app-creator-reason-gating)++A state-changing call with no ai-thread name gets a teaching refusal. The+caller is an AI; the error text is a prompt it will read and obey:++```json+{+  "ok": false,+  "errorCode": "caller_identity_required",+  "error": "This app requires every AI caller to give its ai-thread name.",+  "hint": "Re-run with the global flag: <app> --ai-thread \"<name>\" <verb>, or add a top-level \"aiThread\" field if you are POSTing directly. Pick a short name a HUMAN would recognize for THIS conversation (like 'kicad board review', not 'agent' or a UUID) and reuse it on every call to every Adom tool."+}+```++Keep the exact code `caller_identity_required`: ab established it, and+callers already know what it means and how to fix it.++## Good ai-thread names++The name is shown to a human deciding whether to trust what is happening.++- Good: `chip-fetcher tab 3`, `kicad board review`, `nightly wiki sync`+- Bad: `claude`, `agent`, `session_1`, a UUID++What the work is, plus which tab, if several do the same thing. If the user+has told the AI what they call the conversation, those words win.++## The ai-thread name is never authorization++It is self-reported. Record it, display it, key state by it, and never+verify or trust it: it exists for attribution, logging, and instance+management. Do not grant any privilege based on it, and never present it to+the user as proof of anything.++## Passing it along++When your app calls another Adom tool on behalf of a thread, hand the same+name onward: shell out with `--ai-thread "<the name you were given>"` (ab,+pup, and every lifecycle-following app accept it). When your server acts on+its OWN behalf (health poll, reaper, cleanup), use your app's own name+(`hero-studio housekeeping`), never a stale thread name from an earlier+request. If you are implementing a full ab bridge, ab's delegation headers+apply; that contract lives in `adom-bridge-caller-identity`.++## Implementation (Node, drop-in)++```js+const READ_ONLY = new Set(['/state', '/console', '/settings', '/events', '/version']);+function requireAiThread(req, res, body) {+  if (req.method === 'GET' || READ_ONLY.has(req.url.split('?')[0])) return null;+  const name = (body && body.aiThread) || '';+  if (name) { req.aiThread = String(name); return null; }+  res.writeHead(400, { 'Content-Type': 'application/json' });+  res.end(JSON.stringify({ ok: false, errorCode: 'caller_identity_required',+    error: 'This app requires every AI caller to give its ai-thread name.',+    hint: 'Re-run with the global flag: <app> --ai-thread "<name>" <verb>, or add a top-level "aiThread" field if POSTing directly. Use a short human-recognizable name for THIS conversation and reuse it everywhere.' }));+  return true;  // handled+}+```++And in the CLI: accept `--ai-thread` as a global flag (any position, every+verb, like `--target` in adom-bridge-cli), merge it into the JSON body of+every request as `aiThread`, and error locally with the same hint if it is+missing, so the round trip is saved.++Log every accepted call as `thread "<name>": <verb>` in the console ring+buffer, and key registry entries and snapshots by the name+(`app-creator-server-lifecycle`). Gated verbs additionally want a `reason`;+that is a separate contract with its own refusal: `app-creator-reason-gating`.
skills/app-creator-live-channel/SKILL.md+1−1
@@ -104,7 +104,7 @@ Every CLI verb that touches the UI is a thin HTTP client:  There is NO separate AI remote-control channel (main skill ยง7a): the CLI hits the same endpoints the UI's own buttons hit, carrying its caller-identity (`app-creator-caller-identity`), and the SSE push is how the open+identity (`app-creator-ai-thread-name`), and the SSE push is how the open page finds out. Test before shipping: run the CLI verb from a terminal and watch the open page react without being touched. If it does not, the page is keeping local state that belongs on the server.
skills/app-creator-reason-gating/SKILL.md+1−1
@@ -111,7 +111,7 @@ function requireReason(req, res, body, what, alternative) { //   'If the user did not ask to see it, flash the taskbar instead.') ``` -Pair with `app-creator-caller-identity` (who) and surface both in the audit+Pair with `app-creator-ai-thread-name` (who is asking) and surface both in the audit trail. For which surfaces default to background and how to signal instead of foregrounding, see `app-creator-surfaces` and the `foreground-etiquette` skill.
skills/app-creator-server-lifecycle/SKILL.md+1−1
@@ -29,7 +29,7 @@ manage themselves.** A `/shutdown` endpoint that a well-behaved caller is supposed to hit is not a lifecycle plan. These four rules are.  (Who is calling, and how to refuse anonymous or unjustified calls, are the-sibling skills `app-creator-caller-identity` and `app-creator-reason-gating`.+sibling skills `app-creator-ai-thread-name` and `app-creator-reason-gating`. This skill assumes every instance knows its owning thread.)  ## Rule 1: Idle self-shutdown (the reaper), default 24 hours
uninstall.sh+1−1
@@ -1,7 +1,7 @@ #!/bin/bash set -e rm -rf "$HOME/.claude/skills/app-creator"-for sub in caller-identity reason-gating server-lifecycle settings surfaces live-channel; do+for sub in ai-thread-name caller-identity reason-gating server-lifecycle settings surfaces live-channel; do  # caller-identity kept to clean 1.3.0 installs   rm -rf "$HOME/.claude/skills/app-creator-$sub" done echo "Uninstalled app-creator (+ sub-skills)"