mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-30 16:45:48 +08:00
fix: avoid cursor nested AGENTS context pollution
This commit is contained in:
parent
95ce9eaaeb
commit
d49f0329a9
@ -133,6 +133,12 @@ module.exports = createInstallTargetAdapter({
|
||||
destinationPath: path.join(targetRoot, 'mcp.json'),
|
||||
});
|
||||
|
||||
if (sourceRelativePath === 'AGENTS.md') {
|
||||
// Cursor treats nested AGENTS.md files as directory context; do not
|
||||
// install ECC's root project identity into a host project's .cursor/.
|
||||
return [];
|
||||
}
|
||||
|
||||
if (sourceRelativePath === 'rules') {
|
||||
return takeUniqueOperations(createFlatRuleOperations({
|
||||
moduleId: module.id,
|
||||
|
||||
@ -172,6 +172,36 @@ function runTests() {
|
||||
);
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('does not install root AGENTS.md into Cursor nested context', () => {
|
||||
const repoRoot = path.join(__dirname, '..', '..');
|
||||
const projectRoot = '/workspace/app';
|
||||
|
||||
const plan = planInstallTargetScaffold({
|
||||
target: 'cursor',
|
||||
repoRoot,
|
||||
projectRoot,
|
||||
modules: [
|
||||
{
|
||||
id: 'agents-core',
|
||||
paths: ['.agents', 'agents', 'AGENTS.md'],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
assert.ok(
|
||||
!plan.operations.some(operation => (
|
||||
normalizedRelativePath(operation.sourceRelativePath) === 'AGENTS.md'
|
||||
)),
|
||||
'Cursor installs should not copy ECC root AGENTS.md into host project context'
|
||||
);
|
||||
assert.ok(
|
||||
!plan.operations.some(operation => (
|
||||
operation.destinationPath === path.join(projectRoot, '.cursor', 'AGENTS.md')
|
||||
)),
|
||||
'Cursor installs should not create .cursor/AGENTS.md'
|
||||
);
|
||||
})) 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';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user