mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-19 01:26:29 +03:00
Fix Codex skill version metadata (#703)
Move Codex and .agents skill versions under metadata while keeping all version readers compatible with legacy top-level frontmatter.\n\nAI assistance: prepared with Codex under maintainer direction.
This commit is contained in:
@@ -241,6 +241,7 @@ export function createTransformer(config) {
|
||||
providerTags = [provider],
|
||||
writeOpenAIMetadata = false,
|
||||
includeVersion = true,
|
||||
versionInMetadata = false,
|
||||
} = config;
|
||||
const placeholderKey = placeholderProvider || provider;
|
||||
|
||||
@@ -274,7 +275,9 @@ export function createTransformer(config) {
|
||||
name: skillName,
|
||||
description: skill.description,
|
||||
};
|
||||
if (skillsVersion && includeVersion) frontmatterObj.version = skillsVersion;
|
||||
if (skillsVersion && includeVersion && !versionInMetadata) {
|
||||
frontmatterObj.version = skillsVersion;
|
||||
}
|
||||
|
||||
for (const spec of activeFields) {
|
||||
if (spec.condition && !spec.condition(skill)) continue;
|
||||
@@ -282,6 +285,13 @@ export function createTransformer(config) {
|
||||
if (val) frontmatterObj[spec.yamlKey] = val;
|
||||
}
|
||||
|
||||
if (skillsVersion && includeVersion && versionInMetadata) {
|
||||
frontmatterObj.metadata = {
|
||||
...(frontmatterObj.metadata || {}),
|
||||
version: skillsVersion,
|
||||
};
|
||||
}
|
||||
|
||||
// Replace {{command_hint}} in argument-hint with command names from metadata,
|
||||
// grouped by category with middle dots between groups for natural line-breaking.
|
||||
if (frontmatterObj['argument-hint']?.includes('{{command_hint}}')) {
|
||||
|
||||
Reference in New Issue
Block a user