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(commands): execute selected-profile resolvers and honor explicit audit intent

haelyrab582964d672b
diff --git a/commands/skill-host-compat.md b/commands/skill-host-compat.md
index 2a38ebdf6..43152c714 100644
--- a/commands/skill-host-compat.md
+++ b/commands/skill-host-compat.md
@@ -13,14 +13,14 @@ Lint curated `skills/` for Codex-safe frontmatter and Claude-only substitutions.
Run the host-compat validator:
```bash
-ECC_ROOT="${CLAUDE_PLUGIN_ROOT:-$(node -e "var r=(function(){var p=require('path'),f=require('fs'),o=require('os');var e=process.env.CLAUDE_PLUGIN_ROOT;if(e&&e.trim())return e.trim();var d=(process.env.CLAUDE_CONFIG_DIR||'').trim()||p.join(o.homedir(),'.claude');if(d==='~')d=o.homedir();else if(d.charAt(0)==='~'&&(d.charAt(1)==='/'||d.charCodeAt(1)===92))d=p.join(o.homedir(),d.slice(2));d=p.resolve(d);function L(x){try{return require(p.join(x,'scripts','lib','resolve-ecc-root')).resolveEccRoot()}catch(_){return null}}var r=L(d);if(r)return r;var s=['ecc','ecc@ecc','marketplaces/ecc','everything-claude-code','everything-claude-code@everything-claude-code','marketplaces/everything-claude-code'];for(var i=0;i<s.length;i++){r=L(p.join(d,'plugins',s[i]));if(r)return r}try{var g=['ecc','everything-claude-code'];for(var j=0;j<g.length;j++){var c=p.join(d,'plugins','cache',g[j]);var O=f.readdirSync(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=f.readdirSync(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}}catch(_){}return d})();console.log(r)}")}"
+ECC_ROOT="${CLAUDE_PLUGIN_ROOT:-$(node -e "var r=(function(){var p=require('path'),f=require('fs'),o=require('os');var e=process.env.CLAUDE_PLUGIN_ROOT;if(e&&e.trim())return e.trim();var d=(process.env.CLAUDE_CONFIG_DIR||'').trim()||p.join(o.homedir(),'.claude');if(d==='~')d=o.homedir();else if(d.charAt(0)==='~'&&(d.charAt(1)==='/'||d.charCodeAt(1)===92))d=p.join(o.homedir(),d.slice(2));d=p.resolve(d);function L(x){try{return require(p.join(x,'scripts','lib','resolve-ecc-root')).resolveEccRoot()}catch(_){return null}}var r=L(d);if(r)return r;var s=['ecc','ecc@ecc','marketplaces/ecc','everything-claude-code','everything-claude-code@everything-claude-code','marketplaces/everything-claude-code'];for(var i=0;i<s.length;i++){r=L(p.join(d,'plugins',s[i]));if(r)return r}try{var g=['ecc','everything-claude-code'];for(var j=0;j<g.length;j++){var c=p.join(d,'plugins','cache',g[j]);var O=f.readdirSync(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=f.readdirSync(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}}catch(_){}return d})();console.log(r)")}"
node "$ECC_ROOT/scripts/ci/validate-skill-host-compat.js"
```
Inventory counts without failing:
```bash
-ECC_ROOT="${CLAUDE_PLUGIN_ROOT:-$(node -e "var r=(function(){var p=require('path'),f=require('fs'),o=require('os');var e=process.env.CLAUDE_PLUGIN_ROOT;if(e&&e.trim())return e.trim();var d=(process.env.CLAUDE_CONFIG_DIR||'').trim()||p.join(o.homedir(),'.claude');if(d==='~')d=o.homedir();else if(d.charAt(0)==='~'&&(d.charAt(1)==='/'||d.charCodeAt(1)===92))d=p.join(o.homedir(),d.slice(2));d=p.resolve(d);function L(x){try{return require(p.join(x,'scripts','lib','resolve-ecc-root')).resolveEccRoot()}catch(_){return null}}var r=L(d);if(r)return r;var s=['ecc','ecc@ecc','marketplaces/ecc','everything-claude-code','everything-claude-code@everything-claude-code','marketplaces/everything-claude-code'];for(var i=0;i<s.length;i++){r=L(p.join(d,'plugins',s[i]));if(r)return r}try{var g=['ecc','everything-claude-code'];for(var j=0;j<g.length;j++){var c=p.join(d,'plugins','cache',g[j]);var O=f.readdirSync(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=f.readdirSync(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}}catch(_){}return d})();console.log(r)}")}"
+ECC_ROOT="${CLAUDE_PLUGIN_ROOT:-$(node -e "var r=(function(){var p=require('path'),f=require('fs'),o=require('os');var e=process.env.CLAUDE_PLUGIN_ROOT;if(e&&e.trim())return e.trim();var d=(process.env.CLAUDE_CONFIG_DIR||'').trim()||p.join(o.homedir(),'.claude');if(d==='~')d=o.homedir();else if(d.charAt(0)==='~'&&(d.charAt(1)==='/'||d.charCodeAt(1)===92))d=p.join(o.homedir(),d.slice(2));d=p.resolve(d);function L(x){try{return require(p.join(x,'scripts','lib','resolve-ecc-root')).resolveEccRoot()}catch(_){return null}}var r=L(d);if(r)return r;var s=['ecc','ecc@ecc','marketplaces/ecc','everything-claude-code','everything-claude-code@everything-claude-code','marketplaces/everything-claude-code'];for(var i=0;i<s.length;i++){r=L(p.join(d,'plugins',s[i]));if(r)return r}try{var g=['ecc','everything-claude-code'];for(var j=0;j<g.length;j++){var c=p.join(d,'plugins','cache',g[j]);var O=f.readdirSync(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=f.readdirSync(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}}catch(_){}return d})();console.log(r)")}"
node "$ECC_ROOT/scripts/ci/validate-skill-host-compat.js" --inventory
```
diff --git a/legacy-command-shims/commands/context-budget.md b/legacy-command-shims/commands/context-budget.md
index 09a82c2a9..c96d9161c 100644
--- a/legacy-command-shims/commands/context-budget.md
+++ b/legacy-command-shims/commands/context-budget.md
@@ -18,6 +18,7 @@ $ARGUMENTS
## Delegation
Apply the `context-budget` skill.
-- Without an explicit `--audit`, return the harness's native live-context command and do not scan files or call tools.
+- Without an explicit audit request, return the harness's native live-context command and do not scan files or call tools.
+- Treat `--audit`, “audit installed components,” or equivalent unambiguous audit wording as opt-in. `--verbose` alone stays on the native live-context path.
- Pass through `--audit` and `--verbose` only when the user supplied them.
- Keep any explicit audit bounded to the scope and safety rules in the canonical skill.
diff --git a/tests/lib/command-plugin-root.test.js b/tests/lib/command-plugin-root.test.js
index 287001fe9..96759ad0b 100644
--- a/tests/lib/command-plugin-root.test.js
+++ b/tests/lib/command-plugin-root.test.js
@@ -4,6 +4,7 @@ const fs = require('fs');
const path = require('path');
const os = require('os');
const assert = require('assert');
+const { spawnSync } = require('child_process');
const { INLINE_RESOLVE } = require('../../scripts/lib/resolve-ecc-root');
// Sentinel ECC skill that resolveEccRoot() requires alongside the script tree
@@ -103,6 +104,27 @@ test('resolveEccRoot module covers current and legacy marketplace plugin roots',
assert.ok(INLINE_RESOLVE.includes("scripts','lib','resolve-ecc-root"));
});
+for (const name of ['auto-update', 'instinct-status', 'skill-health', 'skill-host-compat']) {
+ const doc = fs.readFileSync(path.join(__dirname, '..', '..', 'commands', `${name}.md`), 'utf8');
+ const assignments = doc.split('\n').filter(line => line.startsWith('ECC_ROOT='));
+ for (const [index, assignment] of assignments.entries()) {
+ test(`${name} declared resolver ${index + 1} executes selected and explicit roots`, () => {
+ const root = path.resolve(__dirname, '../..');
+ const temp = fs.mkdtempSync(path.join(os.tmpdir(), 'ecc-command-profile-'));
+ try {
+ const selected = { ...process.env, HOME: temp, USERPROFILE: temp, CLAUDE_CONFIG_DIR: root };
+ delete selected.CLAUDE_PLUGIN_ROOT;
+ for (const env of [selected, { ...selected, CLAUDE_PLUGIN_ROOT: root }]) {
+ const result = spawnSync('bash', ['-c', 'source /dev/stdin; printf '%s' "$ECC_ROOT"'],
+ { input: assignment + '\n', env, cwd: temp, encoding: 'utf8' });
+ assert.strictEqual(result.status, 0, result.stderr);
+ assert.strictEqual(result.stderr, '');
+ assert.strictEqual(result.stdout, root);
+ }
+ } finally { fs.rmSync(temp, { recursive: true, force: true }); }
+ });
+ }
+}
console.log(`Passed: ${passed}`);
console.log(`Failed: ${failed}`);