Phase 1 of #3464. Removes the `// allow-test-rule:` marker from 22 test files where it is provably vestigial, and tightens the ratchet ceiling in scripts/lint-allow-test-rule-refs.ceiling.json from 305 to 285. Eligibility is decided by two independent AST discriminators, both conservative (any doubt => keep): (a) Read-target type. Every readFileSync/readFile call in the file resolves statically to a prose/config extension (.md/.json/.yml/.yaml/.toml/.txt), or the file performs no reads at all. Any read of a source extension (.cjs/.js/.mjs/.ts/.cts/.mts/.jsx/.tsx), any dynamic/unresolvable path, and any other extension all disqualify the file. (b) Marker context. Every `allow-test-rule:` occurrence is a genuine comment node, never string- or template-literal payload. A marker that lives inside a RuleTester `code:` fixture is test DATA, not a suppression directive; stripping it corrupts the test. tests/eslint-rules.test.cjs is the one such fixture host and is deliberately untouched. An earlier attempt at this phase classified markers by "strip it and see if local/no-source-grep still passes" and was reverted in full before commit. That oracle is unsound: the rule only fires on a literal .cjs/.js/.ts path containing a quoted bin/lib/gsd-core/src segment, tracked one hop from the binding, so files that genuinely source-grep real JavaScript pass it silently -- tests/no-unbounded-spawn-allowlist.test.cjs (reads test sources through a listTestFiles() walk) and tests/claude-imperative-reference.test.cjs (matches bin/install.js through an intermediate variable) both cleared it while being real source-greps. The rule's implementation is narrower than its intent, so it cannot adjudicate whether an exemption is load-bearing. Scope is limited to comment deletions: the diff over the test tree is 100% line removals with zero insertions, and no executable line is altered. On the ceiling value. The measured count at this HEAD is 283, so 285 leaves 2 slack -- deliberate, and well inside the documented grace band of 3. Pinning the ceiling to the exact count makes this change effectively unmergeable: any concurrent PR that lands one marker-bearing test file re-reds it. That race fired twice while preparing this branch (once mid-rebase taking the count 304->305 on next, once between rebase and the verification run taking it 282->283), and it is the same race that broke next in #3461. A ceiling of actual+2 preserves a merge window while still ratcheting 305 -> 285. Known limit, disclosed rather than papered over: this clears 22 of 303 markers and does not reach #3464's trend-to-zero goal. Most of the remaining markers sit on dynamic-path reads, commonly a hoisted `const p = path.join(tmpDir, 'STATE.md')` whose target is prose but is unresolvable to this classifier. A stricter one-hop const resolution would flip an estimated 95 more; that is deliberately left to a follow-up so it can be reviewed on its own evidence. Marker discovery reads bytes rather than shelling out to grep: tests/security-prompt-injection.security.test.cjs carries a literal NUL byte (an intentional injection fixture) that makes grep treat it as binary and skip it, which is why the true marked-file count is 303 and not the 302 a shell scan reports. Closes #3465 Co-authored-by: sim <sim@local> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
495 lines
18 KiB
JavaScript
495 lines
18 KiB
JavaScript
// Reads .md/.json/.yml product files whose deployed text IS what the
|
|
// runtime loads — testing text content tests the deployed contract.
|
|
|
|
/**
|
|
* GSD Tools Tests - Claude Skills Migration (#1504)
|
|
*
|
|
* Tests for migrating Claude Code from commands/gsd/ to skills/gsd-xxx/SKILL.md
|
|
* format for compatibility with Claude Code 2.1.88+.
|
|
*
|
|
* Uses node:test and node:assert (NOT Jest).
|
|
*/
|
|
|
|
process.env.GSD_TEST_MODE = '1';
|
|
|
|
const { test, describe, beforeEach, afterEach } = require('node:test');
|
|
const assert = require('node:assert/strict');
|
|
const path = require('path');
|
|
const os = require('os');
|
|
const fs = require('fs');
|
|
const { cleanup } = require('./helpers.cjs');
|
|
|
|
const ROOT = path.join(__dirname, '..');
|
|
|
|
const {
|
|
convertClaudeCommandToClaudeSkill,
|
|
writeManifest,
|
|
} = require(path.join(ROOT, 'bin', 'install.js'));
|
|
|
|
const {
|
|
installRuntimeArtifacts,
|
|
uninstallRuntimeArtifacts,
|
|
} = require(path.join(ROOT, 'gsd-core', 'bin', 'lib', 'install-engine.cjs'));
|
|
|
|
const {
|
|
loadSkillsManifest,
|
|
resolveProfile,
|
|
} = require(path.join(ROOT, 'gsd-core', 'bin', 'lib', 'install-profiles.cjs'));
|
|
|
|
// Shared resolved profile (full — installs all skills from srcDir)
|
|
const _manifest = loadSkillsManifest();
|
|
const resolvedProfileFull = resolveProfile({ modes: [], manifest: _manifest });
|
|
|
|
/**
|
|
* Set up a configDir backed by a custom srcDir via .gsd-source marker.
|
|
* Returns { configDir, srcDir } both under tmpDir.
|
|
*/
|
|
function setupConfigDir(tmpDir, commandFiles) {
|
|
const srcDir = path.join(tmpDir, 'commands', 'gsd');
|
|
fs.mkdirSync(srcDir, { recursive: true });
|
|
for (const [name, content] of Object.entries(commandFiles)) {
|
|
fs.writeFileSync(path.join(srcDir, name), content);
|
|
}
|
|
const configDir = path.join(tmpDir, 'config');
|
|
fs.mkdirSync(configDir, { recursive: true });
|
|
// .gsd-source marker tells findInstallSourceRoot to use our custom srcDir
|
|
fs.writeFileSync(path.join(configDir, '.gsd-source'), srcDir + '\n');
|
|
return { configDir, srcDir };
|
|
}
|
|
|
|
// ─── convertClaudeCommandToClaudeSkill ──────────────────────────────────────
|
|
|
|
describe('convertClaudeCommandToClaudeSkill', () => {
|
|
test('preserves allowed-tools multiline YAML list', () => {
|
|
const input = [
|
|
'---',
|
|
'name: gsd:next',
|
|
'description: Advance to the next step',
|
|
'allowed-tools:',
|
|
' - Read',
|
|
' - Bash',
|
|
' - Grep',
|
|
'---',
|
|
'',
|
|
'Body content here.',
|
|
].join('\n');
|
|
|
|
const result = convertClaudeCommandToClaudeSkill(input, 'gsd-next');
|
|
assert.ok(result.includes('allowed-tools:'), 'allowed-tools field is present');
|
|
assert.ok(result.includes('Read'), 'Read tool preserved');
|
|
assert.ok(result.includes('Bash'), 'Bash tool preserved');
|
|
assert.ok(result.includes('Grep'), 'Grep tool preserved');
|
|
});
|
|
|
|
test('preserves argument-hint', () => {
|
|
const input = [
|
|
'---',
|
|
'name: gsd:debug',
|
|
'description: Debug issues',
|
|
'argument-hint: "[issue description]"',
|
|
'allowed-tools:',
|
|
' - Read',
|
|
' - Bash',
|
|
'---',
|
|
'',
|
|
'Debug body.',
|
|
].join('\n');
|
|
|
|
const result = convertClaudeCommandToClaudeSkill(input, 'gsd-debug');
|
|
assert.ok(result.includes('argument-hint:'), 'argument-hint field is present');
|
|
// The value should be preserved (possibly yaml-quoted)
|
|
assert.ok(
|
|
result.includes('[issue description]'),
|
|
'argument-hint value preserved'
|
|
);
|
|
});
|
|
|
|
test('emits hyphen-form name (gsd-<cmd>) from hyphen-form dir (#2808)', () => {
|
|
const input = [
|
|
'---',
|
|
'name: gsd:next',
|
|
'description: Advance workflow',
|
|
'---',
|
|
'',
|
|
'Body.',
|
|
].join('\n');
|
|
|
|
// Directory name is gsd-next (hyphen, Windows-safe), frontmatter name is
|
|
// gsd-next (hyphen, #2808) so Claude Code autocomplete shows canonical form.
|
|
const result = convertClaudeCommandToClaudeSkill(input, 'gsd-next');
|
|
assert.ok(result.includes('name: gsd-next'), 'frontmatter name uses hyphen form (#2808)');
|
|
});
|
|
|
|
test('preserves body content while normalizing gsd: command references (#3583)', () => {
|
|
// The body transformer now rewrites gsd: references (colon → hyphen) but must
|
|
// leave all other custom prose, tags, and structure intact.
|
|
const body = '\n<objective>\nSee /gsd:plan-phase and gsd:review for details.\n</objective>\n\n<process>\nStep 1.\nStep 2.\n</process>\n';
|
|
const input = [
|
|
'---',
|
|
'name: gsd:test',
|
|
'description: Test command',
|
|
'---',
|
|
body,
|
|
].join('');
|
|
|
|
const result = convertClaudeCommandToClaudeSkill(input, 'gsd-test');
|
|
// Custom structure preserved
|
|
assert.ok(result.includes('<objective>'), 'objective tag preserved');
|
|
assert.ok(result.includes('See /gsd-plan-phase'), 'rewritten command reference visible');
|
|
assert.ok(result.includes('<process>'), 'process tag preserved');
|
|
assert.ok(result.includes('Step 1.'), 'step text preserved');
|
|
|
|
// #3583: gsd: references in body are normalized to hyphen form
|
|
assert.ok(result.includes('/gsd-plan-phase'), 'colon command ref rewritten to hyphen');
|
|
assert.ok(result.includes('gsd-review'), 'bare colon ref rewritten to hyphen');
|
|
assert.ok(!result.includes('gsd:plan-phase'), 'no colon form should survive in body');
|
|
assert.ok(!result.includes('gsd:review'), 'no colon form should survive in body');
|
|
});
|
|
|
|
test('preserves agent field', () => {
|
|
const input = [
|
|
'---',
|
|
'name: gsd:plan-phase',
|
|
'description: Plan a phase',
|
|
'agent: true',
|
|
'allowed-tools:',
|
|
' - Read',
|
|
'---',
|
|
'',
|
|
'Plan body.',
|
|
].join('\n');
|
|
|
|
const result = convertClaudeCommandToClaudeSkill(input, 'gsd-plan-phase');
|
|
assert.ok(result.includes('agent:'), 'agent field is present');
|
|
});
|
|
|
|
test('handles content with no frontmatter', () => {
|
|
const input = 'Just some plain markdown content.';
|
|
const result = convertClaudeCommandToClaudeSkill(input, 'gsd-plain');
|
|
assert.strictEqual(result, input, 'content returned unchanged');
|
|
});
|
|
|
|
test('preserves allowed-tools as multiline YAML list (not flattened)', () => {
|
|
const input = [
|
|
'---',
|
|
'name: gsd:debug',
|
|
'description: Debug',
|
|
'allowed-tools:',
|
|
' - Read',
|
|
' - Bash',
|
|
' - Task',
|
|
' - AskUserQuestion',
|
|
'---',
|
|
'',
|
|
'Body.',
|
|
].join('\n');
|
|
|
|
const result = convertClaudeCommandToClaudeSkill(input, 'gsd-debug');
|
|
// Claude Code native format keeps YAML multiline list
|
|
assert.ok(result.includes(' - Read'), 'Read in multiline list');
|
|
assert.ok(result.includes(' - Bash'), 'Bash in multiline list');
|
|
assert.ok(result.includes(' - Task'), 'Task in multiline list');
|
|
assert.ok(result.includes(' - AskUserQuestion'), 'AskUserQuestion in multiline list');
|
|
});
|
|
});
|
|
|
|
// ─── installRuntimeArtifacts (claude global) — skill layout ─────────────────
|
|
|
|
describe('installRuntimeArtifacts (claude global) — skill layout', () => {
|
|
let tmpDir;
|
|
|
|
beforeEach(() => {
|
|
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-claude-skills-test-'));
|
|
});
|
|
|
|
afterEach(() => {
|
|
cleanup(tmpDir);
|
|
});
|
|
|
|
test('creates correct directory structure skills/gsd-xxx/SKILL.md', () => {
|
|
const { configDir } = setupConfigDir(tmpDir, {
|
|
'next.md': '---\nname: gsd:next\ndescription: Advance\nallowed-tools:\n - Read\n---\n\nBody.',
|
|
'health.md': '---\nname: gsd:health\ndescription: Check health\n---\n\nHealth body.',
|
|
});
|
|
|
|
installRuntimeArtifacts('claude', configDir, 'global', resolvedProfileFull);
|
|
|
|
const skillsDir = path.join(configDir, 'skills');
|
|
assert.ok(
|
|
fs.existsSync(path.join(skillsDir, 'gsd-next', 'SKILL.md')),
|
|
'skills/gsd-next/SKILL.md exists'
|
|
);
|
|
assert.ok(
|
|
fs.existsSync(path.join(skillsDir, 'gsd-health', 'SKILL.md')),
|
|
'skills/gsd-health/SKILL.md exists'
|
|
);
|
|
});
|
|
|
|
test('cleans up old skills before installing new ones (uninstall+install cycle)', () => {
|
|
const { configDir } = setupConfigDir(tmpDir, {
|
|
'next.md': '---\nname: gsd:next\ndescription: Advance\n---\n\nBody.',
|
|
});
|
|
|
|
const skillsDir = path.join(configDir, 'skills');
|
|
// Create a stale skill that should be removed by the uninstall step
|
|
const staleDir = path.join(skillsDir, 'gsd-old-command');
|
|
fs.mkdirSync(staleDir, { recursive: true });
|
|
fs.writeFileSync(path.join(staleDir, 'SKILL.md'), 'stale content');
|
|
|
|
// Production sequence: uninstall wipes gsd-* entries, install writes fresh ones
|
|
uninstallRuntimeArtifacts('claude', configDir, 'global');
|
|
installRuntimeArtifacts('claude', configDir, 'global', resolvedProfileFull);
|
|
|
|
// Stale skill removed by uninstall
|
|
assert.ok(
|
|
!fs.existsSync(staleDir),
|
|
'stale skill directory removed'
|
|
);
|
|
// New skill created by install
|
|
assert.ok(
|
|
fs.existsSync(path.join(skillsDir, 'gsd-next', 'SKILL.md')),
|
|
'new skill created'
|
|
);
|
|
});
|
|
|
|
test('does not remove non-GSD skills', () => {
|
|
const { configDir } = setupConfigDir(tmpDir, {
|
|
'next.md': '---\nname: gsd:next\ndescription: Advance\n---\n\nBody.',
|
|
});
|
|
|
|
const skillsDir = path.join(configDir, 'skills');
|
|
// Create a non-GSD skill before install
|
|
const otherDir = path.join(skillsDir, 'my-custom-skill');
|
|
fs.mkdirSync(otherDir, { recursive: true });
|
|
fs.writeFileSync(path.join(otherDir, 'SKILL.md'), 'custom content');
|
|
|
|
// Install (no pre-uninstall: uninstall only removes gsd-* prefixed entries)
|
|
installRuntimeArtifacts('claude', configDir, 'global', resolvedProfileFull);
|
|
|
|
// Non-GSD skill preserved
|
|
assert.ok(
|
|
fs.existsSync(otherDir),
|
|
'non-GSD skill preserved after install'
|
|
);
|
|
|
|
// Also survives uninstall (uninstall only removes gsd-* prefixed entries)
|
|
uninstallRuntimeArtifacts('claude', configDir, 'global');
|
|
assert.ok(
|
|
fs.existsSync(otherDir),
|
|
'non-GSD skill preserved after uninstall'
|
|
);
|
|
});
|
|
|
|
// NOTE: Recursive subdirectory support was removed when the shim was replaced.
|
|
// stageSkillsForRuntimeAsSkills only processes top-level .md files.
|
|
// No subdirectories exist under commands/gsd/ in production.
|
|
// The subdir-recursion test has been deleted (option a per #3664 brief).
|
|
|
|
test('no-ops on install when source directory has no .md files', () => {
|
|
// Create an empty (but existing) commands/gsd dir with no .md files.
|
|
// stageSkillsForRuntimeAsSkills loops over entries, finds none, and stages
|
|
// an empty dir — _copyStaged then copies nothing into skills/.
|
|
const emptySrc = path.join(tmpDir, 'empty-commands', 'gsd');
|
|
fs.mkdirSync(emptySrc, { recursive: true });
|
|
|
|
const configDir = path.join(tmpDir, 'config-empty');
|
|
fs.mkdirSync(configDir, { recursive: true });
|
|
fs.writeFileSync(path.join(configDir, '.gsd-source'), emptySrc + '\n');
|
|
|
|
// Should not throw
|
|
installRuntimeArtifacts('claude', configDir, 'global', resolvedProfileFull);
|
|
const skillsDir = path.join(configDir, 'skills');
|
|
// If skills dir was created it must contain no gsd-* entries
|
|
if (fs.existsSync(skillsDir)) {
|
|
const gsdEntries = fs.readdirSync(skillsDir).filter(n => n.startsWith('gsd-'));
|
|
assert.strictEqual(gsdEntries.length, 0, 'no gsd-* skills created when src has no .md files');
|
|
}
|
|
});
|
|
});
|
|
|
|
// ─── Path replacement in Claude skills (#1653) ────────────────────────────────
|
|
|
|
describe('installRuntimeArtifacts path replacement in Claude global skills (#1653)', () => {
|
|
let tmpDir;
|
|
|
|
beforeEach(() => {
|
|
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-claude-path-test-'));
|
|
});
|
|
|
|
afterEach(() => {
|
|
cleanup(tmpDir);
|
|
});
|
|
|
|
test('replaces ~/.claude/ and $HOME/.claude/ paths with absolute configDir prefix on global install', () => {
|
|
// Global install: configDir IS the runtime config directory.
|
|
// computePathPrefix(isGlobal=true) → resolvedTarget + '/'.
|
|
// applyRuntimeContentRewritesInPlace rewrites ~/.claude/ and $HOME/.claude/
|
|
// to the absolute configDir path so skills work from any machine.
|
|
const { configDir } = setupConfigDir(tmpDir, {
|
|
'manager.md': [
|
|
'---',
|
|
'name: gsd:manager',
|
|
'description: Manager command',
|
|
'---',
|
|
'',
|
|
'<execution_context>',
|
|
'@~/.claude/gsd-core/workflows/manager.md',
|
|
'@$HOME/.claude/gsd-core/references/ui-brand.md',
|
|
'</execution_context>',
|
|
].join('\n'),
|
|
});
|
|
|
|
installRuntimeArtifacts('claude', configDir, 'global', resolvedProfileFull);
|
|
|
|
const content = fs.readFileSync(
|
|
path.join(configDir, 'skills', 'gsd-manager', 'SKILL.md'), 'utf8'
|
|
);
|
|
assert.ok(!content.includes('~/.claude/'), 'no hardcoded ~/.claude/ paths remain');
|
|
assert.ok(!content.includes('$HOME/.claude/'), 'no $HOME/.claude/ paths remain');
|
|
// Paths are rewritten to the absolute configDir prefix
|
|
const expectedPrefix = path.resolve(configDir).replace(/\\/g, '/') + '/';
|
|
assert.ok(
|
|
content.includes(expectedPrefix + 'gsd-core/workflows/manager.md'),
|
|
'tilde path rewritten to absolute configDir prefix'
|
|
);
|
|
assert.ok(
|
|
content.includes(expectedPrefix + 'gsd-core/references/ui-brand.md'),
|
|
'HOME path rewritten to absolute configDir prefix'
|
|
);
|
|
});
|
|
|
|
test('replaces $HOME/.claude/ paths with absolute configDir prefix on global install', () => {
|
|
const { configDir } = setupConfigDir(tmpDir, {
|
|
'debug.md': '---\nname: gsd:debug\ndescription: Debug\n---\n\n@$HOME/.claude/gsd-core/workflows/debug.md',
|
|
});
|
|
|
|
installRuntimeArtifacts('claude', configDir, 'global', resolvedProfileFull);
|
|
|
|
const content = fs.readFileSync(
|
|
path.join(configDir, 'skills', 'gsd-debug', 'SKILL.md'), 'utf8'
|
|
);
|
|
assert.ok(!content.includes('$HOME/.claude/'), 'no $HOME/.claude/ paths remain');
|
|
const expectedPrefix = path.resolve(configDir).replace(/\\/g, '/') + '/';
|
|
assert.ok(
|
|
content.includes(expectedPrefix + 'gsd-core/workflows/debug.md'),
|
|
'path rewritten to absolute configDir prefix'
|
|
);
|
|
});
|
|
|
|
test('global install rewrites ~/.claude/ paths to absolute configDir form', () => {
|
|
// For global installs, computePathPrefix returns the absolute configDir path.
|
|
// Both ~/.claude/ and $HOME/.claude/ are normalized to the same absolute prefix.
|
|
const { configDir } = setupConfigDir(tmpDir, {
|
|
'next.md': '---\nname: gsd:next\ndescription: Next\n---\n\n@~/.claude/gsd-core/workflows/next.md',
|
|
});
|
|
|
|
installRuntimeArtifacts('claude', configDir, 'global', resolvedProfileFull);
|
|
|
|
const content = fs.readFileSync(
|
|
path.join(configDir, 'skills', 'gsd-next', 'SKILL.md'), 'utf8'
|
|
);
|
|
const expectedPrefix = path.resolve(configDir).replace(/\\/g, '/') + '/';
|
|
assert.ok(
|
|
content.includes(expectedPrefix + 'gsd-core/workflows/next.md'),
|
|
'global tilde path rewritten to absolute configDir prefix'
|
|
);
|
|
assert.ok(!content.includes('~/.claude/'), 'tilde form is replaced');
|
|
});
|
|
});
|
|
|
|
// ─── Legacy cleanup during install ──────────────────────────────────────────
|
|
|
|
describe('Legacy commands/gsd/ cleanup', () => {
|
|
let tmpDir;
|
|
|
|
beforeEach(() => {
|
|
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-legacy-test-'));
|
|
});
|
|
|
|
afterEach(() => {
|
|
cleanup(tmpDir);
|
|
});
|
|
|
|
test('install removes legacy commands/gsd/ directory when present', () => {
|
|
const { configDir } = setupConfigDir(tmpDir, {
|
|
'next.md': '---\nname: gsd:next\ndescription: Advance\n---\n\nBody.',
|
|
});
|
|
|
|
// Create a mock legacy commands/gsd/ directory inside configDir
|
|
const legacyDir = path.join(configDir, 'commands', 'gsd');
|
|
fs.mkdirSync(legacyDir, { recursive: true });
|
|
fs.writeFileSync(path.join(legacyDir, 'next.md'), 'legacy content');
|
|
|
|
// installRuntimeArtifacts calls _runLegacyInstallMigrations which removes
|
|
// commands/gsd/ for claude runtime (it's the legacy location for global).
|
|
installRuntimeArtifacts('claude', configDir, 'global', resolvedProfileFull);
|
|
|
|
assert.ok(!fs.existsSync(legacyDir), 'legacy commands/gsd/ removed');
|
|
assert.ok(
|
|
fs.existsSync(path.join(configDir, 'skills', 'gsd-next', 'SKILL.md')),
|
|
'new skill installed'
|
|
);
|
|
});
|
|
});
|
|
|
|
// ─── writeManifest tracks skills/ for Claude ────────────────────────────────
|
|
|
|
describe('writeManifest tracks skills/ for Claude', () => {
|
|
let tmpDir;
|
|
|
|
beforeEach(() => {
|
|
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-manifest-test-'));
|
|
});
|
|
|
|
afterEach(() => {
|
|
cleanup(tmpDir);
|
|
});
|
|
|
|
test('manifest includes skills/gsd-xxx/SKILL.md entries for Claude runtime', () => {
|
|
// Create skills directory structure (as install would)
|
|
const skillsDir = path.join(tmpDir, 'skills');
|
|
const skillDir = path.join(skillsDir, 'gsd-next');
|
|
fs.mkdirSync(skillDir, { recursive: true });
|
|
fs.writeFileSync(path.join(skillDir, 'SKILL.md'), 'skill content');
|
|
|
|
// Create gsd-core directory (required by writeManifest)
|
|
const gsdDir = path.join(tmpDir, 'gsd-core');
|
|
fs.mkdirSync(gsdDir, { recursive: true });
|
|
fs.writeFileSync(path.join(gsdDir, 'test.md'), 'test');
|
|
|
|
writeManifest(tmpDir, 'claude');
|
|
|
|
const manifest = JSON.parse(
|
|
fs.readFileSync(path.join(tmpDir, 'gsd-file-manifest.json'), 'utf8')
|
|
);
|
|
|
|
// Should have skills/ entries
|
|
const skillEntries = Object.keys(manifest.files).filter(k =>
|
|
k.startsWith('skills/')
|
|
);
|
|
assert.ok(skillEntries.length > 0, 'manifest has skills/ entries');
|
|
assert.ok(
|
|
skillEntries.some(k => k === 'skills/gsd-next/SKILL.md'),
|
|
'manifest has skills/gsd-next/SKILL.md'
|
|
);
|
|
|
|
// Should NOT have commands/gsd/ entries
|
|
const cmdEntries = Object.keys(manifest.files).filter(k =>
|
|
k.startsWith('commands/gsd/')
|
|
);
|
|
assert.strictEqual(cmdEntries.length, 0, 'manifest has no commands/gsd/ entries');
|
|
});
|
|
});
|
|
|
|
// ─── Exports exist ──────────────────────────────────────────────────────────
|
|
|
|
describe('Claude skills migration exports', () => {
|
|
test('convertClaudeCommandToClaudeSkill is exported', () => {
|
|
assert.strictEqual(typeof convertClaudeCommandToClaudeSkill, 'function');
|
|
});
|
|
|
|
test('installRuntimeArtifacts is exported', () => {
|
|
assert.strictEqual(typeof installRuntimeArtifacts, 'function');
|
|
});
|
|
});
|