Skip to content

Commit c157483

Browse files
authored
feat(skills): add Agent Skills spec optional metadata fields (Fission-AI#563)
Add optional fields to SkillTemplate interface and all skill templates to improve compliance with the Agent Skills specification: - license: MIT (matching project license) - compatibility: Requires openspec CLI. - metadata: { author: openspec, version: 1.0 } Updates skill file generation to include these fields in YAML frontmatter.
1 parent f90c7c3 commit c157483

2 files changed

Lines changed: 44 additions & 9 deletions

File tree

src/commands/experimental/setup.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ export async function artifactExperimentalSetupCommand(options: ArtifactExperime
284284
const skillContent = `---
285285
name: ${template.name}
286286
description: ${template.description}
287+
license: ${template.license || 'MIT'}
288+
compatibility: ${template.compatibility || 'Requires openspec CLI.'}
289+
metadata:
290+
author: ${template.metadata?.author || 'openspec'}
291+
version: "${template.metadata?.version || '1.0'}"
287292
---
288293
289294
${template.instructions}

src/core/templates/skill-templates.ts

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ export interface SkillTemplate {
1212
name: string;
1313
description: string;
1414
instructions: string;
15+
license?: string;
16+
compatibility?: string;
17+
metadata?: Record<string, string>;
1518
}
1619

1720
/**
@@ -300,7 +303,10 @@ But this summary is optional. Sometimes the thinking IS the value.
300303
- **Don't auto-capture** - Offer to save insights, don't just do it
301304
- **Do visualize** - A good diagram is worth many paragraphs
302305
- **Do explore the codebase** - Ground discussions in reality
303-
- **Do question assumptions** - Including the user's and your own`
306+
- **Do question assumptions** - Including the user's and your own`,
307+
license: 'MIT',
308+
compatibility: 'Requires openspec CLI.',
309+
metadata: { author: 'openspec', version: '1.0' },
304310
};
305311
}
306312

@@ -375,7 +381,10 @@ After completing the steps, summarize:
375381
- Do NOT advance beyond showing the first artifact template
376382
- If the name is invalid (not kebab-case), ask for a valid name
377383
- If a change with that name already exists, suggest continuing that change instead
378-
- Pass --schema if using a non-default workflow`
384+
- Pass --schema if using a non-default workflow`,
385+
license: 'MIT',
386+
compatibility: 'Requires openspec CLI.',
387+
metadata: { author: 'openspec', version: '1.0' },
379388
};
380389
}
381390

@@ -499,7 +508,10 @@ For other schemas, follow the \`instruction\` field from the CLI output.
499508
- Use the schema's artifact sequence, don't assume specific artifact names
500509
- **IMPORTANT**: \`context\` and \`rules\` are constraints for YOU, not content for the file
501510
- Do NOT copy \`<context>\`, \`<rules>\`, \`<project_context>\` blocks into the artifact
502-
- These guide what you write, but should never appear in the output`
511+
- These guide what you write, but should never appear in the output`,
512+
license: 'MIT',
513+
compatibility: 'Requires openspec CLI.',
514+
metadata: { author: 'openspec', version: '1.0' },
503515
};
504516
}
505517

@@ -656,7 +668,10 @@ What would you like to do?
656668
This skill supports the "actions on a change" model:
657669
658670
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
659-
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly`
671+
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly`,
672+
license: 'MIT',
673+
compatibility: 'Requires openspec CLI.',
674+
metadata: { author: 'openspec', version: '1.0' },
660675
};
661676
}
662677

@@ -757,7 +772,10 @@ After completing all artifacts, summarize:
757772
- Always read dependency artifacts before creating a new one
758773
- If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
759774
- If a change with that name already exists, suggest continuing that change instead
760-
- Verify each artifact file exists after writing before proceeding to next`
775+
- Verify each artifact file exists after writing before proceeding to next`,
776+
license: 'MIT',
777+
compatibility: 'Requires openspec CLI.',
778+
metadata: { author: 'openspec', version: '1.0' },
761779
};
762780
}
763781

@@ -895,7 +913,10 @@ Main specs are now updated. The change remains active - archive when implementat
895913
- Preserve existing content not mentioned in delta
896914
- If something is unclear, ask for clarification
897915
- Show what you're changing as you go
898-
- The operation should be idempotent - running twice should give same result`
916+
- The operation should be idempotent - running twice should give same result`,
917+
license: 'MIT',
918+
compatibility: 'Requires openspec CLI.',
919+
metadata: { author: 'openspec', version: '1.0' },
899920
};
900921
}
901922

@@ -1659,7 +1680,10 @@ All artifacts complete. All tasks complete.
16591680
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
16601681
- Show clear summary of what happened
16611682
- If sync is requested, use openspec-sync-specs approach (agent-driven)
1662-
- If delta specs exist, always run the sync assessment and show the combined summary before prompting`
1683+
- If delta specs exist, always run the sync assessment and show the combined summary before prompting`,
1684+
license: 'MIT',
1685+
compatibility: 'Requires openspec CLI.',
1686+
metadata: { author: 'openspec', version: '1.0' },
16631687
};
16641688
}
16651689

@@ -1905,7 +1929,10 @@ No active changes found. Use \`/opsx:new\` to create a new change.
19051929
- Track and report all outcomes (success/skip/fail)
19061930
- Preserve .openspec.yaml when moving to archive
19071931
- Archive directory target uses current date: YYYY-MM-DD-<name>
1908-
- If archive target exists, fail that change but continue with others`
1932+
- If archive target exists, fail that change but continue with others`,
1933+
license: 'MIT',
1934+
compatibility: 'Requires openspec CLI.',
1935+
metadata: { author: 'openspec', version: '1.0' },
19091936
};
19101937
}
19111938

@@ -2212,7 +2239,10 @@ Use clear markdown with:
22122239
- Grouped lists for issues (CRITICAL/WARNING/SUGGESTION)
22132240
- Code references in format: \`file.ts:123\`
22142241
- Specific, actionable recommendations
2215-
- No vague suggestions like "consider reviewing"`
2242+
- No vague suggestions like "consider reviewing"`,
2243+
license: 'MIT',
2244+
compatibility: 'Requires openspec CLI.',
2245+
metadata: { author: 'openspec', version: '1.0' },
22162246
};
22172247
}
22182248

0 commit comments

Comments
 (0)