mirror of
https://github.com/affaan-m/ECC.git
synced 2026-11-23 08:15:29 +00:00
merge: sync upstream main into feat/antigravity-tier1
Regenerate the skill-triggers registryDigest against the merged context registry instead of taking either side of the conflict. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
e0214a3409
136 files changed
+4390
-1060
No files matched your search
@@ -0,0 +1,68 @@
|
||||
# Issue submission moderation
|
||||
|
||||
The Issue Submission Guard protects maintainer triage capacity. It runs after a
|
||||
new Issue opens or a closed Issue reopens. It examines creation metadata only,
|
||||
without reading or executing Issue titles or bodies. It does not judge the value
|
||||
of a report. Existing open Issues stay open when this policy ships.
|
||||
|
||||
| Control | Default | Enforcement |
|
||||
| --- | --- | --- |
|
||||
| Burst allowance | Five Issue creations per author in 20 minutes | Close and lock later Issues; alert maintainers |
|
||||
| Severe burst | More than ten creations in 20 minutes | Attempt owner account block; alert maintainers |
|
||||
| Open-Issue cap | Ten open Issues per author | Close new excess or reopened Issues with an explanation; no lock |
|
||||
| Trusted contributors | Repository write, maintain, or admin permission | Exempt from burst moderation, but subject to the open cap |
|
||||
|
||||
Change `.github/issue-submission-policy.json` to adjust thresholds and alert
|
||||
recipients. Pull requests are excluded from every Issue count. The PR guard uses
|
||||
its own policy. The Issue guard skips its own bot-authored alert Issues.
|
||||
|
||||
The open cap acts only on newly opened or reopened Issues. If an author already
|
||||
has more than ten open Issues when this ships, those older Issues stay open. A
|
||||
delayed opened run can also close newer excess Issues visible in its API snapshot.
|
||||
Reopening an old Issue consumes a slot, so it closes again when the author is
|
||||
above the cap. Closing is reversible after the author reduces their open count.
|
||||
|
||||
Closed Issues still count toward the rolling burst window. The guard checks
|
||||
newer creation windows when a run is delayed, and serializes each author's
|
||||
events. GitHub's Actions queue can hold at most 100 pending runs for one
|
||||
concurrency group. A longer backlog can leave individual events unchecked.
|
||||
Moderation happens after creation, so it cannot prevent every downstream
|
||||
notification or workflow from starting.
|
||||
|
||||
The optional `PR_MODERATION_BLOCK_TOKEN` must authenticate as the personal
|
||||
repository owner and have **Block another user: write** permission. Without it,
|
||||
Issue closure and alerting still run; a severe burst fails the Actions job and
|
||||
records that blocking was unavailable. A personal account block affects all
|
||||
repositories owned by that account. The default `GITHUB_TOKEN` performs Issue
|
||||
moderation only. If ownership moves to an organization, owner blocking needs
|
||||
a separate implementation.
|
||||
|
||||
The privileged workflow checks out the trusted default-branch SHA and only the
|
||||
policy plus two scripts. It does not check out contributor code or install
|
||||
dependencies. API failures fail the run; only a collaborator lookup `404`
|
||||
means the author is an outsider. A bot-authored daily alert ledger prevents
|
||||
contributor text from suppressing notifications.
|
||||
|
||||
## Verify
|
||||
|
||||
```sh
|
||||
node tests/ci/issue-submission-guard.test.js
|
||||
node tests/ci/issue-submission-guard-workflow.test.js
|
||||
node scripts/ci/validate-workflow-security.js
|
||||
```
|
||||
|
||||
The workflow test runs the actual CLI against a disposable HTTP fixture. After
|
||||
deployment, inspect a real **Issue Submission Guard** run and its job summary.
|
||||
For a live read-only replay, supply `GITHUB_TOKEN` securely and run:
|
||||
|
||||
```sh
|
||||
GITHUB_REPOSITORY=affaan-m/ECC node scripts/ci/issue-submission-guard.js --dry-run --issue <NUMBER>
|
||||
```
|
||||
|
||||
The dry run reads GitHub but does not close, lock, comment, alert, or block.
|
||||
To roll back, disable **Issue Submission Guard** in Actions. To restore an
|
||||
Issue, unlock and reopen it after adjusting policy or resolving the author's
|
||||
open count. The repository owner must remove any account block separately.
|
||||
|
||||
This advances ECC 2.2 maintenance reliability. It does not change runtime
|
||||
sandboxing, ExecutionCapsule contracts, Fleet, or release publication.
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"windowMinutes": 20,
|
||||
"closeAbove": 5,
|
||||
"blockAbove": 10,
|
||||
"maxOpen": 10,
|
||||
"deniedUserIDs": [],
|
||||
"notify": ["affaan-m", "haelyra"]
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
name: Issue Submission Guard
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened, reopened]
|
||||
|
||||
concurrency:
|
||||
group: issue-guard-${{ github.repository }}-${{ github.event.issue.user.id }}
|
||||
cancel-in-progress: false
|
||||
queue: max
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
moderate:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
# The issues event uses the trusted default branch, never contributor code.
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: ${{ github.sha }}
|
||||
persist-credentials: false
|
||||
sparse-checkout: |
|
||||
.github/issue-submission-policy.json
|
||||
scripts/ci/issue-submission-guard.js
|
||||
scripts/ci/pr-burst-guard.js
|
||||
sparse-checkout-cone-mode: false
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
with:
|
||||
node-version: '22.x'
|
||||
- name: Enforce Issue submission policy
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
PR_MODERATION_BLOCK_TOKEN: ${{ secrets.PR_MODERATION_BLOCK_TOKEN }}
|
||||
run: node scripts/ci/issue-submission-guard.js
|
||||
@@ -54,3 +54,22 @@ jobs:
|
||||
stale-pr-message: 'This PR is stale due to inactivity.'
|
||||
days-before-stale: 30
|
||||
days-before-close: 7
|
||||
|
||||
closed-reference-audit:
|
||||
name: Audit Closed-Issue PR References
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
issues: read
|
||||
pull-requests: read
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
with:
|
||||
node-version: '20.x'
|
||||
- name: Verify cited PRs in closed issues are actually merged
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: node scripts/ci/audit-closed-references.js
|
||||
@@ -36,12 +36,10 @@ SECURE_HSTS_SECONDS = 31536000 # 1 year
|
||||
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
|
||||
SECURE_HSTS_PRELOAD = True
|
||||
SECURE_CONTENT_TYPE_NOSNIFF = True
|
||||
SECURE_BROWSER_XSS_FILTER = True
|
||||
X_FRAME_OPTIONS = 'DENY'
|
||||
|
||||
# HTTPS and Cookies
|
||||
SESSION_COOKIE_HTTPONLY = True
|
||||
CSRF_COOKIE_HTTPONLY = True
|
||||
SESSION_COOKIE_SAMESITE = 'Lax'
|
||||
CSRF_COOKIE_SAMESITE = 'Lax'
|
||||
|
||||
@@ -311,7 +309,6 @@ def greet_user(username):
|
||||
```python
|
||||
# settings.py
|
||||
SECURE_CONTENT_TYPE_NOSNIFF = True # Prevent MIME sniffing
|
||||
SECURE_BROWSER_XSS_FILTER = True # Enable XSS filter
|
||||
X_FRAME_OPTIONS = 'DENY' # Prevent clickjacking
|
||||
|
||||
# Custom middleware
|
||||
|
||||
Generated
+6
-4
@@ -8,6 +8,9 @@
|
||||
"name": "ecc-universal",
|
||||
"version": "2.2.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"zod": "4.6.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opencode-ai/plugin": "^1.4.3",
|
||||
"@types/node": "^20.0.0",
|
||||
@@ -156,10 +159,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/zod": {
|
||||
"version": "4.1.8",
|
||||
"resolved": "https://registry.npmjs.org/zod/-/zod-4.1.8.tgz",
|
||||
"integrity": "sha512-5R1P+WwQqmmMIEACyzSvo4JXHY5WiAFHRMg+zBZKgKS+Q1viRa0C1hmUKtHltoIFKtIdki3pRxkmpP74jnNYHQ==",
|
||||
"dev": true,
|
||||
"version": "4.6.7",
|
||||
"resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz",
|
||||
"integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/colinhacks"
|
||||
|
||||
@@ -56,6 +56,9 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"zod": "4.6.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@opencode-ai/plugin": ">=1.0.0"
|
||||
},
|
||||
@@ -66,5 +69,8 @@
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"overrides": {
|
||||
"zod": "4.6.7"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { tool, type ToolDefinition } from "@opencode-ai/plugin/tool"
|
||||
import { tool, type ToolDefinition } from "./tool.ts"
|
||||
import type { ChangeType, TreeNode } from "../plugins/lib/changed-files-store.ts"
|
||||
|
||||
const INDICATORS: Record<ChangeType, string> = {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Supports common coverage report formats.
|
||||
*/
|
||||
|
||||
import { tool, type ToolDefinition } from "@opencode-ai/plugin/tool"
|
||||
import { tool, type ToolDefinition } from "./tool.ts"
|
||||
import * as path from "path"
|
||||
import * as fs from "fs"
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* and unused dependencies. Supports multiple package managers.
|
||||
*/
|
||||
|
||||
import { tool, type ToolDefinition } from "@opencode-ai/plugin/tool"
|
||||
import { tool, type ToolDefinition } from "./tool.ts"
|
||||
import * as path from "path"
|
||||
import * as fs from "fs"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Supports cross-platform command generation.
|
||||
*/
|
||||
|
||||
import { tool, type ToolDefinition } from "@opencode-ai/plugin/tool"
|
||||
import { tool, type ToolDefinition } from "./tool.ts"
|
||||
import * as path from "path"
|
||||
import * as fs from "fs"
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Returns branch/status/log/diff details for the active repository.
|
||||
*/
|
||||
|
||||
import { tool, type ToolDefinition } from "@opencode-ai/plugin/tool"
|
||||
import { tool, type ToolDefinition } from "./tool.ts"
|
||||
import { execFileSync } from "child_process"
|
||||
|
||||
// Conservative subset of git's allowed ref-name characters. Rejects shell
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Supports cross-platform command generation and error handling.
|
||||
*/
|
||||
|
||||
import { tool, type ToolDefinition } from "@opencode-ai/plugin/tool"
|
||||
import { tool, type ToolDefinition } from "./tool.ts"
|
||||
import * as path from "path"
|
||||
import * as fs from "fs"
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Automatically detects the package manager and test framework.
|
||||
*/
|
||||
|
||||
import { tool, type ToolDefinition } from "@opencode-ai/plugin/tool"
|
||||
import { tool, type ToolDefinition } from "./tool.ts"
|
||||
import * as path from "path"
|
||||
import * as fs from "fs"
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* The regex patterns below are used to DETECT potential issues in user code.
|
||||
*/
|
||||
|
||||
import { tool, type ToolDefinition } from "@opencode-ai/plugin/tool"
|
||||
import { tool, type ToolDefinition } from "./tool.ts"
|
||||
import * as path from "path"
|
||||
import * as fs from "fs"
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import { z } from "zod"
|
||||
import type { tool as OpenCodeTool } from "@opencode-ai/plugin/tool"
|
||||
|
||||
export type { ToolDefinition } from "@opencode-ai/plugin/tool"
|
||||
|
||||
// OpenCode's tool helper returns the definition unchanged and exposes Zod as schema.
|
||||
// Keep the runtime import local so packed installs use the audited Zod version.
|
||||
export const tool = Object.assign(<T>(definition: T): T => definition, {
|
||||
schema: z,
|
||||
}) as typeof OpenCodeTool
|
||||
@@ -26,6 +26,7 @@
|
||||
- GateGuard gates NotebookEdit as a first-touch edit of its `notebook_path`; notebooks were never gated before.
|
||||
- GateGuard prior-search credit no longer counts a search that never saw the target. File-type filters (`rg -t`/`-T`/`--type`/`--type-not`, `fd -e`/`--extension`, the Grep tool's `type`), the Glob tool's pattern, shell glob operands, and git pathspecs now filter like include globs, so `rg -t py tokenizer src` or `Glob **/tokenizer.py` no longer credits `tokenizer.js`. A search confined to the target's own file name (`Glob **/tokenizer.js`, `find -name tokenizer.js`, Grep `glob: 'tokenizer.js'`) is a lookup and never credits it. PowerShell searches keep backslashes as path separators.
|
||||
- GateGuard no longer passes an edit as comment-only when its text contains U+2028, U+2029, or U+0085, which end a JavaScript or C# line comment.
|
||||
- Claude Code home installs (`ecc install --target claude` and `install.sh`) now install under `CLAUDE_CONFIG_DIR` when it is set, matching the directory Claude Code reads its user-level config from. Previously ECC wrote to `~/.claude` regardless, so when `CLAUDE_CONFIG_DIR` redirected the config root the install never loaded ("installs, but nothing loads"); the settings.json, plugin.json, hook commands, bundle and install state were all stranded in `~/.claude` while Claude Code read an empty `CLAUDE_CONFIG_DIR`. The claude-home adapter now resolves its root the same way the runtime does (`CLAUDE_CONFIG_DIR || ~/.claude`), consistent with the opencode adapter and `resolveClaudePaths`.
|
||||
|
||||
## 2.2.3 - 2026-10-01
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ Thanks for wanting to contribute! This repo is a community resource for Claude C
|
||||
- [Cross-Harness and Translations](#cross-harness-and-translations)
|
||||
- [Pull Request Process](#pull-request-process)
|
||||
- [Releases](#releases)
|
||||
- [Guidelines](#guidelines)
|
||||
- [File Naming](#file-naming)
|
||||
- [Questions?](#questions)
|
||||
|
||||
---
|
||||
|
||||
@@ -431,6 +434,13 @@ Translations live under `docs/` (e.g. `docs/zh-CN`, `docs/zh-TW`, `docs/ja-JP`).
|
||||
|
||||
---
|
||||
|
||||
## Issue submission
|
||||
|
||||
Please submit at most five Issues within any 20-minute period and keep at
|
||||
most ten Issues open at once. The [Issue moderation policy](.github/ISSUE_MODERATION.md)
|
||||
explains the automatic closure, reopening, and maintainer alert rules. Existing
|
||||
open Issues stay open when the policy takes effect.
|
||||
|
||||
## Pull Request Process
|
||||
|
||||
### Submission volume
|
||||
|
||||
@@ -145,13 +145,22 @@ JWT_SECRET=change-me-to-a-random-string
|
||||
```bash
|
||||
cd TARGET_DIR
|
||||
git init
|
||||
printf '%s\n' FORK_REPORT.md SANITIZATION_REPORT.md >> .git/info/exclude
|
||||
git add -A
|
||||
git rm -q --cached --ignore-unmatch FORK_REPORT.md SANITIZATION_REPORT.md
|
||||
git commit -m "Initial open-source release
|
||||
|
||||
Forked from private source. All secrets stripped, internal references
|
||||
replaced with configurable placeholders. See .env.example for configuration."
|
||||
```
|
||||
|
||||
This commit is provisional. The pipeline amends it after sanitizer fixes and packaging, so the
|
||||
published history stays one commit (see the opensource-pipeline skill, Step 3). The reports never
|
||||
go into it: `.git/info/exclude` is written before `git add -A`, so even a report already present in
|
||||
the source project (copied by Step 2) stays untracked. A `.gitignore` rule outranks
|
||||
`.git/info/exclude`, so a copied `!FORK_REPORT.md` would re-include it; `git rm --cached` drops
|
||||
the reports from the index in that case.
|
||||
|
||||
### Step 7: Generate Fork Report
|
||||
|
||||
Create `FORK_REPORT.md` in the staging directory:
|
||||
|
||||
@@ -135,10 +135,20 @@ cd PROJECT_DIR
|
||||
git log --oneline | wc -l
|
||||
# If > 1, history was not cleaned — FAIL
|
||||
|
||||
# Search history for potential secrets
|
||||
git log -p | grep -iE '(password|secret|api.?key|token)' | head -20
|
||||
# Write the full history to a file outside the project, so Steps 1-3 never scan it
|
||||
HISTORY="$(mktemp)"
|
||||
git log -p --all --no-color > "$HISTORY"
|
||||
echo "$HISTORY"
|
||||
|
||||
# Broad keyword pass (WARNING — manual review)
|
||||
grep -iE '(password|secret|api.?key|token)' "$HISTORY" | head -20
|
||||
```
|
||||
|
||||
Steps 1-3 read the working tree, but the push sends commits. A secret fixed in a file but still in
|
||||
a commit is published. Run every Step 1 pattern (CRITICAL) and the Step 3 home-directory patterns
|
||||
over `$HISTORY` with the same tool you used for Steps 1-3. Any match is a FAIL, even when the
|
||||
current file is clean. Delete `$HISTORY` when done.
|
||||
|
||||
### Step 7: Unreadable Files (WARNING)
|
||||
|
||||
Steps 1-3 only match text, so a credential sitting in a spreadsheet, a PDF or an embedded database
|
||||
|
||||
@@ -11,7 +11,7 @@ Update ECC from its upstream repo and regenerate the current context's managed i
|
||||
|
||||
```bash
|
||||
# Preview the update without mutating anything
|
||||
ECC_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({probe:p.join('scripts','auto-update.js')})}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();console.log(r)")" &&
|
||||
ECC_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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\/g,'/')}}}}catch(_){}d=p.resolve(d);function L(x){try{return require(p.join(x,'scripts','lib','resolve-ecc-root')).resolveEccRoot({probe:p.join('scripts','auto-update.js')})}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();console.log(r)")" &&
|
||||
node "$ECC_ROOT/scripts/auto-update.js" --dry-run
|
||||
|
||||
# Update only Cursor-managed files in the current project
|
||||
|
||||
@@ -18,7 +18,7 @@ while a legacy `~/.claude/skills/continuous-learning-v2/` directory still
|
||||
exists (#2037).
|
||||
|
||||
```bash
|
||||
ECC_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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();console.log(r)")" &&
|
||||
ECC_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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();console.log(r)")" &&
|
||||
python3 "$ECC_ROOT/skills/continuous-learning-v2/scripts/instinct-cli.py" status
|
||||
```
|
||||
|
||||
|
||||
@@ -72,6 +72,8 @@ Launch an Agent (subagent_type: `code-reviewer`, model: `opus`) with the full ru
|
||||
|
||||
#### Reviewer B: External Model (Claude fallback if no external reviewer is ready)
|
||||
|
||||
Codex uses its configured model or CLI default. Set `model` in your Codex configuration to choose a reviewer model supported by your account.
|
||||
|
||||
Antigravity is optional and requires the external `ccg-workflow` runtime; it is not included in the base ECC install. An existing installation must provide both an executable `~/.claude/bin/codeagent-wrapper` and a readable regular reviewer role file at `~/.claude/.ccg/prompts/antigravity/reviewer.md`. Otherwise, retain the Claude fallback. Use the wrapper's maintained model-selection contract; do not add an Antigravity model pin.
|
||||
|
||||
Run detection, prompt creation, and the selected external review together in this single Bash subshell. Replace the prompt placeholder with the same rubric, file contents, and review-only instructions given to Reviewer A. The order remains Codex, Gemini, Antigravity, then Claude. The Claude fallback creates no prompt file.
|
||||
@@ -116,7 +118,7 @@ EOF
|
||||
|
||||
case "$REVIEWER_BACKEND" in
|
||||
codex)
|
||||
codex exec --sandbox read-only -m gpt-5.4 -C "$(pwd)" - < "$PROMPT_FILE"
|
||||
codex exec --sandbox read-only -C "$(pwd)" - < "$PROMPT_FILE"
|
||||
;;
|
||||
gemini)
|
||||
REVIEWER_PROMPT=$(cat "$PROMPT_FILE")
|
||||
|
||||
@@ -29,7 +29,7 @@ Use `/sessions info` when you need operator-surface context for a swarm: branch,
|
||||
**Script:**
|
||||
```bash
|
||||
node -e "
|
||||
const _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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();
|
||||
const _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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();
|
||||
const sm = require(_r + '/scripts/lib/session-manager');
|
||||
const aa = require(_r + '/scripts/lib/session-aliases');
|
||||
const path = require('path');
|
||||
@@ -71,7 +71,7 @@ Load and display a session's content (by ID or alias).
|
||||
**Script:**
|
||||
```bash
|
||||
node -e "
|
||||
const _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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();
|
||||
const _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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();
|
||||
const sm = require(_r + '/scripts/lib/session-manager');
|
||||
const aa = require(_r + '/scripts/lib/session-aliases');
|
||||
const id = process.argv[1];
|
||||
@@ -145,7 +145,7 @@ Create a memorable alias for a session.
|
||||
**Script:**
|
||||
```bash
|
||||
node -e "
|
||||
const _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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();
|
||||
const _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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();
|
||||
const sm = require(_r + '/scripts/lib/session-manager');
|
||||
const aa = require(_r + '/scripts/lib/session-aliases');
|
||||
|
||||
@@ -186,7 +186,7 @@ Delete an existing alias.
|
||||
**Script:**
|
||||
```bash
|
||||
node -e "
|
||||
const _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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();
|
||||
const _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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();
|
||||
const aa = require(_r + '/scripts/lib/session-aliases');
|
||||
|
||||
const aliasName = process.argv[1];
|
||||
@@ -216,7 +216,7 @@ Show detailed information about a session.
|
||||
**Script:**
|
||||
```bash
|
||||
node -e "
|
||||
const _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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();
|
||||
const _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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();
|
||||
const sm = require(_r + '/scripts/lib/session-manager');
|
||||
const aa = require(_r + '/scripts/lib/session-aliases');
|
||||
|
||||
@@ -267,7 +267,7 @@ Show all session aliases.
|
||||
**Script:**
|
||||
```bash
|
||||
node -e "
|
||||
const _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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();
|
||||
const _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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();
|
||||
const aa = require(_r + '/scripts/lib/session-aliases');
|
||||
|
||||
const aliases = aa.listAliases();
|
||||
|
||||
@@ -13,21 +13,21 @@ Shows a comprehensive health dashboard for all skills in the portfolio with succ
|
||||
Run the skill health CLI in dashboard mode:
|
||||
|
||||
```bash
|
||||
ECC_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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();console.log(r)")" &&
|
||||
ECC_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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();console.log(r)")" &&
|
||||
node "$ECC_ROOT/scripts/skills-health.js" --dashboard
|
||||
```
|
||||
|
||||
For a specific panel only:
|
||||
|
||||
```bash
|
||||
ECC_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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();console.log(r)")" &&
|
||||
ECC_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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();console.log(r)")" &&
|
||||
node "$ECC_ROOT/scripts/skills-health.js" --dashboard --panel failures
|
||||
```
|
||||
|
||||
For machine-readable output:
|
||||
|
||||
```bash
|
||||
ECC_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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();console.log(r)")" &&
|
||||
ECC_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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();console.log(r)")" &&
|
||||
node "$ECC_ROOT/scripts/skills-health.js" --dashboard --json
|
||||
```
|
||||
|
||||
|
||||
@@ -13,14 +13,14 @@ Lint curated `skills/` for Codex-safe frontmatter and Claude-only substitutions.
|
||||
Run the host-compat validator:
|
||||
|
||||
```bash
|
||||
ECC_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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();console.log(r)")" &&
|
||||
ECC_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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();console.log(r)")" &&
|
||||
node "$ECC_ROOT/scripts/ci/validate-skill-host-compat.js"
|
||||
```
|
||||
|
||||
Inventory counts without failing:
|
||||
|
||||
```bash
|
||||
ECC_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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();console.log(r)")" &&
|
||||
ECC_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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();console.log(r)")" &&
|
||||
node "$ECC_ROOT/scripts/ci/validate-skill-host-compat.js" --inventory
|
||||
```
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ below.
|
||||
|
||||
## Quick start
|
||||
|
||||
Verify that 2.2.0 is readable from the registry, then run the pinned package
|
||||
Verify that 2.2.3 is readable from the registry, then run the pinned package
|
||||
from the project you want to configure:
|
||||
|
||||
```bash
|
||||
npm view ecc-universal version
|
||||
npx ecc-universal@2.2.0 install --profile minimal --target antigravity
|
||||
npm view ecc-universal@2.2.3 version
|
||||
npx ecc-universal@2.2.3 install --profile minimal --target antigravity
|
||||
```
|
||||
|
||||
### Source checkout alternative
|
||||
|
||||
@@ -62,7 +62,7 @@ exit 2
|
||||
**What helps:**
|
||||
|
||||
- Reduce tool-definition pressure with `ENABLE_TOOL_SEARCH=auto:5` if your setup supports it.
|
||||
- Lower `MAX_THINKING_TOKENS` for routine work.
|
||||
- Lower the supported effort level (for example, `/effort low`) for routine work on adaptive-reasoning models. `MAX_THINKING_TOKENS=0` disables thinking; nonzero values cap fixed-budget thinking only when adaptive thinking is disabled.
|
||||
- Route subagent work to a cheaper model such as `CLAUDE_CODE_SUBAGENT_MODEL=haiku` if your setup exposes that knob.
|
||||
- Disable unused MCP servers per project.
|
||||
- Compact manually at natural breakpoints instead of waiting for auto-compaction.
|
||||
|
||||
@@ -61,7 +61,7 @@ What helps:
|
||||
What helps:
|
||||
|
||||
- Reduce tool-definition pressure with `ENABLE_TOOL_SEARCH=auto:5` if your setup supports it.
|
||||
- Lower `MAX_THINKING_TOKENS` for routine work.
|
||||
- Lower the supported effort level (for example, `/effort low`) for routine work on adaptive-reasoning models. `MAX_THINKING_TOKENS=0` disables thinking; nonzero values cap fixed-budget thinking only when adaptive thinking is disabled.
|
||||
- Route subagent work to a cheaper model such as `CLAUDE_CODE_SUBAGENT_MODEL=haiku` if your setup exposes that knob.
|
||||
- Disable unused MCP servers per project.
|
||||
- Compact manually at natural breakpoints instead of waiting for auto-compaction.
|
||||
|
||||
@@ -89,8 +89,11 @@ EOF
|
||||
最初に利用可能なCLIを使用します:
|
||||
|
||||
**Codex CLI**(インストールされている場合)
|
||||
|
||||
Codexは設定されたモデル、またはCLIのデフォルトを使用します。アカウントで利用できるレビュアーモデルを選ぶには、Codex設定の `model` を指定してください。
|
||||
|
||||
```bash
|
||||
codex exec --sandbox read-only -m gpt-5.4 -C "$(pwd)" - < "$PROMPT_FILE"
|
||||
codex exec --sandbox read-only -C "$(pwd)" - < "$PROMPT_FILE"
|
||||
rm -f "$PROMPT_FILE"
|
||||
```
|
||||
|
||||
@@ -166,8 +169,8 @@ Result: [PUSHED / ESCALATED TO USER]
|
||||
## 注意事項
|
||||
|
||||
- レビュアー A(Claude Opus)は常に実行されます — ツール環境に関係なく、少なくとも1つの強力なレビュアーが保証されます。
|
||||
- レビュアー Bの目標はモデル多様性です。GPT-5.4またはGemini 2.5 Proは真の独立性を提供します — 異なる学習データ、異なるバイアス、異なる死角。Claudeのみのフォールバックでもコンテキスト分離による価値はありますが、モデル多様性は失われます。
|
||||
- 利用可能な最も強力なモデルが使用されます:レビュアー AにはOpus、レビュアー BにはGPT-5.4またはGemini 2.5 Pro。
|
||||
- レビュアー Bの目標はモデル多様性です。選択したバックエンドが報告する実際のモデルとプロバイダーを記録してください。Claudeのみのフォールバックはコンテキストを分離しますが、モデル多様性は失われます。
|
||||
- レビュアー AにはOpusを使用します。レビュアー BのCodexは設定されたモデル、またはCLIのデフォルトを使用します。
|
||||
- 外部レビュアーはレビュー中のリポジトリ変更を防ぐため、`--sandbox read-only`(Codex)で実行されます。
|
||||
- 各ラウンドで新しいレビュアーを使用することで、以前の発見に対するアンカリングバイアスを防ぎます。
|
||||
- ルーブリックは最も重要な入力です。レビュアーがゴム印承認をしたり、主観的なスタイルの問題をフラグに立てる場合は、ルーブリックを厳格化してください。
|
||||
|
||||
@@ -48,7 +48,7 @@ origin: ECC
|
||||
|
||||
## 出力契約
|
||||
|
||||
ダウンストリームスキルが直接消費できる再利用可能な`VOICE PROFILE`ブロックを作成します。[references/voice-profile-schema.md](references/voice-profile-schema.md)のスキーマを使用します。
|
||||
ダウンストリームスキルが直接消費できる再利用可能な`VOICE PROFILE`ブロックを作成します。[references/voice-profile-schema.md](https://github.com/affaan-m/ECC/blob/main/skills/brand-voice/references/voice-profile-schema.md)のスキーマを使用します。
|
||||
|
||||
プロファイルを構造化され、セッションコンテキストで再利用するのに十分な短さに保つ。ポイントは文学批評ではありません。ポイントは運用上の再利用です。
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# ECC 長文ガイド
|
||||
|
||||

|
||||

|
||||
|
||||
---
|
||||
|
||||
> **前提条件**: このガイドは[ECC 簡潔ガイド](./the-shortform-guide.md)を基に構成されています。スキル、フック、サブエージェント、MCP、プラグインのセットアップがまだの場合は、先にそちらをお読みください。
|
||||
|
||||

|
||||

|
||||
*簡潔ガイド - まずこちらを読んでください*
|
||||
|
||||
簡潔ガイドでは、基礎的なセットアップをカバーしました:スキルとコマンド、フック、サブエージェント、MCP、プラグイン、そして効果的なClaude Codeワークフローのバックボーンとなる設定パターン。それはセットアップガイドであり、基盤インフラでした。
|
||||
@@ -39,7 +39,7 @@ MCPを実際に使用せずにCLIをMCPのように機能させるには(そ
|
||||
|
||||
セッション間でメモリを共有するには、進捗を要約してチェックインし、`.claude`フォルダの`.tmp`ファイルに保存してセッション終了まで追記するスキルまたはコマンドが最善策です。翌日にはそれをコンテキストとして使用し、中断した箇所から再開できます。古いコンテキストが新しい作業を汚染しないよう、各セッションごとに新しいファイルを作成してください。
|
||||
|
||||

|
||||

|
||||
*セッションストレージの例 -> <https://github.com/affaan-m/ECC/tree/main/examples/sessions>*
|
||||
|
||||
Claudeが現在の状態を要約するファイルを作成します。レビューし、必要に応じて編集を依頼し、新しく開始。新しい会話では、ファイルパスを提供するだけです。コンテキスト制限に達して複雑な作業を継続する必要がある場合に特に便利です。これらのファイルには以下を含めるべきです:
|
||||
@@ -110,7 +110,7 @@ alias claude-research='claude --system-prompt "$(cat ~/.claude/contexts/research
|
||||
|
||||
**モデル選択クイックリファレンス:**
|
||||
|
||||

|
||||

|
||||
*さまざまな一般的タスクにおけるサブエージェントの仮想セットアップと選択理由*
|
||||
|
||||
| タスクタイプ | モデル | 理由 |
|
||||
@@ -128,14 +128,14 @@ alias claude-research='claude --system-prompt "$(cat ~/.claude/contexts/research
|
||||
|
||||
**価格リファレンス:**
|
||||
|
||||

|
||||

|
||||
*出典: <https://platform.claude.com/docs/en/about-claude/pricing>*
|
||||
|
||||
**ツール固有の最適化:**
|
||||
|
||||
grepをmgrepに置き換え — 従来のgrepやripgrepと比較して平均約50%のトークン削減:
|
||||
|
||||

|
||||

|
||||
*50タスクのベンチマークで、mgrep + Claude Codeはgrepベースのワークフローと同等以上の品質で約2倍少ないトークンを使用。出典:@mixedbread-aiによるmgrep*
|
||||
|
||||
**モジュラーコードベースの利点:**
|
||||
@@ -181,7 +181,7 @@ pass^k: k回の試行すべてが成功する必要がある
|
||||
|
||||
**任意のターミナル数について:**
|
||||
|
||||

|
||||

|
||||
*Boris(Anthropic)が複数のClaudeインスタンスの実行について*
|
||||
|
||||
Borisは並列化のヒントを持っています。ローカルで5つ、上流で5つのClaudeインスタンスを実行するようなことを提案しています。任意のターミナル数の設定は推奨しません。ターミナルの追加は本当の必要性から生まれるべきです。
|
||||
@@ -202,7 +202,7 @@ cd ../project-feature-a && claude
|
||||
|
||||
インスタンスのスケーリングを開始し、複数のClaudeインスタンスが互いに重複するコードで作業する場合、gitワークツリーを使用し、各インスタンスに非常に明確な計画を持つことが不可欠です。`/rename <名前>`を使用してすべてのチャットに名前を付けてください。
|
||||
|
||||

|
||||

|
||||
*初期セットアップ:左ターミナルでコーディング、右ターミナルで質問 - /renameと/forkを使用*
|
||||
|
||||
**カスケード方式:**
|
||||
@@ -314,7 +314,7 @@ alias q='cd ~/Desktop/projects'
|
||||
|
||||
## マイルストーン
|
||||
|
||||

|
||||

|
||||
*1週間足らずでGitHub 25,000+スター*
|
||||
|
||||
---
|
||||
|
||||
@@ -18,7 +18,7 @@ _ecc / research / security_
|
||||
|
||||
### 攻撃チェーンと関与するノード / コンポーネント
|
||||
|
||||

|
||||

|
||||
|
||||
例えば、あなたのエージェントがゲートウェイレイヤーを介してWhatsAppに接続されているとします。攻撃者があなたのWhatsApp番号を知っています。既存のジェイルブレイクを使ってプロンプトインジェクションを試みます。チャットにジェイルブレイクをスパムします。エージェントがメッセージを読み、指示として受け取ります。プライベート情報を明かすレスポンスを実行します。エージェントがroot権限、広範なファイルシステムアクセス、または有用な認証情報を持っている場合、あなたは侵害されています。
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# ECC 簡潔ガイド
|
||||
|
||||

|
||||

|
||||
|
||||
---
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
Opus 4.5での長いコーディングセッション後にデッドコードや散らかった.mdファイルを整理したい?`/refactor-clean`を実行。テストが必要?`/tdd`、`/e2e`、`/test-coverage`。これらのスラッシュエントリーは便利ですが、真に持続的な単位は基盤となるスキルです。スキルにはコードマップも含められます — コンテキストを探索に消費せずにClaude がコードベースを素早くナビゲートする方法です。
|
||||
|
||||

|
||||

|
||||
*コマンドの連鎖実行*
|
||||
|
||||
ECCは依然として`commands/`レイヤーを提供していますが、マイグレーション中のレガシースラッシュエントリー互換性と考えるのが最適です。持続的なロジックはスキルに置くべきです。
|
||||
@@ -66,7 +66,7 @@ ECCは依然として`commands/`レイヤーを提供していますが、マイ
|
||||
}
|
||||
```
|
||||
|
||||

|
||||

|
||||
*PostToolUseフック実行中のClaude Codeでのフィードバック例*
|
||||
|
||||
**プロヒント:** JSONを手動で書く代わりに`hookify`プラグインを使ってフックを会話的に作成できます。`/hookify`を実行して欲しいものを説明してください。
|
||||
@@ -129,7 +129,7 @@ MCPはClaudeを外部サービスに直接接続します。APIの置き換え
|
||||
|
||||
**例:** Supabase MCPにより、Claudeはコピー&ペーストなしで特定のデータを取得し、上流で直接SQLを実行できます。データベース、デプロイメントプラットフォームなども同様です。
|
||||
|
||||

|
||||

|
||||
*Supabase MCPがpublicスキーマ内のテーブルを一覧表示している例*
|
||||
|
||||
**Claude内のChrome:** Claudeがブラウザを自律的に制御する組み込みプラグインMCP — クリックして動作を確認できます。
|
||||
@@ -138,7 +138,7 @@ MCPはClaudeを外部サービスに直接接続します。APIの置き換え
|
||||
|
||||
MCPは厳選してください。すべてのMCPをユーザー設定に入れていますが、**未使用のものはすべて無効化**しています。`/plugins`に移動してスクロールするか、`/mcp`を実行してください。
|
||||
|
||||

|
||||

|
||||
*/pluginsを使用してMCPのインストール状況とステータスを確認*
|
||||
|
||||
圧縮前の200kコンテキストウィンドウも、有効なツールが多すぎると70kにしかならない場合があります。パフォーマンスが大幅に低下します。
|
||||
@@ -168,7 +168,7 @@ claude plugin marketplace add https://github.com/mixedbread-ai/mgrep
|
||||
# Claudeを開き、/plugins を実行、新しいマーケットプレイスを見つけてインストール
|
||||
```
|
||||
|
||||

|
||||

|
||||
*新しくインストールされたMixedbread-Grepマーケットプレイスの表示*
|
||||
|
||||
**LSPプラグイン**は、エディタ外でClaude Codeを頻繁に使用する場合に特に便利です。Language Server Protocolにより、IDEを開かずにClaudeにリアルタイムの型チェック、定義ジャンプ、インテリジェント補完を提供します。
|
||||
@@ -237,7 +237,7 @@ mgrep --web "Next.js 15 app router changes" # Web検索
|
||||
|
||||
GitHub ActionsでPRにコードレビューを設定。設定すればClaudeがPRを自動的にレビューできます。
|
||||
|
||||

|
||||

|
||||
*Claudeがバグ修正PRを承認*
|
||||
|
||||
### サンドボックス
|
||||
@@ -262,7 +262,7 @@ GitHub ActionsでPRにコードレビューを設定。設定すればClaudeがP
|
||||
- **最小限のリソース使用** — 重い操作中にClaudeとRAM/CPUを競合しない。Opus実行時に重要
|
||||
- **Vimモード** — お好みならフルVimキーバインド
|
||||
|
||||

|
||||

|
||||
*CMD+Shift+Rでカスタムコマンドドロップダウンを表示するZedエディタ。右下にフォローモードが牛眼として表示。*
|
||||
|
||||
**エディタに依存しないヒント:**
|
||||
@@ -277,7 +277,7 @@ GitHub ActionsでPRにコードレビューを設定。設定すればClaudeがP
|
||||
|
||||
これも実用的な選択肢でClaude Codeとうまく連携します。`\ide`でLSP機能を有効にしたターミナル形式(プラグインでやや冗長になりました)、またはエディタにより統合されたマッチするUIの拡張機能を選択できます。
|
||||
|
||||

|
||||

|
||||
*VS Code拡張機能はClaude CodeのネイティブグラフィカルインターフェースをIDE内に直接統合して提供。*
|
||||
|
||||
---
|
||||
@@ -361,7 +361,7 @@ mgrep@Mixedbread-Grep # より良い検索
|
||||
|
||||
ユーザー、ディレクトリ、ダーティインジケーター付きgitブランチ、残りコンテキスト%、モデル、時間、Todoカウントを表示:
|
||||
|
||||

|
||||

|
||||
*Macルートディレクトリでのステータスライン例*
|
||||
|
||||
```
|
||||
|
||||
@@ -21,4 +21,4 @@ PR을 만들 때:
|
||||
5. 새 브랜치인 경우 `-u` 플래그와 함께 push
|
||||
|
||||
> git 작업 전 전체 개발 프로세스(계획, TDD, 코드 리뷰)는
|
||||
> [development-workflow.md](./development-workflow.md)를 참고하세요.
|
||||
> [development-workflow.md](https://github.com/affaan-m/ECC/blob/main/rules/common/development-workflow.md)를 참고하세요.
|
||||
@@ -21,4 +21,4 @@ Ao criar PRs:
|
||||
5. Fazer push com a flag `-u` se for uma nova branch
|
||||
|
||||
> Para o processo de desenvolvimento completo (planejamento, TDD, revisão de código) antes de operações git,
|
||||
> veja [development-workflow.md](./development-workflow.md).
|
||||
> veja [development-workflow.md](https://github.com/affaan-m/ECC/blob/main/rules/common/development-workflow.md).
|
||||
@@ -309,7 +309,7 @@ commands/your-command.md
|
||||
|
||||
### 命令模板
|
||||
|
||||
```markdown
|
||||
````markdown
|
||||
---
|
||||
description: 在 /help 中显示的简要描述
|
||||
---
|
||||
@@ -338,7 +338,7 @@ description: 在 /help 中显示的简要描述
|
||||
|
||||
用户将收到的内容。
|
||||
|
||||
```
|
||||
````
|
||||
|
||||
### 命令示例
|
||||
|
||||
|
||||
@@ -93,8 +93,10 @@ EOF
|
||||
|
||||
**Codex CLI**(如果已安装)
|
||||
|
||||
Codex 使用已配置的模型或 CLI 默认值。在 Codex 配置中设置 `model`,即可选择账号支持的评审模型。
|
||||
|
||||
```bash
|
||||
codex exec --sandbox read-only -m gpt-5.4 -C "$(pwd)" - < "$PROMPT_FILE"
|
||||
codex exec --sandbox read-only -C "$(pwd)" - < "$PROMPT_FILE"
|
||||
rm -f "$PROMPT_FILE"
|
||||
```
|
||||
|
||||
@@ -171,8 +173,8 @@ Result: [PUSHED / ESCALATED TO USER]
|
||||
## 备注
|
||||
|
||||
* 评审者 A(Claude Opus)始终运行——无论工具如何,保证至少有一个强大的评审者。
|
||||
* 模型多样性是评审者 B 的目标。GPT-5.4 或 Gemini 2.5 Pro 提供真正的独立性——不同的训练数据、不同的偏见、不同的盲点。仅 Claude 的回退通过上下文隔离仍然提供价值,但失去了模型多样性。
|
||||
* 使用最强可用模型:Opus 用于评审者 A,GPT-5.4 或 Gemini 2.5 Pro 用于评审者 B。
|
||||
* 模型多样性是评审者 B 的目标。记录所选 backend 报告的实际模型和 provider。仅 Claude 的回退仍提供上下文隔离,但失去了模型多样性。
|
||||
* 评审者 A 使用 Opus;评审者 B 的 Codex 使用已配置的模型或 CLI 默认值。
|
||||
* 外部评审者使用 `--sandbox read-only`(Codex)运行,以防止审查期间仓库发生变异。
|
||||
* 每轮使用全新的评审者可以防止先前发现导致的锚定偏差。
|
||||
* 评分标准是最重要的输入。如果评审者盖章通过或标记主观风格问题,请收紧评分标准。
|
||||
|
||||
@@ -48,7 +48,7 @@ origin: ECC
|
||||
|
||||
## 输出约定
|
||||
|
||||
生成一个可复用的`VOICE PROFILE`代码块,供下游技能直接调用。使用[references/voice-profile-schema.md](references/voice-profile-schema.md)中的架构。
|
||||
生成一个可复用的`VOICE PROFILE`代码块,供下游技能直接调用。使用[references/voice-profile-schema.md](https://github.com/affaan-m/ECC/blob/main/skills/brand-voice/references/voice-profile-schema.md)中的架构。
|
||||
|
||||
保持档案结构化且足够简短,以便在会话上下文中复用。重点不是文学批评,而是操作复用。
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"if(!process.env.PLUGIN_ROOT)throw new Error('Missing Codex PLUGIN_ROOT');process.env.CLAUDE_PLUGIN_ROOT=process.env.PLUGIN_ROOT;const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/session-start-bootstrap.js"
|
||||
"command": "node -e \"if(!process.env.PLUGIN_ROOT)throw new Error('Missing Codex PLUGIN_ROOT');process.env.CLAUDE_PLUGIN_ROOT=process.env.PLUGIN_ROOT;const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/session-start-bootstrap.js"
|
||||
}
|
||||
],
|
||||
"description": "Load previous context and detect package manager on new session",
|
||||
|
||||
+27
-27
@@ -6,7 +6,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/pre-bash-dispatcher.js"
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/pre-bash-dispatcher.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -15,7 +15,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:powershell:gateguard-fact-force scripts/hooks/gateguard-fact-force.js standard,strict",
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:powershell:gateguard-fact-force scripts/hooks/gateguard-fact-force.js standard,strict",
|
||||
"timeout": 5
|
||||
}
|
||||
]
|
||||
@@ -25,7 +25,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:write:doc-file-warning scripts/hooks/doc-file-warning.js standard,strict"
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:write:doc-file-warning scripts/hooks/doc-file-warning.js standard,strict"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -34,7 +34,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:edit-write:suggest-compact scripts/hooks/suggest-compact.js standard,strict"
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:edit-write:suggest-compact scripts/hooks/suggest-compact.js standard,strict"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -43,7 +43,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:observe scripts/hooks/observe-runner.js standard,strict",
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:observe scripts/hooks/observe-runner.js standard,strict",
|
||||
"async": true,
|
||||
"timeout": 10
|
||||
}
|
||||
@@ -54,7 +54,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:governance-capture scripts/hooks/governance-capture.js standard,strict",
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:governance-capture scripts/hooks/governance-capture.js standard,strict",
|
||||
"timeout": 10
|
||||
}
|
||||
]
|
||||
@@ -64,7 +64,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:config-protection scripts/hooks/config-protection.js standard,strict",
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:config-protection scripts/hooks/config-protection.js standard,strict",
|
||||
"timeout": 5
|
||||
}
|
||||
]
|
||||
@@ -74,7 +74,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:mcp-health-check scripts/hooks/mcp-health-check.js standard,strict"
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:mcp-health-check scripts/hooks/mcp-health-check.js standard,strict"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -83,7 +83,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:edit-write:gateguard-fact-force scripts/hooks/gateguard-fact-force.js standard,strict",
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:edit-write:gateguard-fact-force scripts/hooks/gateguard-fact-force.js standard,strict",
|
||||
"timeout": 5
|
||||
}
|
||||
]
|
||||
@@ -93,7 +93,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:hookify-runtime scripts/hooks/hookify-runtime.js minimal,standard,strict",
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:hookify-runtime scripts/hooks/hookify-runtime.js minimal,standard,strict",
|
||||
"timeout": 10
|
||||
}
|
||||
]
|
||||
@@ -104,7 +104,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js prompt:hookify-runtime scripts/hooks/hookify-runtime.js minimal,standard,strict",
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js prompt:hookify-runtime scripts/hooks/hookify-runtime.js minimal,standard,strict",
|
||||
"timeout": 10
|
||||
}
|
||||
]
|
||||
@@ -116,7 +116,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:compact scripts/hooks/pre-compact.js standard,strict"
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js pre:compact scripts/hooks/pre-compact.js standard,strict"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -127,7 +127,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/session-start-bootstrap.js"
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/session-start-bootstrap.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -136,7 +136,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js session-start:plan-canvas-sessions scripts/hooks/plan-canvas-sessions.js standard,strict"
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js session-start:plan-canvas-sessions scripts/hooks/plan-canvas-sessions.js standard,strict"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -147,7 +147,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/posttooluse-dispatcher.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s).cli()\" sync",
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/posttooluse-dispatcher.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s).cli()\" sync",
|
||||
"timeout": 30
|
||||
}
|
||||
]
|
||||
@@ -157,7 +157,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/posttooluse-dispatcher.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s).cli()\" async",
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/posttooluse-dispatcher.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s).cli()\" async",
|
||||
"async": true,
|
||||
"timeout": 45
|
||||
}
|
||||
@@ -170,7 +170,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js post:mcp-health-check scripts/hooks/mcp-health-check.js standard,strict"
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js post:mcp-health-check scripts/hooks/mcp-health-check.js standard,strict"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -179,7 +179,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js post:skill:track scripts/hooks/skill-run-tracker.js standard,strict"
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const s=p.join(r,'scripts/hooks/plugin-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=r;process.argv.splice(1,0,s);require(s)\" node scripts/hooks/run-with-flags.js post:skill:track scripts/hooks/skill-run-tracker.js standard,strict"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -190,7 +190,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" stop:hookify-runtime scripts/hooks/hookify-runtime.js minimal,standard,strict 10000",
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" stop:hookify-runtime scripts/hooks/hookify-runtime.js minimal,standard,strict 10000",
|
||||
"timeout": 10
|
||||
}
|
||||
]
|
||||
@@ -200,7 +200,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" stop:plan-canvas-pending scripts/hooks/plan-canvas-pending.js minimal,standard,strict 30000"
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" stop:plan-canvas-pending scripts/hooks/plan-canvas-pending.js minimal,standard,strict 30000"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -209,7 +209,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" stop:format-typecheck scripts/hooks/stop-format-typecheck.js standard,strict 300000",
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" stop:format-typecheck scripts/hooks/stop-format-typecheck.js standard,strict 300000",
|
||||
"timeout": 300
|
||||
}
|
||||
]
|
||||
@@ -219,7 +219,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" stop:check-console-log scripts/hooks/check-console-log.js standard,strict 30000"
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" stop:check-console-log scripts/hooks/check-console-log.js standard,strict 30000"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -228,7 +228,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" stop:session-end scripts/hooks/session-end.js minimal,standard,strict 30000",
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" stop:session-end scripts/hooks/session-end.js minimal,standard,strict 30000",
|
||||
"async": true,
|
||||
"timeout": 10
|
||||
}
|
||||
@@ -239,7 +239,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" stop:evaluate-session scripts/hooks/evaluate-session.js minimal,standard,strict 30000",
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" stop:evaluate-session scripts/hooks/evaluate-session.js minimal,standard,strict 30000",
|
||||
"async": true,
|
||||
"timeout": 10
|
||||
}
|
||||
@@ -250,7 +250,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" stop:cost-tracker scripts/hooks/cost-tracker.js minimal,standard,strict 30000",
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" stop:cost-tracker scripts/hooks/cost-tracker.js minimal,standard,strict 30000",
|
||||
"async": true,
|
||||
"timeout": 10
|
||||
}
|
||||
@@ -261,7 +261,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" stop:desktop-notify scripts/hooks/desktop-notify.js standard,strict 30000",
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" stop:desktop-notify scripts/hooks/desktop-notify.js standard,strict 30000",
|
||||
"async": true,
|
||||
"timeout": 10
|
||||
}
|
||||
@@ -274,7 +274,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node -e \"const p=require('path');const 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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" session:end:marker scripts/hooks/session-end-marker.js minimal,standard,strict 30000",
|
||||
"command": "node -e \"const p=require('path');const 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));try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})();const n=process.platform==='win32'&&r.charAt(0)==='/'&&/[a-zA-Z]/.test(r.charAt(1))&&(r.length===2||r.charAt(2)==='/')?r.charAt(1).toUpperCase()+':/'+r.slice(3):r;const s=p.join(n,'scripts/hooks/lifecycle-hook-bootstrap.js');process.env.CLAUDE_PLUGIN_ROOT=n;if(require('fs').existsSync(s)){process.argv.splice(1,0,s);require(s).cli()}else{process.stderr.write('[Hook] lifecycle bootstrap unavailable; skipping hook'+String.fromCharCode(10))}\" session:end:marker scripts/hooks/session-end-marker.js minimal,standard,strict 30000",
|
||||
"async": true,
|
||||
"timeout": 10
|
||||
}
|
||||
|
||||
+27
-27
@@ -5,151 +5,151 @@
|
||||
{
|
||||
"id": "pre:bash:dispatcher",
|
||||
"description": "Consolidated Bash preflight dispatcher for quality, tmux, push, and GateGuard checks",
|
||||
"fingerprint": "7cb7b18bf466"
|
||||
"fingerprint": "caee3580a1cd"
|
||||
},
|
||||
{
|
||||
"id": "pre:powershell:gateguard-fact-force",
|
||||
"description": "PowerShell fact-forcing gate: inspect destructive commands without running unrelated Bash-only preflight hooks",
|
||||
"fingerprint": "d050a53aacaa"
|
||||
"fingerprint": "1a35f5c99e91"
|
||||
},
|
||||
{
|
||||
"id": "pre:write:doc-file-warning",
|
||||
"description": "Doc file warning: warn about non-standard documentation files (exit code 0; warns only)",
|
||||
"fingerprint": "b5d423c0a802"
|
||||
"fingerprint": "893a188556b3"
|
||||
},
|
||||
{
|
||||
"id": "pre:edit-write:suggest-compact",
|
||||
"description": "Suggest manual compaction at logical intervals",
|
||||
"fingerprint": "fe20553467a1"
|
||||
"fingerprint": "fed9e6d43aee"
|
||||
},
|
||||
{
|
||||
"id": "pre:observe:continuous-learning",
|
||||
"description": "Capture tool use observations for continuous learning",
|
||||
"fingerprint": "50e21a8e420d"
|
||||
"fingerprint": "11b383576cfa"
|
||||
},
|
||||
{
|
||||
"id": "pre:governance-capture",
|
||||
"description": "Capture governance events (secrets, policy violations, approval requests). Enable with ECC_GOVERNANCE_CAPTURE=1",
|
||||
"fingerprint": "59da397f1c62"
|
||||
"fingerprint": "d471aed407c3"
|
||||
},
|
||||
{
|
||||
"id": "pre:config-protection",
|
||||
"description": "Block modifications to linter/formatter config files. Steers agent to fix code instead of weakening configs.",
|
||||
"fingerprint": "a0259d293ded"
|
||||
"fingerprint": "c64d0c44c2c3"
|
||||
},
|
||||
{
|
||||
"id": "pre:mcp-health-check",
|
||||
"description": "Check MCP server health before MCP tool execution and block unhealthy MCP calls",
|
||||
"fingerprint": "d521e2361b09"
|
||||
"fingerprint": "2fcc0a6c1abe"
|
||||
},
|
||||
{
|
||||
"id": "pre:edit-write:gateguard-fact-force",
|
||||
"description": "Fact-forcing gate: deny the first Edit/Write/MultiEdit/NotebookEdit of each file with questions chosen by target class and by what the change touches; a completed search naming the file in the current turn, a comment or whitespace-only edit, or a same-turn sibling of a new file already gated passes with a note instead; sensitive targets (secrets, keys, auth/payment code, migrations, CI workflows) and hard-linked files are always gated, also in subagents",
|
||||
"fingerprint": "e29e628410ff"
|
||||
"fingerprint": "7cdd46de0a80"
|
||||
},
|
||||
{
|
||||
"id": "pre:hookify-runtime",
|
||||
"description": "Evaluate project-local Hookify rules before Bash, PowerShell, and file tools run",
|
||||
"fingerprint": "00070ba8af1f"
|
||||
"fingerprint": "8660029625c3"
|
||||
}
|
||||
],
|
||||
"UserPromptSubmit": [
|
||||
{
|
||||
"id": "prompt:hookify-runtime",
|
||||
"description": "Evaluate project-local Hookify prompt rules before a user prompt is processed",
|
||||
"fingerprint": "90a043fa3531"
|
||||
"fingerprint": "d27d2280d1e9"
|
||||
}
|
||||
],
|
||||
"PreCompact": [
|
||||
{
|
||||
"id": "pre:compact",
|
||||
"description": "Save state before context compaction",
|
||||
"fingerprint": "19bf2c230878"
|
||||
"fingerprint": "2887efc09d19"
|
||||
}
|
||||
],
|
||||
"SessionStart": [
|
||||
{
|
||||
"id": "session:start",
|
||||
"description": "Load previous context and detect package manager on new session",
|
||||
"fingerprint": "bba15355d598"
|
||||
"fingerprint": "4778a134fdb5"
|
||||
},
|
||||
{
|
||||
"id": "session-start:plan-canvas-sessions",
|
||||
"description": "Surface open Plan Canvas review sessions so a fresh session can resume the loop",
|
||||
"fingerprint": "77c7cba86b78"
|
||||
"fingerprint": "0c30b023430c"
|
||||
}
|
||||
],
|
||||
"PostToolUse": [
|
||||
{
|
||||
"id": "post:dispatcher:sync",
|
||||
"description": "Run synchronous PostToolUse hooks in one process while preserving per-hook controls",
|
||||
"fingerprint": "c717dcc9b73b"
|
||||
"fingerprint": "20fcf58798e2"
|
||||
},
|
||||
{
|
||||
"id": "post:dispatcher:async",
|
||||
"description": "Run background PostToolUse hooks in one process while preserving per-hook controls",
|
||||
"fingerprint": "deb48a18b282"
|
||||
"fingerprint": "8e9539714a63"
|
||||
}
|
||||
],
|
||||
"PostToolUseFailure": [
|
||||
{
|
||||
"id": "post:mcp-health-check",
|
||||
"description": "Track failed MCP tool calls, mark unhealthy servers, and attempt reconnect",
|
||||
"fingerprint": "3bd2f771b362"
|
||||
"fingerprint": "19085ba18c5a"
|
||||
},
|
||||
{
|
||||
"id": "post:skill:track",
|
||||
"description": "Record hard Skill tool failures for skill-health telemetry",
|
||||
"fingerprint": "4faf4e303862"
|
||||
"fingerprint": "92f9e5ae924d"
|
||||
}
|
||||
],
|
||||
"Stop": [
|
||||
{
|
||||
"id": "stop:hookify-runtime",
|
||||
"description": "Evaluate project-local Hookify completion rules before Claude stops",
|
||||
"fingerprint": "7c63366a0501"
|
||||
"fingerprint": "1bb03a734032"
|
||||
},
|
||||
{
|
||||
"id": "stop:plan-canvas-pending",
|
||||
"description": "Deliver undelivered Plan Canvas browser feedback before the agent stops",
|
||||
"fingerprint": "39f62c67249a"
|
||||
"fingerprint": "36be3a8827c2"
|
||||
},
|
||||
{
|
||||
"id": "stop:format-typecheck",
|
||||
"description": "Batch format (Biome/Prettier) and typecheck (tsc) all JS/TS files edited this response — runs once at Stop instead of after every Edit",
|
||||
"fingerprint": "4d1e44223b8a"
|
||||
"fingerprint": "29127461d5ac"
|
||||
},
|
||||
{
|
||||
"id": "stop:check-console-log",
|
||||
"description": "Check for console.log in modified files after each response",
|
||||
"fingerprint": "1f3b47f79452"
|
||||
"fingerprint": "d0f15ca0f7a4"
|
||||
},
|
||||
{
|
||||
"id": "stop:session-end",
|
||||
"description": "Persist session state after each response (Stop carries transcript_path)",
|
||||
"fingerprint": "e6ce566612a8"
|
||||
"fingerprint": "bde6299741f6"
|
||||
},
|
||||
{
|
||||
"id": "stop:evaluate-session",
|
||||
"description": "Evaluate session for extractable patterns",
|
||||
"fingerprint": "5fb61666ab84"
|
||||
"fingerprint": "b824054c76bd"
|
||||
},
|
||||
{
|
||||
"id": "stop:cost-tracker",
|
||||
"description": "Track token and cost metrics per session",
|
||||
"fingerprint": "e9ede0496acc"
|
||||
"fingerprint": "8baad4f457e8"
|
||||
},
|
||||
{
|
||||
"id": "stop:desktop-notify",
|
||||
"description": "Send desktop notification (macOS/WSL) with task summary when Claude responds",
|
||||
"fingerprint": "f98005a071bc"
|
||||
"fingerprint": "6fe86a1ae9c3"
|
||||
}
|
||||
],
|
||||
"SessionEnd": [
|
||||
{
|
||||
"id": "session:end:marker",
|
||||
"description": "Session end lifecycle marker (non-blocking)",
|
||||
"fingerprint": "4ab026fcc7fc"
|
||||
"fingerprint": "6ff7e7ef97b4"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"id": "hand-seeded",
|
||||
"source": "manual-curation-pending-regeneration"
|
||||
},
|
||||
"registryDigest": "25fdb7f75a02286ffddaa5902c0803be09d7e5a9a55797bb9f0224816e3d18e7",
|
||||
"registryDigest": "485efd0aa455a61c25ff6da1fb61ef36518523ab87ea6e23f002c8503e6f9c36",
|
||||
"schemaVersion": 1,
|
||||
"triggers": {
|
||||
"skill:agent-runtime-gateway-smoke-test": [
|
||||
|
||||
Generated
+18
-315
@@ -12,7 +12,8 @@
|
||||
"@iarna/toml": "2.2.5",
|
||||
"ajv": "8.20.0",
|
||||
"js-yaml": "4.3.2",
|
||||
"sql.js": "1.14.2"
|
||||
"sql.js": "1.14.2",
|
||||
"zod": "4.6.7"
|
||||
},
|
||||
"bin": {
|
||||
"ecc": "scripts/ecc.js",
|
||||
@@ -24,7 +25,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "9.39.2",
|
||||
"@opencode-ai/plugin": "1.18.34",
|
||||
"@opencode-ai/plugin": "1.4.3",
|
||||
"@types/node": "26.6.4",
|
||||
"c8": "11.0.0",
|
||||
"eslint": "10.11.0",
|
||||
@@ -36,19 +37,6 @@
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@ai-sdk/provider": {
|
||||
"version": "3.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-3.0.8.tgz",
|
||||
"integrity": "sha512-oGMAgGoQdBXbZqNG0Ze56CHjDZ1IDYOwGYxYjO5KLSlz5HiNQ9udIXsPZ61VWaHGZ5XW/jyjmr6t2xz2jGVwbQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"json-schema": "^0.4.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@bcoe/v8-coverage": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-1.0.2.tgz",
|
||||
@@ -337,136 +325,39 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.4.tgz",
|
||||
"integrity": "sha512-LCkGo6JDfaBhgST7UpPWgNgLINpcpabaHfyz5OBx75nUYxBsaEPxjnyNjWpeb/xBup/682QnBfRBy2/LvPutZQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.4.tgz",
|
||||
"integrity": "sha512-zExlW9zUJKZH/tOtVMttwjKa4Xm/3KcNjnE3dPN92uCktwavMxpgCA3MoJK/DOnTWsQgo224OaST27/mPNAf+w==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"node_modules/@msgpackr-extract/msgpackr-extract-linux-arm": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.4.tgz",
|
||||
"integrity": "sha512-Tg3yX65f5GbtXLkrYEHE5oibZG9epyYWas7FogTTEJeDEF9JlXJzKgXaNhT3UXlTOeA+AfZpYZYZ0uPj7Cfquw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@msgpackr-extract/msgpackr-extract-linux-arm64": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.4.tgz",
|
||||
"integrity": "sha512-dgX0P/9wGPJeHFBG+ZmhgE6bmtMt7NP5CRBGyyktpopdk/mW4POnrpQsSLtKI1dwpc+pPLuXHDh6vvskyQE/sw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@msgpackr-extract/msgpackr-extract-linux-x64": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.4.tgz",
|
||||
"integrity": "sha512-8TNXMEjJc3QEy7R/x1INhgiU+XakDAFUzBhaz7+Rbrs8NH5UQeHQxxmzsSBJGyV6I1jW79undiQm8tOI+D+8FQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@msgpackr-extract/msgpackr-extract-win32-x64": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.4.tgz",
|
||||
"integrity": "sha512-CmCXPQrkbwExx3j946/PtHWHbYJiCRBRDl4BlkRQcJB/YOwQxJRTpoo7aTsortjgoJ1x7opzTSxn7C+ASSLVjQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/@opencode-ai/plugin": {
|
||||
"version": "1.18.34",
|
||||
"resolved": "https://registry.npmjs.org/@opencode-ai/plugin/-/plugin-1.18.34.tgz",
|
||||
"integrity": "sha512-bC1EBL/QJ6LpC7liKZXr5JA+oa9qDAwTzpEgPxPsx1pbIUdhKOqg3/yoPEQgoa4YdO3hsgCWNFmbDE/DeOl/Ug==",
|
||||
"version": "1.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@opencode-ai/plugin/-/plugin-1.4.3.tgz",
|
||||
"integrity": "sha512-Ob/3tVSIeuMRJBr2O23RtrnC5djRe01Lglx+TwGEmjrH9yDBJ2tftegYLnNEjRoMuzITgq9LD8168p4pzv+U/A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@ai-sdk/provider": "3.0.8",
|
||||
"@opencode-ai/sdk": "1.18.34",
|
||||
"effect": "4.0.0-beta.83",
|
||||
"@opencode-ai/sdk": "1.4.3",
|
||||
"zod": "4.1.8"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@opentui/core": ">=0.4.5",
|
||||
"@opentui/keymap": ">=0.4.5",
|
||||
"@opentui/solid": ">=0.4.5"
|
||||
"@opentui/core": ">=0.1.97",
|
||||
"@opentui/solid": ">=0.1.97"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@opentui/core": {
|
||||
"optional": true
|
||||
},
|
||||
"@opentui/keymap": {
|
||||
"optional": true
|
||||
},
|
||||
"@opentui/solid": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@opencode-ai/sdk": {
|
||||
"version": "1.18.34",
|
||||
"resolved": "https://registry.npmjs.org/@opencode-ai/sdk/-/sdk-1.18.34.tgz",
|
||||
"integrity": "sha512-R9QWUpcngtdQ6FCixz7NC6n1WsSho6CEuRUzYHz/CzZcp3miSklDzXkm0oDwXVCnuEu+ANoeM0f6RDp51kOMzQ==",
|
||||
"version": "1.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@opencode-ai/sdk/-/sdk-1.4.3.tgz",
|
||||
"integrity": "sha512-X0CAVbwoGAjTY2iecpWkx2B+GAa2jSaQKYpJ+xILopeF/OGKZUN15mjqci+L7cEuwLHV5wk3x2TStUOVCa5p0A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cross-spawn": "7.0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/@standard-schema/spec": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",
|
||||
"integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/debug": {
|
||||
"version": "4.1.13",
|
||||
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz",
|
||||
@@ -896,17 +787,6 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/detect-libc": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
|
||||
"integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/devlop": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz",
|
||||
@@ -921,25 +801,6 @@
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/effect": {
|
||||
"version": "4.0.0-beta.83",
|
||||
"resolved": "https://registry.npmjs.org/effect/-/effect-4.0.0-beta.83.tgz",
|
||||
"integrity": "sha512-0wsak8RtgGAr9UWSbVDgJHZcUqMSvicHcvaZv1MbMM7MCGgW4Rn/137J1MHQbwYPcwYGxT/IqehFd+UbYuj78w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@standard-schema/spec": "^1.1.0",
|
||||
"fast-check": "^4.8.0",
|
||||
"find-my-way-ts": "^0.1.6",
|
||||
"ini": "^7.0.0",
|
||||
"kubernetes-types": "^1.30.0",
|
||||
"msgpackr": "^2.0.1",
|
||||
"multipasta": "^0.2.7",
|
||||
"toml": "^4.1.1",
|
||||
"uuid": "^14.0.0",
|
||||
"yaml": "^2.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/emoji-regex": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||
@@ -1161,29 +1022,6 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fast-check": {
|
||||
"version": "4.9.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.9.0.tgz",
|
||||
"integrity": "sha512-7ms6T7SybUev/PQITciI0yLM2pOSFy5zpG8Ty7tQofcVaQUvrMXp6CBwqF6fThLCLOrfBtuHAtwq6Yu4XPCllg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/dubzzz"
|
||||
},
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/fast-check"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"pure-rand": "^8.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.17.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fast-deep-equal": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||
@@ -1205,9 +1043,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fast-uri": {
|
||||
"version": "3.1.8",
|
||||
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.8.tgz",
|
||||
"integrity": "sha512-GZMtZUTNRpOVIECoXwLNZS5xUGE+mVNbTB8h/7Rwh2TFWcBQiPzTgyZi05BF9UMZKkLJv8XBRJTlU7zg8+ZfMg==",
|
||||
"version": "3.1.9",
|
||||
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz",
|
||||
"integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
@@ -1248,13 +1086,6 @@
|
||||
"flat-cache": "^6.1.23"
|
||||
}
|
||||
},
|
||||
"node_modules/find-my-way-ts": {
|
||||
"version": "0.1.6",
|
||||
"resolved": "https://registry.npmjs.org/find-my-way-ts/-/find-my-way-ts-0.1.6.tgz",
|
||||
"integrity": "sha512-a85L9ZoXtNAey3Y6Z+eBWW658kO/MwR7zIafkIUPUMf3isZG0NCs2pjW2wtjxAKuJPxMAsHUIP4ZPGv0o5gyTA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/find-up": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
|
||||
@@ -1591,13 +1422,6 @@
|
||||
"js-yaml": "bin/js-yaml.js"
|
||||
}
|
||||
},
|
||||
"node_modules/json-schema": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",
|
||||
"integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==",
|
||||
"dev": true,
|
||||
"license": "(AFL-2.1 OR BSD-3-Clause)"
|
||||
},
|
||||
"node_modules/json-schema-traverse": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
|
||||
@@ -1665,13 +1489,6 @@
|
||||
"@keyv/serialize": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/kubernetes-types": {
|
||||
"version": "1.30.0",
|
||||
"resolved": "https://registry.npmjs.org/kubernetes-types/-/kubernetes-types-1.30.0.tgz",
|
||||
"integrity": "sha512-Dew1okvhM/SQcIa2rcgujNndZwU8VnSapDgdxlYoB84ZlpAD43U6KLAFqYo17ykSFGHNPrg0qry0bP+GJd9v7Q==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/levn": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
|
||||
@@ -2422,46 +2239,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/msgpackr": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-2.1.0.tgz",
|
||||
"integrity": "sha512-p/pBCVO63CsvvpkomUnNNag6+n38rULuDA6HHe70o2gtC8ODI52foF/4ko2qQcp6OiErJXTmrZeXmsGGHsIQNQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optionalDependencies": {
|
||||
"msgpackr-extract": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/msgpackr-extract": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/msgpackr-extract/-/msgpackr-extract-3.0.4.tgz",
|
||||
"integrity": "sha512-4kmO/MdyUIkLIvTPr8VHLil4AtoKIoniWPIEk5+CDy0xnWC84azhSFmuJ7PxZdsYtiP5kEeQsORAVIeMgxT+Hw==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"node-gyp-build-optional-packages": "5.2.2"
|
||||
},
|
||||
"bin": {
|
||||
"download-msgpackr-prebuilds": "bin/download-prebuilds.js"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.4",
|
||||
"@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.4",
|
||||
"@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.4",
|
||||
"@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.4",
|
||||
"@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.4",
|
||||
"@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/multipasta": {
|
||||
"version": "0.2.8",
|
||||
"resolved": "https://registry.npmjs.org/multipasta/-/multipasta-0.2.8.tgz",
|
||||
"integrity": "sha512-ZPWuMKyv0cSO29f7hozp+k6+crZbQijV8ipMvxNxRf2SwtYGTX1ZX89Kd20VV4H9Znonx+EQn+iy1wGQsJ+b+Q==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/natural-compare": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
|
||||
@@ -2469,22 +2246,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/node-gyp-build-optional-packages": {
|
||||
"version": "5.2.2",
|
||||
"resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.2.2.tgz",
|
||||
"integrity": "sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"detect-libc": "^2.0.1"
|
||||
},
|
||||
"bin": {
|
||||
"node-gyp-build-optional-packages": "bin.js",
|
||||
"node-gyp-build-optional-packages-optional": "optional.js",
|
||||
"node-gyp-build-optional-packages-test": "build-test.js"
|
||||
}
|
||||
},
|
||||
"node_modules/optionator": {
|
||||
"version": "0.9.4",
|
||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
|
||||
@@ -2634,23 +2395,6 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/pure-rand": {
|
||||
"version": "8.4.2",
|
||||
"resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-8.4.2.tgz",
|
||||
"integrity": "sha512-vvuOGgcuPJAirlHvuQw1TrOiw7ptaIXXmIbNuiNOY6lNGJJH49PQ1Kj4nd783nPdQhQdicgOjVI2yI/9BD6/Ng==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/dubzzz"
|
||||
},
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/fast-check"
|
||||
}
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/qified": {
|
||||
"version": "0.10.1",
|
||||
"resolved": "https://registry.npmjs.org/qified/-/qified-0.10.1.tgz",
|
||||
@@ -2865,16 +2609,6 @@
|
||||
"url": "https://github.com/sponsors/SuperchupuDev"
|
||||
}
|
||||
},
|
||||
"node_modules/toml": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/toml/-/toml-4.3.0.tgz",
|
||||
"integrity": "sha512-lVb8X9BsPVuH0M4BKeS91tXAmJvCjQ5UIyAbQFaxkKGyUFK2RPkhwaFSQH8vbpl1d23eu/IBH+dwVMHWaq9A5A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
},
|
||||
"node_modules/type-check": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
|
||||
@@ -2926,20 +2660,6 @@
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "14.0.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.2.tgz",
|
||||
"integrity": "sha512-xZe/16rV4aa+HGSOCiY2YeLT1OybRLrrkL/Rqaq7p7GMVXjFh+6wN4oMYgjFmnSnhY8t6Xpdl2l9qmnHYuMHwQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
"https://github.com/sponsors/broofa",
|
||||
"https://github.com/sponsors/ctavan"
|
||||
],
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"uuid": "dist-node/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/v8-to-istanbul": {
|
||||
"version": "9.3.0",
|
||||
"resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz",
|
||||
@@ -2991,22 +2711,6 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/yaml": {
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz",
|
||||
"integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"bin": {
|
||||
"yaml": "bin.mjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/eemeli"
|
||||
}
|
||||
},
|
||||
"node_modules/yargs": {
|
||||
"version": "17.7.2",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
|
||||
@@ -3088,10 +2792,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/zod": {
|
||||
"version": "4.1.8",
|
||||
"resolved": "https://registry.npmjs.org/zod/-/zod-4.1.8.tgz",
|
||||
"integrity": "sha512-5R1P+WwQqmmMIEACyzSvo4JXHY5WiAFHRMg+zBZKgKS+Q1viRa0C1hmUKtHltoIFKtIdki3pRxkmpP74jnNYHQ==",
|
||||
"dev": true,
|
||||
"version": "4.6.7",
|
||||
"resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz",
|
||||
"integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/colinhacks"
|
||||
|
||||
+9
-6
@@ -545,7 +545,8 @@
|
||||
"@iarna/toml": "2.2.5",
|
||||
"ajv": "8.20.0",
|
||||
"js-yaml": "4.3.2",
|
||||
"sql.js": "1.14.2"
|
||||
"sql.js": "1.14.2",
|
||||
"zod": "4.6.7"
|
||||
},
|
||||
"pi": {
|
||||
"extensions": [
|
||||
@@ -560,7 +561,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "9.39.2",
|
||||
"@opencode-ai/plugin": "1.18.34",
|
||||
"@opencode-ai/plugin": "1.4.3",
|
||||
"@types/node": "26.6.4",
|
||||
"c8": "11.0.0",
|
||||
"eslint": "10.11.0",
|
||||
@@ -572,22 +573,24 @@
|
||||
"node": ">=18"
|
||||
},
|
||||
"overrides": {
|
||||
"fast-uri": "3.1.8",
|
||||
"fast-uri": "3.1.9",
|
||||
"markdown-it": "14.3.1",
|
||||
"js-yaml": "4.3.2",
|
||||
"@humanfs/node": "0.16.8",
|
||||
"brace-expansion": "5.0.12",
|
||||
"katex": "0.18.2",
|
||||
"smol-toml": "1.9.1"
|
||||
"smol-toml": "1.9.1",
|
||||
"zod": "4.6.7"
|
||||
},
|
||||
"resolutions": {
|
||||
"fast-uri": "3.1.8",
|
||||
"fast-uri": "3.1.9",
|
||||
"markdown-it": "14.3.1",
|
||||
"js-yaml": "4.3.2",
|
||||
"@humanfs/node": "0.16.8",
|
||||
"brace-expansion": "5.0.12",
|
||||
"katex": "0.18.2",
|
||||
"smol-toml": "1.9.1"
|
||||
"smol-toml": "1.9.1",
|
||||
"zod": "4.6.7"
|
||||
},
|
||||
"packageManager": "yarn@4.9.2+sha512.1fc009bc09d13cfd0e19efa44cbfc2b9cf6ca61482725eb35bbc5e257e093ebf4130db6dfe15d604ff4b79efd8e1e8e99b25fa7d0a6197c9f9826358d4d65c3c"
|
||||
}
|
||||
@@ -37,12 +37,10 @@ SECURE_HSTS_SECONDS = 31536000 # 1 year
|
||||
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
|
||||
SECURE_HSTS_PRELOAD = True
|
||||
SECURE_CONTENT_TYPE_NOSNIFF = True
|
||||
SECURE_BROWSER_XSS_FILTER = True
|
||||
X_FRAME_OPTIONS = 'DENY'
|
||||
|
||||
# HTTPS and Cookies
|
||||
SESSION_COOKIE_HTTPONLY = True
|
||||
CSRF_COOKIE_HTTPONLY = True
|
||||
SESSION_COOKIE_SAMESITE = 'Lax'
|
||||
CSRF_COOKIE_SAMESITE = 'Lax'
|
||||
|
||||
@@ -312,7 +310,6 @@ def greet_user(username):
|
||||
```python
|
||||
# settings.py
|
||||
SECURE_CONTENT_TYPE_NOSNIFF = True # Prevent MIME sniffing
|
||||
SECURE_BROWSER_XSS_FILTER = True # Enable XSS filter
|
||||
X_FRAME_OPTIONS = 'DENY' # Prevent clickjacking
|
||||
|
||||
# Custom middleware
|
||||
@@ -338,7 +335,7 @@ class SecurityHeaderMiddleware:
|
||||
```python
|
||||
# settings.py - CSRF is enabled by default
|
||||
CSRF_COOKIE_SECURE = True # Only send over HTTPS
|
||||
CSRF_COOKIE_HTTPONLY = True # Prevent JavaScript access
|
||||
CSRF_COOKIE_HTTPONLY = False # False so AJAX can read csrf token from document.cookie; SESSION_COOKIE_HTTPONLY remains True
|
||||
CSRF_COOKIE_SAMESITE = 'Lax' # Prevent CSRF in some cases
|
||||
CSRF_TRUSTED_ORIGINS = ['https://example.com'] # Trusted domains
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ ActiveUserDep = Annotated[User, Depends(get_current_active_user)]
|
||||
```python
|
||||
# app/routers/users.py
|
||||
from typing import Annotated
|
||||
from fastapi import APIRouter, HTTPException, Query, status
|
||||
from fastapi import APIRouter, Depends, HTTPException, Query, status
|
||||
from fastapi.security import OAuth2PasswordRequestForm
|
||||
|
||||
from app.dependencies import ActiveUserDep, DbDep
|
||||
|
||||
@@ -588,7 +588,7 @@ final class StorePostRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'title' => ['required', 'string', 'max:255', 'sanitize_html'],
|
||||
'title' => ['required', 'string', 'max:255'],
|
||||
'content' => ['required', 'string', 'max:10000'],
|
||||
'image' => [
|
||||
'required',
|
||||
|
||||
@@ -412,10 +412,6 @@ Always encode output for its context: `HTML::Entities::encode_entities()` for HT
|
||||
severity = 3
|
||||
theme = security + core
|
||||
|
||||
# Require three-arg open
|
||||
[InputOutput::RequireThreeArgOpen]
|
||||
severity = 5
|
||||
|
||||
# Require checked system calls
|
||||
[InputOutput::RequireCheckedSyscalls]
|
||||
functions = :builtins
|
||||
@@ -429,10 +425,6 @@ severity = 5
|
||||
[InputOutput::ProhibitBacktickOperators]
|
||||
severity = 4
|
||||
|
||||
# Require taint checking in CGI
|
||||
[Modules::RequireTaintChecking]
|
||||
severity = 5
|
||||
|
||||
# Prohibit two-arg open
|
||||
[InputOutput::ProhibitTwoArgOpen]
|
||||
severity = 5
|
||||
|
||||
@@ -224,7 +224,7 @@ def test_without_fixture_call():
|
||||
assert Config.get_setting("debug") is False
|
||||
```
|
||||
|
||||
### Conftest.py for Shared Fixtures
|
||||
### Conftest.py for Shared Fixtures (Flask)
|
||||
|
||||
```python
|
||||
# tests/conftest.py
|
||||
@@ -484,15 +484,23 @@ async def test_async_with_fixture(async_client):
|
||||
assert response.status_code == 200
|
||||
```
|
||||
|
||||
### Async Fixture
|
||||
### Async Fixture (FastAPI)
|
||||
|
||||
`ASGITransport` does not run lifespan events. Install `asgi-lifespan` and wrap the client in `LifespanManager` when the app uses startup or shutdown handlers. See [FastAPI's async testing guidance](https://github.com/fastapi/fastapi/blob/master/docs/en/docs/advanced/async-tests.md).
|
||||
|
||||
```python
|
||||
@pytest.fixture
|
||||
import pytest
|
||||
import pytest_asyncio
|
||||
from asgi_lifespan import LifespanManager
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
|
||||
@pytest_asyncio.fixture
|
||||
async def async_client():
|
||||
"""Async fixture providing async test client."""
|
||||
app = create_app()
|
||||
async with app.test_client() as client:
|
||||
yield client
|
||||
"""Async fixture providing async test client with lifespan events."""
|
||||
app = create_app() # Returns a FastAPI application
|
||||
async with LifespanManager(app) as manager:
|
||||
async with AsyncClient(transport=ASGITransport(app=manager.app), base_url="http://test") as client:
|
||||
yield client
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_api_endpoint(async_client):
|
||||
@@ -661,7 +669,7 @@ class TestUserService:
|
||||
|
||||
## Common Patterns
|
||||
|
||||
### Testing API Endpoints (FastAPI/Flask)
|
||||
### Testing API Endpoints (Flask)
|
||||
|
||||
```python
|
||||
@pytest.fixture
|
||||
|
||||
@@ -0,0 +1,336 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Audit recently closed issues whose asserted delivery claims cite a PR that
|
||||
* is not actually merged.
|
||||
*
|
||||
* Motivated by #3223: an issue closed as "fixed in #N" while #N was closed
|
||||
* without merging leaves a completion claim that does not hold up. This audit
|
||||
* runs weekly from .github/workflows/maintenance.yml, scans issue text and
|
||||
* close-window comments for *asserted* delivery claims, verifies each cited
|
||||
* PR's merge state, and reports findings to the workflow step summary.
|
||||
*
|
||||
* Evidence contract (per the #3522 review):
|
||||
* - Only asserted delivery claims ("delivered through #N", "fixed in #N")
|
||||
* produce findings. Historical mentions, quoted text, fenced examples,
|
||||
* negated claims, and tracking-only references are reported separately as
|
||||
* context — a merged PR alone also does not certify issue completion.
|
||||
* - Observed states are reported distinctly: merged, open-unmerged,
|
||||
* closed-unmerged, and unknown (404, rate limit, transient failures). An
|
||||
* unavailable PR warrants manual verification; it does not establish that
|
||||
* a claim failed.
|
||||
* - Collection is paginated and its completeness is visible: skipped pages,
|
||||
* rate limits, and retrieval failures turn the report into an explicitly
|
||||
* incomplete audit rather than an all-clear.
|
||||
*
|
||||
* Read-only by design: findings are advisory, the script never comments on or
|
||||
* closes anything, and always exits 0 so the scheduled run never breaks.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const { execFileSync } = require('child_process');
|
||||
|
||||
const DEFAULT_WINDOW_DAYS = 30;
|
||||
const MAX_COMMENT_REQUESTS = 200;
|
||||
const MAX_PR_CHECKS = 100;
|
||||
|
||||
const CLAIM_PATTERN =
|
||||
/\b(?:delivered|delivers|fixed|fixes|shipped|ships|landed|lands|resolved|resolves|implemented|implements|completed|completes|closed|closes|merged|merges)\s+(?:through|in|via|by|with|as|into)\s+(?:PR\s+)?#(\d+)\b/gi;
|
||||
const PR_REF_PATTERN = /\bPR\s+#(\d+)\b/gi;
|
||||
const ANY_REF_PATTERN = /(?:^|[^\w&])#(\d+)\b/g;
|
||||
const NEGATION_PATTERN =
|
||||
/\b(?:not|never|cannot|can't|won't|doesn't|does\s+not|no\s+longer|isn't|wasn't)\s+(?:\w+\s+){0,2}$/i;
|
||||
|
||||
function runGh(args, env) {
|
||||
const options = { encoding: 'utf8', env, timeout: 60000, maxBuffer: 64 * 1024 * 1024 };
|
||||
if (env.AUDIT_GH_SCRIPT) {
|
||||
// Testability hook: run a fixture script instead of the real gh CLI.
|
||||
return execFileSync(process.execPath, [env.AUDIT_GH_SCRIPT, ...args], options);
|
||||
}
|
||||
return execFileSync('gh', args, options);
|
||||
}
|
||||
|
||||
function describeGhError(error) {
|
||||
const stderr = (error && error.stderr) || '';
|
||||
const http = stderr.match(/HTTP (\d{3})/);
|
||||
if (http) return `HTTP ${http[1]}`;
|
||||
return String((error && error.message) || error).split('\n')[0];
|
||||
}
|
||||
|
||||
// Pure: fenced code blocks, inline code, and blockquoted lines are examples or
|
||||
// quotation, not assertions made by the author — strip them before matching.
|
||||
function stripNonEvidence(text) {
|
||||
if (!text) return '';
|
||||
return text
|
||||
.replace(/```[\s\S]*?```/g, ' ')
|
||||
.replace(/`[^`\n]*`/g, ' ')
|
||||
.split('\n')
|
||||
.filter((line) => !/^\s*>/.test(line))
|
||||
.join('\n');
|
||||
}
|
||||
|
||||
// Pure: a claim pattern preceded by negation words is not an assertion.
|
||||
function isNegated(clean, matchIndex) {
|
||||
const before = clean.slice(Math.max(0, matchIndex - 60), matchIndex);
|
||||
return NEGATION_PATTERN.test(before);
|
||||
}
|
||||
|
||||
// Pure: classify every #N in one text as an asserted delivery claim or a
|
||||
// contextual reference. Deduplicates per (pr, kind). In a closing comment a
|
||||
// bare "PR #N" reference is the closing evidence; in issue text it stays
|
||||
// context.
|
||||
function extractRefs(text, source, sourceUrl) {
|
||||
const clean = stripNonEvidence(text);
|
||||
if (!clean) return [];
|
||||
const refs = [];
|
||||
const claimMatches = [...clean.matchAll(CLAIM_PATTERN)];
|
||||
if (source === 'closing-comment') claimMatches.push(...clean.matchAll(PR_REF_PATTERN));
|
||||
for (const match of claimMatches) {
|
||||
if (isNegated(clean, match.index)) continue;
|
||||
refs.push({ pr: Number(match[1]), kind: 'claim', source, sourceUrl, snippet: match[0] });
|
||||
}
|
||||
const ranges = claimMatches.map((m) => [m.index, m.index + m[0].length]);
|
||||
for (const match of clean.matchAll(ANY_REF_PATTERN)) {
|
||||
const insideClaim = ranges.some(([start, end]) => match.index >= start && match.index < end);
|
||||
if (insideClaim || isNegated(clean, match.index)) continue;
|
||||
refs.push({ pr: Number(match[1]), kind: 'reference', source, sourceUrl, snippet: match[0].trim() });
|
||||
}
|
||||
const seen = new Set();
|
||||
return refs.filter((ref) => (seen.has(ref.pr + ':' + ref.kind) ? false : (seen.add(ref.pr + ':' + ref.kind), true)));
|
||||
}
|
||||
|
||||
// Pure: issues closed within the look-back window; PRs are not issues.
|
||||
function selectRecentClosedIssues(issues, nowMs, windowDays) {
|
||||
const cutoff = nowMs - windowDays * 24 * 60 * 60 * 1000;
|
||||
return issues.filter(
|
||||
(issue) =>
|
||||
issue.state === 'closed' &&
|
||||
!issue.pull_request &&
|
||||
typeof issue.closed_at === 'string' &&
|
||||
Date.parse(issue.closed_at) >= cutoff
|
||||
);
|
||||
}
|
||||
|
||||
// Pure: comment objects (body + html_url) inside the window, starting at the
|
||||
// issue's closure so the closing comment always counts as evidence.
|
||||
function selectWindowComments(comments, issueClosedAt, windowDays, nowMs) {
|
||||
const cutoff = nowMs - windowDays * 24 * 60 * 60 * 1000;
|
||||
return comments
|
||||
.filter((comment) => typeof comment.body === 'string')
|
||||
.filter((comment) => Date.parse(comment.created_at) >= Math.max(cutoff, Date.parse(issueClosedAt) - 60_000));
|
||||
}
|
||||
|
||||
// Pure: one entry per issue with its claims and contextual references.
|
||||
function extractEvidence(issue, comments, nowMs) {
|
||||
const refs = [
|
||||
...extractRefs([issue.title, issue.body].filter(Boolean).join('\n'), 'issue-body', issue.html_url),
|
||||
];
|
||||
for (const comment of selectWindowComments(comments, issue.closed_at, DEFAULT_WINDOW_DAYS, nowMs)) {
|
||||
refs.push(...extractRefs(comment.body, 'closing-comment', comment.html_url));
|
||||
}
|
||||
return refs;
|
||||
}
|
||||
|
||||
// Collect issues + evidence. Fetch failures are surfaced as incomplete notes,
|
||||
// never silently swallowed into an empty list.
|
||||
function collectEntries(fetchIssues, fetchComments, nowMs, windowDays) {
|
||||
const { items: issues, error } = fetchIssues();
|
||||
if (error) return { entries: [], incomplete: [`issue list unavailable: ${error}`] };
|
||||
const incomplete = [];
|
||||
const entries = [];
|
||||
for (const issue of selectRecentClosedIssues(issues, nowMs, windowDays)) {
|
||||
const { items: comments, error: commentError } = fetchComments(issue.number);
|
||||
if (commentError) incomplete.push(`#${issue.number} comments unavailable: ${commentError}`);
|
||||
const refs = extractEvidence(issue, comments, nowMs);
|
||||
if (refs.length) entries.push({ issue: issue.number, issueUrl: issue.html_url, refs });
|
||||
}
|
||||
return { entries, incomplete };
|
||||
}
|
||||
|
||||
function uniqueClaimPrs(entries) {
|
||||
return [...new Set(entries.flatMap((entry) => entry.refs.filter((r) => r.kind === 'claim').map((r) => r.pr)))];
|
||||
}
|
||||
|
||||
function collectReferences(entries) {
|
||||
const seen = new Set();
|
||||
const refs = [];
|
||||
for (const entry of entries) {
|
||||
for (const ref of entry.refs.filter((r) => r.kind === 'reference')) {
|
||||
const key = entry.issue + ':' + ref.pr;
|
||||
if (seen.has(key)) continue;
|
||||
seen.add(key);
|
||||
refs.push({ issue: entry.issue, pr: ref.pr });
|
||||
}
|
||||
}
|
||||
return refs;
|
||||
}
|
||||
|
||||
// Pure: one verdict row per asserted claim. Merged passes; open/closed
|
||||
// unmerged are findings; unknown is unverifiable and needs manual verification.
|
||||
function buildVerdicts(entries, pullStates) {
|
||||
const rows = [];
|
||||
for (const entry of entries) {
|
||||
for (const ref of entry.refs.filter((r) => r.kind === 'claim')) {
|
||||
const state = pullStates.get(ref.pr) || { observed: 'unknown', reason: 'not fetched' };
|
||||
rows.push({
|
||||
issue: entry.issue, pr: ref.pr, snippet: ref.snippet, source: ref.source,
|
||||
sourceUrl: ref.sourceUrl, observed: state.observed, reason: state.reason || null,
|
||||
verdict: state.observed === 'merged' ? 'pass' : state.observed === 'unknown' ? 'unverifiable' : 'unmerged',
|
||||
});
|
||||
}
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
function summaryIncomplete(lines, incomplete) {
|
||||
if (!incomplete.length) return;
|
||||
lines.push('', '**Audit incomplete** — some evidence could not be collected; absence of findings below is not an all-clear:');
|
||||
for (const note of incomplete) lines.push(`- ${note}`);
|
||||
}
|
||||
|
||||
function summaryFindings(lines, unmerged) {
|
||||
if (!unmerged.length) return;
|
||||
lines.push('', '### Findings — asserted delivery claims whose cited PR is not merged');
|
||||
for (const v of unmerged) {
|
||||
lines.push(`- #${v.issue} claims "${v.snippet}" (source: ${v.source}, ${v.sourceUrl}) → #${v.pr}: ${v.observed}.`);
|
||||
}
|
||||
}
|
||||
|
||||
function summaryUnverifiable(lines, unverifiable) {
|
||||
if (!unverifiable.length) return;
|
||||
lines.push('', '### Unverifiable — manual verification required');
|
||||
for (const v of unverifiable) {
|
||||
lines.push(`- #${v.issue} claims "${v.snippet}" (${v.sourceUrl}) → #${v.pr}: unavailable (${v.reason}). An unavailable PR does not establish that the claim failed.`);
|
||||
}
|
||||
}
|
||||
|
||||
// Traceability: every checked claim is listed with its evidence link, passes
|
||||
// included — an all-clear line alone cannot be audited.
|
||||
function summaryPasses(lines, passes) {
|
||||
if (!passes.length) return;
|
||||
lines.push('', '### Checked claims — cited PR is merged');
|
||||
for (const v of passes) {
|
||||
lines.push(`- #${v.issue} claims "${v.snippet}" (source: ${v.source}, ${v.sourceUrl}) → #${v.pr}: merged.`);
|
||||
}
|
||||
}
|
||||
|
||||
// Pure: markdown lines for the step summary.
|
||||
function buildSummary(verdicts, references, incomplete) {
|
||||
const lines = ['## Closed-issue delivery-claim audit', '', `Observed: ${new Date().toISOString()}`];
|
||||
summaryIncomplete(lines, incomplete);
|
||||
const unmerged = verdicts.filter((v) => v.verdict === 'unmerged');
|
||||
const unverifiable = verdicts.filter((v) => v.verdict === 'unverifiable');
|
||||
lines.push('', `${verdicts.length} asserted delivery claim(s) found: ${unmerged.length} unmerged finding(s), ${unverifiable.length} unverifiable.`);
|
||||
summaryFindings(lines, unmerged);
|
||||
summaryUnverifiable(lines, unverifiable);
|
||||
summaryPasses(lines, verdicts.filter((v) => v.verdict === 'pass'));
|
||||
if (references.length) {
|
||||
lines.push('', '### Contextual references (not delivery claims)');
|
||||
const byIssue = new Map();
|
||||
for (const r of references) {
|
||||
if (!byIssue.has(r.issue)) byIssue.set(r.issue, []);
|
||||
byIssue.get(r.issue).push('#' + r.pr);
|
||||
}
|
||||
for (const [issue, prs] of byIssue) {
|
||||
lines.push(`- #${issue}: ${[...new Set(prs)].join(', ')}`);
|
||||
}
|
||||
}
|
||||
if (!verdicts.length && !references.length && !incomplete.length) {
|
||||
lines.push('No asserted delivery claims found in recently closed issues.');
|
||||
}
|
||||
if (verdicts.length && !unmerged.length) {
|
||||
lines.push('', 'No unmerged findings. A merged cited PR supports the claim; it does not by itself certify issue completion, current code after a revert, or package publication.');
|
||||
}
|
||||
return lines;
|
||||
}
|
||||
|
||||
// Paginated gh api fetch: --paginate --slurp yields one array per page.
|
||||
function fetchAllPages(args, env) {
|
||||
try {
|
||||
const raw = JSON.parse(runGh(['api', '--paginate', '--slurp', args], env));
|
||||
return { items: Array.isArray(raw) ? raw.flat() : [], error: null };
|
||||
} catch (error) {
|
||||
return { items: [], error: describeGhError(error) };
|
||||
}
|
||||
}
|
||||
|
||||
// Comment fetching is bounded by a request budget; exhaustion is reported as
|
||||
// incompleteness instead of passing as an empty list.
|
||||
function makeCommentFetcher(env) {
|
||||
let budget = MAX_COMMENT_REQUESTS;
|
||||
return (number) => {
|
||||
if (budget-- <= 0) return { items: [], error: 'comment request budget exhausted' };
|
||||
return fetchAllPages(`repos/${env.GITHUB_REPOSITORY}/issues/${number}/comments?per_page=100`, env);
|
||||
};
|
||||
}
|
||||
|
||||
// Four observed states, kept distinct: merged / open-unmerged /
|
||||
// closed-unmerged / unknown (404, rate limit, transient failure).
|
||||
function fetchPullState(env, number) {
|
||||
try {
|
||||
const pr = JSON.parse(runGh(['api', `repos/${env.GITHUB_REPOSITORY}/pulls/${number}`], env));
|
||||
if (pr.merged === true) return { observed: 'merged' };
|
||||
if (pr.state === 'open') return { observed: 'open-unmerged' };
|
||||
if (pr.state === 'closed') return { observed: 'closed-unmerged' };
|
||||
return { observed: 'unknown', reason: 'unexpected PR payload' };
|
||||
} catch (error) {
|
||||
return { observed: 'unknown', reason: describeGhError(error) };
|
||||
}
|
||||
}
|
||||
|
||||
function fetchPullStates(env, prNumbers, incomplete) {
|
||||
const states = new Map();
|
||||
if (prNumbers.length > MAX_PR_CHECKS) {
|
||||
incomplete.push(`${prNumbers.length - MAX_PR_CHECKS} cited PR(s) not checked: PR check limit of ${MAX_PR_CHECKS} reached`);
|
||||
}
|
||||
for (const number of prNumbers.slice(0, MAX_PR_CHECKS)) {
|
||||
states.set(number, fetchPullState(env, number));
|
||||
}
|
||||
return states;
|
||||
}
|
||||
|
||||
function main() {
|
||||
const env = process.env;
|
||||
if (!env.GITHUB_REPOSITORY || !env.GITHUB_STEP_SUMMARY) {
|
||||
console.error('audit-closed-references: requires GITHUB_REPOSITORY and GITHUB_STEP_SUMMARY');
|
||||
process.exitCode = 1;
|
||||
return;
|
||||
}
|
||||
const issuesResult = fetchAllPages(
|
||||
`repos/${env.GITHUB_REPOSITORY}/issues?state=closed&sort=updated&direction=desc&per_page=100`, env
|
||||
);
|
||||
const fetchComments = makeCommentFetcher(env);
|
||||
const { entries, incomplete } = collectEntries(
|
||||
() => issuesResult, fetchComments, Date.now(), DEFAULT_WINDOW_DAYS
|
||||
);
|
||||
const pullStates = fetchPullStates(env, uniqueClaimPrs(entries), incomplete);
|
||||
const verdicts = buildVerdicts(entries, pullStates);
|
||||
const references = collectReferences(entries);
|
||||
const report = buildSummary(verdicts, references, incomplete).join('\n');
|
||||
fs.appendFileSync(env.GITHUB_STEP_SUMMARY, report + '\n');
|
||||
console.log(report);
|
||||
// Advisory by design: findings land in the summary; the run stays green so
|
||||
// the weekly audit is never the thing that fails.
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
DEFAULT_WINDOW_DAYS,
|
||||
MAX_COMMENT_REQUESTS,
|
||||
CLAIM_PATTERN,
|
||||
stripNonEvidence,
|
||||
isNegated,
|
||||
extractRefs,
|
||||
selectRecentClosedIssues,
|
||||
selectWindowComments,
|
||||
extractEvidence,
|
||||
collectEntries,
|
||||
uniqueClaimPrs,
|
||||
collectReferences,
|
||||
buildVerdicts,
|
||||
buildSummary,
|
||||
fetchAllPages,
|
||||
fetchPullState,
|
||||
};
|
||||
|
||||
if (require.main === module) main();
|
||||
@@ -0,0 +1,137 @@
|
||||
#!/usr/bin/env node
|
||||
/** Moderate Issue creation metadata only. Never execute or print contributor text. */
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const { githubAPI, listPages, validatePolicy, strongestWindow, blockAuthor } = require('./pr-burst-guard');
|
||||
|
||||
const LOGIN = /^[a-z\d](?:[a-z\d-]{0,38})(?:\[bot\])?$/i;
|
||||
const CAP_MARKER = '<!-- ecc-issue-open-cap -->';
|
||||
const ALERT_MARKER = '<!-- ecc-issue-burst:';
|
||||
const isIssue = issue => !issue.pull_request;
|
||||
const byCreation = (a, b) => Date.parse(a.created_at) - Date.parse(b.created_at) || a.number - b.number;
|
||||
|
||||
function capExcess(openRows, current, policy, alreadyClosed = new Set(), action = 'opened') {
|
||||
validatePolicy(policy);
|
||||
const open = [...new Map([...openRows, current].map(issue => [issue.number, issue])).values()]
|
||||
.filter(issue => isIssue(issue) && issue.user.id === current.user.id
|
||||
&& issue.state === 'open' && !alreadyClosed.has(issue.number)).sort(byCreation);
|
||||
const currentIndex = open.findIndex(issue => issue.number === current.number);
|
||||
const excess = open.length <= policy.maxOpen || currentIndex < 0 ? []
|
||||
: action === 'reopened' ? [open[currentIndex]]
|
||||
: open.filter((issue, index) => index >= policy.maxOpen && byCreation(issue, current) >= 0);
|
||||
return { openCount: open.length, maxOpen: policy.maxOpen,
|
||||
capExcess: excess.map(issue => ({ number: issue.number, state: issue.state })) };
|
||||
}
|
||||
|
||||
async function notify(api, root, current, result, policy) {
|
||||
const day = result.until.slice(0, 10);
|
||||
const marker = `${ALERT_MARKER}${current.user.id}:${day} -->`;
|
||||
const rows = await listPages(api, `${root}/issues?state=all&sort=created&direction=desc`,
|
||||
batch => batch.some(issue => issue.created_at?.slice(0, 10) < day));
|
||||
const existing = rows.find(issue => isIssue(issue) && issue.user?.login === 'github-actions[bot]'
|
||||
&& issue.body?.includes(marker));
|
||||
const escalation = '<!-- ecc-issue-burst:block-threshold -->';
|
||||
if (existing?.body.includes(escalation) && !result.block) return;
|
||||
const mentions = policy.notify.map(login => `@${login}`).join(' ');
|
||||
const body = [marker, result.block ? escalation : '', `${mentions}: Issue submission moderation triggered.`, '',
|
||||
`Author: @${current.user.login} (user ID ${current.user.id}).`,
|
||||
`Observed: ${result.count} Issue creations between ${result.since} and ${result.until}.`,
|
||||
`Policy: close Issues beyond ${policy.closeAbove}; block beyond ${policy.blockAbove} in ${policy.windowMinutes} minutes.`,
|
||||
`Blocking: ${result.blockStatus}.`, `Excess Issues: ${result.excess.map(issue => `#${issue.number}`).join(', ') || 'none'}.`,
|
||||
`Enforcement errors: ${result.errors.join('; ') || 'none'}.`, '',
|
||||
'Counts include closed Issues and exclude pull requests. Review the Actions run before lifting an account block.']
|
||||
.filter(Boolean).join('\n');
|
||||
if (!existing) await api('POST', `${root}/issues`, { title: `Issue burst alert: ${current.user.login}`, body });
|
||||
else {
|
||||
if (result.block && !existing.body.includes(escalation)) {
|
||||
await api('POST', `${root}/issues/${existing.number}/comments`, {
|
||||
body: `${mentions}: the Issue burst escalated. Blocking: ${result.blockStatus}.`,
|
||||
});
|
||||
}
|
||||
await api('PATCH', `${root}/issues/${existing.number}`, { body });
|
||||
}
|
||||
}
|
||||
|
||||
async function enforceCap(api, root, issue, current, result) {
|
||||
try {
|
||||
await api('PATCH', `${root}/issues/${issue.number}`, { state: 'closed' });
|
||||
const comments = await listPages(api, `${root}/issues/${issue.number}/comments?sort=created`);
|
||||
if (comments.some(comment => comment.user?.login === 'github-actions[bot]'
|
||||
&& comment.body?.includes(CAP_MARKER))) return;
|
||||
await api('POST', `${root}/issues/${issue.number}/comments`, { body: [CAP_MARKER,
|
||||
`Closed automatically: @${current.user.login} has ${result.openCount} open Issues in this repository, above the limit of ${result.maxOpen} per author.`,
|
||||
'', 'Close older Issues or wait for them to be resolved, then reopen this one. This limit protects maintainer triage capacity.',
|
||||
'Policy: `.github/ISSUE_MODERATION.md`.'].join('\n') });
|
||||
} catch (error) { result.errors.push(`#${issue.number}: ${error.message}`); }
|
||||
}
|
||||
|
||||
async function moderate({ api, blockAPI, repository, number, action = 'opened', policy, dryRun = false, now = Date.now() }) {
|
||||
validatePolicy(policy);
|
||||
if (!/^[a-z\d-]+\/[a-z\d_.-]+$/i.test(repository) || !Number.isSafeInteger(number) || number < 1) {
|
||||
throw new Error('Invalid repository or Issue number');
|
||||
}
|
||||
if (!['opened', 'reopened'].includes(action)) throw new Error('Unsupported Issue event');
|
||||
const root = `/repos/${repository}`;
|
||||
const repo = await api('GET', root);
|
||||
const current = await api('GET', `${root}/issues/${number}`);
|
||||
if (!isIssue(current)) return { skipped: 'pull request' };
|
||||
if (!LOGIN.test(current.user.login)) throw new Error('Invalid Issue author login');
|
||||
// The guard's own alert Issues must never enter the moderation ledger.
|
||||
if (current.user.login === 'github-actions[bot]') return { skipped: 'guard bot' };
|
||||
let permission;
|
||||
try { permission = (await api('GET', `${root}/collaborators/${current.user.login}/permission`)).permission; }
|
||||
catch (error) {
|
||||
if (error.status !== 404) throw error;
|
||||
permission = 'none';
|
||||
}
|
||||
const burstExempt = ['admin', 'maintain', 'write'].includes(permission);
|
||||
let result;
|
||||
if (burstExempt) result = { author: current.user.login, burstExempt, dryRun, errors: [], excess: [],
|
||||
blockStatus: 'Exempt from burst threshold' };
|
||||
else {
|
||||
const end = action === 'opened' ? Date.parse(current.created_at) : now;
|
||||
const since = end - policy.windowMinutes * 60000;
|
||||
const rows = (await listPages(api, `${root}/issues?state=all&sort=created&direction=desc`,
|
||||
batch => batch.some(issue => Date.parse(issue.created_at) < since))).filter(isIssue);
|
||||
result = { ...strongestWindow(rows, current, policy, end), author: current.user.login,
|
||||
burstExempt, dryRun, errors: [], blockStatus: 'Below blocking threshold' };
|
||||
}
|
||||
const openRows = (await listPages(api, `${root}/issues?state=open&sort=created&direction=desc`)).filter(isIssue);
|
||||
Object.assign(result, capExcess(openRows, current, policy, new Set(result.excess.map(issue => issue.number)), action));
|
||||
if (dryRun) {
|
||||
if (result.block) result.blockStatus = 'Dry run: would attempt owner-scoped blocking';
|
||||
return result;
|
||||
}
|
||||
if (result.excess.length) {
|
||||
if (result.block) result.blockStatus = await blockAuthor(blockAPI, repo.owner, current.user.login);
|
||||
for (const issue of result.excess) {
|
||||
if (issue.state !== 'open') continue;
|
||||
try {
|
||||
await api('PATCH', `${root}/issues/${issue.number}`, { state: 'closed' });
|
||||
await api('PUT', `${root}/issues/${issue.number}/lock`, { lock_reason: 'spam' });
|
||||
} catch (error) { result.errors.push(`#${issue.number}: ${error.message}`); }
|
||||
}
|
||||
await notify(api, root, current, result, policy);
|
||||
}
|
||||
for (const issue of result.capExcess) await enforceCap(api, root, issue, current, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const dryRun = process.argv.includes('--dry-run');
|
||||
const event = process.env.GITHUB_EVENT_PATH ? JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8')) : {};
|
||||
const issueIndex = process.argv.indexOf('--issue');
|
||||
const number = issueIndex >= 0 ? Number(process.argv[issueIndex + 1]) : event.issue?.number;
|
||||
const policy = JSON.parse(fs.readFileSync(path.join(__dirname, '../../.github/issue-submission-policy.json'), 'utf8'));
|
||||
const result = await moderate({ api: githubAPI(process.env.GITHUB_TOKEN),
|
||||
blockAPI: !dryRun && process.env.PR_MODERATION_BLOCK_TOKEN ? githubAPI(process.env.PR_MODERATION_BLOCK_TOKEN) : undefined,
|
||||
repository: process.env.GITHUB_REPOSITORY, number, action: event.action || 'opened', policy, dryRun });
|
||||
const report = JSON.stringify(result, null, 2);
|
||||
console.log(report);
|
||||
if (process.env.GITHUB_STEP_SUMMARY) fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY,
|
||||
`## Issue submission guard\n\n\`\`\`json\n${report}\n\`\`\`\n`);
|
||||
if (result.errors?.length || /^(Failed|Unavailable):/.test(result.blockStatus || '')) process.exitCode = 1;
|
||||
}
|
||||
|
||||
if (require.main === module) main().catch(error => { console.error(error.message); process.exitCode = 1; });
|
||||
module.exports = { capExcess, moderate };
|
||||
@@ -230,4 +230,4 @@ async function main() {
|
||||
}
|
||||
|
||||
if (require.main === module) main().catch(error => { console.error(error.message); process.exitCode = 1; });
|
||||
module.exports = { evaluate, moderate, githubAPI, listPages, validatePolicy, strongestWindow, capExcess };
|
||||
module.exports = { evaluate, moderate, githubAPI, listPages, validatePolicy, strongestWindow, capExcess, blockAuthor };
|
||||
@@ -14,7 +14,8 @@
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const { isGitRepo, getGitModifiedFiles, readFile, log } = require('../lib/utils');
|
||||
const path = require('path');
|
||||
const { isGitRepo, getGitModifiedFiles, readFile, log, runCommand } = require('../lib/utils');
|
||||
|
||||
// Files where console.log is expected and should not trigger warnings
|
||||
const EXCLUDED_PATTERNS = [
|
||||
@@ -27,6 +28,18 @@ const EXCLUDED_PATTERNS = [
|
||||
];
|
||||
|
||||
const MAX_DIRECT_STDIN_BYTES = 16 * 1024 * 1024;
|
||||
|
||||
// This Stop hook inspects the session's working directory. Inherited GIT_*
|
||||
// variables from another Git process can silently redirect discovery and diff
|
||||
// commands to a different repository, so give every Git call the same clean env.
|
||||
function sessionGitOptions() {
|
||||
const env = { ...process.env };
|
||||
for (const name of Object.keys(env)) {
|
||||
if (name.toUpperCase().startsWith('GIT_')) delete env[name];
|
||||
}
|
||||
return { env };
|
||||
}
|
||||
|
||||
let data = '';
|
||||
let stdinBytes = 0;
|
||||
let oversized = false;
|
||||
@@ -61,19 +74,23 @@ function passThroughAndExit() {
|
||||
|
||||
process.stdin.on('end', () => {
|
||||
try {
|
||||
if (!isGitRepo()) {
|
||||
const gitOptions = sessionGitOptions();
|
||||
if (!isGitRepo(gitOptions)) {
|
||||
passThroughAndExit();
|
||||
return;
|
||||
}
|
||||
|
||||
const files = getGitModifiedFiles(['\\.tsx?$', '\\.jsx?$'])
|
||||
.filter(f => fs.existsSync(f))
|
||||
// git reports paths from the repository root, and the session can run in a
|
||||
// subdirectory of it, so read each file from the root.
|
||||
const root = runCommand('git rev-parse --show-toplevel', gitOptions).output;
|
||||
const files = getGitModifiedFiles(['\\.tsx?$', '\\.jsx?$'], gitOptions)
|
||||
.filter(f => fs.existsSync(path.join(root, f)))
|
||||
.filter(f => !EXCLUDED_PATTERNS.some(pattern => pattern.test(f)));
|
||||
|
||||
let hasConsole = false;
|
||||
|
||||
for (const file of files) {
|
||||
const content = readFile(file);
|
||||
const content = readFile(path.join(root, file));
|
||||
if (content && content.includes('console.log')) {
|
||||
log(`[Hook] WARNING: console.log found in ${file}`);
|
||||
hasConsole = true;
|
||||
|
||||
@@ -117,8 +117,9 @@ const PROTECTED_FILES = new Set([
|
||||
const PROTECTED_PATTERNS = [
|
||||
// eslint.config.base.mjs, prettier.config.shared.cjs, stylelint.config.local.js ...
|
||||
/^(eslint|prettier|stylelint|commitlint|oxlint)\.config(\.[A-Za-z0-9_-]+)*\.(js|mjs|cjs|ts|mts|cts)$/i,
|
||||
// .eslintrc.base.json, .prettierrc.shared.yml ...
|
||||
/^\.(eslintrc|prettierrc|stylelintrc|markdownlintrc)(\.[A-Za-z0-9_-]+)*\.(js|cjs|mjs|json|jsonc|yml|yaml|toml)$/i,
|
||||
// .eslintrc.base.json, .prettierrc.shared.yml ... Prettier also reads
|
||||
// `.prettierrc.ts`, `.mts`, `.cts` and `.json5`.
|
||||
/^\.(eslintrc|prettierrc|stylelintrc|markdownlintrc)(\.[A-Za-z0-9_-]+)*\.(js|cjs|mjs|ts|mts|cts|json|jsonc|json5|yml|yaml|toml)$/i,
|
||||
];
|
||||
|
||||
function isProtectedName(basename) {
|
||||
|
||||
@@ -56,7 +56,9 @@ function readToken(input, startIndex) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ch === '\\' && quote === '"' && index + 1 < input.length) {
|
||||
// Inside double quotes, bash drops a backslash only before $ ` " \ or a
|
||||
// newline, so `"echo ready\;"` keeps its `\;` for tmux.
|
||||
if (ch === '\\' && quote === '"' && index + 1 < input.length && '$`"\\\n'.includes(input[index + 1])) {
|
||||
token += input[index + 1];
|
||||
index += 2;
|
||||
continue;
|
||||
@@ -104,7 +106,7 @@ function normalizeCommandWord(token) {
|
||||
return base.replace(/\.(cmd|exe|bat)$/i, '');
|
||||
}
|
||||
|
||||
function getLeadingCommandWord(segment) {
|
||||
function getLeadingCommand(segment) {
|
||||
let index = 0;
|
||||
let activeWrapper = null;
|
||||
let skipNextValue = false;
|
||||
@@ -145,7 +147,7 @@ function getLeadingCommandWord(segment) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return normalizedToken;
|
||||
return { word: normalizedToken, end: index };
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -160,7 +162,19 @@ process.stdin.on('data', chunk => {
|
||||
}
|
||||
});
|
||||
|
||||
const TMUX_LAUNCHER = /^\s*tmux\s+(new|new-session|new-window|split-window)\b/;
|
||||
// tmux commands, and their aliases, that run their shell command in a tmux pane,
|
||||
// where its output stays readable. run-shell and `tmux -c` run it without one.
|
||||
const TMUX_PANE_COMMANDS = new Set([
|
||||
'new-session', 'new',
|
||||
'new-window', 'neww',
|
||||
'split-window', 'splitw',
|
||||
'respawn-pane', 'respawnp',
|
||||
'respawn-window', 'respawnw',
|
||||
'send-keys', 'send'
|
||||
]);
|
||||
// tmux's own options that take a value (`-L work`, `-Lwork`, or the last of a
|
||||
// cluster such as `-vL work`).
|
||||
const TMUX_OPTION_VALUE_LETTERS = new Set(['f', 'L', 'S', 'T']);
|
||||
// Trailing (?![\w-]) rather than \b: \b treats a hyphen as a word boundary, so
|
||||
// `dev\b` matches the `dev` prefix of distinct scripts like `dev-setup` /
|
||||
// `dev-docs` / `dev-build` and wrongly blocks them. The lookahead still matches
|
||||
@@ -199,10 +213,51 @@ function collectCheckSegments(cmd) {
|
||||
return segments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true when the tmux invocation that starts at `index` runs the dev
|
||||
* server in a pane. The tmux commands follow tmux's own options (`-L work`,
|
||||
* `-f conf`), and the executable may come through a path or an env prefix, so
|
||||
* this reads the parsed tokens instead of the start of the segment. A sequence
|
||||
* (`new-session -d \; run-shell ...`) is exempt only when every command in it
|
||||
* that runs the dev server is a pane command.
|
||||
*/
|
||||
function isTmuxPaneLaunch(segment, index) {
|
||||
const tokens = [];
|
||||
for (let parsed = readToken(segment, index); parsed; parsed = readToken(segment, parsed.end)) {
|
||||
if (parsed.token) tokens.push(parsed.token);
|
||||
}
|
||||
|
||||
let next = 0;
|
||||
for (; next < tokens.length && isOptionToken(tokens[next]); next++) {
|
||||
const letters = tokens[next].slice(1);
|
||||
for (let i = 0; i < letters.length; i++) {
|
||||
// -c runs its shell command without a pane.
|
||||
if (letters[i] === 'c') return false;
|
||||
if (TMUX_OPTION_VALUE_LETTERS.has(letters[i])) {
|
||||
if (i === letters.length - 1) next++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// tmux ends a command at a `;` argument and at a `;` that ends an argument
|
||||
// (`'npm run dev;'`); an escaped `\;` at the end stays literal.
|
||||
const commands = [[]];
|
||||
for (const token of tokens.slice(next)) {
|
||||
const ends = token.endsWith(';') && !token.endsWith('\\;');
|
||||
const value = ends ? token.slice(0, -1) : token;
|
||||
if (value) commands[commands.length - 1].push(value);
|
||||
if (ends) commands.push([]);
|
||||
}
|
||||
const devCommands = commands.filter(command => DEV_PATTERN.test(command.join(' ')));
|
||||
return devCommands.length > 0 && devCommands.every(command => TMUX_PANE_COMMANDS.has(command[0]));
|
||||
}
|
||||
|
||||
function isBlockedDevSegment(segment) {
|
||||
const commandWord = getLeadingCommandWord(segment);
|
||||
if (!commandWord || !DEV_COMMAND_WORDS.has(commandWord)) return false;
|
||||
return DEV_PATTERN.test(segment) && !TMUX_LAUNCHER.test(segment);
|
||||
const command = getLeadingCommand(segment);
|
||||
if (!command || !DEV_COMMAND_WORDS.has(command.word)) return false;
|
||||
if (!DEV_PATTERN.test(segment)) return false;
|
||||
return !(command.word === 'tmux' && isTmuxPaneLaunch(segment, command.end));
|
||||
}
|
||||
|
||||
process.stdin.on('end', () => {
|
||||
|
||||
@@ -128,10 +128,16 @@ function findTsConfigDir(filePath) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// tsc --pretty false starts each diagnostic with the file it is about:
|
||||
// `src/a.ts(1,14): error TS2322: ...`. Compare that path instead of looking for
|
||||
// the edited path anywhere in the line, which let a root `index.ts` claim the
|
||||
// errors of `src/index.ts`, and `src/utils.ts` those of `web/src/utils.ts`.
|
||||
function diagnosticMatchesFile(line, paths) {
|
||||
const normalizedLine = line.replace(/\\/g, '/');
|
||||
const location = /^(.+?)\(\d+,\d+\): /.exec(line);
|
||||
if (!location) return false;
|
||||
const file = location[1].replace(/\\/g, '/');
|
||||
for (const candidate of paths) {
|
||||
if (normalizedLine.includes(candidate.replace(/\\/g, '/'))) return true;
|
||||
if (file === candidate.replace(/\\/g, '/')) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ function readManagedHookConfig(env = process.env) {
|
||||
if (!configPath || !fs.existsSync(configPath)) return {};
|
||||
|
||||
try {
|
||||
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
||||
const config = JSON.parse(fs.readFileSync(configPath, 'utf8').replace(/^\uFEFF/, ''));
|
||||
return config?.hooks
|
||||
&& typeof config.hooks === 'object'
|
||||
&& !Array.isArray(config.hooks)
|
||||
|
||||
@@ -21,8 +21,15 @@ function normalizeFailureReason(reason) {
|
||||
.replace(/\d{4}-\d{2}-\d{2}[t ]\d{2}:\d{2}:\d{2}[.\dz]*/g, '<timestamp>')
|
||||
// Strip UUIDs (already lowercased)
|
||||
.replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/g, '<uuid>')
|
||||
// Strip file paths
|
||||
.replace(/\/[\w./-]+/g, '<path>')
|
||||
// Quoted Windows paths preserve spaces and apostrophes inside path components.
|
||||
// A closing quote must be followed by a delimiter, not another name character.
|
||||
.replace(/(["'])(?:[a-z]:[\\/]|\\\\)[^\r\n]*?\1(?=[:\s),;.!?]|$)/gu, '$1<path>$1')
|
||||
// Directories may contain spaces, but trailing whitespace separates diagnostic prose.
|
||||
// Unquoted spaced leaves allow one final dotted token; longer prose stays diagnostic.
|
||||
// Quote paths with multiple spaces in the final filename to remove ambiguity.
|
||||
.replace(/(?:\b[a-z]:|\\)[\\/](?:[^\\/:*?"<>|\r\n]*[^\s\\/:*?"<>|][\\/])*[^\s\\/:*?"<>|(),;]+(?: [^\s\\/:*?"<>|]+\.[^\s\\/:*?"<>|]+(?=:))?[\\/]*/gu, '<path>')
|
||||
// Strip remaining file paths
|
||||
.replace(/(?:\b[a-z]:)?[\\/][\w./\\-]+/g, '<path>')
|
||||
// Collapse whitespace
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim();
|
||||
@@ -60,6 +67,14 @@ function groupFailures(skillRuns) {
|
||||
return groups;
|
||||
}
|
||||
|
||||
function compareTimestampsDescending(a, b) {
|
||||
const timeA = Date.parse(a);
|
||||
const timeB = Date.parse(b);
|
||||
if (Number.isNaN(timeA)) return Number.isNaN(timeB) ? 0 : 1;
|
||||
if (Number.isNaN(timeB)) return -1;
|
||||
return timeB - timeA;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect recurring failure patterns from skill runs.
|
||||
*
|
||||
@@ -79,7 +94,7 @@ function detectPatterns(skillRuns, options = {}) {
|
||||
}
|
||||
|
||||
const sortedRuns = [...group.runs].sort(
|
||||
(a, b) => (b.createdAt || '').localeCompare(a.createdAt || '')
|
||||
(a, b) => compareTimestampsDescending(a.createdAt, b.createdAt)
|
||||
);
|
||||
|
||||
const firstSeen = sortedRuns[sortedRuns.length - 1].createdAt || null;
|
||||
@@ -106,7 +121,7 @@ function detectPatterns(skillRuns, options = {}) {
|
||||
// Sort by count descending, then by lastSeen descending
|
||||
return patterns.sort((a, b) => {
|
||||
if (b.count !== a.count) return b.count - a.count;
|
||||
return (b.lastSeen || '').localeCompare(a.lastSeen || '');
|
||||
return compareTimestampsDescending(a.lastSeen, b.lastSeen);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ function planClaudeStyleLegacyInstall(context, { adapterId, adapterRootInput, ru
|
||||
function planClaudeLegacyInstall(context) {
|
||||
return planClaudeStyleLegacyInstall(context, {
|
||||
adapterId: 'claude',
|
||||
adapterRootInput: { homeDir: context.homeDir },
|
||||
adapterRootInput: { homeDir: context.homeDir, env: context.env },
|
||||
rulesDir: context.claudeRulesDir || null
|
||||
});
|
||||
}
|
||||
@@ -461,6 +461,7 @@ function createLegacyInstallPlan(options = {}) {
|
||||
sourceRoot,
|
||||
projectRoot,
|
||||
homeDir,
|
||||
env: options.env || {},
|
||||
languages: Array.isArray(options.languages) ? options.languages : [],
|
||||
claudeRulesDir: options.claudeRulesDir || process.env.CLAUDE_RULES_DIR || null
|
||||
};
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const { resolveInvocationEnvironment } = require('../invocation-environment');
|
||||
|
||||
const {
|
||||
HOME_INSTALL_EXCLUDED_SOURCE_PATHS,
|
||||
@@ -7,6 +9,7 @@ const {
|
||||
isForeignPlatformPath,
|
||||
normalizeRelativePath,
|
||||
planClaudeHooksOperations,
|
||||
convertWindowsPathToWSL,
|
||||
} = require('./helpers');
|
||||
|
||||
const CLAUDE_ECC_NAMESPACE = 'ecc';
|
||||
@@ -47,11 +50,52 @@ function getClaudeManagedDestinationPath(adapter, sourceRelativePath, input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expand leading ~, ~/, ~\ against the home directory.
|
||||
* Mirrors the expansion in resolveEccRoot to keep install and runtime roots in sync.
|
||||
*/
|
||||
function expandTilde(inputPath, homeDir) {
|
||||
if (typeof inputPath !== 'string') return inputPath;
|
||||
const trimmed = inputPath.trim();
|
||||
if (trimmed === '~') return homeDir;
|
||||
if (trimmed.startsWith('~/') || trimmed.startsWith('~\\')) {
|
||||
return path.join(homeDir, trimmed.slice(2));
|
||||
}
|
||||
return trimmed;
|
||||
}
|
||||
|
||||
// Claude Code loads its user-level config from CLAUDE_CONFIG_DIR when set,
|
||||
// otherwise ~/.claude. Resolve the install root the same way the runtime does
|
||||
// (see resolveClaudePaths/inventory and getDefaultClaudeAgentDataHome) so an
|
||||
// install lands where Claude Code will actually read it; without this, ECC
|
||||
// writes to ~/.claude and "installs, but nothing loads" whenever CLAUDE_CONFIG_DIR
|
||||
// redirects the config root (common on WSL / dev-container / dotfile setups).
|
||||
// On WSL, convert Windows paths (e.g., C:\Users\name\.claude) to WSL paths
|
||||
// (/mnt/c/Users/name/.claude) so the installer writes to the correct location.
|
||||
function resolveClaudeConfigRoot(options = {}) {
|
||||
const environment = resolveInvocationEnvironment(options);
|
||||
const configured = environment && environment.CLAUDE_CONFIG_DIR;
|
||||
const homeDir = path.resolve(options.homeDir || os.homedir());
|
||||
if (typeof configured === 'string' && configured.trim() !== '') {
|
||||
const normalized = configured.trim();
|
||||
const converted = convertWindowsPathToWSL(normalized);
|
||||
// After WSL conversion, a blank result means the config dir was invalid.
|
||||
// Fall back to the default Claude directory just like the runtime adapter does.
|
||||
const expanded = expandTilde(converted, homeDir);
|
||||
if (typeof expanded === 'string' && expanded.trim() === '') {
|
||||
return path.join(homeDir, '.claude');
|
||||
}
|
||||
return path.resolve(expanded);
|
||||
}
|
||||
return path.join(homeDir, '.claude');
|
||||
}
|
||||
|
||||
module.exports = createInstallTargetAdapter({
|
||||
id: 'claude-home',
|
||||
target: 'claude',
|
||||
kind: 'home',
|
||||
rootSegments: ['.claude'],
|
||||
resolveRoot: resolveClaudeConfigRoot,
|
||||
installStatePathSegments: ['ecc', 'install-state.json'],
|
||||
excludedSourcePaths: HOME_INSTALL_EXCLUDED_SOURCE_PATHS,
|
||||
nativeRootRelativePath: '.claude-plugin',
|
||||
@@ -63,6 +107,7 @@ module.exports = createInstallTargetAdapter({
|
||||
repoRoot: input.repoRoot,
|
||||
projectRoot: input.projectRoot,
|
||||
homeDir: input.homeDir,
|
||||
env: input.env,
|
||||
};
|
||||
|
||||
const operations = modules.flatMap(module => {
|
||||
|
||||
@@ -7,6 +7,55 @@ const {
|
||||
} = require('../install/claude-settings');
|
||||
const { METADATA_FILENAME } = require('../hooks-config');
|
||||
|
||||
// Memoized WSL detection (avoids repeated /proc/version reads)
|
||||
let _isWSL = null;
|
||||
function isWSL() {
|
||||
if (_isWSL !== null) return _isWSL;
|
||||
if (process.platform !== 'linux') {
|
||||
_isWSL = false;
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
_isWSL = fs.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft');
|
||||
} catch {
|
||||
_isWSL = false;
|
||||
}
|
||||
return _isWSL;
|
||||
}
|
||||
|
||||
// Reset WSL detection memoization (for testing only)
|
||||
function resetWSLDetection() {
|
||||
_isWSL = null;
|
||||
}
|
||||
|
||||
// Set WSL detection for testing (for testing only)
|
||||
function setWSLForTesting(value) {
|
||||
_isWSL = value;
|
||||
}
|
||||
|
||||
// Windows path pattern: drive letter followed by :\ or :/
|
||||
const WINDOWS_PATH_PATTERN = /^[A-Za-z]:[\\/]/;
|
||||
|
||||
// Compact WSL conversion snippet for inline resolvers embedded in commands and hooks.
|
||||
// Uses 8 backslashes in regex source so it preserves shell escaping when inlined into `node -e "..."`.
|
||||
const INLINE_WSL_CONVERSION = `try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}`;
|
||||
|
||||
/**
|
||||
* Convert a Windows path to a WSL path.
|
||||
* Example: "C:\Users\name" -> "/mnt/c/Users/name"
|
||||
* Example: "D:/Projects" -> "/mnt/d/Projects"
|
||||
* Returns the original path if it's not a Windows path or not on WSL.
|
||||
*/
|
||||
function convertWindowsPathToWSL(windowsPath) {
|
||||
if (!isWSL()) return windowsPath;
|
||||
if (typeof windowsPath !== 'string') return windowsPath;
|
||||
const trimmed = windowsPath.trim();
|
||||
if (!WINDOWS_PATH_PATTERN.test(trimmed)) return trimmed;
|
||||
const driveLetter = trimmed[0].toLowerCase();
|
||||
const rest = trimmed.slice(2).replace(/\\/g, '/');
|
||||
return `/mnt/${driveLetter}${rest}`;
|
||||
}
|
||||
|
||||
const PLATFORM_SOURCE_PATH_OWNERS = Object.freeze({
|
||||
'.claude-plugin': 'claude',
|
||||
'.codex': 'codex',
|
||||
@@ -448,4 +497,9 @@ module.exports = {
|
||||
isForeignPlatformPath,
|
||||
normalizeRelativePath,
|
||||
planClaudeHooksOperations,
|
||||
isWSL,
|
||||
resetWSLDetection,
|
||||
setWSLForTesting,
|
||||
convertWindowsPathToWSL,
|
||||
INLINE_WSL_CONVERSION,
|
||||
};
|
||||
@@ -12,7 +12,7 @@ const {
|
||||
const { readInstallState, writeInstallState } = require('../install-state');
|
||||
const {
|
||||
assertHookConsentReady,
|
||||
disableOpenCodeHookPluginRegistration,
|
||||
parseJsoncConfig,
|
||||
getDisabledOpenCodePluginContent,
|
||||
getRecordedHookConsent,
|
||||
getOpenCodeActivationPathKind,
|
||||
@@ -463,9 +463,16 @@ function activationIsInactive(kind, operation, content) {
|
||||
return content.toString('utf8') === getDisabledOpenCodePluginContent();
|
||||
}
|
||||
const text = content.toString('utf8');
|
||||
// Validate first so malformed JSON retains its source context.
|
||||
disableOpenCodeHookPluginRegistration(text, operation.sourceRelativePath || operation.destinationPath);
|
||||
const config = JSON.parse(text);
|
||||
const relativePath = operation.sourceRelativePath || operation.destinationPath;
|
||||
// JSONC-tolerant parse so a comment in the user's config does not crash
|
||||
// the install; the ownership guard never writes this file (issue #3546).
|
||||
const config = parseJsoncConfig(text, relativePath);
|
||||
// Keep the same shape error the strict parser surfaced via
|
||||
// disableOpenCodeHookPluginRegistration: a non-array plugin must not
|
||||
// silently count as inactive.
|
||||
if (config.plugin !== undefined && !Array.isArray(config.plugin)) {
|
||||
throw new Error(`Invalid ${relativePath}: plugin must be an array`);
|
||||
}
|
||||
return !Array.isArray(config.plugin) || !config.plugin.includes('./plugins');
|
||||
}
|
||||
|
||||
|
||||
@@ -45,16 +45,109 @@ function normalizeOperationPath(value) {
|
||||
return String(value || '').replace(/\\/g, '/').toLowerCase();
|
||||
}
|
||||
|
||||
function disableOpenCodeHookPluginRegistration(content, sourceRelativePath) {
|
||||
/**
|
||||
* Parse an OpenCode config the way OpenCode itself does: comments and the
|
||||
* trailing commas they hide are legal (JSONC). The installer only ever
|
||||
* reads these files (the ownership guard never writes user-owned configs),
|
||||
* so a tolerant read prevents a membership check from crashing the install
|
||||
* on a config OpenCode accepts.
|
||||
*/
|
||||
function parseJsoncConfig(content, sourceRelativePath) {
|
||||
let config;
|
||||
try {
|
||||
config = JSON.parse(content);
|
||||
config = JSON.parse(stripJsonc(content));
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to parse ${sourceRelativePath}: ${error.message}`);
|
||||
}
|
||||
if (!config || typeof config !== 'object' || Array.isArray(config)) {
|
||||
throw new Error(`Invalid ${sourceRelativePath}: expected a JSON object`);
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
||||
function isLineBreak(ch) {
|
||||
return ch === '\n' || ch === '\r';
|
||||
}
|
||||
|
||||
/**
|
||||
* Advance past whitespace and // or /* *\/ comments; returns the index of
|
||||
* the next significant character.
|
||||
*/
|
||||
function skipJsoncTrivia(input, start) {
|
||||
let j = start;
|
||||
for (;;) {
|
||||
while (j < input.length && /\s/.test(input[j])) j += 1;
|
||||
if (input[j] === '/' && input[j + 1] === '/') {
|
||||
while (j < input.length && !isLineBreak(input[j])) j += 1;
|
||||
continue;
|
||||
}
|
||||
if (input[j] === '/' && input[j + 1] === '*') {
|
||||
j += 2;
|
||||
while (j < input.length && !(input[j] === '*' && input[j + 1] === '/')) j += 1;
|
||||
if (j >= input.length) throw new Error('Unterminated block comment');
|
||||
j += 2;
|
||||
continue;
|
||||
}
|
||||
return j;
|
||||
}
|
||||
}
|
||||
|
||||
function isJsoncTrailingComma(input, index, previousSignificant) {
|
||||
const next = skipJsoncTrivia(input, index + 1);
|
||||
// Preserve commas in empty containers or after another separator so
|
||||
// JSON.parse rejects them; it validates the remaining value syntax.
|
||||
return (input[next] === '}' || input[next] === ']')
|
||||
&& previousSignificant !== null && !'[{,:'.includes(previousSignificant);
|
||||
}
|
||||
|
||||
/**
|
||||
* Strip // and /* *\/ comments and the trailing commas they hide, without
|
||||
* touching string contents (URLs like "https://..." must survive intact).
|
||||
*/
|
||||
function stripJsonc(input) {
|
||||
let out = '';
|
||||
let inString = false;
|
||||
let escaped = false;
|
||||
let previousSignificant = null;
|
||||
for (let i = 0; i < input.length; i += 1) {
|
||||
const ch = input[i];
|
||||
if (inString) {
|
||||
out += ch;
|
||||
if (escaped) escaped = false;
|
||||
else if (ch === '\\') escaped = true;
|
||||
else if (ch === '"') inString = false;
|
||||
continue;
|
||||
}
|
||||
if (ch === '"') {
|
||||
inString = true;
|
||||
out += ch;
|
||||
previousSignificant = '"';
|
||||
continue;
|
||||
}
|
||||
if (ch === '/' && input[i + 1] === '/') {
|
||||
while (i < input.length && !isLineBreak(input[i])) i += 1;
|
||||
out += '\n';
|
||||
continue;
|
||||
}
|
||||
if (ch === '/' && input[i + 1] === '*') {
|
||||
i += 2;
|
||||
while (i < input.length && !(input[i] === '*' && input[i + 1] === '/')) i += 1;
|
||||
if (i >= input.length) throw new Error('Unterminated block comment');
|
||||
i += 1; // consume the closing '/'
|
||||
out += ' ';
|
||||
continue;
|
||||
}
|
||||
if (ch === ',') {
|
||||
if (isJsoncTrailingComma(input, i, previousSignificant)) continue;
|
||||
}
|
||||
out += ch;
|
||||
if (!/\s/.test(ch)) previousSignificant = ch;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
function disableOpenCodeHookPluginRegistration(content, sourceRelativePath) {
|
||||
const config = parseJsoncConfig(content, sourceRelativePath);
|
||||
if (config.plugin !== undefined && !Array.isArray(config.plugin)) {
|
||||
throw new Error(`Invalid ${sourceRelativePath}: plugin must be an array`);
|
||||
}
|
||||
@@ -334,6 +427,7 @@ module.exports = {
|
||||
assertHookConsentReady,
|
||||
disableUnselectedOpenCodeHooks,
|
||||
disableOpenCodeHookPluginRegistration,
|
||||
parseJsoncConfig,
|
||||
getDisabledOpenCodePluginContent,
|
||||
getOpenCodeActivationPathKind,
|
||||
getOpenCodeSourceActivationKind,
|
||||
|
||||
@@ -4,6 +4,7 @@ const fs = require('fs');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const { isWithinRoot, realpathNearestExisting } = require('../path-safety');
|
||||
const { convertWindowsPathToWSL } = require('../install-targets/helpers');
|
||||
|
||||
const CURRENT_PLUGIN_ID = 'ecc@ecc';
|
||||
// Legacy plugin ids, kept so existing installs are still recognized.
|
||||
@@ -12,19 +13,44 @@ const LEGACY_PLUGIN_IDS = new Set([
|
||||
'everything-claude-code@ecc',
|
||||
]);
|
||||
|
||||
function expandTilde(inputPath, homeDir) {
|
||||
if (typeof inputPath !== 'string') return inputPath;
|
||||
const trimmed = inputPath.trim();
|
||||
if (trimmed === '~') return homeDir;
|
||||
if (trimmed.startsWith('~/') || trimmed.startsWith('~\\')) {
|
||||
return path.join(homeDir, trimmed.slice(2));
|
||||
}
|
||||
return trimmed;
|
||||
}
|
||||
|
||||
function resolveClaudePaths(options = {}) {
|
||||
const homeDir = options.homeDir
|
||||
|| process.env.HOME
|
||||
|| process.env.USERPROFILE
|
||||
|| os.homedir();
|
||||
const configDir = options.configDir
|
||||
|| process.env.CLAUDE_CONFIG_DIR
|
||||
|| path.join(homeDir, '.claude');
|
||||
const homeDir = path.resolve(
|
||||
options.homeDir
|
||||
|| process.env.HOME
|
||||
|| process.env.USERPROFILE
|
||||
|| os.homedir()
|
||||
);
|
||||
const configured = options.configDir !== undefined
|
||||
? options.configDir
|
||||
: process.env.CLAUDE_CONFIG_DIR;
|
||||
let resolvedConfigDir;
|
||||
if (typeof configured === 'string' && configured.trim() !== '') {
|
||||
const normalized = configured.trim();
|
||||
const converted = convertWindowsPathToWSL(normalized);
|
||||
const expanded = expandTilde(converted, homeDir);
|
||||
if (typeof expanded === 'string' && expanded.trim() !== '') {
|
||||
resolvedConfigDir = path.resolve(expanded.trim());
|
||||
} else {
|
||||
resolvedConfigDir = path.join(homeDir, '.claude');
|
||||
}
|
||||
} else {
|
||||
resolvedConfigDir = path.join(homeDir, '.claude');
|
||||
}
|
||||
const projectRoot = options.projectRoot || process.cwd();
|
||||
|
||||
return {
|
||||
homeDir: path.resolve(homeDir),
|
||||
configDir: path.resolve(configDir),
|
||||
homeDir,
|
||||
configDir: resolvedConfigDir,
|
||||
projectRoot: path.resolve(projectRoot),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ function createRawInstallPlan(request, options = {}) {
|
||||
languages: request.languages,
|
||||
projectRoot: options.projectRoot,
|
||||
homeDir: options.homeDir,
|
||||
env: resolveInvocationEnvironment(options),
|
||||
claudeRulesDir: options.claudeRulesDir,
|
||||
sourceRoot: options.sourceRoot,
|
||||
});
|
||||
|
||||
@@ -4,6 +4,23 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
const os = require('os');
|
||||
|
||||
// Lazily loaded so this module can be required from stripped-down directories
|
||||
// (e.g., temp dirs in tests that copy only resolve-ecc-root.js + utils.js).
|
||||
// Falls back to identity on failure, which matches non-WSL behavior.
|
||||
let _convertWindowsPathToWSL = null;
|
||||
function convertWindowsPathToWSL(windowsPath) {
|
||||
if (_convertWindowsPathToWSL === null) {
|
||||
try {
|
||||
_convertWindowsPathToWSL = require('./install-targets/helpers').convertWindowsPathToWSL;
|
||||
} catch (_) {
|
||||
// Module unavailable from this location; non-WSL behavior returns
|
||||
// the input unchanged, so the fallback is safe.
|
||||
_convertWindowsPathToWSL = (p) => p;
|
||||
}
|
||||
}
|
||||
return _convertWindowsPathToWSL(windowsPath);
|
||||
}
|
||||
|
||||
const CURRENT_PLUGIN_SLUG = 'ecc';
|
||||
// Legacy install id, kept for existing installs.
|
||||
const LEGACY_PLUGIN_SLUG = 'everything-claude-code';
|
||||
@@ -66,7 +83,10 @@ function resolveEccRoot(options = {}) {
|
||||
const configuredDir = options.configDir !== undefined
|
||||
? options.configDir
|
||||
: process.env.CLAUDE_CONFIG_DIR;
|
||||
const rawDir = typeof configuredDir === 'string' ? configuredDir.trim() : '';
|
||||
// On WSL, convert Windows paths (e.g., C:\Users\name\.claude) to WSL paths
|
||||
// (/mnt/c/Users/name/.claude) so the resolver finds the correct location.
|
||||
const wslConfiguredDir = convertWindowsPathToWSL(configuredDir);
|
||||
const rawDir = typeof wslConfiguredDir === 'string' ? wslConfiguredDir.trim() : '';
|
||||
const expandedDir = rawDir === '~'
|
||||
? homeDir
|
||||
: (rawDir.startsWith('~/') || rawDir.startsWith('~\\'))
|
||||
@@ -160,10 +180,41 @@ function normalizePluginRootForPlatform(rootDir, platform = process.platform) {
|
||||
* const _r = <paste INLINE_RESOLVE>;
|
||||
* const sm = require(_r + '/scripts/lib/session-manager');
|
||||
*/
|
||||
const INLINE_RESOLVE = `(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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})()`;
|
||||
// Lazily loaded so this module can be required from stripped-down directories
|
||||
// (e.g., temp dirs in tests that copy only resolve-ecc-root.js + utils.js).
|
||||
// Falls back to canonical inline string with identical escaping when unavailable.
|
||||
let _inlineWslConversion = null;
|
||||
function getInlineWslConversion() {
|
||||
if (_inlineWslConversion === null) {
|
||||
try {
|
||||
_inlineWslConversion = require('./install-targets/helpers').INLINE_WSL_CONVERSION;
|
||||
} catch (_) {
|
||||
_inlineWslConversion = `try{if(o.platform()==='linux'){var v=f.readFileSync('/proc/version','utf8').toLowerCase();if(v.includes('microsoft')){var m=d.match(/^([A-Za-z]):[\\\\\\\\/]/);if(m){var dl=m[1].toLowerCase();d='/mnt/'+dl+d.slice(2).replace(/\\\\\\\\/g,'/')}}}}catch(_){}`;
|
||||
}
|
||||
}
|
||||
return _inlineWslConversion;
|
||||
}
|
||||
|
||||
function buildInlineResolve(options = {}) {
|
||||
const wslConversion = getInlineWslConversion();
|
||||
let probeArg = '';
|
||||
if (options && options.probe) {
|
||||
const segments = String(options.probe).split(/[\\/]/).filter(Boolean);
|
||||
for (const seg of segments) {
|
||||
if (!/^[\w.-]+$/.test(seg)) {
|
||||
throw new Error(`Invalid probe segment: ${seg}`);
|
||||
}
|
||||
}
|
||||
probeArg = `{probe:p.join(${segments.map((s) => `'${s}'`).join(',')})}`;
|
||||
}
|
||||
return `(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));${wslConversion}d=p.resolve(d);function L(x){try{return require(p.join(x,'scripts','lib','resolve-ecc-root')).resolveEccRoot(${probeArg})}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}function D(x){try{return f.readdirSync(x,{withFileTypes:true}).filter(function(z){return z.isDirectory()}).map(function(z){return z.name})}catch(e){if(e.code==='ENOENT')return [];throw e}}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=D(c);for(var k=0;k<O.length;k++){var q=p.join(c,O[k]);var V=D(q);for(var m=0;m<V.length;m++){r=L(p.join(q,V[m]));if(r)return r}}}return d})()`;
|
||||
}
|
||||
|
||||
const INLINE_RESOLVE = buildInlineResolve();
|
||||
|
||||
module.exports = {
|
||||
resolveEccRoot,
|
||||
normalizePluginRootForPlatform,
|
||||
INLINE_RESOLVE,
|
||||
buildInlineResolve,
|
||||
};
|
||||
@@ -32,7 +32,16 @@ const PRETTIER_CONFIGS = [
|
||||
'.prettierrc.toml',
|
||||
'prettier.config.js',
|
||||
'prettier.config.cjs',
|
||||
'prettier.config.mjs'
|
||||
'prettier.config.mjs',
|
||||
// The rest of the names Prettier's config searcher looks for
|
||||
// (src/config/prettier-config/config-searcher.js).
|
||||
'.prettierrc.json5',
|
||||
'.prettierrc.ts',
|
||||
'.prettierrc.mts',
|
||||
'.prettierrc.cts',
|
||||
'prettier.config.ts',
|
||||
'prettier.config.mts',
|
||||
'prettier.config.cts'
|
||||
];
|
||||
|
||||
const PROJECT_ROOT_MARKERS = ['package.json', ...BIOME_CONFIGS, ...PRETTIER_CONFIGS];
|
||||
|
||||
@@ -58,7 +58,7 @@ function loadAliases() {
|
||||
const data = JSON.parse(content);
|
||||
|
||||
// Validate structure
|
||||
if (!data.aliases || typeof data.aliases !== 'object') {
|
||||
if (!data.aliases || typeof data.aliases !== 'object' || Array.isArray(data.aliases)) {
|
||||
log('[Aliases] Invalid aliases file structure, resetting');
|
||||
return getDefaultAliases();
|
||||
}
|
||||
@@ -215,6 +215,10 @@ function setAliasUnlocked(alias, sessionPath, title = null) {
|
||||
return { success: false, error: 'Session path cannot be empty' };
|
||||
}
|
||||
|
||||
if (title !== null && typeof title !== 'string') {
|
||||
return { success: false, error: 'Title must be a string or null' };
|
||||
}
|
||||
|
||||
if (alias.length > 128) {
|
||||
return { success: false, error: 'Alias name cannot exceed 128 characters' };
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ function bucketByDay(records, nowMs, days) {
|
||||
}
|
||||
|
||||
for (const bucket of buckets) {
|
||||
if (recordMs > bucket.start && recordMs <= bucket.end) {
|
||||
if (recordMs >= bucket.start && recordMs <= bucket.end) {
|
||||
bucket.records.push(record);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@ function toNullableNumber(value, fieldName) {
|
||||
}
|
||||
|
||||
const numericValue = Number(value);
|
||||
if (!Number.isFinite(numericValue)) {
|
||||
throw new Error(`${fieldName} must be a number`);
|
||||
if (!Number.isFinite(numericValue) || numericValue < 0) {
|
||||
throw new Error(`${fieldName} must be a number greater than or equal to zero`);
|
||||
}
|
||||
|
||||
return numericValue;
|
||||
@@ -79,7 +79,7 @@ function normalizeExecutionRecord(input, options = {}) {
|
||||
throw new Error('failure_reason must be a string or null');
|
||||
}
|
||||
|
||||
if (Number.isNaN(Date.parse(recordedAt))) {
|
||||
if (typeof recordedAt !== 'string' || Number.isNaN(Date.parse(recordedAt))) {
|
||||
throw new Error('recorded_at must be an ISO timestamp');
|
||||
}
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -193,10 +193,10 @@ export interface CommandResult {
|
||||
export function runCommand(cmd: string, options?: ExecSyncOptions): CommandResult;
|
||||
|
||||
/** Check if the current directory is inside a git repository */
|
||||
export function isGitRepo(): boolean;
|
||||
export function isGitRepo(options?: ExecSyncOptions): boolean;
|
||||
|
||||
/**
|
||||
* Get git modified files (staged + unstaged), optionally filtered by regex patterns.
|
||||
* Invalid regex patterns are silently skipped.
|
||||
*/
|
||||
export function getGitModifiedFiles(patterns?: string[]): string[];
|
||||
export function getGitModifiedFiles(patterns?: string[], options?: ExecSyncOptions): string[];
|
||||
@@ -537,22 +537,25 @@ function runCommand(cmd, options = {}) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if current directory is a git repository
|
||||
* Check if current directory is a git repository.
|
||||
* @param {object} [options] - Options forwarded to runCommand, including env.
|
||||
*/
|
||||
function isGitRepo() {
|
||||
return runCommand('git rev-parse --git-dir').success;
|
||||
function isGitRepo(options = {}) {
|
||||
return runCommand('git rev-parse --git-dir', options).success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get git modified files, optionally filtered by regex patterns
|
||||
* @param {string[]} patterns - Array of regex pattern strings to filter files.
|
||||
* Invalid patterns are silently skipped.
|
||||
* @param {object} [options] - Options forwarded to every Git subprocess.
|
||||
* @returns {string[]} Array of modified file paths
|
||||
*/
|
||||
function getGitModifiedFiles(patterns = []) {
|
||||
if (!isGitRepo()) return [];
|
||||
function getGitModifiedFiles(patterns = [], options = {}) {
|
||||
if (!isGitRepo(options)) return [];
|
||||
|
||||
const result = runCommand('git diff --name-only HEAD');
|
||||
// Paths from the repository root even when diff.relative is set.
|
||||
const result = runCommand('git -c diff.relative=false diff --name-only HEAD', options);
|
||||
if (!result.success) return [];
|
||||
|
||||
let files = result.output.split('\n').filter(Boolean);
|
||||
|
||||
@@ -39,7 +39,13 @@ function usage() {
|
||||
|
||||
function parseArgs(argv) {
|
||||
const args = argv.slice(2);
|
||||
const target = args.find(argument => !argument.startsWith('--'));
|
||||
const valueOptions = ['--adapter', '--target-type', '--skill', '--amendment-id', '--observations', '--write'];
|
||||
for (const [index, argument] of args.entries()) {
|
||||
if (valueOptions.includes(argument) && (!args[index + 1] || args[index + 1].startsWith('--'))) {
|
||||
throw new Error(`Missing value for ${argument}`);
|
||||
}
|
||||
}
|
||||
const target = args.find((argument, index) => !argument.startsWith('--') && !valueOptions.includes(args[index - 1]));
|
||||
const listAdapters = args.includes('--list-adapters');
|
||||
|
||||
const adapterIndex = args.indexOf('--adapter');
|
||||
|
||||
@@ -28,11 +28,17 @@ function parseArgs(argv) {
|
||||
const arg = args[index];
|
||||
|
||||
if (arg === '--db') {
|
||||
if (!args[index + 1] || args[index + 1].startsWith('--') || args[index + 1] === '-h') {
|
||||
throw new Error(`Missing value for ${arg}`);
|
||||
}
|
||||
parsed.dbPath = args[index + 1] || null;
|
||||
index += 1;
|
||||
} else if (arg === '--json') {
|
||||
parsed.json = true;
|
||||
} else if (arg === '--limit') {
|
||||
if (!args[index + 1] || args[index + 1].startsWith('--') || args[index + 1] === '-h') {
|
||||
throw new Error(`Missing value for ${arg}`);
|
||||
}
|
||||
parsed.limit = args[index + 1] || null;
|
||||
index += 1;
|
||||
} else if (arg === '--help' || arg === '-h') {
|
||||
|
||||
+32
-15
@@ -12,7 +12,13 @@ repo: https://github.com/sreedhargs89/context-keeper
|
||||
|
||||
You are the **Context Keeper** assistant. When the user invokes any `/ck:*` command,
|
||||
run the corresponding Node.js script and present its stdout to the user verbatim.
|
||||
Scripts live at: `~/.claude/skills/ck/commands/` (expand `~` with `$HOME`).
|
||||
Scripts live in the `commands/` directory next to this SKILL.md (for example
|
||||
`~/.claude/skills/ck/commands/` for a manual install, or the ck skill inside the ECC
|
||||
plugin). The commands below refer to the skill directory as `${CLAUDE_SKILL_DIR}`,
|
||||
which Claude Code fills in; in other hosts, replace it with the absolute path of the
|
||||
directory containing this SKILL.md. Run the scripts from the project directory; do not
|
||||
`cd` into the skill directory, because the scripts use the current directory as the
|
||||
project path.
|
||||
|
||||
---
|
||||
|
||||
@@ -32,7 +38,7 @@ Scripts live at: `~/.claude/skills/ck/commands/` (expand `~` with `$HOME`).
|
||||
|
||||
### `/ck:init` — Register a Project
|
||||
```bash
|
||||
node "$HOME/.claude/skills/ck/commands/init.mjs"
|
||||
node "${CLAUDE_SKILL_DIR}/commands/init.mjs"
|
||||
```
|
||||
The script outputs JSON with auto-detected info. Present it as a confirmation draft:
|
||||
```
|
||||
@@ -44,9 +50,13 @@ Goal: <goal>
|
||||
Do-nots: <constraints or "None">
|
||||
Repo: <repo or "none">
|
||||
```
|
||||
Wait for user approval. Apply any edits. Then pipe confirmed JSON to save.mjs --init:
|
||||
Wait for user approval. Apply any edits. Then pass the confirmed JSON to save.mjs --init
|
||||
through a quoted heredoc (never `echo '...'`: an apostrophe in any field would end the
|
||||
quoted string and hand the rest to the shell):
|
||||
```bash
|
||||
echo '<confirmed-json>' | node "$HOME/.claude/skills/ck/commands/save.mjs" --init
|
||||
node "${CLAUDE_SKILL_DIR}/commands/save.mjs" --init <<'CK_JSON'
|
||||
<confirmed-json>
|
||||
CK_JSON
|
||||
```
|
||||
Confirmed JSON schema: `{"name":"...","path":"...","description":"...","stack":["..."],"goal":"...","constraints":["..."],"repo":"..." }`
|
||||
|
||||
@@ -62,9 +72,11 @@ Confirmed JSON schema: `{"name":"...","path":"...","description":"...","stack":[
|
||||
- `goal`: updated goal string **only if it changed this session**, else omit
|
||||
|
||||
Show a draft summary to the user: `"Session: '<summary>' — save this? (yes / edit)"`
|
||||
Wait for confirmation. Then pipe to save.mjs:
|
||||
Wait for confirmation. Then pass the JSON to save.mjs through a quoted heredoc:
|
||||
```bash
|
||||
echo '<json>' | node "$HOME/.claude/skills/ck/commands/save.mjs"
|
||||
node "${CLAUDE_SKILL_DIR}/commands/save.mjs" <<'CK_JSON'
|
||||
<json>
|
||||
CK_JSON
|
||||
```
|
||||
JSON schema (exact): `{"summary":"...","leftOff":"...","nextSteps":["..."],"decisions":[{"what":"...","why":"..."}],"blockers":["..."]}`
|
||||
Display the script's stdout confirmation verbatim.
|
||||
@@ -73,7 +85,7 @@ Display the script's stdout confirmation verbatim.
|
||||
|
||||
### `/ck:resume [name|number]` — Full Briefing
|
||||
```bash
|
||||
node "$HOME/.claude/skills/ck/commands/resume.mjs" [arg]
|
||||
node "${CLAUDE_SKILL_DIR}/commands/resume.mjs" [arg]
|
||||
```
|
||||
Display output verbatim. Then ask: "Continue from here? Or has anything changed?"
|
||||
If user reports changes → run `/ck:save` immediately.
|
||||
@@ -82,7 +94,7 @@ If user reports changes → run `/ck:save` immediately.
|
||||
|
||||
### `/ck:info [name|number]` — Quick Snapshot
|
||||
```bash
|
||||
node "$HOME/.claude/skills/ck/commands/info.mjs" [arg]
|
||||
node "${CLAUDE_SKILL_DIR}/commands/info.mjs" [arg]
|
||||
```
|
||||
Display output verbatim. No follow-up question.
|
||||
|
||||
@@ -90,7 +102,7 @@ Display output verbatim. No follow-up question.
|
||||
|
||||
### `/ck:list` — Portfolio View
|
||||
```bash
|
||||
node "$HOME/.claude/skills/ck/commands/list.mjs"
|
||||
node "${CLAUDE_SKILL_DIR}/commands/list.mjs"
|
||||
```
|
||||
Display output verbatim. If user replies with a number or name → run `/ck:resume`.
|
||||
|
||||
@@ -101,7 +113,7 @@ First resolve the project name (run `/ck:list` if needed).
|
||||
Ask: `"This will permanently delete context for '<name>'. Are you sure? (yes/no)"`
|
||||
If yes:
|
||||
```bash
|
||||
node "$HOME/.claude/skills/ck/commands/forget.mjs" [name]
|
||||
node "${CLAUDE_SKILL_DIR}/commands/forget.mjs" [name]
|
||||
```
|
||||
Display confirmation verbatim.
|
||||
|
||||
@@ -109,11 +121,11 @@ Display confirmation verbatim.
|
||||
|
||||
### `/ck:migrate` — Convert v1 Data to v2
|
||||
```bash
|
||||
node "$HOME/.claude/skills/ck/commands/migrate.mjs"
|
||||
node "${CLAUDE_SKILL_DIR}/commands/migrate.mjs"
|
||||
```
|
||||
For a dry run first:
|
||||
```bash
|
||||
node "$HOME/.claude/skills/ck/commands/migrate.mjs" --dry-run
|
||||
node "${CLAUDE_SKILL_DIR}/commands/migrate.mjs" --dry-run
|
||||
```
|
||||
Display output verbatim. Migrates all v1 CONTEXT.md + meta.json files to v2 context.json.
|
||||
Originals are backed up as `meta.json.v1-backup` — nothing is deleted.
|
||||
@@ -122,19 +134,24 @@ Originals are backed up as `meta.json.v1-backup` — nothing is deleted.
|
||||
|
||||
## SessionStart Hook
|
||||
|
||||
The hook at `~/.claude/skills/ck/hooks/session-start.mjs` must be registered in
|
||||
`~/.claude/settings.json` to auto-load project context on session start:
|
||||
The hook at `hooks/session-start.mjs` in this skill's directory must be registered in
|
||||
`~/.claude/settings.json` to auto-load project context on session start. For a manual
|
||||
install in `~/.claude/skills/ck`:
|
||||
|
||||
```json
|
||||
{
|
||||
"hooks": {
|
||||
"SessionStart": [
|
||||
{ "hooks": [{ "type": "command", "command": "node \"~/.claude/skills/ck/hooks/session-start.mjs\"" }] }
|
||||
{ "hooks": [{ "type": "command", "command": "node \"$HOME/.claude/skills/ck/hooks/session-start.mjs\"" }] }
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Use `$HOME`, not `~`: the shell does not expand `~` inside double quotes. If ck lives
|
||||
elsewhere (for example inside the ECC plugin), use the absolute path of its
|
||||
`hooks/session-start.mjs` instead.
|
||||
|
||||
The hook injects ~100 tokens per session (compact 5-line summary). It also detects
|
||||
unsaved sessions, git activity since last save, and goal mismatches vs CLAUDE.md.
|
||||
|
||||
|
||||
@@ -6,8 +6,9 @@
|
||||
*/
|
||||
|
||||
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
|
||||
import { resolve } from 'path';
|
||||
import { resolve, dirname } from 'path';
|
||||
import { homedir } from 'os';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { spawnSync } from 'child_process';
|
||||
import { randomBytes } from 'crypto';
|
||||
|
||||
@@ -17,7 +18,7 @@ export const CK_HOME = resolve(homedir(), '.claude', 'ck');
|
||||
export const CONTEXTS_DIR = resolve(CK_HOME, 'contexts');
|
||||
export const PROJECTS_FILE = resolve(CK_HOME, 'projects.json');
|
||||
export const CURRENT_SESSION = resolve(CK_HOME, 'current-session.json');
|
||||
export const SKILL_FILE = resolve(homedir(), '.claude', 'skills', 'ck', 'SKILL.md');
|
||||
export const SKILL_FILE = resolve(dirname(fileURLToPath(import.meta.url)), '..', 'SKILL.md');
|
||||
|
||||
// ─── JSON I/O ─────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -183,8 +184,9 @@ export function gitSummary(projectPath, sinceDate) {
|
||||
// ─── Native memory path encoding ──────────────────────────────────────────────
|
||||
|
||||
export function encodeProjectPath(absolutePath) {
|
||||
// "/Users/sree/dev/app" -> "-Users-sree-dev-app"
|
||||
return absolutePath.replace(/\//g, '-');
|
||||
// Same rule as Claude Code: every non-alphanumeric character becomes '-'.
|
||||
// "/Users/sree/dev/my app" -> "-Users-sree-dev-my-app"
|
||||
return absolutePath.replace(/[^A-Za-z0-9]/g, '-');
|
||||
}
|
||||
|
||||
export function nativeMemoryDir(absolutePath) {
|
||||
|
||||
@@ -15,14 +15,17 @@
|
||||
*/
|
||||
|
||||
import { readFileSync, writeFileSync, existsSync } from 'fs';
|
||||
import { resolve } from 'path';
|
||||
import { resolve, dirname } from 'path';
|
||||
import { homedir } from 'os';
|
||||
import { spawnSync } from 'child_process';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const CK_HOME = resolve(homedir(), '.claude', 'ck');
|
||||
const PROJECTS_FILE = resolve(CK_HOME, 'projects.json');
|
||||
const CURRENT_SESSION = resolve(CK_HOME, 'current-session.json');
|
||||
const SKILL_FILE = resolve(homedir(), '.claude', 'skills', 'ck', 'SKILL.md');
|
||||
// Resolve SKILL.md next to this hook, so plugin installs work as well as ~/.claude/skills/ck.
|
||||
const SKILL_DIR = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const SKILL_FILE = resolve(SKILL_DIR, 'SKILL.md');
|
||||
|
||||
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -85,7 +88,13 @@ function main() {
|
||||
const sessionId = readSessionId();
|
||||
|
||||
// Load skill (always inject — now only ~50 lines)
|
||||
const skill = existsSync(SKILL_FILE) ? readFileSync(SKILL_FILE, 'utf8') : '';
|
||||
// The host does not expand ${CLAUDE_SKILL_DIR} in hook output, so fill it in here.
|
||||
// SKILL.md uses it inside double-quoted bash, so escape the characters bash
|
||||
// still interprets there; the callback keeps `$&` etc. in the path literal.
|
||||
const shellSkillDir = SKILL_DIR.replace(/[\\$`"]/g, '\\$&');
|
||||
const skill = existsSync(SKILL_FILE)
|
||||
? readFileSync(SKILL_FILE, 'utf8').replaceAll('${CLAUDE_SKILL_DIR}', () => shellSkillDir)
|
||||
: '';
|
||||
|
||||
const projects = readJson(PROJECTS_FILE) || {};
|
||||
const entry = projects[cwd];
|
||||
|
||||
@@ -238,11 +238,10 @@ def _fetch_import_url(source: str, *, max_bytes: int = 2 * 1024 * 1024) -> str:
|
||||
def _yaml_quote(value: str) -> str:
|
||||
"""Quote a string for safe YAML frontmatter serialization.
|
||||
|
||||
Uses double quotes and escapes embedded double-quote characters to
|
||||
prevent malformed YAML when the value contains quotes.
|
||||
JSON double-quoted strings are valid YAML and keep control characters
|
||||
escaped on one line, preserving instinct frontmatter boundaries.
|
||||
"""
|
||||
escaped = value.replace('\\', '\\\\').replace('"', '\\"')
|
||||
return f'"{escaped}"'
|
||||
return json.dumps(value)
|
||||
|
||||
|
||||
# ─────────────────────────────────────────────
|
||||
@@ -546,7 +545,10 @@ def parse_instinct_file(content: str) -> list[dict]:
|
||||
value = value.strip()
|
||||
# Unescape quoted YAML strings
|
||||
if value.startswith('"') and value.endswith('"'):
|
||||
value = value[1:-1].replace('\\"', '"').replace('\\\\', '\\')
|
||||
try:
|
||||
value = json.loads(value)
|
||||
except json.JSONDecodeError:
|
||||
value = value[1:-1].replace('\\"', '"').replace('\\\\', '\\')
|
||||
elif value.startswith("'") and value.endswith("'"):
|
||||
value = value[1:-1].replace("''", "'")
|
||||
if key == 'confidence':
|
||||
|
||||
@@ -281,6 +281,40 @@ def test_parse_confidence_preserves_valid_range(confidence):
|
||||
assert parse_instinct_file(content)[0]["confidence"] == confidence
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
@pytest.mark.parametrize("value", [
|
||||
"line one\nline two", "tab\tvalue", "carriage\rreturn",
|
||||
'when writing "quoted" text', r"C:\Users\name", "caf\u00e9",
|
||||
r"literal\ntext", "line\n---\nid: other\n---", "control\x01value",
|
||||
])
|
||||
def test_quoted_instinct_strings_roundtrip(value: str) -> None:
|
||||
quoted = _mod._yaml_quote(value)
|
||||
assert json.loads(quoted) == value
|
||||
instincts = parse_instinct_file(f"---\nid: roundtrip\ntrigger: {quoted}\n---\nBody")
|
||||
assert len(instincts) == 1
|
||||
assert instincts[0]["trigger"] == value
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_parse_quoted_instinct_decodes_newline_escape() -> None:
|
||||
content = '---\nid: newline\ntrigger: "line one\\nline two"\n---\nBody'
|
||||
assert parse_instinct_file(content)[0]["trigger"] == "line one\nline two"
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
@pytest.mark.parametrize("value", ["line\u0085value", "line\u0090value"])
|
||||
def test_unicode_controls_are_escaped_for_yaml(value: str) -> None:
|
||||
quoted = _mod._yaml_quote(value)
|
||||
assert quoted.isascii()
|
||||
assert json.loads(quoted) == value
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_parse_quoted_instinct_preserves_legacy_escape() -> None:
|
||||
content = '---\nid: legacy\ntrigger: "C:\\projects"\n---\nBody'
|
||||
assert parse_instinct_file(content)[0]["trigger"] == r"C:\projects"
|
||||
|
||||
|
||||
def test_parse_trigger_strips_quotes():
|
||||
content = """\
|
||||
---
|
||||
|
||||
@@ -21,11 +21,14 @@ This is the same pattern as CI pipeline gates — automated, deterministic check
|
||||
| Check | Mechanism | On Hit |
|
||||
|-------|-----------|--------|
|
||||
| Rationalization patterns | Regex on transcript tail | **Warning only** (never blocks) |
|
||||
| Stale learning libraries | mtime on 5 configurable paths | Warning if some stale; **Block** if >=3 stale OR growth-log stale + complex task |
|
||||
| Disk space < 50GB | `shutil.disk_usage` | Warning |
|
||||
| Disk space < 15GB | `shutil.disk_usage` | **Block** (exit 2) |
|
||||
| Stale learning libraries | mtime on 5 configurable paths | Warning if some stale; **Block** on a complex task if >=3 stale OR growth-log stale |
|
||||
| Disk space < 50GB | `shutil.disk_usage` | Reminder |
|
||||
| Disk space < 30GB | `shutil.disk_usage` | Warning |
|
||||
| Disk space < 15GB | `shutil.disk_usage` | **Block** (exit 2), on every Stop |
|
||||
|
||||
Rationalization detection warns about patterns like "skip tests for now" and "pre-existing bug" — surface signals that thinking may have been cut short. It never blocks on its own, because regex heuristics can false-positive. The blocking conditions are: disk critical, `>=3 learning libs stale`, OR `growth-log` specifically stale (all require complex task >=3 edits).
|
||||
Rationalization detection warns about patterns like "skip tests for now" and "pre-existing bug" — surface signals that thinking may have been cut short. It never blocks on its own, because regex heuristics can false-positive. The blocking conditions are: disk critical (any session), or, on a complex task (>=3 Edit/Write calls), `>=3 learning libs stale` OR `growth-log` specifically stale. If the project memory directory does not exist, the learning-library checks are skipped: the hook only warns that it cannot verify learning capture, and a complex task is not blocked (the disk checks still apply).
|
||||
|
||||
The hook blocks a given Stop at most once. When Claude Code re-runs it with `stop_hook_active: true` (Claude already continued once because of this hook), it exits 0, so a condition the agent cannot fix (such as low disk space) cannot trap the session in an endless loop.
|
||||
|
||||
## Why
|
||||
|
||||
@@ -50,7 +53,7 @@ Add to `~/.claude/settings.json`:
|
||||
"hooks": [{
|
||||
"type": "command",
|
||||
"command": "python3 ~/.claude/scripts/quality-gate.py",
|
||||
"timeout": 5000
|
||||
"timeout": 5
|
||||
}]
|
||||
}]
|
||||
}
|
||||
@@ -59,7 +62,7 @@ Add to `~/.claude/settings.json`:
|
||||
|
||||
## Learning Libraries
|
||||
|
||||
Create these files in your project's memory directory. The hook checks if at least one was updated today:
|
||||
Create these files in your project's memory directory (`~/.claude/projects/<encoded-project-path>/memory/`, where every non-alphanumeric character of the project path becomes `-`). The hook checks which of them were updated today:
|
||||
|
||||
```
|
||||
memory/
|
||||
@@ -81,7 +84,8 @@ Edit `quality-gate.py`:
|
||||
| `RATIONALIZE` | 4 patterns | Regex patterns for rationalization detection |
|
||||
| `LIBS` | 5 libraries | Files/dirs to check for today's updates |
|
||||
| `COMPLEX_THRESHOLD` | 3 | Edit/Write calls to classify as complex |
|
||||
| `DISK_WARN_GB` | 50 | Warn below this |
|
||||
| `DISK_REMIND_GB` | 50 | Remind below this |
|
||||
| `DISK_WARN_GB` | 30 | Warn below this |
|
||||
| `DISK_CRIT_GB` | 15 | Block below this |
|
||||
|
||||
## Examples
|
||||
@@ -93,24 +97,24 @@ edit_count=1 (< 3, not complex) → exit 0
|
||||
|
||||
**Complex task, learning captured — allowed:**
|
||||
```
|
||||
edit_count=5 (complex) → checks LIBS → growth-log updated today → exit 0
|
||||
edit_count=5 (complex) → checks LIBS → growth-log + 2 others updated today (2 stale) → exit 0
|
||||
```
|
||||
|
||||
**Complex task, no learning — BLOCKED:**
|
||||
```
|
||||
edit_count=4 (complex) → checks LIBS → all 5 stale → exit 2
|
||||
stderr: "Blocked: complex task completed but no learning captured today."
|
||||
stderr: "Blocked: complex task but >=3 learning libs stale."
|
||||
```
|
||||
|
||||
**Low disk space — BLOCKED:**
|
||||
```
|
||||
disk_free=12GB < 15GB critical → exit 2
|
||||
stderr: "Blocked: disk space at 12GB (threshold: 15GB)."
|
||||
stderr: "Blocked: disk space at 12GB (<15GB). Free space before continuing."
|
||||
```
|
||||
|
||||
## Limitations
|
||||
|
||||
The hook enforces the **habit** of touching learning libraries, not the **quality** of what was recorded. If `output-index.md` is updated but `growth-log` is skipped, the hook passes (1 of 5 libraries touched). This is by design: mechanical gates check machine-verifiable facts. For content quality verification, pair with `self-audit`.
|
||||
The hook enforces the **habit** of touching learning libraries, not the **quality** of what was recorded. On a complex task it passes only when `growth-log` was updated today and at most 2 libraries are stale; updating `output-index.md` alone still blocks. Without a project memory directory there is nothing to check, so it only warns. This is by design: mechanical gates check machine-verifiable facts. For content quality verification, pair with `self-audit`.
|
||||
|
||||
## Compatibility
|
||||
|
||||
|
||||
@@ -55,7 +55,9 @@ def get_project_memory_dir() -> Optional[str]:
|
||||
Returns None if no memory directory exists for this project.
|
||||
Does NOT fall back to other projects (privacy boundary)."""
|
||||
cwd = os.environ.get('CLAUDE_PROJECT_DIR', os.getcwd())
|
||||
safe = cwd.replace(':', '-').replace('\\', '-').replace('/', '-')
|
||||
# Claude Code names project dirs by replacing every non-alphanumeric
|
||||
# character (including spaces) with '-'.
|
||||
safe = re.sub(r'[^A-Za-z0-9]', '-', cwd)
|
||||
mem = os.path.expanduser(f'~/.claude/projects/{safe}/memory')
|
||||
log.info('Looking for memory dir: cwd=%s -> %s', cwd, mem)
|
||||
if os.path.isdir(mem):
|
||||
@@ -136,6 +138,9 @@ def main() -> None:
|
||||
transcript = raw
|
||||
try:
|
||||
payload = json.loads(raw)
|
||||
if isinstance(payload, dict) and payload.get('stop_hook_active') is True:
|
||||
# This Stop was already blocked once; blocking again would loop forever.
|
||||
sys.exit(0)
|
||||
if isinstance(payload, dict) and 'transcript_path' in payload:
|
||||
tp = os.path.expanduser(payload['transcript_path'])
|
||||
if os.path.exists(tp):
|
||||
|
||||
@@ -37,12 +37,10 @@ SECURE_HSTS_SECONDS = 31536000 # 1 year
|
||||
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
|
||||
SECURE_HSTS_PRELOAD = True
|
||||
SECURE_CONTENT_TYPE_NOSNIFF = True
|
||||
SECURE_BROWSER_XSS_FILTER = True
|
||||
X_FRAME_OPTIONS = 'DENY'
|
||||
|
||||
# HTTPS and Cookies
|
||||
SESSION_COOKIE_HTTPONLY = True
|
||||
CSRF_COOKIE_HTTPONLY = True
|
||||
SESSION_COOKIE_SAMESITE = 'Lax'
|
||||
CSRF_COOKIE_SAMESITE = 'Lax'
|
||||
|
||||
@@ -312,7 +310,6 @@ def greet_user(username):
|
||||
```python
|
||||
# settings.py
|
||||
SECURE_CONTENT_TYPE_NOSNIFF = True # Prevent MIME sniffing
|
||||
SECURE_BROWSER_XSS_FILTER = True # Enable XSS filter
|
||||
X_FRAME_OPTIONS = 'DENY' # Prevent clickjacking
|
||||
|
||||
# Custom middleware
|
||||
@@ -338,7 +335,7 @@ class SecurityHeaderMiddleware:
|
||||
```python
|
||||
# settings.py - CSRF is enabled by default
|
||||
CSRF_COOKIE_SECURE = True # Only send over HTTPS
|
||||
CSRF_COOKIE_HTTPONLY = True # Prevent JavaScript access
|
||||
CSRF_COOKIE_HTTPONLY = False # False so AJAX can read csrf token from document.cookie; SESSION_COOKIE_HTTPONLY remains True
|
||||
CSRF_COOKIE_SAMESITE = 'Lax' # Prevent CSRF in some cases
|
||||
CSRF_TRUSTED_ORIGINS = ['https://example.com'] # Trusted domains
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ ActiveUserDep = Annotated[User, Depends(get_current_active_user)]
|
||||
```python
|
||||
# app/routers/users.py
|
||||
from typing import Annotated
|
||||
from fastapi import APIRouter, HTTPException, Query, status
|
||||
from fastapi import APIRouter, Depends, HTTPException, Query, status
|
||||
from fastapi.security import OAuth2PasswordRequestForm
|
||||
|
||||
from app.dependencies import ActiveUserDep, DbDep
|
||||
|
||||
@@ -73,7 +73,7 @@ if [[ ! -f "$INPUT_HTML" ]]; then
|
||||
fi
|
||||
|
||||
# Resolve to absolute path
|
||||
INPUT_HTML=$(cd "$(dirname "$INPUT_HTML")" && pwd)/$(basename "$INPUT_HTML")
|
||||
INPUT_HTML=$(CDPATH= cd -- "$(dirname "$INPUT_HTML")" && pwd)/$(basename "$INPUT_HTML")
|
||||
|
||||
# Output PDF path: use second argument or derive from input name
|
||||
if [[ $# -ge 2 ]]; then
|
||||
@@ -82,10 +82,10 @@ else
|
||||
OUTPUT_PDF="$(dirname "$INPUT_HTML")/$(basename "$INPUT_HTML" .html).pdf"
|
||||
fi
|
||||
|
||||
# Resolve output to absolute path
|
||||
# Resolve output to absolute path (the export later runs from a temp dir that is deleted)
|
||||
OUTPUT_DIR=$(dirname "$OUTPUT_PDF")
|
||||
mkdir -p "$OUTPUT_DIR"
|
||||
OUTPUT_PDF="$OUTPUT_DIR/$(basename "$OUTPUT_PDF")"
|
||||
OUTPUT_PDF="$(CDPATH= cd -- "$OUTPUT_DIR" && pwd)/$(basename "$OUTPUT_PDF")"
|
||||
|
||||
echo ""
|
||||
echo -e "${BOLD}========================================${NC}"
|
||||
|
||||
@@ -588,7 +588,7 @@ final class StorePostRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'title' => ['required', 'string', 'max:255', 'sanitize_html'],
|
||||
'title' => ['required', 'string', 'max:255'],
|
||||
'content' => ['required', 'string', 'max:10000'],
|
||||
'image' => [
|
||||
'required',
|
||||
|
||||
@@ -82,6 +82,24 @@ Follow the full forking protocol:
|
||||
|
||||
Wait for completion. Read `{STAGING_PATH}/FORK_REPORT.md`.
|
||||
|
||||
The forker's single commit is only the starting point: `gh repo create --push` (Step 7)
|
||||
publishes commits, not the working tree. Every later change (sanitizer fixes, packager output)
|
||||
must be folded into that commit, so the public history is one commit that matches the tree the
|
||||
sanitizer passed. The reports stay out of it. Fold changes in with:
|
||||
|
||||
```bash
|
||||
cd "{STAGING_PATH}"
|
||||
grep -qxF SANITIZATION_REPORT.md .git/info/exclude || printf '%s\n' FORK_REPORT.md SANITIZATION_REPORT.md >> .git/info/exclude
|
||||
git add -A
|
||||
git rm -q --cached --ignore-unmatch FORK_REPORT.md SANITIZATION_REPORT.md
|
||||
git commit --amend --no-edit
|
||||
git status --porcelain -uno # must print nothing
|
||||
git rev-list --count HEAD # must print 1
|
||||
```
|
||||
|
||||
An amend leaves a secret that was removed from a file out of the new commit. A new commit on top
|
||||
would publish it in history.
|
||||
|
||||
#### Step 4: Run Sanitizer Agent
|
||||
|
||||
Spawn the `opensource-sanitizer` agent:
|
||||
@@ -113,7 +131,7 @@ Generate SANITIZATION_REPORT.md inside {STAGING_PATH}/ with PASS/FAIL verdict.
|
||||
Wait for completion. Read `{STAGING_PATH}/SANITIZATION_REPORT.md`.
|
||||
|
||||
**If FAIL:** Show findings to user. Ask: "Fix these and re-scan, or abort?"
|
||||
- If fix: Apply fixes, re-run sanitizer (maximum 3 retry attempts — after 3 FAILs, present all findings and ask user to fix manually)
|
||||
- If fix: Apply fixes, fold them into the commit (see Step 3), re-run sanitizer (maximum 3 retry attempts — after 3 FAILs, present all findings and ask user to fix manually)
|
||||
- If abort: Clean up staging directory
|
||||
|
||||
**Unreadable files.** After the fix/rescan loop settles, read the report's `## Unreadable Files`
|
||||
@@ -168,6 +186,19 @@ Generate:
|
||||
)
|
||||
```
|
||||
|
||||
#### Step 5b: Commit the Packaging and Re-Verify
|
||||
|
||||
The packager's files are not committed yet. Fold them into the commit (see Step 3), then run the
|
||||
sanitizer again exactly as in Step 4, against what will be published. Apply the same gate as
|
||||
Step 4, including the fix loop and the unreadable-files check. A FAIL here stops the pipeline:
|
||||
packaging can add a personal email, a home path or a key in an example.
|
||||
|
||||
When the gate passes, record the commit the sanitizer scanned as `{SCANNED_COMMIT}`:
|
||||
|
||||
```bash
|
||||
git -C "{STAGING_PATH}" rev-parse HEAD
|
||||
```
|
||||
|
||||
#### Step 6: Final Review
|
||||
|
||||
Present to user:
|
||||
@@ -184,7 +215,7 @@ Files generated:
|
||||
- CONTRIBUTING.md
|
||||
- .env.example ({N} variables)
|
||||
|
||||
Sanitization: {sanitization_verdict}
|
||||
Sanitization: {sanitization_verdict} (scanned after packaging, on the commit that will be pushed)
|
||||
|
||||
Next steps:
|
||||
1. Review: cd {STAGING_PATH}
|
||||
@@ -196,8 +227,20 @@ Proceed with GitHub creation? (yes/no/review first)
|
||||
|
||||
#### Step 7: GitHub Publish (on user approval)
|
||||
|
||||
Push only the commit the sanitizer passed. If the tree or the commit changed since Step 5b (for
|
||||
example the user edited files after "review first" and amended), go back to Step 5b instead of
|
||||
pushing. The two generated reports may remain untracked even when a source `.gitignore` negates
|
||||
their names. Allow only those two untracked files; a report in the index or scanned commit, or any
|
||||
other worktree change, still stops publication.
|
||||
|
||||
```bash
|
||||
cd "{STAGING_PATH}"
|
||||
test -z "$(git ls-files -- FORK_REPORT.md SANITIZATION_REPORT.md)" \
|
||||
&& test -z "$(git ls-tree -r --name-only HEAD -- FORK_REPORT.md SANITIZATION_REPORT.md)" \
|
||||
&& test -z "$(git status --porcelain --untracked-files=all -- . ':(exclude)FORK_REPORT.md' ':(exclude)SANITIZATION_REPORT.md')" \
|
||||
&& test "$(git rev-list --count HEAD)" = 1 \
|
||||
&& test "$(git rev-parse HEAD)" = "{SCANNED_COMMIT}" \
|
||||
|| { echo "Uncommitted changes, extra commits, or HEAD is not the scanned commit: return to Step 5b" >&2; exit 1; }
|
||||
gh repo create "{github_org}/{github_repo}" --public --source=. --push --description "{description}"
|
||||
```
|
||||
|
||||
@@ -270,13 +313,14 @@ $HOME/opensource-staging/
|
||||
- **Never** push to GitHub without user approval
|
||||
- **Never** skip the sanitizer — it is the safety gate
|
||||
- **Never** proceed after a sanitizer FAIL without fixing all critical findings
|
||||
- **Never** push with uncommitted changes or more than one commit: the push sends commits, so unfolded fixes are not published and the original secret is
|
||||
- **Never** leave `.env`, `*.pem`, or `credentials.json` in the staging directory
|
||||
|
||||
## Best Practices
|
||||
|
||||
- Always run the full pipeline (fork → sanitize → package) for new releases
|
||||
- The staging directory persists until explicitly cleaned up — use it for review
|
||||
- Re-run the sanitizer after any manual fixes before publishing
|
||||
- After any manual fix, fold it into the single commit and re-run the sanitizer before publishing
|
||||
- Parameterize secrets rather than deleting them — preserve project functionality
|
||||
|
||||
## Related Skills
|
||||
|
||||
@@ -412,10 +412,6 @@ Always encode output for its context: `HTML::Entities::encode_entities()` for HT
|
||||
severity = 3
|
||||
theme = security + core
|
||||
|
||||
# Require three-arg open
|
||||
[InputOutput::RequireThreeArgOpen]
|
||||
severity = 5
|
||||
|
||||
# Require checked system calls
|
||||
[InputOutput::RequireCheckedSyscalls]
|
||||
functions = :builtins
|
||||
@@ -429,10 +425,6 @@ severity = 5
|
||||
[InputOutput::ProhibitBacktickOperators]
|
||||
severity = 4
|
||||
|
||||
# Require taint checking in CGI
|
||||
[Modules::RequireTaintChecking]
|
||||
severity = 5
|
||||
|
||||
# Prohibit two-arg open
|
||||
[InputOutput::ProhibitTwoArgOpen]
|
||||
severity = 5
|
||||
|
||||
@@ -224,7 +224,7 @@ def test_without_fixture_call():
|
||||
assert Config.get_setting("debug") is False
|
||||
```
|
||||
|
||||
### Conftest.py for Shared Fixtures
|
||||
### Conftest.py for Shared Fixtures (Flask)
|
||||
|
||||
```python
|
||||
# tests/conftest.py
|
||||
@@ -484,15 +484,23 @@ async def test_async_with_fixture(async_client):
|
||||
assert response.status_code == 200
|
||||
```
|
||||
|
||||
### Async Fixture
|
||||
### Async Fixture (FastAPI)
|
||||
|
||||
`ASGITransport` does not run lifespan events. Install `asgi-lifespan` and wrap the client in `LifespanManager` when the app uses startup or shutdown handlers. See [FastAPI's async testing guidance](https://github.com/fastapi/fastapi/blob/master/docs/en/docs/advanced/async-tests.md).
|
||||
|
||||
```python
|
||||
@pytest.fixture
|
||||
import pytest
|
||||
import pytest_asyncio
|
||||
from asgi_lifespan import LifespanManager
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
|
||||
@pytest_asyncio.fixture
|
||||
async def async_client():
|
||||
"""Async fixture providing async test client."""
|
||||
app = create_app()
|
||||
async with app.test_client() as client:
|
||||
yield client
|
||||
"""Async fixture providing async test client with lifespan events."""
|
||||
app = create_app() # Returns a FastAPI application
|
||||
async with LifespanManager(app) as manager:
|
||||
async with AsyncClient(transport=ASGITransport(app=manager.app), base_url="http://test") as client:
|
||||
yield client
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_api_endpoint(async_client):
|
||||
@@ -661,7 +669,7 @@ class TestUserService:
|
||||
|
||||
## Common Patterns
|
||||
|
||||
### Testing API Endpoints (FastAPI/Flask)
|
||||
### Testing API Endpoints (Flask)
|
||||
|
||||
```python
|
||||
@pytest.fixture
|
||||
|
||||
@@ -33,7 +33,7 @@ export const MyComposition = () => {
|
||||
};
|
||||
```
|
||||
|
||||
Preferrably, specify only needed weights and subsets to reduce file size:
|
||||
Preferably, specify only needed weights and subsets to reduce file size:
|
||||
|
||||
```tsx
|
||||
import { loadFont } from "@remotion/google-fonts/Roboto";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: safety-guard
|
||||
description: "Guard against destructive operations with three modes: Careful intercepts dangerous commands (rm -rf, git push --force, DROP TABLE) for confirmation, Freeze locks writes to one directory, and Guard combines both via PreToolUse hooks. Use when working on production systems, running agents autonomously, restricting edits to a directory, or during migrations, deploys, and data changes."
|
||||
description: "Guard against destructive operations with three modes: Careful intercepts dangerous commands (rm -rf, git push --force, DROP TABLE) for confirmation, Freeze locks writes to one directory, and Guard combines both. Advisory: the agent applies these rules itself; no hook ships with it. Use when working on production systems, running agents autonomously, restricting edits to a directory, or during migrations, deploys, and data changes."
|
||||
metadata:
|
||||
origin: ECC
|
||||
---
|
||||
@@ -16,11 +16,11 @@ metadata:
|
||||
|
||||
## How It Works
|
||||
|
||||
Three modes of protection:
|
||||
Three modes of protection. They are instructions the agent follows, not enforced blocks (see [Enforcement](#enforcement)).
|
||||
|
||||
### Mode 1: Careful Mode
|
||||
|
||||
Intercepts destructive commands before execution and warns:
|
||||
Before it runs a destructive command, the agent stops and warns:
|
||||
|
||||
```
|
||||
Watched patterns:
|
||||
@@ -41,36 +41,25 @@ When detected: shows what the command does, asks for confirmation, suggests safe
|
||||
|
||||
### Mode 2: Freeze Mode
|
||||
|
||||
Locks file edits to a specific directory tree:
|
||||
Locks file edits to a specific directory tree, for example: "freeze edits to `src/components/`".
|
||||
|
||||
```
|
||||
/safety-guard freeze src/components/
|
||||
```
|
||||
|
||||
Any Write/Edit outside `src/components/` is blocked with an explanation. Useful when you want an agent to focus on one area without touching unrelated code.
|
||||
The agent does not Write/Edit outside `src/components/`, and explains why when a change would need it. Useful when you want an agent to focus on one area without touching unrelated code.
|
||||
|
||||
### Mode 3: Guard Mode (Careful + Freeze combined)
|
||||
|
||||
Both protections active. Maximum safety for autonomous agents.
|
||||
Both protections active, for example: "guard mode, write only to `src/api/`, read anything".
|
||||
|
||||
```
|
||||
/safety-guard guard --dir src/api/ --allow-read-all
|
||||
```
|
||||
|
||||
Agents can read anything but only write to `src/api/`. Destructive commands are blocked everywhere.
|
||||
The agent can read anything but only writes to `src/api/`, and asks before any destructive command.
|
||||
|
||||
### Unlock
|
||||
|
||||
```
|
||||
/safety-guard off
|
||||
```
|
||||
Tell the agent to stop applying the rules.
|
||||
|
||||
## Implementation
|
||||
## Enforcement
|
||||
|
||||
Uses PreToolUse hooks to intercept Bash, Write, Edit, and MultiEdit tool calls. Checks the command/path against the active rules before allowing execution.
|
||||
This skill is advisory. ECC ships no `/safety-guard` command and no hook for it, so nothing blocks a tool call that breaks these rules. For blocking that does not depend on the agent, use Claude Code [permission deny rules](https://code.claude.com/docs/en/permissions) (for example `Bash(rm -rf *)`) or a [PreToolUse hook](https://code.claude.com/docs/en/hooks).
|
||||
|
||||
## Integration
|
||||
|
||||
- Enable by default for `codex -a never` sessions
|
||||
- Pair with observability risk scoring in ECC 2.0
|
||||
- Logs all blocked actions to `~/.claude/safety-guard.log`
|
||||
@@ -40,7 +40,7 @@ def classify_events(
|
||||
for i, event in enumerate(trace)
|
||||
)
|
||||
|
||||
prompt_template = (PROMPTS_DIR / "classifier.md").read_text()
|
||||
prompt_template = (PROMPTS_DIR / "classifier.md").read_text(encoding="utf-8")
|
||||
prompt = (
|
||||
prompt_template
|
||||
.replace("{steps_description}", steps_desc)
|
||||
@@ -48,9 +48,10 @@ def classify_events(
|
||||
)
|
||||
|
||||
result = subprocess.run(
|
||||
["claude", "-p", prompt, "--model", model, "--output-format", "text"],
|
||||
["claude", "-p", "--model", model, "--output-format", "text"],
|
||||
input=prompt,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
encoding="utf-8",
|
||||
timeout=60,
|
||||
)
|
||||
|
||||
@@ -85,6 +86,8 @@ def _parse_classification(text: str) -> dict[str, list[int]]:
|
||||
raise ClassifierParseError(
|
||||
f"classifier returned non-list JSON value: {type(value).__name__}"
|
||||
)
|
||||
if any(isinstance(i, bool) or (isinstance(i, float) and not i.is_integer()) for i in value):
|
||||
raise ValueError("tool call indices must be whole numbers, not booleans")
|
||||
return {k: [int(i) for i in v] for k, v in parsed.items()}
|
||||
except (json.JSONDecodeError, ValueError, TypeError, OverflowError) as e:
|
||||
raise ClassifierParseError(
|
||||
|
||||
@@ -183,7 +183,7 @@ def grade(
|
||||
detected_required = sum(1 for s in required_steps if s.detected)
|
||||
total_required = len(required_steps)
|
||||
|
||||
compliance_rate = detected_required / total_required if total_required > 0 else 0.0
|
||||
compliance_rate = detected_required / total_required if total_required > 0 else 1.0
|
||||
|
||||
return ComplianceResult(
|
||||
spec_id=spec.id,
|
||||
|
||||
@@ -49,7 +49,7 @@ def parse_trace(path: Path) -> list[ObservationEvent]:
|
||||
if not path.is_file():
|
||||
raise FileNotFoundError(f"Trace file not found: {path}")
|
||||
|
||||
text = path.read_text().strip()
|
||||
text = path.read_text(encoding="utf-8").strip()
|
||||
if not text:
|
||||
return []
|
||||
|
||||
@@ -78,7 +78,7 @@ def parse_spec(path: Path) -> ComplianceSpec:
|
||||
"""Parse a YAML compliance spec file."""
|
||||
if not path.is_file():
|
||||
raise FileNotFoundError(f"Spec file not found: {path}")
|
||||
raw = yaml.safe_load(path.read_text())
|
||||
raw = yaml.safe_load(path.read_text(encoding="utf-8"))
|
||||
|
||||
steps: list[Step] = []
|
||||
for s in raw["steps"]:
|
||||
|
||||
@@ -106,7 +106,7 @@ def main() -> None:
|
||||
|
||||
report = generate_report(args.skill, spec, graded_results, scenarios=scenarios)
|
||||
output_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
output_path.write_text(report)
|
||||
output_path.write_text(report, encoding="utf-8")
|
||||
logger.info(" Report saved to %s", output_path)
|
||||
|
||||
# Summary
|
||||
|
||||
@@ -50,7 +50,7 @@ def run_scenario(
|
||||
|
||||
result = subprocess.run(
|
||||
[
|
||||
"claude", "-p", scenario.prompt,
|
||||
"claude", "-p",
|
||||
"--model", model,
|
||||
"--max-turns", str(max_turns),
|
||||
"--add-dir", str(sandbox_dir),
|
||||
@@ -58,8 +58,9 @@ def run_scenario(
|
||||
"--output-format", "stream-json",
|
||||
"--verbose",
|
||||
],
|
||||
input=scenario.prompt,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
encoding="utf-8",
|
||||
timeout=timeout,
|
||||
cwd=sandbox_dir,
|
||||
)
|
||||
|
||||
@@ -32,8 +32,8 @@ def generate_scenarios(
|
||||
|
||||
Calls claude -p with the scenario_generator prompt, parses YAML output.
|
||||
"""
|
||||
skill_content = skill_path.read_text()
|
||||
prompt_template = (PROMPTS_DIR / "scenario_generator.md").read_text()
|
||||
skill_content = skill_path.read_text(encoding="utf-8")
|
||||
prompt_template = (PROMPTS_DIR / "scenario_generator.md").read_text(encoding="utf-8")
|
||||
prompt = (
|
||||
prompt_template
|
||||
.replace("{skill_content}", skill_content)
|
||||
@@ -41,9 +41,10 @@ def generate_scenarios(
|
||||
)
|
||||
|
||||
result = subprocess.run(
|
||||
["claude", "-p", prompt, "--model", model, "--output-format", "text"],
|
||||
["claude", "-p", "--model", model, "--output-format", "text"],
|
||||
input=prompt,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
encoding="utf-8",
|
||||
timeout=120,
|
||||
)
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ def generate_spec(
|
||||
Calls claude -p with the spec_generator prompt, parses YAML output.
|
||||
Retries on YAML parse errors with error feedback.
|
||||
"""
|
||||
skill_content = skill_path.read_text()
|
||||
prompt_template = (PROMPTS_DIR / "spec_generator.md").read_text()
|
||||
skill_content = skill_path.read_text(encoding="utf-8")
|
||||
prompt_template = (PROMPTS_DIR / "spec_generator.md").read_text(encoding="utf-8")
|
||||
base_prompt = prompt_template.replace("{skill_content}", skill_content)
|
||||
|
||||
last_error: Exception | None = None
|
||||
@@ -41,9 +41,10 @@ def generate_spec(
|
||||
)
|
||||
|
||||
result = subprocess.run(
|
||||
["claude", "-p", prompt, "--model", model, "--output-format", "text"],
|
||||
["claude", "-p", "--model", model, "--output-format", "text"],
|
||||
input=prompt,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
encoding="utf-8",
|
||||
timeout=120,
|
||||
)
|
||||
|
||||
@@ -54,7 +55,7 @@ def generate_spec(
|
||||
|
||||
tmp_path = None
|
||||
with tempfile.NamedTemporaryFile(
|
||||
mode="w", suffix=".yaml", delete=False,
|
||||
mode="w", suffix=".yaml", delete=False, encoding="utf-8",
|
||||
) as f:
|
||||
f.write(raw_yaml)
|
||||
tmp_path = Path(f.name)
|
||||
|
||||
@@ -28,7 +28,12 @@ class TestParseClassification:
|
||||
_parse_classification('{"a": [0], "other": "x"}')
|
||||
|
||||
def test_existing_index_coercion_is_preserved(self) -> None:
|
||||
assert _parse_classification('{"a": [true, 2.9, "3"]}') == {"a": [1, 2, 3]}
|
||||
assert _parse_classification('{"a": [0, 2.0, "3"]}') == {"a": [0, 2, 3]}
|
||||
|
||||
@pytest.mark.parametrize("index", [True, False, 2.9, -0.1])
|
||||
def test_boolean_and_fractional_indices_raise(self, index: object) -> None:
|
||||
with pytest.raises(classifier.ClassifierParseError, match="failed to parse"):
|
||||
_parse_classification(json.dumps({"a": [index]}))
|
||||
|
||||
def test_empty_object_is_valid(self) -> None:
|
||||
assert _parse_classification("{}") == {}
|
||||
@@ -54,7 +59,7 @@ class TestParseClassification:
|
||||
assert issubclass(classifier.ClassifierParseError, RuntimeError)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("response", ["not JSON", "[]", '{"a": ["x"]}', '{"a": "x"}', '{"a": [0], "other": null}', '{"a": [1e309]}', '{"a": [-1e309]}'])
|
||||
@pytest.mark.parametrize("response", ["not JSON", "[]", '{"a": ["x"]}', '{"a": "x"}', '{"a": [0], "other": null}', '{"a": [1e309]}', '{"a": [-1e309]}', '{"a": [false]}', '{"a": [0.5]}'])
|
||||
def test_grader_propagates_classifier_parse_failure(response: str) -> None:
|
||||
"""An invalid successful subprocess response cannot become a zero score."""
|
||||
spec = ComplianceSpec(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"""Tests for grader module — compliance scoring with LLM classification."""
|
||||
|
||||
from dataclasses import replace
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
@@ -120,6 +121,48 @@ class TestGradeNoncompliant:
|
||||
|
||||
|
||||
class TestGradeEdgeCases:
|
||||
@pytest.mark.parametrize("detected", [False, True])
|
||||
@patch("scripts.grader.classify_events")
|
||||
def test_optional_only_spec_is_compliant(
|
||||
self, mock_cls: MagicMock, detected: bool,
|
||||
tdd_spec: ComplianceSpec, compliant_trace: list[ObservationEvent],
|
||||
) -> None:
|
||||
optional = replace(
|
||||
next(step for step in tdd_spec.steps if not step.required),
|
||||
detector=Detector("Refactor if applicable"),
|
||||
)
|
||||
spec = replace(tdd_spec, steps=(optional,))
|
||||
mock_cls.return_value = {optional.id: [4]} if detected else {}
|
||||
|
||||
result = grade(spec, compliant_trace)
|
||||
|
||||
assert result.steps[0].detected is detected
|
||||
assert result.compliance_rate == 1.0
|
||||
assert result.recommend_hook_promotion is False
|
||||
|
||||
def test_spec_without_steps_is_compliant(self, tdd_spec: ComplianceSpec) -> None:
|
||||
result = grade(replace(tdd_spec, steps=()), [])
|
||||
|
||||
assert result.steps == ()
|
||||
assert result.compliance_rate == 1.0
|
||||
assert result.recommend_hook_promotion is False
|
||||
|
||||
@patch("scripts.grader.classify_events", return_value={"refactor": [4]})
|
||||
def test_optional_detection_does_not_satisfy_required_steps(
|
||||
self, mock_cls: MagicMock,
|
||||
tdd_spec: ComplianceSpec, compliant_trace: list[ObservationEvent],
|
||||
) -> None:
|
||||
optional = replace(
|
||||
next(step for step in tdd_spec.steps if not step.required),
|
||||
detector=Detector("Refactor if applicable"),
|
||||
)
|
||||
spec = replace(tdd_spec, steps=(tdd_spec.steps[0], optional))
|
||||
result = grade(spec, compliant_trace)
|
||||
|
||||
assert next(step for step in result.steps if step.step_id == "refactor").detected
|
||||
assert result.compliance_rate == 0.0
|
||||
assert result.recommend_hook_promotion is True
|
||||
|
||||
@patch("scripts.grader.classify_events", side_effect=_mock_empty_classification)
|
||||
def test_empty_trace(self, mock_cls, tdd_spec) -> None:
|
||||
result = grade(tdd_spec, [])
|
||||
|
||||
Loaded 100 of 136 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user