@@ -13,6 +13,7 @@ import {
1313 skillSearchDefinition ,
1414 workerSkillSearchDefinition ,
1515} from "../../src/agent/skill-search.js" ;
16+ import { loadSkillCommands } from "../../src/plugins/skill-commands.js" ;
1617import {
1718 useSkillDefinition ,
1819 workerUseSkillDefinition ,
@@ -276,18 +277,27 @@ describe("path-like skill refs", () => {
276277describe ( "description caps (CL-8854)" , ( ) => {
277278 const MAX_DESCRIPTION_CHARS = 160 ;
278279
279- test ( "all five registration descriptions are one line within the cap" , ( ) => {
280- const skillDescriptions = [
280+ test ( "primary descriptions keep the pointer; worker copies are pointer-free, all one line within the cap" , ( ) => {
281+ const primaryDescriptions = [
281282 skillSearchDefinition . description ,
282- workerSkillSearchDefinition . description ,
283283 useSkillDefinition . description ,
284- workerUseSkillDefinition . description ,
285284 ] ;
286- for ( const description of skillDescriptions ) {
285+ for ( const description of primaryDescriptions ) {
287286 expect ( description ) . not . toContain ( "\n" ) ;
288287 expect ( description . length ) . toBeLessThanOrEqual ( MAX_DESCRIPTION_CHARS ) ;
289288 expect ( description . endsWith ( "See Guidelines: Tool choice." ) ) . toBe ( true ) ;
290289 }
290+ // The lean worker contract ships no guidelines, so the worker copies must
291+ // not point at them.
292+ const workerDescriptions = [
293+ workerSkillSearchDefinition . description ,
294+ workerUseSkillDefinition . description ,
295+ ] ;
296+ for ( const description of workerDescriptions ) {
297+ expect ( description ) . not . toContain ( "\n" ) ;
298+ expect ( description . length ) . toBeLessThanOrEqual ( MAX_DESCRIPTION_CHARS ) ;
299+ expect ( description ) . not . toContain ( "See Guidelines:" ) ;
300+ }
291301 expect ( spawnAgentToolDefinition . description ) . not . toContain ( "\n" ) ;
292302 expect ( spawnAgentToolDefinition . description . length ) . toBeLessThanOrEqual (
293303 MAX_DESCRIPTION_CHARS ,
@@ -316,4 +326,25 @@ describe("description caps (CL-8854)", () => {
316326 ) ;
317327 expect ( out ) . toBe ( "- scribe: write docs" ) ;
318328 } ) ;
329+
330+ test ( "a multi-line SKILL.md frontmatter description renders as a single slash-picker line" , async ( ) => {
331+ const plugin = await mkdtemp ( join ( tmpdir ( ) , "skill-slash-multiline-" ) ) ;
332+ try {
333+ await mkdir ( join ( plugin , "skills" , "scribe" ) , { recursive : true } ) ;
334+ await writeFile (
335+ join ( plugin , "skills" , "scribe" , "SKILL.md" ) ,
336+ "---\nname: scribe\ndescription: |\n write docs\n second line\n---\nScribe body.\n" ,
337+ "utf8" ,
338+ ) ;
339+ const cmds = defined ( await loadSkillCommands ( plugin ) , "skill commands" ) ;
340+ const scribe = defined (
341+ cmds . find ( ( c ) => c . name === "scribe" ) ,
342+ "scribe command" ,
343+ ) ;
344+ expect ( scribe . description ) . toBe ( "write docs" ) ;
345+ expect ( scribe . description ) . not . toContain ( "\n" ) ;
346+ } finally {
347+ await rm ( plugin , { recursive : true , force : true } ) ;
348+ }
349+ } ) ;
319350} ) ;
0 commit comments