docs+test(3562): align codex roots wording and parse SKILL frontmatter
This commit is contained in:
@@ -10,7 +10,7 @@ const crypto = require('node:crypto');
|
||||
const { execFileSync } = require('node:child_process');
|
||||
|
||||
const { install, uninstall, parseTomlToObject } = require('../bin/install.js');
|
||||
const { createTempDir, cleanup } = require('./helpers.cjs');
|
||||
const { createTempDir, cleanup, parseFrontmatter } = require('./helpers.cjs');
|
||||
|
||||
const HOOKS_DIST = path.join(__dirname, '..', 'hooks', 'dist');
|
||||
const BUILD_HOOKS_SCRIPT = path.join(__dirname, '..', 'scripts', 'build-hooks.js');
|
||||
@@ -85,7 +85,8 @@ describe('#3427 + #3433 — Codex installer avoids duplicate skills and mixed ho
|
||||
assert.equal(entries.includes('gsd-help'), true);
|
||||
const refreshedBody = fs.readFileSync(path.join(skillsDir, 'gsd-help', 'SKILL.md'), 'utf8');
|
||||
assert.notEqual(refreshedBody, legacySkillBody, 'stale legacy body must be overwritten');
|
||||
assert.ok(refreshedBody.startsWith('---'), 'refreshed SKILL.md must be valid frontmatter shape');
|
||||
const frontmatter = parseFrontmatter(refreshedBody);
|
||||
assert.equal(frontmatter.name, 'gsd-help', 'refreshed SKILL.md frontmatter must declare name: gsd-help');
|
||||
|
||||
// Unrelated user skills are preserved — the regen scope is `gsd-*` only.
|
||||
assert.equal(entries.includes('custom-user-skill'), true);
|
||||
|
||||
@@ -26,7 +26,7 @@ const path = require('node:path');
|
||||
const { execFileSync } = require('node:child_process');
|
||||
|
||||
const { install } = require('../bin/install.js');
|
||||
const { createTempDir, cleanup } = require('./helpers.cjs');
|
||||
const { createTempDir, cleanup, parseFrontmatter } = require('./helpers.cjs');
|
||||
|
||||
const HOOKS_DIST = path.join(__dirname, '..', 'hooks', 'dist');
|
||||
const BUILD_HOOKS_SCRIPT = path.join(__dirname, '..', 'scripts', 'build-hooks.js');
|
||||
@@ -77,16 +77,8 @@ describe('#3562 — Codex install produces discoverable $gsd-* skill surface', {
|
||||
assert.ok(fs.existsSync(skillPath), 'precondition: SKILL.md exists');
|
||||
|
||||
const content = fs.readFileSync(skillPath, 'utf8');
|
||||
// SKILL.md is YAML frontmatter then body; convertClaudeCommandToCodexSkill
|
||||
// emits at minimum a `name:` field on the leading frontmatter block.
|
||||
assert.ok(
|
||||
content.startsWith('---'),
|
||||
'SKILL.md must begin with YAML frontmatter (---) for Codex discovery',
|
||||
);
|
||||
assert.ok(
|
||||
/^name:\s*["']?gsd-help["']?\s*$/m.test(content),
|
||||
'SKILL.md frontmatter must declare name: gsd-help so $gsd-help resolves',
|
||||
);
|
||||
const frontmatter = parseFrontmatter(content);
|
||||
assert.equal(frontmatter.name, 'gsd-help', 'SKILL.md frontmatter must declare name: gsd-help so $gsd-help resolves');
|
||||
});
|
||||
|
||||
test('multiple core $gsd-* skills are produced (not just gsd-help)', () => {
|
||||
|
||||
Reference in New Issue
Block a user