mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-05-01 06:23:28 +08:00
fix: namespace cursor agent installs
This commit is contained in:
committed by
Affaan Mustafa
parent
5881554a1c
commit
e1d6d853f7
@@ -213,7 +213,10 @@ function runTests() {
|
||||
assert.strictEqual(plan.installRoot, targetRoot);
|
||||
assert.ok(operationFor(plan, path.join('.cursor', 'rules', 'common-style.md')));
|
||||
assert.ok(operationFor(plan, path.join('.cursor', 'rules', 'typescript-style.md')));
|
||||
assert.ok(operationFor(plan, path.join('.cursor', 'agents', 'planner.md')));
|
||||
assert.ok(operationFor(plan, path.join('.cursor', 'agents', 'ecc-planner.md')));
|
||||
assert.ok(!plan.operations.some(operation => (
|
||||
operation.destinationPath.endsWith(path.join('.cursor', 'agents', 'planner.md'))
|
||||
)));
|
||||
assert.ok(operationFor(plan, path.join('.cursor', 'skills', 'demo', 'SKILL.md')));
|
||||
assert.ok(operationFor(plan, path.join('.cursor', 'commands', 'plan.md')));
|
||||
assert.ok(operationFor(plan, path.join('.cursor', 'hooks', 'hook.js')));
|
||||
|
||||
@@ -202,6 +202,44 @@ function runTests() {
|
||||
);
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('plans cursor agents with ecc-prefixed filenames to avoid agent collisions', () => {
|
||||
const repoRoot = path.join(__dirname, '..', '..');
|
||||
const projectRoot = '/workspace/app';
|
||||
|
||||
const plan = planInstallTargetScaffold({
|
||||
target: 'cursor',
|
||||
repoRoot,
|
||||
projectRoot,
|
||||
modules: [
|
||||
{
|
||||
id: 'agents-core',
|
||||
paths: ['agents'],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
assert.ok(
|
||||
plan.operations.some(operation => (
|
||||
normalizedRelativePath(operation.sourceRelativePath) === 'agents/architect.md'
|
||||
&& operation.destinationPath === path.join(projectRoot, '.cursor', 'agents', 'ecc-architect.md')
|
||||
)),
|
||||
'Should prefix Cursor agent files with ecc-'
|
||||
);
|
||||
assert.ok(
|
||||
!plan.operations.some(operation => (
|
||||
operation.destinationPath === path.join(projectRoot, '.cursor', 'agents', 'architect.md')
|
||||
)),
|
||||
'Should not write bare Cursor agent filenames'
|
||||
);
|
||||
assert.ok(
|
||||
!plan.operations.some(operation => (
|
||||
normalizedRelativePath(operation.sourceRelativePath) === 'agents'
|
||||
&& operation.destinationPath === path.join(projectRoot, '.cursor', 'agents')
|
||||
)),
|
||||
'Should not plan a whole-directory Cursor agent copy'
|
||||
);
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('plans cursor platform rule files as .mdc and excludes rule README docs', () => {
|
||||
const repoRoot = path.join(__dirname, '..', '..');
|
||||
const projectRoot = '/workspace/app';
|
||||
|
||||
@@ -136,7 +136,8 @@ function runTests() {
|
||||
assert.ok(fs.existsSync(path.join(projectDir, '.cursor', 'rules', 'common-agents.mdc')));
|
||||
assert.ok(!fs.existsSync(path.join(projectDir, '.cursor', 'rules', 'common-agents.md')));
|
||||
assert.ok(!fs.existsSync(path.join(projectDir, '.cursor', 'rules', 'README.mdc')));
|
||||
assert.ok(fs.existsSync(path.join(projectDir, '.cursor', 'agents', 'architect.md')));
|
||||
assert.ok(fs.existsSync(path.join(projectDir, '.cursor', 'agents', 'ecc-architect.md')));
|
||||
assert.ok(!fs.existsSync(path.join(projectDir, '.cursor', 'agents', 'architect.md')));
|
||||
assert.ok(fs.existsSync(path.join(projectDir, '.cursor', 'commands', 'plan.md')));
|
||||
assert.ok(fs.existsSync(path.join(projectDir, '.cursor', 'hooks.json')));
|
||||
assert.ok(fs.existsSync(path.join(projectDir, '.cursor', 'mcp.json')));
|
||||
|
||||
@@ -93,6 +93,21 @@ function runTests() {
|
||||
);
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('README documents Cursor agent namespace and loading caveat', () => {
|
||||
assert.ok(
|
||||
readme.includes('`.cursor/agents/ecc-*.md`'),
|
||||
'README should document the Cursor agent namespace'
|
||||
);
|
||||
assert.ok(
|
||||
readme.includes('Cursor-native loading behavior can vary by Cursor build.'),
|
||||
'README should avoid overclaiming Cursor agent loading semantics'
|
||||
);
|
||||
assert.ok(
|
||||
readme.includes('ECC does not install root `AGENTS.md` into `.cursor/`.'),
|
||||
'README should explain why root AGENTS.md is not copied into Cursor context'
|
||||
);
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('README explains plugin-path cleanup and rules scoping', () => {
|
||||
assert.ok(
|
||||
readme.includes('remove the plugin from Claude Code'),
|
||||
|
||||
Reference in New Issue
Block a user