@@ -63,7 +63,7 @@ async function loadSkillFromPath(
6363) : Promise < LoadedSkill | null > {
6464 try {
6565 const content = await fs . readFile ( skillPath , "utf-8" )
66- const { data } = parseFrontmatter < SkillMetadata > ( content )
66+ const { data, body } = parseFrontmatter < SkillMetadata > ( content )
6767 const frontmatterMcp = parseSkillMcpConfigFromFrontmatter ( content )
6868 const mcpJsonMcp = await loadMcpJsonFromDir ( resolvedPath )
6969 const mcpConfig = mcpJsonMcp || frontmatterMcp
@@ -73,14 +73,7 @@ async function loadSkillFromPath(
7373 const isOpencodeSource = scope === "opencode" || scope === "opencode-project"
7474 const formattedDescription = `(${ scope } - Skill) ${ originalDescription } `
7575
76- const lazyContent : LazyContentLoader = {
77- loaded : false ,
78- content : undefined ,
79- load : async ( ) => {
80- if ( ! lazyContent . loaded ) {
81- const fileContent = await fs . readFile ( skillPath , "utf-8" )
82- const { body } = parseFrontmatter < SkillMetadata > ( fileContent )
83- lazyContent . content = `<skill-instruction>
76+ const templateContent = `<skill-instruction>
8477Base directory for this skill: ${ resolvedPath } /
8578File references (@path) in this skill are relative to this directory.
8679
@@ -90,16 +83,17 @@ ${body.trim()}
9083<user-request>
9184$ARGUMENTS
9285</user-request>`
93- lazyContent . loaded = true
94- }
95- return lazyContent . content !
96- } ,
86+
87+ const lazyContent : LazyContentLoader = {
88+ loaded : true ,
89+ content : templateContent ,
90+ load : async ( ) => templateContent ,
9791 }
9892
9993 const definition : CommandDefinition = {
10094 name : skillName ,
10195 description : formattedDescription ,
102- template : "" ,
96+ template : templateContent ,
10397 model : sanitizeModelField ( data . model , isOpencodeSource ? "opencode" : "claude-code" ) ,
10498 agent : data . agent ,
10599 subtask : data . subtask ,
0 commit comments