mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-05-17 22:33:06 +08:00
fix: restore short Claude plugin slug and skill installs (#1712)
This commit is contained in:
@@ -81,6 +81,25 @@ function runTests() {
|
||||
]);
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('parses --skills as skill component selections', () => {
|
||||
const parsed = parseInstallArgs([
|
||||
'node', 'install-apply.js',
|
||||
'--skills', 'continuous-learning-v2,security-review',
|
||||
]);
|
||||
assert.deepStrictEqual(parsed.includeComponentIds, [
|
||||
'skill:continuous-learning-v2',
|
||||
'skill:security-review',
|
||||
]);
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('parses --skill when caller already includes the skill: prefix', () => {
|
||||
const parsed = parseInstallArgs([
|
||||
'node', 'install-apply.js',
|
||||
'--skill', 'skill:continuous-learning-v2',
|
||||
]);
|
||||
assert.deepStrictEqual(parsed.includeComponentIds, ['skill:continuous-learning-v2']);
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('parses multiple --without flags', () => {
|
||||
const parsed = parseInstallArgs([
|
||||
'node', 'install-apply.js',
|
||||
@@ -244,6 +263,7 @@ function runTests() {
|
||||
const components = listInstallComponents({ family: 'skill' });
|
||||
assert.ok(components.length > 0, 'Should have at least one skill component');
|
||||
assert.ok(components.some(c => c.id === 'skill:continuous-learning'), 'Should have skill:continuous-learning');
|
||||
assert.ok(components.some(c => c.id === 'skill:continuous-learning-v2'), 'Should have skill:continuous-learning-v2');
|
||||
})) passed++; else failed++;
|
||||
|
||||
// ─── Install Plan Resolution with --with ───
|
||||
@@ -430,6 +450,22 @@ function runTests() {
|
||||
'Should include workflow-quality module from skill:continuous-learning');
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('--with skill:continuous-learning-v2 installs only that skill module', () => {
|
||||
const plan = resolveInstallPlan({
|
||||
includeComponentIds: ['skill:continuous-learning-v2'],
|
||||
target: 'claude',
|
||||
});
|
||||
assert.deepStrictEqual(plan.selectedModuleIds, ['skill-continuous-learning-v2']);
|
||||
assert.ok(
|
||||
plan.operations.some(operation => operation.sourceRelativePath === 'skills/continuous-learning-v2'),
|
||||
'Should install the continuous-learning-v2 skill directory'
|
||||
);
|
||||
assert.ok(
|
||||
!plan.operations.some(operation => operation.sourceRelativePath === 'skills/tdd-workflow'),
|
||||
'Should not install the whole workflow-quality skill module'
|
||||
);
|
||||
})) passed++; else failed++;
|
||||
|
||||
// ─── Help Text ───
|
||||
|
||||
if (test('help text documents --with and --without flags', () => {
|
||||
@@ -670,6 +706,43 @@ function runTests() {
|
||||
}
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('end-to-end: --skills continuous-learning-v2 installs only that skill', () => {
|
||||
const { execFileSync } = require('child_process');
|
||||
const scriptPath = path.join(__dirname, '..', '..', 'scripts', 'install-apply.js');
|
||||
const homeDir = fs.mkdtempSync(path.join(os.tmpdir(), 'selective-skill-install-'));
|
||||
const projectDir = fs.mkdtempSync(path.join(os.tmpdir(), 'selective-skill-install-project-'));
|
||||
|
||||
try {
|
||||
execFileSync('node', [
|
||||
scriptPath,
|
||||
'--skills', 'continuous-learning-v2',
|
||||
], {
|
||||
cwd: projectDir,
|
||||
env: { ...process.env, HOME: homeDir },
|
||||
encoding: 'utf8',
|
||||
stdio: ['pipe', 'pipe', 'pipe'],
|
||||
});
|
||||
|
||||
const claudeRoot = path.join(homeDir, '.claude');
|
||||
assert.ok(
|
||||
fs.existsSync(path.join(claudeRoot, 'skills', 'ecc', 'continuous-learning-v2', 'SKILL.md')),
|
||||
'Should install continuous-learning-v2'
|
||||
);
|
||||
assert.ok(
|
||||
!fs.existsSync(path.join(claudeRoot, 'skills', 'ecc', 'tdd-workflow', 'SKILL.md')),
|
||||
'Should not install unrelated workflow-quality skills'
|
||||
);
|
||||
|
||||
const statePath = path.join(claudeRoot, 'ecc', 'install-state.json');
|
||||
const state = JSON.parse(fs.readFileSync(statePath, 'utf8'));
|
||||
assert.deepStrictEqual(state.request.includeComponents, ['skill:continuous-learning-v2']);
|
||||
assert.deepStrictEqual(state.resolution.selectedModules, ['skill-continuous-learning-v2']);
|
||||
} finally {
|
||||
fs.rmSync(homeDir, { recursive: true, force: true });
|
||||
fs.rmSync(projectDir, { recursive: true, force: true });
|
||||
}
|
||||
})) passed++; else failed++;
|
||||
|
||||
// ─── JSON output mode ───
|
||||
|
||||
if (test('end-to-end: --dry-run --json includes component selections in output', () => {
|
||||
|
||||
Reference in New Issue
Block a user