test(02-02): add failing Kimi global skill install tests

- Expect Kimi global layout to stage skills/gsd-*/SKILL.md
- Assert --kimi --global writes gsd-new-project SKILL.md
- Preserve explicit --kimi --local no-op guard
This commit is contained in:
Viktorplus
2026-06-06 13:59:55 +02:00
parent ca68213664
commit da1b6111e7
3 changed files with 64 additions and 10 deletions

View File

@@ -175,6 +175,24 @@ describe('resolveRuntimeArtifactLayout — qwen', () => {
});
});
describe('resolveRuntimeArtifactLayout — kimi', () => {
test('returns global skills layout and guarded empty local layout for kimi', () => {
const globalLayout = resolveRuntimeArtifactLayout('kimi', FAKE_DIR, 'global');
assert.strictEqual(globalLayout.runtime, 'kimi');
assert.strictEqual(globalLayout.configDir, FAKE_DIR);
assert.strictEqual(globalLayout.kinds.length, 1);
assert.strictEqual(globalLayout.kinds[0].kind, 'skills');
assert.strictEqual(globalLayout.kinds[0].destSubpath, 'skills');
assert.strictEqual(globalLayout.kinds[0].prefix, 'gsd-');
assert.strictEqual(typeof globalLayout.kinds[0].stage, 'function');
const localLayout = resolveRuntimeArtifactLayout('kimi', FAKE_DIR, 'local');
assert.strictEqual(localLayout.runtime, 'kimi');
assert.strictEqual(localLayout.configDir, FAKE_DIR);
assert.deepStrictEqual(localLayout.kinds, []);
});
});
describe('resolveRuntimeArtifactLayout — hermes', () => {
test('returns correct layout for hermes', () => {
const layout = resolveRuntimeArtifactLayout('hermes', FAKE_DIR);
@@ -379,6 +397,23 @@ describe('stage — skills kind (claude global)', () => {
});
});
describe('stage — skills kind (kimi global)', () => {
test('stage returns Kimi SKILL.md dirs with /skill:gsd-* invocations', () => {
const layout = resolveRuntimeArtifactLayout('kimi', FAKE_STAGE_DIR, 'global');
const skillsKind = layout.kinds.find(k => k.kind === 'skills');
assert.ok(skillsKind, 'should have a skills kind');
const stagedDir = skillsKind.stage(PROFILE_CORE);
assert.ok(fs.existsSync(stagedDir), 'stagedDir must exist');
const skillMd = path.join(stagedDir, 'gsd-new-project', 'SKILL.md');
assert.ok(fs.existsSync(skillMd), 'gsd-new-project/SKILL.md must exist');
const content = fs.readFileSync(skillMd, 'utf8');
assert.match(content, /^name: gsd-new-project$/m);
assert.match(content, /\/skill:gsd-new-project/);
assert.doesNotMatch(content, /kimi_cli\.tools|system_prompt_path|^version: 1$/m);
});
});
describe('stage — opencode commands kind', () => {
test('opencode stage returns directory with .md files for selected skills', () => {
const layout = resolveRuntimeArtifactLayout('opencode', FAKE_STAGE_DIR);