@@ -193,10 +193,12 @@ export function getModeSelection(mode: string, promptComponent?: PromptComponent
193193
194194 const roleDefinition = modeToUse ?. roleDefinition || ""
195195 const baseInstructions = modeToUse ?. customInstructions || ""
196+ const description = ( customMode || builtInMode ) ?. description || ""
196197
197198 return {
198199 roleDefinition,
199200 baseInstructions,
201+ description,
200202 }
201203}
202204
@@ -287,6 +289,7 @@ export const defaultPrompts: Readonly<CustomModePrompts> = Object.freeze(
287289 roleDefinition : mode . roleDefinition ,
288290 whenToUse : mode . whenToUse ,
289291 customInstructions : mode . customInstructions ,
292+ // Note: description is not included here as it's not part of the PromptComponent interface
290293 } ,
291294 ] ) ,
292295 ) ,
@@ -303,6 +306,7 @@ export async function getAllModesWithPrompts(context: vscode.ExtensionContext):
303306 roleDefinition : customModePrompts [ mode . slug ] ?. roleDefinition ?? mode . roleDefinition ,
304307 whenToUse : customModePrompts [ mode . slug ] ?. whenToUse ?? mode . whenToUse ,
305308 customInstructions : customModePrompts [ mode . slug ] ?. customInstructions ?? mode . customInstructions ,
309+ // description is not overridable via customModePrompts, so we keep the original
306310 } ) )
307311}
308312
@@ -326,6 +330,8 @@ export async function getFullModeDetails(
326330 // Get the base custom instructions
327331 const baseCustomInstructions = promptComponent ?. customInstructions || baseMode . customInstructions || ""
328332 const baseWhenToUse = promptComponent ?. whenToUse || baseMode . whenToUse || ""
333+ // Description is not part of PromptComponent, so we use it directly from the mode
334+ const baseDescription = baseMode . description || ""
329335
330336 // If we have cwd, load and combine all custom instructions
331337 let fullCustomInstructions = baseCustomInstructions
@@ -344,6 +350,7 @@ export async function getFullModeDetails(
344350 ...baseMode ,
345351 roleDefinition : promptComponent ?. roleDefinition || baseMode . roleDefinition ,
346352 whenToUse : baseWhenToUse ,
353+ description : baseDescription ,
347354 customInstructions : fullCustomInstructions ,
348355 }
349356}
@@ -358,6 +365,16 @@ export function getRoleDefinition(modeSlug: string, customModes?: ModeConfig[]):
358365 return mode . roleDefinition
359366}
360367
368+ // Helper function to safely get description
369+ export function getDescription ( modeSlug : string , customModes ?: ModeConfig [ ] ) : string {
370+ const mode = getModeBySlug ( modeSlug , customModes )
371+ if ( ! mode ) {
372+ console . warn ( `No mode found for slug: ${ modeSlug } ` )
373+ return ""
374+ }
375+ return mode . description ?? ""
376+ }
377+
361378// Helper function to safely get whenToUse
362379export function getWhenToUse ( modeSlug : string , customModes ?: ModeConfig [ ] ) : string {
363380 const mode = getModeBySlug ( modeSlug , customModes )
0 commit comments