@@ -2,7 +2,10 @@ import { describe, expect, it } from "vite-plus/test";
22import { ProviderDriverKind } from "@t3tools/contracts" ;
33
44import type { ComposerCommandItem } from "./ComposerCommandMenu" ;
5- import { searchSlashCommandItems } from "./composerSlashCommandSearch" ;
5+ import {
6+ searchSlashCommandItems ,
7+ slashCommandItemsForPromptPosition ,
8+ } from "./composerSlashCommandSearch" ;
69
710describe ( "searchSlashCommandItems" , ( ) => {
811 const claudeDriver = ProviderDriverKind . make ( "claudeAgent" ) ;
@@ -173,4 +176,38 @@ describe("searchSlashCommandItems", () => {
173176 "skill:claudeAgent:unslop" ,
174177 ] ) ;
175178 } ) ;
179+
180+ it ( "hides skills from slash completion after the first message line" , ( ) => {
181+ const items = [
182+ {
183+ id : "slash:model" ,
184+ type : "slash-command" ,
185+ command : "model" ,
186+ label : "/model" ,
187+ description : "Switch model" ,
188+ } ,
189+ {
190+ id : "skill:claudeAgent:unslop" ,
191+ type : "skill" ,
192+ provider : claudeDriver ,
193+ skill : {
194+ name : "unslop" ,
195+ path : "/skills/unslop/SKILL.md" ,
196+ enabled : true ,
197+ } ,
198+ label : "/skill:unslop" ,
199+ description : "Cut AI tells from writing" ,
200+ } ,
201+ ] satisfies Array <
202+ Extract < ComposerCommandItem , { type : "slash-command" | "provider-slash-command" | "skill" } >
203+ > ;
204+
205+ expect ( slashCommandItemsForPromptPosition ( items , false ) . map ( ( item ) => item . id ) ) . toEqual ( [
206+ "slash:model" ,
207+ ] ) ;
208+ expect ( slashCommandItemsForPromptPosition ( items , true ) . map ( ( item ) => item . id ) ) . toEqual ( [
209+ "slash:model" ,
210+ "skill:claudeAgent:unslop" ,
211+ ] ) ;
212+ } ) ;
176213} ) ;
0 commit comments