refactor: hard-fork GSD -> MSD (Make Software Done)
Mechanical rename produced by scripts/msd-rename.cjs: gsd/Gsd/GSD -> msd/Msd/MSD across contents and paths, upstream package/repo coordinates -> @golem15/msd-core and golem15com/msd-core. Deep links into upstream history, sibling upstream packages, the GSD-2 import feature, CHANGELOG.md and .changeset/ are kept as-is. Hand edits on top: MSD block-letter banner and logos, LICENSE copyright line, package/plugin identity, regenerated lockfile, install-tree fixtures, derived registries and benchmark baseline; migration checksum baseline re-locked (MSD keeps its own install state, so no install had applied the old sums); sort-order and regex-escaped expectations in tests adjusted.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* belongs to the later Phase 3 slices.
|
||||
*/
|
||||
|
||||
process.env.GSD_TEST_MODE = '1';
|
||||
process.env.MSD_TEST_MODE = '1';
|
||||
|
||||
const { test, describe } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
@@ -16,26 +16,26 @@ const {
|
||||
} = require('../bin/install.js');
|
||||
|
||||
const ROOT_AGENT = `---
|
||||
name: gsd
|
||||
description: Root GSD agent for Kimi CLI
|
||||
name: msd
|
||||
description: Root MSD agent for Kimi CLI
|
||||
tools: Agent, mcp__github__search, DefinitelyUnknownTool
|
||||
color: blue
|
||||
---
|
||||
|
||||
# GSD Root
|
||||
# MSD Root
|
||||
|
||||
Coordinate GSD workflows through subagents.
|
||||
Read ~/.claude/gsd-core when source-package context is needed.`;
|
||||
Coordinate MSD workflows through subagents.
|
||||
Read ~/.claude/msd-core when source-package context is needed.`;
|
||||
|
||||
const EXECUTOR_AGENT = `---
|
||||
name: gsd-executor
|
||||
description: Execute planned GSD task slices with atomic commits.
|
||||
name: msd-executor
|
||||
description: Execute planned MSD task slices with atomic commits.
|
||||
tools: Read, Write, Edit, Bash, Grep, Glob
|
||||
color: yellow
|
||||
---
|
||||
|
||||
<role>
|
||||
You are a GSD plan executor.
|
||||
You are a MSD plan executor.
|
||||
</role>`;
|
||||
|
||||
const INVALID_AGENT = `---
|
||||
@@ -51,18 +51,18 @@ describe('buildKimiAgentArtifacts', () => {
|
||||
const result = buildKimiAgentArtifacts({
|
||||
rootAgent: ROOT_AGENT,
|
||||
subagents: [
|
||||
{ path: 'agents/gsd-executor.md', content: EXECUTOR_AGENT },
|
||||
{ path: 'agents/msd-executor.md', content: EXECUTOR_AGENT },
|
||||
],
|
||||
requestedSubagents: ['gsd-executor', 'gsd-missing'],
|
||||
requestedSubagents: ['msd-executor', 'msd-missing'],
|
||||
});
|
||||
|
||||
assert.equal(result.root.yamlPath, 'agents/gsd.yaml');
|
||||
assert.equal(result.root.promptPath, 'agents/gsd.md');
|
||||
assert.equal(result.root.yamlPath, 'agents/msd.yaml');
|
||||
assert.equal(result.root.promptPath, 'agents/msd.md');
|
||||
assert.ok(result.root.yaml.includes('version: 1'), 'root YAML includes Kimi version marker');
|
||||
assert.ok(result.root.yaml.includes('agent:'), 'root YAML includes agent object');
|
||||
assert.ok(result.root.yaml.includes('name: gsd'), 'root agent name is gsd');
|
||||
assert.ok(result.root.yaml.includes('name: msd'), 'root agent name is msd');
|
||||
assert.ok(result.root.yaml.includes('extend: default'), 'root agent extends default Kimi behavior');
|
||||
assert.ok(result.root.yaml.includes('system_prompt_path: ./gsd.md'), 'root prompt path is relative');
|
||||
assert.ok(result.root.yaml.includes('system_prompt_path: ./msd.md'), 'root prompt path is relative');
|
||||
assert.ok(result.root.yaml.includes('tools:'), 'root YAML has a tools field');
|
||||
assert.ok(result.root.yaml.includes('kimi_cli.tools.agent:Agent'), 'root can call Kimi subagents');
|
||||
assert.ok(
|
||||
@@ -71,29 +71,29 @@ describe('buildKimiAgentArtifacts', () => {
|
||||
);
|
||||
assert.ok(!result.root.yaml.includes('- Agent'), 'root YAML does not emit raw Claude Agent tool');
|
||||
assert.ok(result.root.yaml.includes('subagents:'), 'root YAML declares custom subagents');
|
||||
assert.ok(result.root.yaml.includes('gsd-executor:'), 'known GSD subagent key is canonical');
|
||||
assert.ok(result.root.yaml.includes('msd-executor:'), 'known MSD subagent key is canonical');
|
||||
assert.ok(
|
||||
result.root.yaml.includes('path: ./subagents/gsd-executor.yaml'),
|
||||
'known GSD subagent path is relative to root YAML'
|
||||
result.root.yaml.includes('path: ./subagents/msd-executor.yaml'),
|
||||
'known MSD subagent path is relative to root YAML'
|
||||
);
|
||||
assert.ok(!result.root.yaml.includes('gsd-missing'), 'unknown requested subagent is excluded');
|
||||
assert.ok(!result.root.yaml.includes('msd-missing'), 'unknown requested subagent is excluded');
|
||||
});
|
||||
|
||||
test('emits separate frontmatter-free Markdown prompts for root and subagents', () => {
|
||||
const result = buildKimiAgentArtifacts({
|
||||
rootAgent: ROOT_AGENT,
|
||||
subagents: [
|
||||
{ path: 'agents/gsd-executor.md', content: EXECUTOR_AGENT },
|
||||
{ path: 'agents/msd-executor.md', content: EXECUTOR_AGENT },
|
||||
],
|
||||
requestedSubagents: ['gsd-executor'],
|
||||
requestedSubagents: ['msd-executor'],
|
||||
});
|
||||
|
||||
const executor = result.subagents.find((artifact) => artifact.name === 'gsd-executor');
|
||||
const executor = result.subagents.find((artifact) => artifact.name === 'msd-executor');
|
||||
assert.ok(executor, 'executor subagent artifact exists');
|
||||
|
||||
assert.equal(executor.yamlPath, 'agents/subagents/gsd-executor.yaml');
|
||||
assert.equal(executor.promptPath, 'agents/subagents/gsd-executor.md');
|
||||
assert.ok(executor.yaml.includes('system_prompt_path: ./gsd-executor.md'));
|
||||
assert.equal(executor.yamlPath, 'agents/subagents/msd-executor.yaml');
|
||||
assert.equal(executor.promptPath, 'agents/subagents/msd-executor.md');
|
||||
assert.ok(executor.yaml.includes('system_prompt_path: ./msd-executor.md'));
|
||||
assert.ok(executor.yaml.includes('kimi_cli.tools.file:ReadFile'), 'Read maps to Kimi file tool');
|
||||
assert.ok(executor.yaml.includes('kimi_cli.tools.file:WriteFile'), 'Write maps to Kimi file tool');
|
||||
assert.ok(executor.yaml.includes('kimi_cli.tools.file:StrReplaceFile'), 'Edit maps to Kimi file tool');
|
||||
@@ -109,28 +109,28 @@ describe('buildKimiAgentArtifacts', () => {
|
||||
assert.ok(!prompt.includes('tools:'), 'source frontmatter tools do not leak into prompt');
|
||||
assert.ok(!prompt.includes('color:'), 'source frontmatter color does not leak into prompt');
|
||||
}
|
||||
assert.ok(result.root.prompt.includes('# GSD Root'), 'root body content is preserved');
|
||||
assert.ok(executor.prompt.includes('You are a GSD plan executor.'), 'subagent body content is preserved');
|
||||
assert.ok(!result.root.prompt.includes('~/.claude/gsd-core'), 'Claude-specific path is neutralized');
|
||||
assert.ok(result.root.prompt.includes('# MSD Root'), 'root body content is preserved');
|
||||
assert.ok(executor.prompt.includes('You are a MSD plan executor.'), 'subagent body content is preserved');
|
||||
assert.ok(!result.root.prompt.includes('~/.claude/msd-core'), 'Claude-specific path is neutralized');
|
||||
});
|
||||
|
||||
test('diagnoses unknown subagents and unsupported inputs instead of emitting invalid names', () => {
|
||||
const result = buildKimiAgentArtifacts({
|
||||
rootAgent: ROOT_AGENT,
|
||||
subagents: [
|
||||
{ path: 'agents/gsd-executor.md', content: EXECUTOR_AGENT },
|
||||
{ path: 'agents/msd-executor.md', content: EXECUTOR_AGENT },
|
||||
{ path: 'agents/not-valid.md', content: INVALID_AGENT },
|
||||
],
|
||||
requestedSubagents: ['gsd-executor', 'gsd-missing'],
|
||||
requestedSubagents: ['msd-executor', 'msd-missing'],
|
||||
});
|
||||
|
||||
assert.deepEqual(
|
||||
result.subagents.map((artifact) => artifact.name),
|
||||
['gsd-executor'],
|
||||
['msd-executor'],
|
||||
'invalid and unknown subagents are not emitted'
|
||||
);
|
||||
assert.ok(
|
||||
result.diagnostics.some((item) => item.code === 'kimi_unknown_subagent' && item.value === 'gsd-missing'),
|
||||
result.diagnostics.some((item) => item.code === 'kimi_unknown_subagent' && item.value === 'msd-missing'),
|
||||
'unknown requested subagent is diagnosed'
|
||||
);
|
||||
assert.ok(
|
||||
@@ -167,7 +167,7 @@ describe('buildKimiAgentArtifacts', () => {
|
||||
__foldDescribe("folded:bug-kimi-path-layout-local-guard (consolidation epic #1969 B3 #1972)", () => {
|
||||
'use strict';
|
||||
|
||||
process.env.GSD_TEST_MODE = '1';
|
||||
process.env.MSD_TEST_MODE = '1';
|
||||
|
||||
const { describe, test } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
@@ -182,8 +182,8 @@ const { installerEnv } = require('./helpers/install-shared.cjs');
|
||||
const ROOT = path.join(__dirname, '..');
|
||||
|
||||
// Cross-platform temp paths for test fixtures (avoids hardcoded /tmp)
|
||||
const KIMI_CFG = path.join(os.tmpdir(), 'gsd-kimi-config-test').replace(/\\/g, '/');
|
||||
const XDG_HOME = path.join(os.tmpdir(), 'gsd-xdg-home-test');
|
||||
const KIMI_CFG = path.join(os.tmpdir(), 'msd-kimi-config-test').replace(/\\/g, '/');
|
||||
const XDG_HOME = path.join(os.tmpdir(), 'msd-xdg-home-test');
|
||||
const INSTALL_SCRIPT = path.join(ROOT, 'bin', 'install.js');
|
||||
// #3145: class-norm timeout, not a per-suite value — see helpers/timeouts.cjs.
|
||||
const { INSTALL_TIMEOUT_MS } = require('./helpers/timeouts.cjs');
|
||||
@@ -193,10 +193,10 @@ const {
|
||||
getGlobalSkillsBase,
|
||||
getGlobalSkillDir,
|
||||
resolveKimiGlobalDir,
|
||||
} = require(path.join(ROOT, 'gsd-core', 'bin', 'lib', 'runtime-homes.cjs'));
|
||||
} = require(path.join(ROOT, 'msd-core', 'bin', 'lib', 'runtime-homes.cjs'));
|
||||
const {
|
||||
resolveRuntimeArtifactLayout,
|
||||
} = require(path.join(ROOT, 'gsd-core', 'bin', 'lib', 'runtime-artifact-layout.cjs'));
|
||||
} = require(path.join(ROOT, 'msd-core', 'bin', 'lib', 'runtime-artifact-layout.cjs'));
|
||||
const {
|
||||
getGlobalDir,
|
||||
getConfigDirFromHome,
|
||||
@@ -222,7 +222,7 @@ function withEnv(updates, fn) {
|
||||
|
||||
describe('Kimi runtime homes', () => {
|
||||
test('default Kimi global root is recommended ~/.config/agents when no generic skills root exists', () => {
|
||||
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-home-default-'));
|
||||
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-home-default-'));
|
||||
try {
|
||||
withEnv({ KIMI_CONFIG_DIR: undefined, XDG_CONFIG_HOME: undefined, HOME: tmpHome, USERPROFILE: tmpHome }, () => {
|
||||
assert.strictEqual(
|
||||
@@ -234,8 +234,8 @@ describe('Kimi runtime homes', () => {
|
||||
path.join(tmpHome, '.config', 'agents', 'skills'),
|
||||
);
|
||||
assert.strictEqual(
|
||||
getGlobalSkillDir('kimi', 'gsd-help'),
|
||||
path.join(tmpHome, '.config', 'agents', 'skills', 'gsd-help'),
|
||||
getGlobalSkillDir('kimi', 'msd-help'),
|
||||
path.join(tmpHome, '.config', 'agents', 'skills', 'msd-help'),
|
||||
);
|
||||
assert.notStrictEqual(
|
||||
getGlobalSkillsBase('kimi'),
|
||||
@@ -248,7 +248,7 @@ describe('Kimi runtime homes', () => {
|
||||
});
|
||||
|
||||
test('Kimi root resolution follows first-existing generic skills directory order', () => {
|
||||
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-home-existing-'));
|
||||
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-home-existing-'));
|
||||
try {
|
||||
const recommendedRoot = path.join(tmpHome, '.config', 'agents');
|
||||
const fallbackRoot = path.join(tmpHome, '.agents');
|
||||
@@ -286,7 +286,7 @@ describe('Kimi runtime homes', () => {
|
||||
});
|
||||
|
||||
test('XDG_CONFIG_HOME does not change Kimi default root', () => {
|
||||
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-home-xdg-'));
|
||||
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-home-xdg-'));
|
||||
try {
|
||||
withEnv({ KIMI_CONFIG_DIR: undefined, XDG_CONFIG_HOME: XDG_HOME, HOME: tmpHome, USERPROFILE: tmpHome }, () => {
|
||||
assert.strictEqual(
|
||||
@@ -304,8 +304,8 @@ describe('Kimi runtime homes', () => {
|
||||
});
|
||||
|
||||
test('Kimi global install reuses existing ~/.agents/skills when recommended root is absent', () => {
|
||||
const tmpProject = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-existing-agents-project-'));
|
||||
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-existing-agents-home-'));
|
||||
const tmpProject = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-existing-agents-project-'));
|
||||
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-existing-agents-home-'));
|
||||
try {
|
||||
fs.mkdirSync(path.join(tmpHome, '.agents', 'skills'), { recursive: true });
|
||||
const result = runNode(
|
||||
@@ -323,11 +323,11 @@ describe('Kimi runtime homes', () => {
|
||||
`expected --kimi --global to reuse existing ~/.agents/skills\nstdout: ${result.stdout}\nstderr: ${result.stderr}`,
|
||||
);
|
||||
assert.strictEqual(
|
||||
fs.existsSync(path.join(tmpHome, '.agents', 'skills', 'gsd-new-project', 'SKILL.md')),
|
||||
fs.existsSync(path.join(tmpHome, '.agents', 'skills', 'msd-new-project', 'SKILL.md')),
|
||||
true,
|
||||
);
|
||||
assert.strictEqual(
|
||||
fs.existsSync(path.join(tmpHome, '.config', 'agents', 'skills', 'gsd-new-project', 'SKILL.md')),
|
||||
fs.existsSync(path.join(tmpHome, '.config', 'agents', 'skills', 'msd-new-project', 'SKILL.md')),
|
||||
false,
|
||||
);
|
||||
} finally {
|
||||
@@ -345,11 +345,11 @@ describe('Kimi runtime artifact layout', () => {
|
||||
assert.strictEqual(globalLayout.kinds.length, 2);
|
||||
assert.strictEqual(globalLayout.kinds[0].kind, 'skills');
|
||||
assert.strictEqual(globalLayout.kinds[0].destSubpath, 'skills');
|
||||
assert.strictEqual(globalLayout.kinds[0].prefix, 'gsd-');
|
||||
assert.strictEqual(globalLayout.kinds[0].prefix, 'msd-');
|
||||
assert.strictEqual(typeof globalLayout.kinds[0].stage, 'function');
|
||||
assert.strictEqual(globalLayout.kinds[1].kind, 'kimi-agents');
|
||||
assert.strictEqual(globalLayout.kinds[1].destSubpath, 'agents');
|
||||
assert.strictEqual(globalLayout.kinds[1].prefix, 'gsd');
|
||||
assert.strictEqual(globalLayout.kinds[1].prefix, 'msd');
|
||||
assert.strictEqual(typeof globalLayout.kinds[1].stage, 'function');
|
||||
|
||||
const localLayout = resolveRuntimeArtifactLayout('kimi', KIMI_CFG, 'local');
|
||||
@@ -360,8 +360,8 @@ describe('Kimi runtime artifact layout', () => {
|
||||
|
||||
describe('Kimi local install guard', () => {
|
||||
test('--kimi --local exits successfully without writing local Kimi project artifacts', () => {
|
||||
const tmpProject = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-local-project-'));
|
||||
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-local-home-'));
|
||||
const tmpProject = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-local-project-'));
|
||||
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-local-home-'));
|
||||
try {
|
||||
const result = runNode(
|
||||
[INSTALL_SCRIPT, '--kimi', '--local', '--no-sdk'],
|
||||
@@ -392,9 +392,9 @@ describe('Kimi local install guard', () => {
|
||||
});
|
||||
|
||||
test('--kimi --global writes converted Kimi skills and agent artifacts', () => {
|
||||
const tmpProject = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-global-project-'));
|
||||
const tmpConfig = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-global-config-'));
|
||||
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-global-home-'));
|
||||
const tmpProject = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-global-project-'));
|
||||
const tmpConfig = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-global-config-'));
|
||||
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-global-home-'));
|
||||
try {
|
||||
const result = runNode(
|
||||
[INSTALL_SCRIPT, '--kimi', '--global', '--config-dir', tmpConfig, '--no-sdk'],
|
||||
@@ -413,54 +413,54 @@ describe('Kimi local install guard', () => {
|
||||
const combined = `${result.stdout}\n${result.stderr}`;
|
||||
assert.match(combined, /Installing for .*Kimi/i);
|
||||
assert.match(combined, /Installed \d+ Kimi skills to skills\//i);
|
||||
assert.match(combined, /Generated Kimi root agent: .*agents.*gsd\.yaml/i);
|
||||
assert.match(combined, /Generated Kimi root agent: .*agents.*msd\.yaml/i);
|
||||
assert.match(combined, /kimi --agent-file/i);
|
||||
assert.match(combined, /Wrote file manifest/i);
|
||||
|
||||
const skillFile = path.join(tmpConfig, 'skills', 'gsd-new-project', 'SKILL.md');
|
||||
assert.ok(fs.existsSync(skillFile), 'must write gsd-new-project/SKILL.md');
|
||||
const skillFile = path.join(tmpConfig, 'skills', 'msd-new-project', 'SKILL.md');
|
||||
assert.ok(fs.existsSync(skillFile), 'must write msd-new-project/SKILL.md');
|
||||
const skillContent = fs.readFileSync(skillFile, 'utf8');
|
||||
assert.match(skillContent, /^name: gsd-new-project$/m);
|
||||
assert.match(skillContent, /\/skill:gsd-new-project/);
|
||||
assert.match(skillContent, /gsd-core\/workflows\/new-project\.md/);
|
||||
assert.doesNotMatch(skillContent, /@~\/\.claude\/gsd-core|@\$HOME\/\.claude\/gsd-core/);
|
||||
assert.match(skillContent, /^name: msd-new-project$/m);
|
||||
assert.match(skillContent, /\/skill:msd-new-project/);
|
||||
assert.match(skillContent, /msd-core\/workflows\/new-project\.md/);
|
||||
assert.doesNotMatch(skillContent, /@~\/\.claude\/msd-core|@\$HOME\/\.claude\/msd-core/);
|
||||
assert.doesNotMatch(skillContent, /@[^\r\n]*\\/, 'serialized Kimi payload references must use forward slashes');
|
||||
assert.doesNotMatch(skillContent, /kimi_cli\.tools|system_prompt_path|^version: 1$/m);
|
||||
|
||||
const rootYaml = path.join(tmpConfig, 'agents', 'gsd.yaml');
|
||||
const rootPrompt = path.join(tmpConfig, 'agents', 'gsd.md');
|
||||
const executorYaml = path.join(tmpConfig, 'agents', 'subagents', 'gsd-executor.yaml');
|
||||
const executorPrompt = path.join(tmpConfig, 'agents', 'subagents', 'gsd-executor.md');
|
||||
assert.ok(fs.existsSync(rootYaml), 'must write agents/gsd.yaml');
|
||||
assert.ok(fs.existsSync(rootPrompt), 'must write agents/gsd.md');
|
||||
assert.ok(fs.existsSync(executorYaml), 'must write agents/subagents/gsd-executor.yaml');
|
||||
assert.ok(fs.existsSync(executorPrompt), 'must write agents/subagents/gsd-executor.md');
|
||||
const rootYaml = path.join(tmpConfig, 'agents', 'msd.yaml');
|
||||
const rootPrompt = path.join(tmpConfig, 'agents', 'msd.md');
|
||||
const executorYaml = path.join(tmpConfig, 'agents', 'subagents', 'msd-executor.yaml');
|
||||
const executorPrompt = path.join(tmpConfig, 'agents', 'subagents', 'msd-executor.md');
|
||||
assert.ok(fs.existsSync(rootYaml), 'must write agents/msd.yaml');
|
||||
assert.ok(fs.existsSync(rootPrompt), 'must write agents/msd.md');
|
||||
assert.ok(fs.existsSync(executorYaml), 'must write agents/subagents/msd-executor.yaml');
|
||||
assert.ok(fs.existsSync(executorPrompt), 'must write agents/subagents/msd-executor.md');
|
||||
|
||||
const rootYamlContent = fs.readFileSync(rootYaml, 'utf8');
|
||||
assert.match(rootYamlContent, /^version: 1$/m);
|
||||
assert.match(rootYamlContent, /^agent:$/m);
|
||||
assert.match(rootYamlContent, /extend: default/);
|
||||
assert.match(rootYamlContent, /system_prompt_path: \.\/gsd\.md/);
|
||||
assert.match(rootYamlContent, /system_prompt_path: \.\/msd\.md/);
|
||||
assert.match(rootYamlContent, /tools:/);
|
||||
assert.match(rootYamlContent, /subagents:/);
|
||||
assert.match(rootYamlContent, /kimi_cli\.tools\./);
|
||||
assert.doesNotMatch(rootYamlContent, /mcp__/);
|
||||
|
||||
const executorYamlContent = fs.readFileSync(executorYaml, 'utf8');
|
||||
assert.match(executorYamlContent, /system_prompt_path: \.\/gsd-executor\.md/);
|
||||
assert.match(executorYamlContent, /system_prompt_path: \.\/msd-executor\.md/);
|
||||
assert.match(executorYamlContent, /kimi_cli\.tools\./);
|
||||
assert.doesNotMatch(executorYamlContent, /mcp__/);
|
||||
|
||||
assert.ok(fs.existsSync(path.join(tmpConfig, 'gsd-core', 'workflows', 'new-project.md')), 'must write workflow payloads used by Kimi skills');
|
||||
const manifestPath = path.join(tmpConfig, 'gsd-file-manifest.json');
|
||||
assert.ok(fs.existsSync(manifestPath), 'must write gsd-file-manifest.json for Kimi installs');
|
||||
assert.ok(fs.existsSync(path.join(tmpConfig, 'msd-core', 'workflows', 'new-project.md')), 'must write workflow payloads used by Kimi skills');
|
||||
const manifestPath = path.join(tmpConfig, 'msd-file-manifest.json');
|
||||
assert.ok(fs.existsSync(manifestPath), 'must write msd-file-manifest.json for Kimi installs');
|
||||
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
||||
assert.ok(manifest.files['skills/gsd-new-project/SKILL.md'], 'manifest tracks generated Kimi skill');
|
||||
assert.ok(manifest.files['agents/gsd.yaml'], 'manifest tracks Kimi root agent YAML');
|
||||
assert.ok(manifest.files['agents/gsd.md'], 'manifest tracks Kimi root agent prompt');
|
||||
assert.ok(manifest.files['agents/subagents/gsd-executor.yaml'], 'manifest tracks Kimi subagent YAML');
|
||||
assert.ok(manifest.files['agents/subagents/gsd-executor.md'], 'manifest tracks Kimi subagent prompt');
|
||||
assert.ok(manifest.files['gsd-core/workflows/new-project.md'], 'manifest tracks installed workflow payload');
|
||||
assert.ok(manifest.files['skills/msd-new-project/SKILL.md'], 'manifest tracks generated Kimi skill');
|
||||
assert.ok(manifest.files['agents/msd.yaml'], 'manifest tracks Kimi root agent YAML');
|
||||
assert.ok(manifest.files['agents/msd.md'], 'manifest tracks Kimi root agent prompt');
|
||||
assert.ok(manifest.files['agents/subagents/msd-executor.yaml'], 'manifest tracks Kimi subagent YAML');
|
||||
assert.ok(manifest.files['agents/subagents/msd-executor.md'], 'manifest tracks Kimi subagent prompt');
|
||||
assert.ok(manifest.files['msd-core/workflows/new-project.md'], 'manifest tracks installed workflow payload');
|
||||
assert.ok(!fs.existsSync(path.join(tmpConfig, 'hooks')), 'must not write hooks under the Kimi root');
|
||||
assert.ok(!fs.existsSync(path.join(tmpConfig, 'settings.json')), 'must not write settings.json under the Kimi root');
|
||||
assert.ok(!fs.existsSync(path.join(tmpConfig, '.clinerules')), 'must not write rules under the Kimi root');
|
||||
@@ -472,9 +472,9 @@ describe('Kimi local install guard', () => {
|
||||
});
|
||||
|
||||
test('--kimi --global backs up local edits to generated skills and agent artifacts on reinstall', () => {
|
||||
const tmpProject = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-reinstall-project-'));
|
||||
const tmpConfig = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-reinstall-config-'));
|
||||
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-reinstall-home-'));
|
||||
const tmpProject = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-reinstall-project-'));
|
||||
const tmpConfig = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-reinstall-config-'));
|
||||
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-reinstall-home-'));
|
||||
const env = installerEnv({ HOME: tmpHome, USERPROFILE: tmpHome });
|
||||
|
||||
try {
|
||||
@@ -490,8 +490,8 @@ describe('Kimi local install guard', () => {
|
||||
`first install failed\nstdout: ${first.stdout}\nstderr: ${first.stderr}`,
|
||||
);
|
||||
|
||||
const skillFile = path.join(tmpConfig, 'skills', 'gsd-new-project', 'SKILL.md');
|
||||
const agentPrompt = path.join(tmpConfig, 'agents', 'subagents', 'gsd-executor.md');
|
||||
const skillFile = path.join(tmpConfig, 'skills', 'msd-new-project', 'SKILL.md');
|
||||
const agentPrompt = path.join(tmpConfig, 'agents', 'subagents', 'msd-executor.md');
|
||||
fs.appendFileSync(skillFile, '\nUSER LOCAL KIMI SKILL EDIT\n');
|
||||
fs.appendFileSync(agentPrompt, '\nUSER LOCAL KIMI AGENT EDIT\n');
|
||||
|
||||
@@ -506,18 +506,18 @@ describe('Kimi local install guard', () => {
|
||||
`second install failed\nstdout: ${second.stdout}\nstderr: ${second.stderr}`,
|
||||
);
|
||||
const secondOutput = `${second.stdout}\n${second.stderr}`;
|
||||
assert.match(secondOutput, /locally modified GSD file/i);
|
||||
assert.match(secondOutput, /\/skill:gsd-update --reapply/);
|
||||
assert.doesNotMatch(secondOutput, /Run\s+\/gsd-update --reapply/);
|
||||
assert.match(secondOutput, /locally modified MSD file/i);
|
||||
assert.match(secondOutput, /\/skill:msd-update --reapply/);
|
||||
assert.doesNotMatch(secondOutput, /Run\s+\/msd-update --reapply/);
|
||||
|
||||
const skillBackup = path.join(tmpConfig, 'gsd-local-patches', 'skills', 'gsd-new-project', 'SKILL.md');
|
||||
const agentBackup = path.join(tmpConfig, 'gsd-local-patches', 'agents', 'subagents', 'gsd-executor.md');
|
||||
const skillBackup = path.join(tmpConfig, 'msd-local-patches', 'skills', 'msd-new-project', 'SKILL.md');
|
||||
const agentBackup = path.join(tmpConfig, 'msd-local-patches', 'agents', 'subagents', 'msd-executor.md');
|
||||
assert.match(fs.readFileSync(skillBackup, 'utf8'), /USER LOCAL KIMI SKILL EDIT/);
|
||||
assert.match(fs.readFileSync(agentBackup, 'utf8'), /USER LOCAL KIMI AGENT EDIT/);
|
||||
|
||||
const meta = JSON.parse(fs.readFileSync(path.join(tmpConfig, 'gsd-local-patches', 'backup-meta.json'), 'utf8'));
|
||||
assert.ok(meta.files.includes('skills/gsd-new-project/SKILL.md'));
|
||||
assert.ok(meta.files.includes('agents/subagents/gsd-executor.md'));
|
||||
const meta = JSON.parse(fs.readFileSync(path.join(tmpConfig, 'msd-local-patches', 'backup-meta.json'), 'utf8'));
|
||||
assert.ok(meta.files.includes('skills/msd-new-project/SKILL.md'));
|
||||
assert.ok(meta.files.includes('agents/subagents/msd-executor.md'));
|
||||
} finally {
|
||||
cleanup(tmpProject);
|
||||
cleanup(tmpConfig);
|
||||
@@ -525,10 +525,10 @@ describe('Kimi local install guard', () => {
|
||||
}
|
||||
});
|
||||
|
||||
test('--kimi --global --uninstall removes GSD artifacts and preserves non-GSD Kimi content', () => {
|
||||
const tmpProject = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-uninstall-project-'));
|
||||
const tmpConfig = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-uninstall-config-'));
|
||||
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-kimi-uninstall-home-'));
|
||||
test('--kimi --global --uninstall removes MSD artifacts and preserves non-MSD Kimi content', () => {
|
||||
const tmpProject = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-uninstall-project-'));
|
||||
const tmpConfig = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-uninstall-config-'));
|
||||
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'msd-kimi-uninstall-home-'));
|
||||
const env = installerEnv({ HOME: tmpHome, USERPROFILE: tmpHome });
|
||||
|
||||
try {
|
||||
@@ -568,17 +568,17 @@ describe('Kimi local install guard', () => {
|
||||
);
|
||||
assert.match(`${uninstallResult.stdout}\n${uninstallResult.stderr}`, /Kimi CLI/);
|
||||
|
||||
assert.ok(!fs.existsSync(path.join(tmpConfig, 'skills', 'gsd-new-project')), 'must remove generated Kimi skills');
|
||||
assert.ok(!fs.existsSync(path.join(tmpConfig, 'agents', 'gsd.yaml')), 'must remove Kimi root agent YAML');
|
||||
assert.ok(!fs.existsSync(path.join(tmpConfig, 'agents', 'gsd.md')), 'must remove Kimi root agent prompt');
|
||||
assert.ok(!fs.existsSync(path.join(tmpConfig, 'agents', 'subagents', 'gsd-executor.yaml')), 'must remove generated Kimi subagent YAML');
|
||||
assert.ok(!fs.existsSync(path.join(tmpConfig, 'agents', 'subagents', 'gsd-executor.md')), 'must remove generated Kimi subagent prompt');
|
||||
assert.ok(!fs.existsSync(path.join(tmpConfig, 'gsd-core')), 'must remove installed workflow payload');
|
||||
assert.ok(!fs.existsSync(path.join(tmpConfig, 'gsd-file-manifest.json')), 'must remove the manifest');
|
||||
assert.ok(!fs.existsSync(path.join(tmpConfig, 'skills', 'msd-new-project')), 'must remove generated Kimi skills');
|
||||
assert.ok(!fs.existsSync(path.join(tmpConfig, 'agents', 'msd.yaml')), 'must remove Kimi root agent YAML');
|
||||
assert.ok(!fs.existsSync(path.join(tmpConfig, 'agents', 'msd.md')), 'must remove Kimi root agent prompt');
|
||||
assert.ok(!fs.existsSync(path.join(tmpConfig, 'agents', 'subagents', 'msd-executor.yaml')), 'must remove generated Kimi subagent YAML');
|
||||
assert.ok(!fs.existsSync(path.join(tmpConfig, 'agents', 'subagents', 'msd-executor.md')), 'must remove generated Kimi subagent prompt');
|
||||
assert.ok(!fs.existsSync(path.join(tmpConfig, 'msd-core')), 'must remove installed workflow payload');
|
||||
assert.ok(!fs.existsSync(path.join(tmpConfig, 'msd-file-manifest.json')), 'must remove the manifest');
|
||||
|
||||
assert.ok(fs.existsSync(foreignSkill), 'must preserve non-GSD Kimi skills');
|
||||
assert.ok(fs.existsSync(foreignRootAgent), 'must preserve non-GSD root agents');
|
||||
assert.ok(fs.existsSync(foreignSubagent), 'must preserve non-GSD subagents');
|
||||
assert.ok(fs.existsSync(foreignSkill), 'must preserve non-MSD Kimi skills');
|
||||
assert.ok(fs.existsSync(foreignRootAgent), 'must preserve non-MSD root agents');
|
||||
assert.ok(fs.existsSync(foreignSubagent), 'must preserve non-MSD subagents');
|
||||
} finally {
|
||||
cleanup(tmpProject);
|
||||
cleanup(tmpConfig);
|
||||
|
||||
Reference in New Issue
Block a user