Repository navigation
feat(chat): run each shortcut from its own playbook and data plan (W2-09) - #1993
Merged
Merged
Conversation
…-09) Each / menu shortcut (CHAT-08) now has a hidden playbook in skills/ (metadata.hidden: "true"): its allowed reads, default scope, output, question rules and next moves, checked by the same format, scan and CI as the library skills. The menu gains /start, /optimize, /opportunities and /audit; "Create a report on" moves to /new-report, as /report is the Weekly report skill's. The composer sends shortcutId with the message while its trigger words stay (rewritten, it drops), and keeps it on Retry. Home chips whose job is a shortcut's send its id; chips for the focus areas' skills ask with the skill's /name. The server takes the id only for a message that is still that shortcut's, writes chat_messages.shortcut_id, loads the playbook first as one of the run's three skill bodies, offers only the reads in its data plan, and tells the model in one line what the plan leaves out. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Chat's
/menu shortcuts (CHAT-08) now each run from a playbook of their own, behindCHAT_AGENTIC. A shortcut's run reads only the data its job needs. No migration: it writeschat_messages.shortcut_id(00417), which nothing wrote until now. Plan: Chat waves plan, W2-09. The owner approved the shortcut screens on 2026-11-02.Playbooks
skills/, markedmetadata.hidden: "true":start,analyze,new-report,create,optimize,opportunitiesandaudit.metadata.reads), its default scope (the chat's brand; the page's date range or the last 30 days; the plan's platforms), its output, when to ask a question, and its next moves.library.jsonkeeps them apart from the 21 skills (SHORTCUT_PLAYBOOKS). They are never listed, never offered touse_skilland never shown in the Skills group.skills/README.mdlists them.The / menu
lib/chat/shortcuts.ts, shared by the browser and the server.Sending a shortcut
shortcutIdwith the message while the shortcut's first words stay in the box. If the person rewrites them, the id drops and the message runs as their own question, with every read. Retry keeps the id.Running it on the server
messageShortcutkeeps it only when the message still starts with the shortcut's first words, or is the chip's own text. A next move written by a tainted run never carries one.chat_messages.shortcut_id.Help:
help/chat/chat.md(Shortcuts) andhelp/chat/skills.mdare updated. Both stayapproved: false.Related issue
None. Chat waves plan, W2-09 (CHAT-08).
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
Unit tests:
shortcuts.test.ts,shortcut-playbooks.test.ts: when a message is still a shortcut's, the reads its run gets, and the plan line.skills/library.test.ts: one playbook per shortcut, titled as the menu names it; MIT;metadata.readsnames only read tools Chat has; never listed, offered or in the/menu.engine.test.ts: the message keeps the shortcut, the playbook loads first, a read outside the data plan is refused, a Home chip's own words count, the playbook counts in the 3 bodies, nothing is kept with the new Chat off.focus-home.test.ts,chat-composer.test.tsx,chat-home.test.tsx,chat-thread-view.test.tsx: the chips, the composer sending and dropping the id, Retry.Manually (
CHAT_AGENTIC=true, as the demo Admin, at /dashboard/chat):/in an empty box. Shortcuts lists /start Get started, /analyze Analyze, /new-report Reports, /create Create content, /optimize Optimize content, /opportunities Find opportunities and /audit Improve with audit. Skills follows, with /report as the Weekly report.skills/analyze/SKILL.md. The message row hasshortcut_id = 'analyze'.shortcut_idis null.Screenshots: shown to the owner in a local preview and approved.
Checklist
yarn lintpassesyarn typecheckpassesyarn format:checkpasseshelp/(or no user-visible change)CI passed on this branch (a3b3be5), run on the fork (https://github.com/cihan-gyk/ansvisor/actions/runs/41411445729): schema is up to date; web
format:check, lint, typecheck, all tests andyarn buildpass; server lint,format:checkand all tests pass.🤖 Generated with Claude Code