[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79RVVM1HM78ZX9K1HY3NQSQ":3,"skill-same:01M79RVVM1HM78ZX9K1HY3NQSQ":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M79RVVM1HM78ZX9K1HY3NQSQ","tk-studio-engage",null,"The planner leg of an engagement — `reply` reads the engagement's memory (the record, the chat so far, the plan under `_bmad-output\u002Fplanning-artifacts\u002F`, `kb\u002F` and `kb\u002Fconfluence\u002F`) and writes the planner's reply line, with optional proposals the owner can press, to the engagement's `chat.jsonl`; `questions` writes at most three multiple-choice clarifying questions, each with a default, for the owner's inbox; `scope` writes and publishes the scope of work; `quote` prices the scope as a seeded 50\u002F85\u002F95 band with a hard cap from the studio's own history and proposes `go`; `closeout` (run by the supervisor once the engagement's last run ends, never by the planner) writes and publishes the delivery report; `studio-reply` answers one line of the studio chat (`studiochat.py`) with proposals. Use when a supervisor `engagement-chat` or `studio-chat` payload names this skill, or the user says \"reply in the engagement chat\" or \"tk engage reply\".","thkennedy\u002Ftk-studio","thkennedy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F4164502?v=4","01M79QZ8DMP5FF2HC6GS3S6FDF","Tim Kennedy","01M79QZ8EM9JBWJ15R5JNC4PW3",0,"MIT","https:\u002F\u002Fgithub.com\u002Fthkennedy\u002Ftk-studio\u002Fblob\u002Fmain\u002Fplugins\u002Ftk-studio\u002Fskills\u002Ftk-studio-engage\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: tk-studio-engage\ndescription: The planner leg of an engagement — `reply` reads the engagement's memory (the record, the chat so far, the plan under `_bmad-output\u002Fplanning-artifacts\u002F`, `kb\u002F` and `kb\u002Fconfluence\u002F`) and writes the planner's reply line, with optional proposals the owner can press, to the engagement's `chat.jsonl`; `questions` writes at most three multiple-choice clarifying questions, each with a default, for the owner's inbox; `scope` writes and publishes the scope of work; `quote` prices the scope as a seeded 50\u002F85\u002F95 band with a hard cap from the studio's own history and proposes `go`; `closeout` (run by the supervisor once the engagement's last run ends, never by the planner) writes and publishes the delivery report; `studio-reply` answers one line of the studio chat (`studiochat.py`) with proposals. Use when a supervisor `engagement-chat` or `studio-chat` payload names this skill, or the user says \"reply in the engagement chat\" or \"tk engage reply\".\n---\n\n# tk-studio-engage\n\nThe owner talks to the studio about one engagement through the supervisor's\nown chat route (design spec §6.4, D2; user flow F2 step 1). Each owner line\nqueues one run of the shipped one-shot `engagement-chat` job: a `claude -p`\nsession of the planner leg, on the host, in the run's worktree, with this\nplugin; it reads and writes the served project's root (the payload's\n`project_root`, where `chat.jsonl` and the record live untracked). The session answers from the project's memory and writes its\nreply through this surface. **The planner moves nothing**: it holds no\nbearer and no CSRF token, it never sends a typed input, and nothing it\nwrites changes the engagement's state. A proposal is a button the owner\npresses through the supervisor's `POST \u002Fengagements\u002F{id}\u002Finput`.\n\n## Behavior (both modes)\n\n1. Read the memory through the plugin root:\n\n   ```bash\n   uv run \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fengage.py\" reply --directory \u003Cproject-root> \\\n     --engagement \u003CENG-NNN>\n   ```\n\n   The result is `{ok, dry_run, engagement, mode: \"memory\", record, chat[],\n   memory {plan, kb, confluence}, scope, notes[], written[]}` with the\n   status block last. `scope` (Story 32.4) is the engagement's current\n   `scope.md` as `{path, text}`, or `null` while none is written: read it\n   before writing a new scope, since an owner edit in Confluence or a\n   `revise` body may have replaced it since your last turn. `record` is the engagement record (`engagement.yaml`, JSON text);\n   `chat[]` every chat line so far; each `memory` entry an index `{root,\n   files: [{path, bytes, title}], truncated}` of\n   `_bmad-output\u002Fplanning-artifacts\u002F`, `kb\u002F` (without `kb\u002Fconfluence\u002F`) and\n   `kb\u002Fconfluence\u002F` (the synced Confluence pages), root-relative, sorted,\n   capped. The index never carries a file's body: read the files the turn\n   needs. Every indexed `path` is relative to the served root (the\n   payload's `project_root`, the same value passed as `--directory`), not\n   to the session's cwd: read each file at `\u003Cproject_root>\u002F\u003Cpath>`, never\n   relative to the run's worktree (the untracked `kb\u002Fconfluence\u002F` and any\n   uncommitted plan edits exist only under the served root).\n\n2. Write the reply:\n\n   ```bash\n   uv run \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fengage.py\" reply --directory \u003Cproject-root> \\\n     --engagement \u003CENG-NNN> --body-file \u003Cpath> [--proposals-file \u003Cpath>] \\\n     --run-id \u003Crun_id> [--dry-run]\n   ```\n\n   The body (at most 32 KiB UTF-8) comes from a file, never the command\n   line. The proposals file is a JSON array of `{verb, payload, label}`:\n   `verb` one of `answer`, `go`, `revise`, `question`, `approve`, `cancel`;\n   `payload` that verb's typed payload (`answer {answers: {\u003Cquestion id>:\n   \u003Coption>}}`, `go {cap?}`, `revise {body?}`, `question {text}`, `approve\n   {autonomy: ask | steady | full, base_ref?}`, `cancel {reason?}`, no other\n   field); `label` the button's text, at most 80 characters. The line\n   `{seq, at, author: \"planner\", body, run_id, proposals[]}` is appended\n   under the chat lock with the next `seq`. The result is `{ok, dry_run,\n   engagement, mode: \"write\", line, notes[], written[]}` with the status\n   block last.\n\n   Payload mapping (the `engagement-chat` job's payload is `{verb: \"reply\",\n   engagement, project, project_root, seq, run_id}`): `project_root` (the\n   served registry root, where `chat.jsonl` and the record live untracked)\n   maps to `--directory` — never `directory`, which is the run's worktree;\n   `engagement` maps to `--engagement`, `run_id` (the queue run id) to\n   `--run-id`; `seq` is the owner line the turn answers.\n\n   **Session procedure for `payload.verb: reply`:** run mode 1; read the\n   owner's line `seq` and the chat before it; read the record (the state,\n   the request, the questions, the scope page, the quote) and whichever\n   plan, kb and Confluence files the question needs, each at\n   `\u003Cproject_root>\u002F\u003Cpath>` (the index's `path` joined to the payload's\n   `project_root`, never to the cwd or the worktree); answer in plain\n   language, naming the files you relied on. Story 32.8: when the record's\n   `inputs[]` holds an owner `question` line (verb `question`, `payload\n   {text}`, source `bearer` or `cookie`) newer than your last chat line (the\n   newest `author: \"planner\"` line's `at`), answer the newest such question\n   in this reply — the owner's `question` moves no state and mints no turn of\n   its own; your next turn is its answer. When a typed input would move\n   the engagement on (for example `go` in `intake`), offer it as a proposal\n   rather than taking it. Write the body and the proposals to temp files\n   and run mode 2 with the payload's `run_id`. End on the status block;\n   commit nothing.\n\n3. Ask clarifying questions (Story 32.3, user flow F2 step 2) — only in\n   `intake`, and only when the turn finds gaps that **no default can\n   cover**: a choice the scope or the quote turns on and the memory does not\n   settle. Ask **at most three**; each has options and exactly one default.\n   When a sensible default covers a gap, do not ask: proceed on it and state\n   it as an assumption in the reply. Write the questions to a temp file (a\n   JSON array) and run:\n\n   ```bash\n   uv run \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fengage.py\" questions --directory \u003Cproject_root> \\\n     --engagement \u003CENG-NNN> --run-id \u003Crun_id> --questions-file \u003Cpath> [--dry-run]\n   ```\n\n   Each question is `{id, text, options: [{label, default?: true}],\n   impact}`: `id` matching `^[a-z0-9][a-z0-9-]{0,15}$` and unique, `text`\n   the question, `impact` what the answer changes (the scope, the quote),\n   2 to 6 options with unique labels and exactly one `\"default\": true`.\n   `--directory` is the payload's `project_root` (never the worktree),\n   `--run-id` the payload's `run_id`. It writes\n   `_bmad-output\u002Fengagements\u002F\u003Cid>\u002Fquestions.json`; the planner still moves\n   no state: when the run ends, the supervisor applies the file\n   (`intake → awaiting-answers`, recorded with source `planner` and the run\n   id), puts the questions in the owner's inbox (one Jira issue per\n   engagement) and reads the answers back. Then write the reply (mode 2)\n   telling the owner what you asked and why. Its refusals (exit 2), each\n   named: `TooManyQuestions` (a fourth), `QuestionInvalid` (naming the\n   index), `NotIntake`, `EngagementClosed`, `RunIdRequired`, plus the\n   record's (`BadEngagement`, `UnknownEngagement`,\n   `EngagementRecordUnreadable`) and an unreadable `--questions-file`. A dry\n   run writes nothing and ends `partial`.\n\n4. Write the scope of work (Story 32.4, user flow F2 step 3) — only in\n   `scoping`. Write `_bmad-output\u002Fengagements\u002F\u003Cid>\u002Fscope.md` (or a temp\n   file) with these `##` sections, in this order, each non-empty:\n\n   1. `## Goal`\n   2. `## Deliverables` — each deliverable a `### \u003Ctitle>` holding a line\n      that starts `Acceptance signal:` (or `**Acceptance signal:**` \u002F\n      `**Acceptance signal**:`) followed by how the owner will know\n      it is done. Keep the signal on its own paragraph (a blank line before\n      it).\n   3. `## Exclusions`\n   4. `## What the studio needs from you` — a list; each item carries the\n      date it is needed by, `YYYY-MM-DD`.\n   5. `## Milestones`\n   6. `## Proposed epics and stories` — `### Epic \u003Ck>: \u003Ctitle>` and\n      `#### Story \u003Ck>.\u003Cm>: \u003Ctitle>`, each story in `epics.md`'s shape (the\n      `As a … \u002F I want … \u002F So that …` lines and `**Acceptance Criteria:**`);\n      the numbers are local (approval renumbers them); at least one story.\n   7. `## Assumptions` (last; required when the record's `assumptions[]` is\n      non-empty) — name each assumption's `question` id.\n\n   A `#` title before `## Goal` is fine; no other `##` section and no image.\n   Then publish it:\n\n   ```bash\n   uv run \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fengage.py\" scope --directory \u003Cproject_root> \\\n     --engagement \u003CENG-NNN> [--scope-file \u003Cpath>] \\\n     [--brief-file \u003Cpath> --gdd-file \u003Cpath>] [--dry-run]\n   ```\n\n   On a game project do step 4a first: this one `scope` call then carries\n   `--brief-file` and `--gdd-file` (a game project's call without them is\n   refused); on any other project never pass them.\n\n   `--scope-file` defaults to the engagement's own `scope.md`. It checks the\n   shape, writes `scope.md` (under `scope.lock`), publishes it as the page\n   `ENG-NNN: Scope of Work` in the Confluence folder `Engagements\u002FENG-NNN`\n   (with the provenance footer; an unchanged scope on a page still at the\n   recorded version is `skipped`, an owner's unmirrored edit is overwritten) and\n   records `scope_page {id, url, version}` in the record. The result is\n   `{ok, dry_run, engagement, mode: \"scope\", source, scope, page {id, url,\n   version, action: created | updated | skipped}, written[], notes[]}` with\n   the status block last. The proposed epics and stories are **not** plan\n   entities: nothing is written under `plan\u002F`,\n   `_bmad-output\u002Fplanning-artifacts\u002F` or `.tk-studio\u002F` until the owner\n   approves (32.6). While `scoping` the page is the owner's to edit (D9):\n   an edit there (mirrored by the next sync-back) or a `revise` body from\n   the Chat screen replaces `scope.md` wholesale, unchecked — read `scope`\n   from the memory first and rewrite it into shape on your next turn. The\n   supervisor runs `engage.py scope --revise-at \u003Cat>` itself for a `revise`\n   body; the planner never does. Its refusals (exit 2), each named:\n   `DeliverableWithoutSignal: \u003Ctitle>`, `ScopeInvalid: \u003Cwhat>` (a section\n   missing, empty, out of order or unknown; an undated dependency; no\n   proposed story; an image), `AssumptionUnstated: \u003Cquestion id>`,\n   `NotScoping`, `EngagementClosed`, `ReviseNotFound`, `ConfluenceUnbound`\n   (no `planning.confluence.space_id`), `ConfluenceEnvMissing` (an absent\n   agent-seat variable, named), `PublishRefused`, `ScopeUnwritable:\n   \u003Cpath>: \u003Cerror>` (`scope.md`, the record or `scope.lock` refused by the\n   OS; `written` names what had already landed), plus the record's; a\n   held `scope.lock` (`ScopeBusy`), a 429 or a 5xx ends `partial` with\n   `retry: true` (`scope.md` kept, `scope_page` unchanged): run it again.\n   Then write the reply (mode 2) with the page's link.\n\n4a. A game project's brief and GDD (Story 34.8, user flow F9) — only in\n   `scoping`, before step 4's `scope` call. A game project is one\n   whose tracked `.tk-studio\u002Fconfig.yaml` `working_set` has any role's list\n   holding `gds` or an entry starting `gds-`, and whose\n   `_bmad\u002F_config\u002Fmanifest.yaml` lists the `gds` module (Story 36.6; the\n   plugin-shipped `gds-engine-godot-4` alone is not enough); `engage.py`\n   decides it (the\n   `scope` result's `game`), so never guess: a game project's `scope`\n   without both docs is refused `GameDocsMissing: brief | gdd`, and the\n   flags on any other project are refused `NotAGameProject` (exit 2). In\n   quick flow, in this order:\n\n   1. Run `gds-create-game-brief` (create intent) on its **Fast path**:\n      batch the gaps into one consolidated pass and draft the full brief\n      with `[ASSUMPTION]` tags where you inferred, from the record, the\n      chat and the answers. Unattended (this `claude -p` session), run it\n      per the skill's `## Headless Mode`: never ask; halt `blocked` if the\n      intent is ambiguous.\n   2. Then run `gds-gdd` (create intent) on its **Express** path, from that\n      brief: resolve the critical gaps in one short batch, then draft the\n      full GDD at once; unattended, per its `## Headless Mode`\n      (`references\u002Fheadless.md`).\n   3. Write `scope.md` (step 4's shape) and make step 4's one `scope`\n      call with the docs: `engage.py scope … --brief-file \u003Cbrief.md>\n      --gdd-file \u003Cgdd.md>`, never a call without them first. The\n      docs land as `_bmad-output\u002Fengagements\u002F\u003Cid>\u002Fbrief.md` and `gdd.md` and\n      are published beside the scope in `Engagements\u002FENG-NNN` as `ENG-NNN:\n      Game Brief` and `ENG-NNN: GDD`; the record gains `brief_page`,\n      `gdd_page` (`{id, url, version}`, shaped like `scope_page`) and\n      `game: true`, which makes approval (32.6) mint the epics' `run-epic-N`\n      jobs as `type: run-vertical-slice`. A `revise` re-run (`--revise-at`,\n      the supervisor's) of a scope already published keeps whatever doc\n      pages the record holds. Put the three page links in the reply.\n\n5. Quote the scope (Story 32.5, user flow F2 step 4) — only in `scoping`,\n   on the turn after the scope is written (or by hand):\n\n   ```bash\n   uv run \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fengage.py\" quote --directory \u003Cproject_root> \\\n     --engagement \u003CENG-NNN> [--seed N] [--dry-run]\n   ```\n\n   It counts the proposed stories of `scope.md` by their headings, reads\n   the project's structured meter records from the store's ledgers, and\n   resamples their per-story tokens and dollars over that count: a seeded\n   bootstrap (10,000 resamples) giving `band50`, `band85` and `band95`, each\n   `{tokens, usd, share}` (`share` over the user config's\n   `plan.window_tokens`, else `\"share unknown\"`), and `cap = p95 + one story\n   at p85` in USD. Under eight metered stories the band says \"thin history\"\n   (`basis.thin`) and is widened ×1.5 from the Opus 5.5 trial's per-story\n   dollars; with none, the tokens are `null` and the dollars carry. It\n   merges `quote {band50, band85, band95, cap, basis, computed_at}` into\n   the record (`basis` names the seed, the history, the route, the\n   autonomy levels on offer, `planning_usd` and `scoping_billable`, and\n   `at_cap`: the run pauses `partial`, the engagement's issue blocks with\n   the figures, the owner decides) with each proposed epic's p85 dollars\n   as `basis.epics[].usd_estimate`; `.tk-studio\u002Fbudget-bands.yaml` is\n   neither read nor written (approve copies the figures onto the minted\n   EP ids). **The state does not move**: write the\n   reply (mode 2) stating the band, the cap and what happens at the cap,\n   never a bare number (say \"thin history\" when `basis.thin`), with the\n   proposal `{\"verb\": \"go\", \"payload\": {}, \"label\": \"Accept the quote\"}`;\n   the owner's `go` moves `scoping → quoted`. A `revise` voids the quote\n   (`quote: null`), and so does any replaced `scope.md` while `scoping`\n   (your `scope`, a `revise` body, or the owner's page edit mirrored by\n   the sync-back voids a non-null `quote` first, before `scope.md` is\n   replaced; a void that fails leaves `scope.md` untouched — your `scope`\n   refuses `ScopeUnwritable`, the sync-back retries on its next tick; a\n   page save whose text equals `scope.md` keeps the quote): quote again\n   after the new scope. `--seed` is an integer `0 \u003C= N \u003C 2**53` (default\n   the first 6 bytes of `sha256(\"\u003Cengagement>:\u003Cn>\")`). Its refusals\n   (exit 2), each named: `BadSeed` (a `--seed` out of that range),\n   `NotScoping`, `EngagementClosed`, `NoScope` (no\n   `scope.md`, no proposed story, a repeated `### Epic \u003Ck>` number, or\n   proposed epics not numbered 1..m in order), `PricesUnreadable` (an\n   unreadable `prices.json` or an unpriced route model), `QuoteUnwritable`\n   (the record refused by the OS, an unreadable `measurements\u002F`, or\n   `scope.lock is held` — the quote holds it from reading `scope.md` through the merge;\n   `written` names what had landed), plus the record's.\n   A dry run writes nothing and ends `partial`.\n\n6. Close out (Story 32.8, user flow F2 steps 7 to 9) — **the supervisor's\n   verb, never the planner's**: the supervisor's closeout pass runs it on\n   the host once the engagement's last run ended (in `in-progress` or\n   `partial`), with its own composition of the runs, the landed stories,\n   their specs and PRs, the declared epics, the side exits, the spend and\n   the quote written to a temp file:\n\n   ```bash\n   uv run \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fengage.py\" closeout --directory \u003Cproject_root> \\\n     --engagement \u003CENG-NNN> --input-file \u003Cpath> [--dry-run]\n   ```\n\n   It judges each `### \u003Ctitle>` of `scope.md`'s `## Deliverables` against\n   its stories (`done` when each landed with `spec_status: done` and its PR\n   is `MERGED`; else `not done —` `no acceptance signal`, `epic not run`,\n   `story \u003Ckey> not landed` or `PR \u003Curl> not merged`), writes\n   `_bmad-output\u002Fengagements\u002F\u003Cid>\u002Fcloseout.md` (`Outcome`, `Deliverables`,\n   `Pull requests`, `Cost per story`, `Spend`, `Quote against actual`,\n   `Side exits`), publishes it as `ENG-NNN: Closeout` beside the scope page\n   (`page: null` with a note when the project has no Confluence binding)\n   and merges `closeout {path, page, outcome, done, not_done, run_id, at}`\n   into the record. The state does not move here: the supervisor then\n   applies `run-ended` (`delivered`, `partial` or `failed`), moves the\n   engagement's issue to `Done` and sends one notifier line. Its refusals\n   (exit 2): `NoScope`, `EngagementRecordUnreadable`,\n   `CloseoutInputInvalid`, `NotInProgress`, `EngagementClosed`, plus the\n   record's; a 429, a 5xx or an OS refusal ends `partial` with `retry:\n   true`. A change after `delivered` is a new engagement\n   (`POST \u002Fengagements {project, request, follows: ENG-NNN}`) with its own\n   scope and quote.\n\n7. Blocking conditions (exit 2), each named in `reason`: `BadEngagement`\n   (not like `ENG-001`), `UnknownEngagement` (no record),\n   `EngagementRecordUnreadable` (not JSON, or not this engagement's record),\n   `EngagementClosed` (`delivered`, `failed` or `cancelled`), `BodyEmpty`,\n   `BodyTooLarge`, `RunIdRequired`, `ProposalInvalid` (naming the index),\n   `ChatBusy` (the chat lock held past the wait), `ChatUnwritable` (the\n   chat not UTF-8, or the lock or chat file refused by the OS), an unreadable\n   `--body-file` or `--proposals-file`. Nothing is appended on a refusal; a\n   dry run appends nothing and ends `partial`.\n\n8. Report:\n   - **Attended:** show the reply line and its proposals.\n   - **Headless:** no prompts (AD-11). Relay the core's `status`, `reason`\n     and `artifacts` as they are — never infer the status from the exit\n     code (`partial` exits 0):\n\n     ```json\n     {\"status\": \"complete\", \"intent\": \"tk-studio-engage\", \"artifacts\": [], \"reason\": null}\n     ```\n\nIf the deterministic core is unrunnable — a tool call denied by permissions, `uv`\u002Fpython unavailable — end `blocked` with the status block naming the unrunnable core as `reason`: never a question, never a headless run that ends without the block (AD-11).\n\n## The studio chat: studio-reply (Story 39.3)\n\nThe owner's chat at `\u002Fapp\u002Fchat` is a conversation with the studio, not with\nan engagement (design addendum 2026-11-07 §3.8, AD-11). Each owner line\nqueues one run of the shipped one-shot `studio-chat` job: a `claude -p`\nsession of the planner leg, on the host, with this plugin and the payload\n`{verb: \"studio-reply\", project, project_root, seq, run_id}`. The session\nruns the `tk-studio-orchestrator` core headless and answers one line. It\nmoves no state, holds no bearer and no CSRF token, and commits nothing: an\naction is a proposal, a button the owner presses.\n\n1. **Read the context** (read-only):\n\n   ```bash\n   uv run \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fstudiochat.py\" context \\\n     --directory \u003Cproject_root> --seq \u003Cseq>\n   ```\n\n   The result is `{ok, dry_run, mode: \"context\", seq, line, chat[], reads,\n   routing, voice, shell?, not_yet[], notes[], written[]}` with the status\n   block last: `line` the owner's line, `chat[]` the last 40 lines of\n   `_bmad-output\u002Ftracking\u002Fstudio-chat.jsonl` up to it, `reads` the\n   supervisor's reads written at post time (`studio-chat-reads\u002F\u003Cseq>.json`:\n   the board, the office, the status and live runs, the project's last ten\n   runs with their ledger cost, the inbox — what `GET \u002Fboard`, `GET \u002Foffice`,\n   `GET \u002Fstatus`, `GET \u002Fruns\u002F{id}` and `GET \u002Finbox` answer), or `null` with\n   a note; `routing` the orchestrator core's own answer, exactly what\n   `orchestrate.py resolve --directory \u003Cproject_root>` prints; `voice`\n   `council` when the line names the council, else `plain`; `shell` the\n   council persona shell, present only for the council voice. Refusals:\n   `UnknownLine` (no owner line `seq`), `ChatUnreadable`.\n\n2. **Handle the outcome.** `routing.outcome` `needs-onboarding` ends\n   `blocked` naming `routing.gaps[]` (the orchestrator's headless rule;\n   never invent a working set). Otherwise answer the line from `reads` and\n   the routing's framing: \"what is running\" costs a read, never a plan. Use\n   the plain studio voice; the council shell is presentation only, used\n   when `voice` is `council`, and never changes the routing.\n\n3. **Emit the reply** once, between `\u003Creply>` and `\u003C\u002Freply>`, before the\n   record is written: the supervisor streams the text between the markers\n   to the page as it is produced. The status block (step 4) is still the\n   session's last output (AD-11).\n\n4. **Write the record** with the same text (UTF-8 files, never the command\n   line):\n\n   ```bash\n   uv run \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fstudiochat.py\" reply \\\n     --directory \u003Cproject_root> --seq \u003Cseq> --run-id \u003Crun_id> \\\n     --body-file \u003Cpath> [--proposals-file \u003Cpath>] [--dry-run]\n   ```\n\n   It appends `{seq, at, author: \"planner\", body, run_id, reply_to,\n   proposals[]}` (`reply_to` the owner line's `seq`; one reply per line).\n   `proposals[]` is at most 6 objects `{kind, label (1–80)}` plus the\n   kind's fields and no other: `queue {project, job}`, `answer {id,\n   letter, note, issue}` (`id` the question's id as its inbox item asks\n   it, `letter` A–Z, `note` possibly empty, `issue` the inbox item's key),\n   `open {route}` (a page under `\u002Fapp`), `engagement {title}`.\n   `stop-after-story` and `open-studio` are refused by name\n   (`ProposalNotYet: \u003Ckind> lands in Story 39.7`): drop them and say in the\n   body that the action arrives with Story 39.7. Its other refusals (exit\n   2): `BodyEmpty`, `BodyTooLarge`, `RunIdRequired`, `UnknownLine`,\n   `AlreadyAnswered`, `ProposalInvalid: \u003Cindex>: \u003Cwhy>`, `ChatBusy`,\n   `ChatUnwritable`. Relay the status block as in step 8 above.\n\n## Rules\n\n- The planner never moves state, never sends an input, and never holds a\n  bearer or a CSRF token; its session runs with a worker's environment\n  (every `TK_SUPERVISOR_*` secret and the owner seat stripped).\n- The only files written are the engagement's `chat.jsonl`, one line per\n  reply, its `questions.json` (Story 32.3), and its `scope.md` with the\n  record's `scope_page` and the Confluence scope page (Story 32.4), and the\n  record's `quote` (Story 32.5; its `basis.epics[].usd_estimate`, never\n  `.tk-studio\u002Fbudget-bands.yaml`); the supervisor's `closeout` (Story 32.8) writes\n  `closeout.md`, its Confluence page and the record's `closeout`; the\n  studio chat's reply (Story 39.3) is one line of\n  `_bmad-output\u002Ftracking\u002Fstudio-chat.jsonl`; nothing\n  is committed, nothing is promoted.\n- All paths resolve through `${CLAUDE_PLUGIN_ROOT}`.\n","# tk-studio-engage\n\nThe owner talks to the studio about one engagement through the supervisor's\nown chat route (design spec §6.4, D2; user flow F2 step 1). Each owner line\nqueues one run of the shipped one-shot `engagement-chat` job: a `claude -p`\nsession of the planner leg, on the host, in the run's worktree, with this\nplugin; it reads and writes the served project's root (the payload's\n`project_root`, where `chat.jsonl` and the record live untracked). The session answers from the project's memory and writes its\nreply through this surface. **The planner moves nothing**: it holds no\nbearer and no CSRF token, it never sends a typed input, and nothing it\nwrites changes the engagement's state. A proposal is a button the owner\npresses through the supervisor's `POST \u002Fengagements\u002F{id}\u002Finput`.\n\n## Behavior (both modes)\n\n1. Read the memory through the plugin root:\n\n   ```bash\n   uv run \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fengage.py\" reply --directory \u003Cproject-root> \\\n     --engagement \u003CENG-NNN>\n   ```\n\n   The result is `{ok, dry_run, engagement, mode: \"memory\", record, chat[],\n   memory {plan, kb, confluence}, scope, notes[], written[]}` with the\n   status block last. `scope` (Story 32.4) is the engagement's current\n   `scope.md` as `{path, text}`, or `null` while none is written: read it\n   before writing a new scope, since an owner edit in Confluence or a\n   `revise` body may have replaced it since your last turn. `record` is the engagement record (`engagement.yaml`, JSON text);\n   `chat[]` every chat line so far; each `memory` entry an index `{root,\n   files: [{path, bytes, title}], truncated}` of\n   `_bmad-output\u002Fplanning-artifacts\u002F`, `kb\u002F` (without `kb\u002Fconfluence\u002F`) and\n   `kb\u002Fconfluence\u002F` (the synced Confluence pages), root-relative, sorted,\n   capped. The index never carries a file's body: read the files the turn\n   needs. Every indexed `path` is relative to the served root (the\n   payload's `project_root`, the same value passed as `--directory`), not\n   to the session's cwd: read each file at `\u003Cproject_root>\u002F\u003Cpath>`, never\n   relative to the run's worktree (the untracked `kb\u002Fconfluence\u002F` and any\n   uncommitted plan edits exist only under the served root).\n\n2. Write the reply:\n\n   ```bash\n   uv run \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fengage.py\" reply --directory \u003Cproject-root> \\\n     --engagement \u003CENG-NNN> --body-file \u003Cpath> [--proposals-file \u003Cpath>] \\\n     --run-id \u003Crun_id> [--dry-run]\n   ```\n\n   The body (at most 32 KiB UTF-8) comes from a file, never the command\n   line. The proposals file is a JSON array of `{verb, payload, label}`:\n   `verb` one of `answer`, `go`, `revise`, `question`, `approve`, `cancel`;\n   `payload` that verb's typed payload (`answer {answers: {\u003Cquestion id>:\n   \u003Coption>}}`, `go {cap?}`, `revise {body?}`, `question {text}`, `approve\n   {autonomy: ask | steady | full, base_ref?}`, `cancel {reason?}`, no other\n   field); `label` the button's text, at most 80 characters. The line\n   `{seq, at, author: \"planner\", body, run_id, proposals[]}` is appended\n   under the chat lock with the next `seq`. The result is `{ok, dry_run,\n   engagement, mode: \"write\", line, notes[], written[]}` with the status\n   block last.\n\n   Payload mapping (the `engagement-chat` job's payload is `{verb: \"reply\",\n   engagement, project, project_root, seq, run_id}`): `project_root` (the\n   served registry root, where `chat.jsonl` and the record live untracked)\n   maps to `--directory` — never `directory`, which is the run's worktree;\n   `engagement` maps to `--engagement`, `run_id` (the queue run id) to\n   `--run-id`; `seq` is the owner line the turn answers.\n\n   **Session procedure for `payload.verb: reply`:** run mode 1; read the\n   owner's line `seq` and the chat before it; read the record (the state,\n   the request, the questions, the scope page, the quote) and whichever\n   plan, kb and Confluence files the question needs, each at\n   `\u003Cproject_root>\u002F\u003Cpath>` (the index's `path` joined to the payload's\n   `project_root`, never to the cwd or the worktree); answer in plain\n   language, naming the files you relied on. Story 32.8: when the record's\n   `inputs[]` holds an owner `question` line (verb `question`, `payload\n   {text}`, source `bearer` or `cookie`) newer than your last chat line (the\n   newest `author: \"planner\"` line's `at`), answer the newest such question\n   in this reply — the owner's `question` moves no state and mints no turn of\n   its own; your next turn is its answer. When a typed input would move\n   the engagement on (for example `go` in `intake`), offer it as a proposal\n   rather than taking it. Write the body and the proposals to temp files\n   and run mode 2 with the payload's `run_id`. End on the status block;\n   commit nothing.\n\n3. Ask clarifying questions (Story 32.3, user flow F2 step 2) — only in\n   `intake`, and only when the turn finds gaps that **no default can\n   cover**: a choice the scope or the quote turns on and the memory does not\n   settle. Ask **at most three**; each has options and exactly one default.\n   When a sensible default covers a gap, do not ask: proceed on it and state\n   it as an assumption in the reply. Write the questions to a temp file (a\n   JSON array) and run:\n\n   ```bash\n   uv run \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fengage.py\" questions --directory \u003Cproject_root> \\\n     --engagement \u003CENG-NNN> --run-id \u003Crun_id> --questions-file \u003Cpath> [--dry-run]\n   ```\n\n   Each question is `{id, text, options: [{label, default?: true}],\n   impact}`: `id` matching `^[a-z0-9][a-z0-9-]{0,15}$` and unique, `text`\n   the question, `impact` what the answer changes (the scope, the quote),\n   2 to 6 options with unique labels and exactly one `\"default\": true`.\n   `--directory` is the payload's `project_root` (never the worktree),\n   `--run-id` the payload's `run_id`. It writes\n   `_bmad-output\u002Fengagements\u002F\u003Cid>\u002Fquestions.json`; the planner still moves\n   no state: when the run ends, the supervisor applies the file\n   (`intake → awaiting-answers`, recorded with source `planner` and the run\n   id), puts the questions in the owner's inbox (one Jira issue per\n   engagement) and reads the answers back. Then write the reply (mode 2)\n   telling the owner what you asked and why. Its refusals (exit 2), each\n   named: `TooManyQuestions` (a fourth), `QuestionInvalid` (naming the\n   index), `NotIntake`, `EngagementClosed`, `RunIdRequired`, plus the\n   record's (`BadEngagement`, `UnknownEngagement`,\n   `EngagementRecordUnreadable`) and an unreadable `--questions-file`. A dry\n   run writes nothing and ends `partial`.\n\n4. Write the scope of work (Story 32.4, user flow F2 step 3) — only in\n   `scoping`. Write `_bmad-output\u002Fengagements\u002F\u003Cid>\u002Fscope.md` (or a temp\n   file) with these `##` sections, in this order, each non-empty:\n\n   1. `## Goal`\n   2. `## Deliverables` — each deliverable a `### \u003Ctitle>` holding a line\n      that starts `Acceptance signal:` (or `**Acceptance signal:**` \u002F\n      `**Acceptance signal**:`) followed by how the owner will know\n      it is done. Keep the signal on its own paragraph (a blank line before\n      it).\n   3. `## Exclusions`\n   4. `## What the studio needs from you` — a list; each item carries the\n      date it is needed by, `YYYY-MM-DD`.\n   5. `## Milestones`\n   6. `## Proposed epics and stories` — `### Epic \u003Ck>: \u003Ctitle>` and\n      `#### Story \u003Ck>.\u003Cm>: \u003Ctitle>`, each story in `epics.md`'s shape (the\n      `As a … \u002F I want … \u002F So that …` lines and `**Acceptance Criteria:**`);\n      the numbers are local (approval renumbers them); at least one story.\n   7. `## Assumptions` (last; required when the record's `assumptions[]` is\n      non-empty) — name each assumption's `question` id.\n\n   A `#` title before `## Goal` is fine; no other `##` section and no image.\n   Then publish it:\n\n   ```bash\n   uv run \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fengage.py\" scope --directory \u003Cproject_root> \\\n     --engagement \u003CENG-NNN> [--scope-file \u003Cpath>] \\\n     [--brief-file \u003Cpath> --gdd-file \u003Cpath>] [--dry-run]\n   ```\n\n   On a game project do step 4a first: this one `scope` call then carries\n   `--brief-file` and `--gdd-file` (a game project's call without them is\n   refused); on any other project never pass them.\n\n   `--scope-file` defaults to the engagement's own `scope.md`. It checks the\n   shape, writes `scope.md` (under `scope.lock`), publishes it as the page\n   `ENG-NNN: Scope of Work` in the Confluence folder `Engagements\u002FENG-NNN`\n   (with the provenance footer; an unchanged scope on a page still at the\n   recorded version is `skipped`, an owner's unmirrored edit is overwritten) and\n   records `scope_page {id, url, version}` in the record. The result is\n   `{ok, dry_run, engagement, mode: \"scope\", source, scope, page {id, url,\n   version, action: created | updated | skipped}, written[], notes[]}` with\n   the status block last. The proposed epics and stories are **not** plan\n   entities: nothing is written under `plan\u002F`,\n   `_bmad-output\u002Fplanning-artifacts\u002F` or `.tk-studio\u002F` until the owner\n   approves (32.6). While `scoping` the page is the owner's to edit (D9):\n   an edit there (mirrored by the next sync-back) or a `revise` body from\n   the Chat screen replaces `scope.md` wholesale, unchecked — read `scope`\n   from the memory first and rewrite it into shape on your next turn. The\n   supervisor runs `engage.py scope --revise-at \u003Cat>` itself for a `revise`\n   body; the planner never does. Its refusals (exit 2), each named:\n   `DeliverableWithoutSignal: \u003Ctitle>`, `ScopeInvalid: \u003Cwhat>` (a section\n   missing, empty, out of order or unknown; an undated dependency; no\n   proposed story; an image), `AssumptionUnstated: \u003Cquestion id>`,\n   `NotScoping`, `EngagementClosed`, `ReviseNotFound`, `ConfluenceUnbound`\n   (no `planning.confluence.space_id`), `ConfluenceEnvMissing` (an absent\n   agent-seat variable, named), `PublishRefused`, `ScopeUnwritable:\n   \u003Cpath>: \u003Cerror>` (`scope.md`, the record or `scope.lock` refused by the\n   OS; `written` names what had already landed), plus the record's; a\n   held `scope.lock` (`ScopeBusy`), a 429 or a 5xx ends `partial` with\n   `retry: true` (`scope.md` kept, `scope_page` unchanged): run it again.\n   Then write the reply (mode 2) with the page's link.\n\n4a. A game project's brief and GDD (Story 34.8, user flow F9) — only in\n   `scoping`, before step 4's `scope` call. A game project is one\n   whose tracked `.tk-studio\u002Fconfig.yaml` `working_set` has any role's list\n   holding `gds` or an entry starting `gds-`, and whose\n   `_bmad\u002F_config\u002Fmanifest.yaml` lists the `gds` module (Story 36.6; the\n   plugin-shipped `gds-engine-godot-4` alone is not enough); `engage.py`\n   decides it (the\n   `scope` result's `game`), so never guess: a game project's `scope`\n   without both docs is refused `GameDocsMissing: brief | gdd`, and the\n   flags on any other project are refused `NotAGameProject` (exit 2). In\n   quick flow, in this order:\n\n   1. Run `gds-create-game-brief` (create intent) on its **Fast path**:\n      batch the gaps into one consolidated pass and draft the full brief\n      with `[ASSUMPTION]` tags where you inferred, from the record, the\n      chat and the answers. Unattended (this `claude -p` session), run it\n      per the skill's `## Headless Mode`: never ask; halt `blocked` if the\n      intent is ambiguous.\n   2. Then run `gds-gdd` (create intent) on its **Express** path, from that\n      brief: resolve the critical gaps in one short batch, then draft the\n      full GDD at once; unattended, per its `## Headless Mode`\n      (`references\u002Fheadless.md`).\n   3. Write `scope.md` (step 4's shape) and make step 4's one `scope`\n      call with the docs: `engage.py scope … --brief-file \u003Cbrief.md>\n      --gdd-file \u003Cgdd.md>`, never a call without them first. The\n      docs land as `_bmad-output\u002Fengagements\u002F\u003Cid>\u002Fbrief.md` and `gdd.md` and\n      are published beside the scope in `Engagements\u002FENG-NNN` as `ENG-NNN:\n      Game Brief` and `ENG-NNN: GDD`; the record gains `brief_page`,\n      `gdd_page` (`{id, url, version}`, shaped like `scope_page`) and\n      `game: true`, which makes approval (32.6) mint the epics' `run-epic-N`\n      jobs as `type: run-vertical-slice`. A `revise` re-run (`--revise-at`,\n      the supervisor's) of a scope already published keeps whatever doc\n      pages the record holds. Put the three page links in the reply.\n\n5. Quote the scope (Story 32.5, user flow F2 step 4) — only in `scoping`,\n   on the turn after the scope is written (or by hand):\n\n   ```bash\n   uv run \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fengage.py\" quote --directory \u003Cproject_root> \\\n     --engagement \u003CENG-NNN> [--seed N] [--dry-run]\n   ```\n\n   It counts the proposed stories of `scope.md` by their headings, reads\n   the project's structured meter records from the store's ledgers, and\n   resamples their per-story tokens and dollars over that count: a seeded\n   bootstrap (10,000 resamples) giving `band50`, `band85` and `band95`, each\n   `{tokens, usd, share}` (`share` over the user config's\n   `plan.window_tokens`, else `\"share unknown\"`), and `cap = p95 + one story\n   at p85` in USD. Under eight metered stories the band says \"thin history\"\n   (`basis.thin`) and is widened ×1.5 from the Opus 5.5 trial's per-story\n   dollars; with none, the tokens are `null` and the dollars carry. It\n   merges `quote {band50, band85, band95, cap, basis, computed_at}` into\n   the record (`basis` names the seed, the history, the route, the\n   autonomy levels on offer, `planning_usd` and `scoping_billable`, and\n   `at_cap`: the run pauses `partial`, the engagement's issue blocks with\n   the figures, the owner decides) with each proposed epic's p85 dollars\n   as `basis.epics[].usd_estimate`; `.tk-studio\u002Fbudget-bands.yaml` is\n   neither read nor written (approve copies the figures onto the minted\n   EP ids). **The state does not move**: write the\n   reply (mode 2) stating the band, the cap and what happens at the cap,\n   never a bare number (say \"thin history\" when `basis.thin`), with the\n   proposal `{\"verb\": \"go\", \"payload\": {}, \"label\": \"Accept the quote\"}`;\n   the owner's `go` moves `scoping → quoted`. A `revise` voids the quote\n   (`quote: null`), and so does any replaced `scope.md` while `scoping`\n   (your `scope`, a `revise` body, or the owner's page edit mirrored by\n   the sync-back voids a non-null `quote` first, before `scope.md` is\n   replaced; a void that fails leaves `scope.md` untouched — your `scope`\n   refuses `ScopeUnwritable`, the sync-back retries on its next tick; a\n   page save whose text equals `scope.md` keeps the quote): quote again\n   after the new scope. `--seed` is an integer `0 \u003C= N \u003C 2**53` (default\n   the first 6 bytes of `sha256(\"\u003Cengagement>:\u003Cn>\")`). Its refusals\n   (exit 2), each named: `BadSeed` (a `--seed` out of that range),\n   `NotScoping`, `EngagementClosed`, `NoScope` (no\n   `scope.md`, no proposed story, a repeated `### Epic \u003Ck>` number, or\n   proposed epics not numbered 1..m in order), `PricesUnreadable` (an\n   unreadable `prices.json` or an unpriced route model), `QuoteUnwritable`\n   (the record refused by the OS, an unreadable `measurements\u002F`, or\n   `scope.lock is held` — the quote holds it from reading `scope.md` through the merge;\n   `written` names what had landed), plus the record's.\n   A dry run writes nothing and ends `partial`.\n\n6. Close out (Story 32.8, user flow F2 steps 7 to 9) — **the supervisor's\n   verb, never the planner's**: the supervisor's closeout pass runs it on\n   the host once the engagement's last run ended (in `in-progress` or\n   `partial`), with its own composition of the runs, the landed stories,\n   their specs and PRs, the declared epics, the side exits, the spend and\n   the quote written to a temp file:\n\n   ```bash\n   uv run \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fengage.py\" closeout --directory \u003Cproject_root> \\\n     --engagement \u003CENG-NNN> --input-file \u003Cpath> [--dry-run]\n   ```\n\n   It judges each `### \u003Ctitle>` of `scope.md`'s `## Deliverables` against\n   its stories (`done` when each landed with `spec_status: done` and its PR\n   is `MERGED`; else `not done —` `no acceptance signal`, `epic not run`,\n   `story \u003Ckey> not landed` or `PR \u003Curl> not merged`), writes\n   `_bmad-output\u002Fengagements\u002F\u003Cid>\u002Fcloseout.md` (`Outcome`, `Deliverables`,\n   `Pull requests`, `Cost per story`, `Spend`, `Quote against actual`,\n   `Side exits`), publishes it as `ENG-NNN: Closeout` beside the scope page\n   (`page: null` with a note when the project has no Confluence binding)\n   and merges `closeout {path, page, outcome, done, not_done, run_id, at}`\n   into the record. The state does not move here: the supervisor then\n   applies `run-ended` (`delivered`, `partial` or `failed`), moves the\n   engagement's issue to `Done` and sends one notifier line. Its refusals\n   (exit 2): `NoScope`, `EngagementRecordUnreadable`,\n   `CloseoutInputInvalid`, `NotInProgress`, `EngagementClosed`, plus the\n   record's; a 429, a 5xx or an OS refusal ends `partial` with `retry:\n   true`. A change after `delivered` is a new engagement\n   (`POST \u002Fengagements {project, request, follows: ENG-NNN}`) with its own\n   scope and quote.\n\n7. Blocking conditions (exit 2), each named in `reason`: `BadEngagement`\n   (not like `ENG-001`), `UnknownEngagement` (no record),\n   `EngagementRecordUnreadable` (not JSON, or not this engagement's record),\n   `EngagementClosed` (`delivered`, `failed` or `cancelled`), `BodyEmpty`,\n   `BodyTooLarge`, `RunIdRequired`, `ProposalInvalid` (naming the index),\n   `ChatBusy` (the chat lock held past the wait), `ChatUnwritable` (the\n   chat not UTF-8, or the lock or chat file refused by the OS), an unreadable\n   `--body-file` or `--proposals-file`. Nothing is appended on a refusal; a\n   dry run appends nothing and ends `partial`.\n\n8. Report:\n   - **Attended:** show the reply line and its proposals.\n   - **Headless:** no prompts (AD-11). Relay the core's `status`, `reason`\n     and `artifacts` as they are — never infer the status from the exit\n     code (`partial` exits 0):\n\n     ```json\n     {\"status\": \"complete\", \"intent\": \"tk-studio-engage\", \"artifacts\": [], \"reason\": null}\n     ```\n\nIf the deterministic core is unrunnable — a tool call denied by permissions, `uv`\u002Fpython unavailable — end `blocked` with the status block naming the unrunnable core as `reason`: never a question, never a headless run that ends without the block (AD-11).\n\n## The studio chat: studio-reply (Story 39.3)\n\nThe owner's chat at `\u002Fapp\u002Fchat` is a conversation with the studio, not with\nan engagement (design addendum 2026-11-07 §3.8, AD-11). Each owner line\nqueues one run of the shipped one-shot `studio-chat` job: a `claude -p`\nsession of the planner leg, on the host, with this plugin and the payload\n`{verb: \"studio-reply\", project, project_root, seq, run_id}`. The session\nruns the `tk-studio-orchestrator` core headless and answers one line. It\nmoves no state, holds no bearer and no CSRF token, and commits nothing: an\naction is a proposal, a button the owner presses.\n\n1. **Read the context** (read-only):\n\n   ```bash\n   uv run \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fstudiochat.py\" context \\\n     --directory \u003Cproject_root> --seq \u003Cseq>\n   ```\n\n   The result is `{ok, dry_run, mode: \"context\", seq, line, chat[], reads,\n   routing, voice, shell?, not_yet[], notes[], written[]}` with the status\n   block last: `line` the owner's line, `chat[]` the last 40 lines of\n   `_bmad-output\u002Ftracking\u002Fstudio-chat.jsonl` up to it, `reads` the\n   supervisor's reads written at post time (`studio-chat-reads\u002F\u003Cseq>.json`:\n   the board, the office, the status and live runs, the project's last ten\n   runs with their ledger cost, the inbox — what `GET \u002Fboard`, `GET \u002Foffice`,\n   `GET \u002Fstatus`, `GET \u002Fruns\u002F{id}` and `GET \u002Finbox` answer), or `null` with\n   a note; `routing` the orchestrator core's own answer, exactly what\n   `orchestrate.py resolve --directory \u003Cproject_root>` prints; `voice`\n   `council` when the line names the council, else `plain`; `shell` the\n   council persona shell, present only for the council voice. Refusals:\n   `UnknownLine` (no owner line `seq`), `ChatUnreadable`.\n\n2. **Handle the outcome.** `routing.outcome` `needs-onboarding` ends\n   `blocked` naming `routing.gaps[]` (the orchestrator's headless rule;\n   never invent a working set). Otherwise answer the line from `reads` and\n   the routing's framing: \"what is running\" costs a read, never a plan. Use\n   the plain studio voice; the council shell is presentation only, used\n   when `voice` is `council`, and never changes the routing.\n\n3. **Emit the reply** once, between `\u003Creply>` and `\u003C\u002Freply>`, before the\n   record is written: the supervisor streams the text between the markers\n   to the page as it is produced. The status block (step 4) is still the\n   session's last output (AD-11).\n\n4. **Write the record** with the same text (UTF-8 files, never the command\n   line):\n\n   ```bash\n   uv run \"${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fstudiochat.py\" reply \\\n     --directory \u003Cproject_root> --seq \u003Cseq> --run-id \u003Crun_id> \\\n     --body-file \u003Cpath> [--proposals-file \u003Cpath>] [--dry-run]\n   ```\n\n   It appends `{seq, at, author: \"planner\", body, run_id, reply_to,\n   proposals[]}` (`reply_to` the owner line's `seq`; one reply per line).\n   `proposals[]` is at most 6 objects `{kind, label (1–80)}` plus the\n   kind's fields and no other: `queue {project, job}`, `answer {id,\n   letter, note, issue}` (`id` the question's id as its inbox item asks\n   it, `letter` A–Z, `note` possibly empty, `issue` the inbox item's key),\n   `open {route}` (a page under `\u002Fapp`), `engagement {title}`.\n   `stop-after-story` and `open-studio` are refused by name\n   (`ProposalNotYet: \u003Ckind> lands in Story 39.7`): drop them and say in the\n   body that the action arrives with Story 39.7. Its other refusals (exit\n   2): `BodyEmpty`, `BodyTooLarge`, `RunIdRequired`, `UnknownLine`,\n   `AlreadyAnswered`, `ProposalInvalid: \u003Cindex>: \u003Cwhy>`, `ChatBusy`,\n   `ChatUnwritable`. Relay the status block as in step 8 above.\n\n## Rules\n\n- The planner never moves state, never sends an input, and never holds a\n  bearer or a CSRF token; its session runs with a worker's environment\n  (every `TK_SUPERVISOR_*` secret and the owner seat stripped).\n- The only files written are the engagement's `chat.jsonl`, one line per\n  reply, its `questions.json` (Story 32.3), and its `scope.md` with the\n  record's `scope_page` and the Confluence scope page (Story 32.4), and the\n  record's `quote` (Story 32.5; its `basis.epics[].usd_estimate`, never\n  `.tk-studio\u002Fbudget-bands.yaml`); the supervisor's `closeout` (Story 32.8) writes\n  `closeout.md`, its Confluence page and the record's `closeout`; the\n  studio chat's reply (Story 39.3) is one line of\n  `_bmad-output\u002Ftracking\u002Fstudio-chat.jsonl`; nothing\n  is committed, nothing is promoted.\n- All paths resolve through `${CLAUDE_PLUGIN_ROOT}`.\n",{"name":5,"description":7},"main","ecd23b3c0458cd511812f643d9111e3d7c8235f4","plugins\u002Ftk-studio\u002Fskills\u002Ftk-studio-engage","https:\u002F\u002Fgithub.com\u002Fthkennedy\u002Ftk-studio","https:\u002F\u002Fgithub.com\u002Fthkennedy","https:\u002F\u002Ftimothyhkennedy.com","Just a guy who loves making tools, automation and games.","2026-11-10 20:38:16",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add thkennedy\u002Ftk-studio --skill tk-studio-engage",{"tool":38,"command":39},"bunx","bunx skills add thkennedy\u002Ftk-studio --skill tk-studio-engage",{"tool":41,"command":42},"pnpm","pnpm dlx skills add thkennedy\u002Ftk-studio --skill tk-studio-engage","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fthkennedy\u002Ftk-studio\u002Fblob\u002Fmain\u002Fplugins\u002Ftk-studio\u002Fskills\u002Ftk-studio-engage\u002FSKILL.md",true,[],[47,54,61,68,75,82],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M79RYSQ8C3MWDFTDSRAYFJYA","tk-studio-track","Tracking verbs on the bound Jira project — `block` moves a story the loop cannot progress, and each dependent story, to \"Blocked - Awaiting User\" with a comment that @mentions the owner (or, with `--engagement`, one engagement's questions issue, which `close` later moves to \"Done\"); `reply` posts the owner's answer (or \"Done.\") with the owner's host-only token and moves the issue to \"Block Resolved\"; `validate` checks that resolution and passes the issue back to work or re-blocks it with a follow-up. Use when the user says \"block this story\", \"tk track block\", \"put it in the owner's inbox\", \"reply to the blocked issue\", \"validate the resolution\", or a supervisor or engagement payload names this skill.","https:\u002F\u002Fgithub.com\u002Fthkennedy\u002Ftk-studio\u002Fblob\u002Fmain\u002Fplugins\u002Ftk-studio\u002Fskills\u002Ftk-studio-track\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M79RYMVE0031EV5B64MBGD8V","tk-studio-session","Session discipline as a surface — land a boundary handoff (optionally carrying knowledge deltas) and end the session, or resume a fresh session from a run workspace alone. Use when the user says \"hand off this run\", \"tk session\", \"resume the run\", or a boundary\u002Fbudget trigger says the session must split.","https:\u002F\u002Fgithub.com\u002Fthkennedy\u002Ftk-studio\u002Fblob\u002Fmain\u002Fplugins\u002Ftk-studio\u002Fskills\u002Ftk-studio-session\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M79RYFM9ATWHM6HAXJ3D19WV","tk-studio-research","Run a chartered research pass — survey the topics a charter scopes, grade every finding by evidence, land the findings in the run workspace, and emit observation events for recommendation-worthy ones. Use when the user says \"run the ecosystem watch\", \"tk research\", or a research job's invoke-skill directive names this skill.","https:\u002F\u002Fgithub.com\u002Fthkennedy\u002Ftk-studio\u002Fblob\u002Fmain\u002Fplugins\u002Ftk-studio\u002Fskills\u002Ftk-studio-research\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M79RYA1AWZZF83KBHGR6JDN3","tk-studio-report","One-verb human defect report — \"the skill did the wrong thing\" — recorded as a report event in the local measurement ledger. Use when the user says \"tk report\", \"report a defect\", \"that skill misbehaved\", or \"log a studio issue\".","https:\u002F\u002Fgithub.com\u002Fthkennedy\u002Ftk-studio\u002Fblob\u002Fmain\u002Fplugins\u002Ftk-studio\u002Fskills\u002Ftk-studio-report\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M79RY33VMYR5YNPVFKWRNW9S","tk-studio-playable-judge","The playable-verify leg's screenshot judge (Story 34.3) — reads only a playable run's report.json and its frames, answers the fixed rubric (scene loaded, player visible and framed, no magenta or error overlay, HUD reads, the named moments shown) with pass or fail and findings each naming a frame and a rubric line. Driven headless by the supervisor's host leg on the project's sandbox tier; use when the payload names a playable `media` folder, or the user says \"judge the playable frames\".","https:\u002F\u002Fgithub.com\u002Fthkennedy\u002Ftk-studio\u002Fblob\u002Fmain\u002Fplugins\u002Ftk-studio\u002Fskills\u002Ftk-studio-playable-judge\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M79RXY4AM8JM6ZK2MAR3W3X2","tk-studio-plan-sync","Planning adapter — canonicalize BMad-native planning artifacts (normalize pass, sole id authority) and sync them with the bound planning backend. Use when the user says \"sync the plan\", \"normalize planning artifacts\", \"tk plan sync\", or after stock BMad planning flows produce or change epics\u002Fstories.","https:\u002F\u002Fgithub.com\u002Fthkennedy\u002Ftk-studio\u002Fblob\u002Fmain\u002Fplugins\u002Ftk-studio\u002Fskills\u002Ftk-studio-plan-sync\u002FSKILL.md",[],[]]