Repository navigation
feat(chat): add the Ansvisor skills library, and load a skill by its /name or when Chat picks it (W2-04) - #1885
Merged
Conversation
…ad a skill when Chat picks it (W2-04) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… skills (W2-04) The library is now the v2 mockup's Ansvisor skills, by the ids CHAT-21's agents use (winback, tasks, quality, faq, report, beat, refresh, publish, shopping, wrongclaim, answerfirst, facts, compare, translate), with the mockup's titles and card lines. Six reuse the earlier bodies; the nine earlier skills that map to none are removed. A message calls a skill by the /commands it starts with, so a page path like "/faq" later in the text isn't one, and the /report skill takes the /report shortcut's place in the / menu. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…l name a skill writes (W2-04) - The scan also reads the front matter's values once parsed, so a double-quoted escape can't hide an instruction, hidden character, email or price. The reader keeps metadata without a prototype, needs a space after each colon and refuses tabs and mixed indents. - Every snake_case name in backticks must be one of Chat's tools. - report, facts and publish describe what Chat does: no email, approved facts only, a CMS draft. - A skill the model picks after the run read outside text isn't loaded; the person's /name still is. The prompt says a /name without a block wasn't loaded. - skills/README.md says how a Chat skill is added, and that outside skills come later through import. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… (W2-04) On Chat Home the box sits high on the page, so the / menu with the fourteen skills ran past the header. The /, @ and + menus now pick their side as they open, and again when the window changes size: above when their rows fit between the box and the nearest clipping box (the page's scroll area under the header) or the window, else below when there's more room there. Their height is the room on that side less the gap, at most 300px, and the active row stays in view as the arrows move it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
8 of 13 tasks
…ding outside text (W2-04) A run started from a tainted run's next move starts tainted (fromTaintedMove): its message is that model's text, so a leading /name in it is the model's pick, not the person's. Such a run now loads no typed skill; the person's own /name in the same chat still loads.
gkhngyk
previously approved these changes
Oct 31, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good with 58b0371: one fix commit on this branch, described below.
The fix: a next move's /name isn't the person's (CHAT-20 §16a)
- A run started from a next move that a run wrote after reading outside text starts tainted (
fromTaintedMove), because its message is that model's text. loadTypedSkillsstill loaded a leading/namein that message. So a move like/winback the two pagesloaded a skill the model picked after outside text, which the PR's own rule refuses foruse_skill.- Now a run that starts tainted loads no typed skill. The person's own
/namein the same chat still loads. - Test:
engine.test.ts› skills › "loads no /name from a move a run wrote after outside text". It fails without the fix.
What I checked
- Where skills come from.
- Only
library.json, which is bundled at build time and kept in step withskills/*/SKILL.mdbylibrary.test.ts. - No path, URL or user-editable text reaches the prompt.
/nameis matched against the library by exact name ([a-z0-9-]), so there's no path to traverse. An unknown name loads nothing.- No client component imports
library.ts. A page gets names and titles only (skillMenuOf), never bodies.
- Only
- What a skill can't do.
- The bodies come after the core rules and the workspace block, in their own block that says they change no rule.
use_skillis handled before the tool registry and only loads library text.- The tools offered, the cards, the role matrix, the plan facts and the read-only and demo gates are unchanged. The "changes no rule" test compares the tool lists and checks that the card still waits.
- A body can't name a tool Chat doesn't have, or carry override text, emails, prices or secrets (
library.test.ts).
- After outside text:
pickSkillrefuses oncetaintedis set. With the fix, a typed/namein a tainted next move is refused too. - Budget.
- The list has the names and descriptions of up to 20 skills, inside the cached workspace block.
- Up to 3 bodies a run, each about 2 KB, unmarked so the cache isn't broken by a mid-run load.
- Skill text. I read all fourteen. They're public-safe: the only competitor name is a fictional example. They never publish, send or close anything, and they defer to "the app asks them first".
- Flag off: no list, no tool, no body, no step, and an empty / menu (tested).
- Embeds, migrations, read-only: no embeds, no migrations, no new write route or action.
Checks on this branch (based on main 703a68600, merges clean):
src/lib/chat,src/components/chat, the chat pages andplan-row.test.ts: 1,252 of 1,253 pass. The one failure ischat-menu.test.tsx's clock case, which this PR doesn't touch and #1876 fixes.tsc,eslint(touched areas) andyarn format:checkpass.
Follow-up (not blocking): a message that starts with a page path (/pricing needs an FAQ) has no skill block. The prompt then tells the model to say a /name wasn't loaded. Telling it so only for library names would avoid a confusing line.
8 of 13 tasks
gkhngyk
approved these changes
Oct 31, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Merging in order with the other approved PRs. This head merges current main; its tree is what main will be after this squash, checked with the full server and web suites, tsc, lint, format and next build.
8 of 13 tasks
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 W2-04: the Ansvisor skills library (CHAT-13 items 3–5). It has the v2 mockup's fourteen skills, each a
SKILL.mdinskills/. Chat loads a skill when a person starts a message with its/name, or when Chat picks one itself. BehindCHAT_AGENTIC.The library (
skills/*/SKILL.md,web/src/lib/chat/skills/)references/and no scripts.library.jsonis generated from the files (yarn test -u src/lib/chat/skills) and is what Chat reads.library.test.ts):name= folder, description ≤ 1,024 characters, title, filters,license: MIT;In Chat (
engine.ts,prompt.ts)/nameloads that skill; Chat can also pick one itself withuse_skill. At most 3 skills load per run, and the prompt says when a/namewasn't loaded.tainted), a skill the model picks isn't loaded. The person's own/namestill is./commandsit starts with, so a page path like "/faq" later in the text isn't one.The / menu (
composer-menus.tsx)/reportskill takes the old/reportshortcut's place.Help: new
help/chat/skills.md("Skills in Chat",approved: false), andhelp/chat/chat.mdlinks it.skills/README.md:Copy: three card lines differ from the mockup on purpose, to say what Chat actually does. The owner approved them in the preview:
Related issue
None. Chat Wave 2 (W2-04, CHAT-13).
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
/fa: only /faq is left./faqin the box./faq for our pricing page. The steps show Used skill: FAQ from fan-outs and Ansvisor library.yarn vitest run src/lib/chat/skills src/lib/chat/engine.test.ts src/components/chat/composer.Screenshots (1024px, light and dark) were reviewed in the preview by the owner.
Checklist
yarn lintpasses (0 errors; 7 old warnings in files this PR doesn't touch)yarn typecheckpassesyarn format:checkpasseshelp/Checks:
86258c960: full web suite 7,675 of 7,676; the one failure ischat-menu.test.tsx's clock case, fixed in fix(chat): give a chat row the menu's clock, so a run's time matches its day #1876.yarn buildpasses.f8c41acc3(menu placement):format:check,lintandtypecheckpass; the composer and panel tests pass, 60 of 60.Follow-ups, not in this PR
agent-skills.ts(agent create) and this library should share one catalog of the skill ids.🤖 Generated with Claude Code