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:
Paul Bakaus
2026-09-01 20:21:01 -04:00
committed by GitHub
parent 4981192613
commit 482368511a
11 changed files with 192 additions and 15 deletions
+11 -1
View File
@@ -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}}')) {