mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-18 00:56:30 +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}}')) {
|
||||
|
||||
@@ -48,6 +48,9 @@ export const PROVIDERS = {
|
||||
configDir: '.codex',
|
||||
displayName: 'Codex',
|
||||
frontmatterFields: [],
|
||||
// Codex's validator rejects unknown top-level keys. Version remains
|
||||
// available to Impeccable's updater under the spec-defined metadata map.
|
||||
versionInMetadata: true,
|
||||
writeOpenAIMetadata: true,
|
||||
// No agentFormat: the Codex subagent ships nested inside the skill's own
|
||||
// agents/ folder (see CODEX_SKILL_PROVIDERS in factory.js), which Codex
|
||||
@@ -63,6 +66,7 @@ export const PROVIDERS = {
|
||||
displayName: 'Codex Repo Skills',
|
||||
placeholderProvider: 'codex',
|
||||
frontmatterFields: [],
|
||||
versionInMetadata: true,
|
||||
writeOpenAIMetadata: true,
|
||||
},
|
||||
github: {
|
||||
|
||||
Reference in New Issue
Block a user