@@ -6,6 +6,7 @@ import { Identifier } from "../id/id"
66import PROMPT_INITIALIZE from "./template/initialize.txt"
77import PROMPT_REVIEW from "./template/review.txt"
88import { MCP } from "../mcp"
9+ import { Skill } from "../skill"
910
1011export namespace Command {
1112 export const Event = {
@@ -26,7 +27,7 @@ export namespace Command {
2627 description : z . string ( ) . optional ( ) ,
2728 agent : z . string ( ) . optional ( ) ,
2829 model : z . string ( ) . optional ( ) ,
29- mcp : z . boolean ( ) . optional ( ) ,
30+ source : z . enum ( [ "command" , "mcp" , "skill" ] ) . optional ( ) ,
3031 // workaround for zod not supporting async functions natively so we use getters
3132 // https://zod.dev/v4/changelog?id=zfunction
3233 template : z . promise ( z . string ( ) ) . or ( z . string ( ) ) ,
@@ -94,7 +95,7 @@ export namespace Command {
9495 for ( const [ name , prompt ] of Object . entries ( await MCP . prompts ( ) ) ) {
9596 result [ name ] = {
9697 name,
97- mcp : true ,
98+ source : "mcp" ,
9899 description : prompt . description ,
99100 get template ( ) {
100101 // since a getter can't be async we need to manually return a promise here
@@ -118,6 +119,21 @@ export namespace Command {
118119 }
119120 }
120121
122+ // Add skills as invokable commands
123+ for ( const skill of await Skill . all ( ) ) {
124+ // Skip if a command with this name already exists
125+ if ( result [ skill . name ] ) continue
126+ result [ skill . name ] = {
127+ name : skill . name ,
128+ description : skill . description ,
129+ source : "skill" ,
130+ get template ( ) {
131+ return skill . content
132+ } ,
133+ hints : [ ] ,
134+ }
135+ }
136+
121137 return result
122138 } )
123139
0 commit comments