Skip to content

armgit / ECC

Public Imported from GitHub
0

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

Fix claude-project target for legacy language installs (#2147)

Adilan Akhramovich53d4b7d6645c
diff --git a/scripts/lib/install-executor.js b/scripts/lib/install-executor.js
index a8311fc1a..dc29f1c8c 100644
--- a/scripts/lib/install-executor.js
+++ b/scripts/lib/install-executor.js
@@ -262,18 +262,16 @@ function isDirectoryNonEmpty(dirPath) {
return fs.existsSync(dirPath) && fs.statSync(dirPath).isDirectory() && fs.readdirSync(dirPath).length > 0;
}
-function planClaudeLegacyInstall(context) {
- const adapter = getInstallTargetAdapter('claude');
- const targetRoot = adapter.resolveRoot({ homeDir: context.homeDir });
- const rulesDir = context.claudeRulesDir || path.join(targetRoot, 'rules', CLAUDE_ECC_NAMESPACE);
- const installStatePath = adapter.getInstallStatePath({ homeDir: context.homeDir });
+function planClaudeStyleLegacyInstall(context, { adapterId, adapterRootInput, rulesDir: rulesDirOverride }) {
+ const adapter = getInstallTargetAdapter(adapterId);
+ const targetRoot = adapter.resolveRoot(adapterRootInput);
+ const rulesDir = rulesDirOverride || path.join(targetRoot, 'rules', CLAUDE_ECC_NAMESPACE);
+ const installStatePath = adapter.getInstallStatePath(adapterRootInput);
const operations = [];
const warnings = [];
if (isDirectoryNonEmpty(rulesDir)) {
- warnings.push(
- `Destination ${rulesDir}/ already exists and files may be overwritten`
- );
+ warnings.push(`Destination ${rulesDir}/ already exists and files may be overwritten`);
}
addRecursiveCopyOperations(operations, {
@@ -285,9 +283,7 @@ function planClaudeLegacyInstall(context) {
for (const language of context.languages) {
if (!LANGUAGE_NAME_PATTERN.test(language)) {
- warnings.push(
- `Invalid language name '${language}'. Only alphanumeric, dash, and underscore are allowed`
- );
+ warnings.push(`Invalid language name '${language}'. Only alphanumeric, dash, and underscore are allowed`);
continue;
}
@@ -308,7 +304,7 @@ function planClaudeLegacyInstall(context) {
return {
mode: 'legacy',
adapter,
- target: 'claude',
+ target: adapterId,
targetRoot,
installRoot: rulesDir,
installStatePath,
@@ -318,6 +314,22 @@ function planClaudeLegacyInstall(context) {
};
}
+function planClaudeLegacyInstall(context) {
+ return planClaudeStyleLegacyInstall(context, {
+ adapterId: 'claude',
+ adapterRootInput: { homeDir: context.homeDir },
+ rulesDir: context.claudeRulesDir || null,
+ });
+}
+
+function planClaudeProjectLegacyInstall(context) {
+ return planClaudeStyleLegacyInstall(context, {
+ adapterId: 'claude-project',
+ adapterRootInput: { repoRoot: context.projectRoot },
+ rulesDir: null,
+ });
+}
+
function planCursorLegacyInstall(context) {
const adapter = getInstallTargetAdapter('cursor');
const targetRoot = adapter.resolveRoot({ repoRoot: context.projectRoot });
@@ -503,6 +515,8 @@ function createLegacyInstallPlan(options = {}) {
let plan;
if (target === 'claude') {
plan = planClaudeLegacyInstall(context);
+ } else if (target === 'claude-project') {
+ plan = planClaudeProjectLegacyInstall(context);
} else if (target === 'cursor') {
plan = planCursorLegacyInstall(context);
} else {
diff --git a/scripts/lib/install/request.js b/scripts/lib/install/request.js
index 5b69d67c9..d95b84ed5 100644
--- a/scripts/lib/install/request.js
+++ b/scripts/lib/install/request.js
@@ -2,7 +2,7 @@
const { validateInstallModuleIds, LOCALE_ALIAS_TO_COMPONENT_ID, listSupportedLocales } = require('../install-manifests');
-const LEGACY_INSTALL_TARGETS = ['claude', 'cursor', 'antigravity'];
+const LEGACY_INSTALL_TARGETS = ['claude', 'claude-project', 'cursor', 'antigravity'];
function dedupeStrings(values) {
return [...new Set((Array.isArray(values) ? values : []).map(value => String(value).trim()).filter(Boolean))];