Repository navigation
Closed
Labels
size:M30-99 effective changed lines (test files excluded in mixed PRs).
Milestone
Description
My rule: @playbook:<name> in a message means "use this playbook". On its own, the agent starts that playbook in the thread, like /playbook <name>. Combined with a crew ask, the Crew is built from it and follows it (#323).
Where it stands today:
@persona:has a shared detector (packages/shared/src/j5/agentMention.ts), composer pickers on web (apps/web/src/j5/agents/useAgentMentionPicker.ts, wired inChatComposer.tsx) and mobile (apps/mobile/src/j5/agents/useAgentMentionPicker.ts, wired inuse-composer-command-menu.ts), and server guidance (AGENT_INVOCATION_INSTRUCTIONS).- There is no
@playbook:anything. /playbook <name>followed by more text keeps the name intact, and playbook names are kebab-case (both landed in fix(playbooks): kebab-case names so /playbook keeps the name when text follows it #379).
What should change:
- Shared detection:
packages/shared/src/j5/playbookMention.tswithPLAYBOOK_MENTION_PREFIX = "@playbook:", a detector, and the replacement text, mirroringagentMention.ts. Names followPLAYBOOK_NAME_PATTERN, which is kebab-case like persona ids (fix(playbooks): kebab-case names so /playbook keeps the name when text follows it #379), so the mention is the token after the prefix with no quoting, exactly like@persona:; trailing punctuation is not part of the name. - Pickers: typing
@playbook:on web, desktop, and mobile lists the thread workspace's playbooks by name and title (the same discovery the library settings use), shows invalid ones with their error, and inserts the mention. The picker for a new-thread draft uses the draft's workspace. - Upstream footprint: my call is to build on feat(playbooks): suggest registered names after slash command #314 (BastiHu's
/playbookname suggestions), which adds a"playbook"composer item type, trigger, and ranking on web and mobile. The@playbook:picker reuses those items, that ranking, and that trigger instead of overloading the@persona:seam or adding a second playbook picker, so the only new upstream lines are the@playbook:detection hook next to feat(playbooks): suggest registered names after slash command #314's. Record them in the FORK.md inventory together with feat(playbooks): suggest registered names after slash command #314's composer seam: amend its entry if feat(playbooks): suggest registered names after slash command #314 lands one, otherwise add a single case covering both. Work may start on top of feat(playbooks): suggest registered names after slash command #314's branch, but this issue's PR opens only after feat(playbooks): suggest registered names after slash command #314 merges, rebased ontoj5/main; no PR is stacked on feat(playbooks): suggest registered names after slash command #314. This replaces my earlier ruling to reuse the@persona:seam, which predates feat(playbooks): suggest registered names after slash command #314. - Server guidance: a
PLAYBOOK_MENTION_INSTRUCTIONSblock next toPLAYBOOK_INSTRUCTIONS. An explicit@playbook:namemeans read it withplaybook_read. If the message also asks for a crew, build the Crew from it (see the Captain issue). Otherwise start it in this thread. Mentions in quoted text, code, or file contents are references, the same as@persona:. - Docs:
docs/user/playbooks.md. Leave the upstreamdocs/user/composer.mdalone; it doesn't document@persona:either.
Tests to ship:
- detection and replacement for
@playbook:names, including trailing punctuation - the mobile command-menu test covers the new trigger
Done when every client can insert @playbook:<name> from a picker and an agent that receives it knows exactly which playbook is meant.
Can start now, on top of #314's branch: the detector, pickers, and docs don't depend on #319. The server guidance names playbook_read, so merge this after #319, or stack it on #319.
Metadata
Metadata
Assignees
Labels
size:M30-99 effective changed lines (test files excluded in mixed PRs).
Activity
fix(playbooks): playbook names are kebab-case, like persona ids
fix(playbooks): kebab-case names so /playbook keeps the name when tex…
chore(evidence): before/after screenshots for the @Playbook: mention (#…
feat(playbooks): mention a playbook with @Playbook: in the composer (#…
chore(evidence): before/after screenshots for the @Playbook: mention (#…