Repository navigation
Description
My rule: a playbook step can name the persona that does it, and that name is data the tools return, not prose the Captain has to guess from. A step with no persona is staffed by the Captain's judgment.
Where it stands today:
- A step is only
{ id, title, prompt }(packages/contracts/src/j5/playbook.ts→PlaybookStep). The decoder strips unknown keys, so apersona:line in the YAML silently disappears. playbook_listreturns step titles only (PlaybookDiscovery). The only way an agent reads the prompts is toplaybook_starta run or open the YAML with file tools, so a Captain can't plan a Crew from a playbook without starting it in its own thread first.- Playbook Author (
packages/client-runtime/src/j5/playbooks.ts→PLAYBOOK_AUTHOR_INSTRUCTIONS) only knows id, title, and prompt.
What should change:
- Schema:
PlaybookStepgains optionalpersona, a persona id from the library. Absent means "any seat". - Discovery:
playbook_listreturns each step'spersona. A step naming a persona that isn't in the library, or is disabled, is still a valid definition, but the entry carries a non-blocking warning naming the step and the persona, so authors see it in Settings and Captains see it before proposing. Warnings are a newwarningslist on the entry, separate fromissue: both Settings screens disable starting and renaming wheneverissueis set, so a warning must never go there. "Missing or disabled" is decided by the same persona catalog and enabled checkpropose_crewalready uses (CrewProposalService), so the warning and the proposal refusal can't disagree. - Read without starting: a read-only
playbook_read(name)returns the full live definition (steps with prompts and personas) without creating a run. It takes the same nameplaybook_startdoes (kebab-case since fix(playbooks): kebab-case names so /playbook keeps the name when text follows it #379) and returns the samewarnings. Mark it read-only likeplaybook_listand add it toJ5_PREAPPROVED_TOOLSinapps/server/src/j5/a2a/mcp/j5ToolPreapproval.ts, which both the Claude and Codex adapters already spread. - Step responses:
playbook_current,playbook_next,playbook_back, andplaybook_reselectinclude the current step'spersona. - Playbook Author: its instructions explain
persona, tell it to calllist_personasbefore writing one, and to leave it off steps the user doesn't assign. - Library settings: web (
PlaybookLibrarySettings.tsx) and mobile (PlaybookLibrarySettingsScreen.tsx) show each step's persona and the missing/disabled warning. - Docs: the example and step description in
docs/user/playbooks.md, andPLAYBOOK_INSTRUCTIONS.
Tests to ship:
- a step with
personadecodes and comes back fromplaybook_list,playbook_read, and the step tools - a definition without
personabehaves exactly as today - a missing or disabled persona produces the warning and doesn't mark the definition invalid
playbook_readcreates no run and leaves an active run's pointer untouched
Done when a Captain can read which persona every step wants, with the prompts, without starting a run.
Out of scope: several personas per step with per-persona prompt blocks (the "per-Role blocks" in docs/j5/product/features/playbooks.md). One persona per step for this milestone.
Upstream footprint: all source changes are in J5-owned files (packages/contracts/src/j5/, apps/server/src/j5/, apps/web/src/j5/, apps/mobile/src/j5/, packages/client-runtime/src/j5/). The only upstream line is adding playbook_read to the exact tool inventory in apps/server/src/mcp/toolkits/worktree/registration.test.ts, which FORK.md's ledger row (cases 4 and 45) already covers.
Activity
chore(evidence): before/after screenshots for playbook step personas (#…
feat(playbooks): steps name the persona that does them (#380)
chore(evidence): before/after screenshots for playbook step personas (#…