Skip to content

feat: add config-health — runtime config integrity monitoring - #2496

Merged
haelyra merged 12 commits into
affaan-m:mainfrom
YuhaoLin2005:feat/config-health
Nov 16, 2026
Merged

haelyra merged 12 commits into
affaan-m:mainfrom
YuhaoLin2005:feat/config-health

Conversation

@YuhaoLin2005

@YuhaoLin2005 YuhaoLin2005 commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds the config-health skill: a deterministic, read-only monitor for Claude Code configuration integrity. It ships the CLI entry at scripts/config-health.py plus three helper modules (config_health_constants.py, config_health_paths.py, config_health_scan.py), the skill documentation, install-module wiring, its own hook config, and a hook contract test suite.

Why

A session-end gate checks whether work is complete after the fact. By then, broken hook wiring and dead rule references have already been in effect for the whole session. This monitor checks the same configuration while the session runs, so a broken reference is reported when it is still cheap to fix.

It does not replace the delivery gate. config-health warns and always exits 0; the delivery gate owns blocking. The boundary is whether the problem can be fixed retroactively: config drift can, a missing growth-log entry cannot.

What it checks

  • Hook wiring: every script referenced by a hook command exists on disk. The audit covers every file Claude loads hooks from: the user settings.json, the project settings.json, the project .claude/settings.local.json, and the plugin's own hooks/hooks.json when the plugin root is known. A hook declared only in settings.local.json or only in the plugin manifest is audited too, instead of being reported clean because no settings.json mentions it. Plugin-root placeholders are resolved through an explicit environment map (CLAUDE_PLUGIN_ROOT, with CONFIG_HEALTH_PLUGIN_ROOT as an override), and substituted paths must stay inside the expected plugin/project roots. An unresolved provider placeholder is skipped and counted as unjudged, not reported as a missing script.
  • Rule references and staleness: a CLAUDE.md that points at a missing rule file is a finding. Rule paths may be nested (rules/ecc/common/security.md), and the reference scan follows them. Rules that have not fired across the five most recent complex sessions are reported as possibly dead; any positive count inside that window — including in a short session that the complexity filter leaves out of the judgment — keeps the rule alive.
  • Guard-script staleness: the maintenance window is configurable and reports rather than blocks.

Install

  • The module ships manifests/install-assets/config-health-hooks.json, a SessionStart registration merged into the target settings.json at install time with the install root substituted for ${CLAUDE_PLUGIN_ROOT} — ~/.claude/scripts/config-health.py for a home install, <project>/.claude/scripts/config-health.py for a project install. Copying the skill and script without that merge would install a monitor that no ordinary session invokes.
  • The merge is a settings write, so hook consent gates it: --enable-hooks wires the SessionStart hook; --no-hooks installs the files only and leaves settings.json untouched.
  • PreToolUse stays opt-in and is deliberately absent from the shipped config.
  • Two modules now merge into the same settings file: hooks-runtime (hooks/hooks.json) and config-health. Install state therefore keeps one record per destination and hook source, not one per destination. Keyed by destination alone, the second record replaced the first and uninstall left the first module's managed hooks behind. The apply path, the repair path, and the state schema all use the same key.

Behavior

  • The default wiring is SessionStart only. PreToolUse is opt-in, and the documented hook uses "matcher": "Edit|Write", so it runs only for the tool classes where a guard could matter.
  • Every mode exits 0. PreToolUse warnings go to stderr and stdout stays clean; the hook payload is drained and discarded, never parsed and never printed.
  • --check is the manual overview. It reports how many hook paths were not audited, so a decision not to judge is distinguishable from a clean result.

Distribution

Registered in agent.yaml, package.json, and manifests/install-modules.json as the config-health module (Claude-only targets), included in the full install profile, and shipping its own hook config. Catalog counts are regenerated. The state schema allows one update-claude-settings record per hook-shipping module: hooks-runtime → hooks/hooks.json, config-health → manifests/install-assets/config-health-hooks.json.

Maintainability

  • The monitor is split by responsibility: config-health.py (CLI entry and audit modes), config_health_constants.py (constants, regexes, audit sets), config_health_paths.py (path resolution and defensive reads), and config_health_scan.py (shell-command tokenising). Every file is below the repository's 800-line limit.
  • scan_command — the function named in the oversized-monitor finding — is now a 49-line orchestrator over _scan_program_body and _word_tokens; the split is behaviour-preserving and covered by the parser suite.
  • The hook contract suite is split into tests/hooks/config-health.test.js (resolution and wording), tests/hooks/config-health-parser.test.js (parsing, accounting, install lifecycle), and tests/hooks/config-health-helpers.js (shared harness). All three are below 800 lines.
  • The entry imports the helper modules behind the same non-blocking guard as the rest of the script, so a broken install or an interpreter fault still exits 0 without a traceback. sys.dont_write_bytecode keeps the read-only monitor from leaving __pycache__ in the plugin directory.
  • The install manifest, npm files list, and standalone-install instructions now copy the entry and all three helpers together.

Testing

  • Hook contract suites: 79/79 — 48 in tests/hooks/config-health.test.js, 31 in tests/hooks/config-health-parser.test.js, sharing tests/hooks/config-health-helpers.js.
  • New coverage: nested rule references, a separator attached to a script path (guard.py;, guard.py&&…, guard.py|…) still being audited, settings.local.json as a hook source, plugin hooks/hooks.json as a hook source, a positive count inside the staleness window suppressing the dead-rule finding, --no-hooks installing the payload without registering the monitor, and the installed SessionStart entry surviving install → startup → repair → uninstall.
  • install-apply.test.js full-profile dry run now asserts two settings operations — one per hook-shipping module — with their sources and managed hook ids.
  • New regression test in uninstall.test.js: install --modules hooks-runtime,config-health --enable-hooks, assert both settings records in state, uninstall, assert both hook ids are gone from settings.json. Before the state-key fix this reproduced 28 leftover hook entries.
  • Disposable-home lifecycle: install-apply.js → startup → repair.js → uninstall.js, including the default install not adding a per-tool hook, and a --pretool run from the installed script against both an absolute project hook and a plugin-root hook.
  • A real claude-project install into a disposable project directory, followed by a --pretool run with a project-relative .claude/scripts/config-health.py hook.
  • Plugin-root, project-relative, unresolved-placeholder, changed-settings, and unchanged-settings fixtures.
  • The repository's own 23 plugin hook commands produce no false missing-script warning.
  • validate-install-manifests, catalog --text, and validate-skills pass locally. validate-context-profiles reports that manifests/context-packs/skill-triggers@1.json is stale — its registry digest no longer matches the generated registry — on this branch and on e83576fe, the merged base it sits on. Pre-existing, untouched here.
  • Measured PreToolUse cost on the repository's 23 real hook commands (Python 3.12, Windows, interleaved A/B, median of 30 paired runs): wiring audit 4.33 ms → 3.83 ms; whole --pretool process 50.6 ms → 54.7 ms, against python -c pass at 42.1 ms. The skill documents this and keeps PreToolUse opt-in.

Known limitations

  • PreToolUse runs in a fresh process and rescans the settings files on every matched call. It is opt-in for that reason; the measured cost is in the skill.
  • An unresolved provider placeholder without CONFIG_HEALTH_PLUGIN_ROOT is counted as not audited, not resolved by guessing.
  • The plugin shape is covered by a plugin-root fixture and the repository's own 23 plugin hook commands, not by a full marketplace plugin install. The project install is run end-to-end in a disposable directory.
  • The module targets Claude Code only; it is not part of the shared multi-harness surface.

@YuhaoLin2005
YuhaoLin2005 requested a review from affaan-m as a code owner July 10, 2026 17:46
@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
Walkthrough

Adds the Config Health skill documentation, wires it into the workflow-quality module, updates skill counts from 281 to 282, and adjusts README headings and spacing.

Changes: Config Health Skill Integration

Layer / File(s) Summary
Config Health documentation and installation wiring
skills/config-health/SKILL.md, manifests/install-modules.json
Documents Config Health monitoring, hook integration, delivery-gate coordination, installation commands, and adds the skill to workflow-quality.
Skill count and README catalog synchronization
AGENTS.md, README.md
Updates documented skill counts from 281 to 282 and adjusts several README headings and spacing elements.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • affaan-m/ECC#2277: Adds another workflow-quality skill with related installation and catalog updates.

Suggested reviewers: affaan-m

Pre-merge checks: Passed 4
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely identifies the primary change: adding runtime configuration integrity monitoring through the new config-health skill.
Description check Passed The pull request description directly describes the new config-health skill, its hook wiring, installation changes, runtime behavior, testing, and related distribution updates.
Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@greptile-apps

greptile-apps Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 3/5

[Medium impact] The PR adds an optional monitor and hook registration to Claude Code installs.

Changes are required before merging because both reproduced startup failures can prevent the promised configuration checks from running.

Findings

  1. P1 Startup cannot find Python ▶
  2. P1 Install paths change at startup ▶
  3. P2 Project Hooks Inflate Fallback Count ▶
  4. P2 Split oversized monitor ▶
Fix with agent prompt
### Issue 1
manifests/install-assets/config-health-hooks.json:10
If a host exposes Python 3 only as `python`, this new SessionStart command cannot launch the monitor because it hardcodes `python3`. Installation can succeed, but ordinary sessions get a startup error instead of configuration checks. Executing the materialized command with only a working `python` on PATH failed before the monitor ran; invoking the same installed script through `python` successfully reported the seeded configuration problem. Resolve an available Python 3 interpreter or provide a version-checked fallback.

### Issue 2
manifests/install-assets/config-health-hooks.json:10
If the install directory contains shell expansion characters, this command can point Python at the wrong script. `materializeManagedHooks` inserts the root unchanged inside double quotes, which still allow expansion. In an executed fixture with a literal `install-$client` directory and `client` unset, the generated command tried to open `install-/scripts/config-health.py` and exited 2 instead of running the existing monitor. Direct invocation of the same installed script succeeded. Encode the root or escape it for the shell before inserting it.

### Issue 3
scripts/config-health.py:213-214
For an existing relative project hook, this comparison checks its file path against the project directory and counts it as satisfied by the user home or plugin root. The resulting `--check` report overstates fallback coverage, so users cannot rely on that count to tell whether a project hook was found in the project.

```suggestion
            if status == AUDIT_OK and relative and stats is not None \
                    and not is_within(paths[0], [project_norm]):
```

### Issue 4
scripts/config-health.py:320-321
The new monitor is 1,014 lines and its test file is 1,041 lines; `scan_command` also exceeds 50 lines. This violates the repository’s limits of 800 lines per file and fewer than 50 lines per function. Split these into focused files and functions. This repository requirement must be satisfied before merging.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds config-health, a read-only Claude Code configuration monitor.

  • Claude Code sessions can report broken hook paths and stale rules.
  • Claude installs can register config-health at session start.
  • Existing documentation now lists 315 skills.

T-Rex validation blocked

Behavioral checks completed, but evidence upload was blocked because no artifact-upload operation or configured upload destination was available. Executed scripts and observed output remain in local evidence files; remote upload is not confirmed.

Reviews (13) · Last reviewed commit: "fix(config-health): audit a script path ..." · Reviewed by Greptile

Comment thread skills/config-health/SKILL.md Resolved

@daltino daltino left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds a new skill, config-health, for runtime configuration integrity monitoring. The SKILL.md file is clear, well-structured, and adheres to the contribution guidelines, with a descriptive name, a concise summary of its purpose, and metadata specifying its origin. The addition complements existing functionality (delivery-gate) effectively, providing a proactive layer for identifying issues during the session. No issues spotted with the implementation.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@skills/config-health/SKILL.md`:
- Around line 8-22: Add canonical ## When to Activate, ## How It Works, and ##
Examples sections to the config-health skill documentation. Under When to
Activate, specify concrete conditions such as session start, before high-risk
tool calls, and guard-script maintenance checks; under How It Works, describe
the monitoring workflow and responses; under Examples, provide representative
configuration-health scenarios.
- Around line 24-38: Update the Install section in SKILL.md so the hook
configuration is explicitly merged into existing Claude settings rather than
replacing the full hooks object. Add instructions to provision or copy
config-health.py into ~/.claude/scripts/config-health.py and verify that the
file exists before enabling the hooks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: eb49f71c-1f5a-4ce1-8048-609fa90d2e45

📥 Commits

Reviewing files that changed from the base of the PR and between 4092795 and 704ff78.

📒 Files selected for processing (1)
  • skills/config-health/SKILL.md
📜 Review details
⏰ Context from checks skipped due to timeout. (28)
  • GitHub Check: CodeRabbit / Review
  • GitHub Check: Test (macos-latest, Node 20.x, npm)
  • GitHub Check: Test (macos-latest, Node 22.x, yarn)
  • GitHub Check: Test (ubuntu-latest, Node 20.x, bun)
  • GitHub Check: Test (macos-latest, Node 18.x, yarn)
  • GitHub Check: Test (ubuntu-latest, Node 20.x, yarn)
  • GitHub Check: Test (macos-latest, Node 20.x, bun)
  • GitHub Check: Test (ubuntu-latest, Node 22.x, pnpm)
  • GitHub Check: Test (windows-latest, Node 18.x, yarn)
  • GitHub Check: Test (macos-latest, Node 18.x, npm)
  • GitHub Check: Test (windows-latest, Node 20.x, npm)
  • GitHub Check: Test (windows-latest, Node 18.x, pnpm)
  • GitHub Check: Test (windows-latest, Node 20.x, yarn)
  • GitHub Check: Test (windows-latest, Node 22.x, npm)
  • GitHub Check: Test (ubuntu-latest, Node 22.x, npm)
  • GitHub Check: Test (windows-latest, Node 18.x, npm)
  • GitHub Check: Test (windows-latest, Node 20.x, pnpm)
  • GitHub Check: Test (windows-latest, Node 22.x, yarn)
  • GitHub Check: Test (ubuntu-latest, Node 22.x, bun)
  • GitHub Check: Test (ubuntu-latest, Node 22.x, yarn)
  • GitHub Check: Test (windows-latest, Node 22.x, pnpm)
  • GitHub Check: Test (ubuntu-latest, Node 18.x, bun)
  • GitHub Check: Test (ubuntu-latest, Node 18.x, npm)
  • GitHub Check: Test (ubuntu-latest, Node 18.x, yarn)
  • GitHub Check: Test (ubuntu-latest, Node 20.x, npm)
  • GitHub Check: Test (ubuntu-latest, Node 18.x, pnpm)
  • GitHub Check: Test (ubuntu-latest, Node 20.x, pnpm)
  • GitHub Check: Coverage
🧰 Additional context used
📓 Path-based instructions (4)
skills/**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

Skills should be formatted as Markdown with clear sections for When to Use, How It Works, and Examples.

Files:

  • skills/config-health/SKILL.md
{agents,skills,commands}/**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

Use lowercase filenames with hyphens (e.g., python-reviewer.md, tdd-workflow.md) for agents, skills, and commands.

Files:

  • skills/config-health/SKILL.md
skills/**

📄 CodeRabbit inference engine (AGENTS.md)

New workflow contributions should land in skills/ first; skills/ is the canonical workflow surface.

Files:

  • skills/config-health/SKILL.md
{skills,commands,agents,rules}/**

⚙️ CodeRabbit configuration file

{skills,commands,agents,rules}/**: Focus on prompt-injection resilience, tool-permission scope, destructive action guards, and secret exfiltration risks.

Files:

  • skills/config-health/SKILL.md
🧠 Learnings (2)
📚 Learning: 2026-03-15T19:02:43.245Z
Learnt from: imrobinsingh
Repo: affaan-m/everything-claude-code PR: 503
File: skills/data-scraper-agent/SKILL.md:1-748
Timestamp: 2026-03-15T19:02:43.245Z
Learning: In this repository, skill folders should use a lowercase-hyphen name (e.g., data-scraper-agent, claude-api) and the skill description file inside each folder should be named SKILL.md (uppercase). Do not flag SKILL.md as a naming violation; treat SKILL.md as the canonical file name inside each skill directory.

Applied to files:

  • skills/config-health/SKILL.md
📚 Learning: 2026-04-15T15:52:59.963Z
Learnt from: manja316
Repo: affaan-m/everything-claude-code PR: 1360
File: skills/security-bounty-hunter/SKILL.md:11-18
Timestamp: 2026-04-15T15:52:59.963Z
Learning: In this repository’s skills documentation (skills/**/SKILL.md), use the canonical auto-activation skill section header `## When to Activate`—do not use `## When to Use`. CONTRIBUTING.md and docs/SKILL-DEVELOPMENT-GUIDE.md confirm the required header, and existing skills follow this convention. This header is important for the auto-activation mechanism to detect the correct section.

Applied to files:

  • skills/config-health/SKILL.md
🔇 Additional comments (2)
skills/config-health/SKILL.md (2)

1-10: LGTM!


40-60: LGTM!

Comment thread skills/config-health/SKILL.md Resolved
Comment thread skills/config-health/SKILL.md Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@skills/config-health/SKILL.md`:
- Line 26: Clarify the boundary statement so `config-health` only warns on
config drift, while `delivery-gate` is explicitly identified as the component
that blocks missing `growth-log` state.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2ff94822-affa-4327-ba92-cddb7123b940

📥 Commits

Reviewing files that changed from the base of the PR and between 704ff78 and 79b0e34.

📒 Files selected for processing (1)
  • skills/config-health/SKILL.md
📜 Review details
⏰ Context from checks skipped due to timeout. (28)
  • GitHub Check: CodeRabbit / Review
  • GitHub Check: Test (windows-latest, Node 20.x, npm)
  • GitHub Check: Test (windows-latest, Node 22.x, yarn)
  • GitHub Check: Test (macos-latest, Node 20.x, bun)
  • GitHub Check: Test (ubuntu-latest, Node 20.x, bun)
  • GitHub Check: Test (macos-latest, Node 22.x, npm)
  • GitHub Check: Test (windows-latest, Node 22.x, npm)
  • GitHub Check: Test (windows-latest, Node 22.x, pnpm)
  • GitHub Check: Test (windows-latest, Node 18.x, yarn)
  • GitHub Check: Test (macos-latest, Node 22.x, bun)
  • GitHub Check: Test (windows-latest, Node 20.x, pnpm)
  • GitHub Check: Test (windows-latest, Node 20.x, yarn)
  • GitHub Check: Test (macos-latest, Node 18.x, yarn)
  • GitHub Check: Test (windows-latest, Node 18.x, pnpm)
  • GitHub Check: Test (macos-latest, Node 18.x, pnpm)
  • GitHub Check: Test (windows-latest, Node 18.x, npm)
  • GitHub Check: Test (ubuntu-latest, Node 22.x, pnpm)
  • GitHub Check: Test (ubuntu-latest, Node 22.x, bun)
  • GitHub Check: Test (ubuntu-latest, Node 22.x, npm)
  • GitHub Check: Test (ubuntu-latest, Node 20.x, yarn)
  • GitHub Check: Test (ubuntu-latest, Node 18.x, pnpm)
  • GitHub Check: Test (ubuntu-latest, Node 18.x, yarn)
  • GitHub Check: Test (ubuntu-latest, Node 20.x, pnpm)
  • GitHub Check: Test (ubuntu-latest, Node 18.x, bun)
  • GitHub Check: Test (ubuntu-latest, Node 22.x, yarn)
  • GitHub Check: Test (ubuntu-latest, Node 18.x, npm)
  • GitHub Check: Test (ubuntu-latest, Node 20.x, npm)
  • GitHub Check: Coverage
🧰 Additional context used
📓 Path-based instructions (4)
skills/**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

Skills should be formatted as Markdown with clear sections for When to Use, How It Works, and Examples.

Files:

  • skills/config-health/SKILL.md
{agents,skills,commands}/**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

Use lowercase filenames with hyphens (e.g., python-reviewer.md, tdd-workflow.md) for agents, skills, and commands.

Files:

  • skills/config-health/SKILL.md
skills/**

📄 CodeRabbit inference engine (AGENTS.md)

New workflow contributions should land in skills/ first; skills/ is the canonical workflow surface.

Files:

  • skills/config-health/SKILL.md
{skills,commands,agents,rules}/**

⚙️ CodeRabbit configuration file

{skills,commands,agents,rules}/**: Focus on prompt-injection resilience, tool-permission scope, destructive action guards, and secret exfiltration risks.

Files:

  • skills/config-health/SKILL.md
🧠 Learnings (2)
📚 Learning: 2026-03-15T19:02:43.245Z
Learnt from: imrobinsingh
Repo: affaan-m/everything-claude-code PR: 503
File: skills/data-scraper-agent/SKILL.md:1-748
Timestamp: 2026-03-15T19:02:43.245Z
Learning: In this repository, skill folders should use a lowercase-hyphen name (e.g., data-scraper-agent, claude-api) and the skill description file inside each folder should be named SKILL.md (uppercase). Do not flag SKILL.md as a naming violation; treat SKILL.md as the canonical file name inside each skill directory.

Applied to files:

  • skills/config-health/SKILL.md
📚 Learning: 2026-04-15T15:52:59.963Z
Learnt from: manja316
Repo: affaan-m/everything-claude-code PR: 1360
File: skills/security-bounty-hunter/SKILL.md:11-18
Timestamp: 2026-04-15T15:52:59.963Z
Learning: In this repository’s skills documentation (skills/**/SKILL.md), use the canonical auto-activation skill section header `## When to Activate`—do not use `## When to Use`. CONTRIBUTING.md and docs/SKILL-DEVELOPMENT-GUIDE.md confirm the required header, and existing skills follow this convention. This header is important for the auto-activation mechanism to detect the correct section.

Applied to files:

  • skills/config-health/SKILL.md
🪛 SkillSpector (2.3.7)
skills/config-health/SKILL.md

[warning] 18: [RA2] Session Persistence: Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Remediation: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.

(Rogue Agent (RA2))

🔇 Additional comments (5)
skills/config-health/SKILL.md (5)

45-54: The install snippet still needs additive merging and script provisioning.

This repeats the prior finding: pasting the standalone hooks object can overwrite existing hooks such as delivery-gate, and ~/.claude/scripts/config-health.py is referenced without instructions to install or verify it.


3-18: LGTM!


20-25: LGTM!


28-43: LGTM!


56-67: LGTM!

Comment thread skills/config-health/SKILL.md Resolved
Comment thread skills/config-health/SKILL.md Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
skills/config-health/SKILL.md (1)

51-52: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Lower these hook timeouts
timeout is in seconds here, so 5000 and 3000 make these hooks wait for hours instead of a few seconds. Use 5 and 3 if that’s the intended limit.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/config-health/SKILL.md` around lines 51 - 52, Update the timeout
values in the SessionStart and PreToolUse hook configurations to use seconds as
intended: change 5000 to 5 and 3000 to 3, while preserving the existing commands
and hook structure.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@skills/config-health/SKILL.md`:
- Around line 51-52: Update the timeout values in the SessionStart and
PreToolUse hook configurations to use seconds as intended: change 5000 to 5 and
3000 to 3, while preserving the existing commands and hook structure.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3cbd8010-fa65-4dea-bdd5-d2c6fbeb8d14

📥 Commits

Reviewing files that changed from the base of the PR and between 79b0e34 and db78a1a.

📒 Files selected for processing (1)
  • skills/config-health/SKILL.md
📜 Review details
⏰ Context from checks skipped due to timeout. (28)
  • GitHub Check: CodeRabbit
  • GitHub Check: Test (ubuntu-latest, Node 22.x, pnpm)
  • GitHub Check: Test (ubuntu-latest, Node 20.x, npm)
  • GitHub Check: Test (windows-latest, Node 18.x, npm)
  • GitHub Check: Test (windows-latest, Node 20.x, npm)
  • GitHub Check: Test (macos-latest, Node 20.x, npm)
  • GitHub Check: Test (ubuntu-latest, Node 20.x, pnpm)
  • GitHub Check: Test (windows-latest, Node 20.x, yarn)
  • GitHub Check: Test (ubuntu-latest, Node 18.x, npm)
  • GitHub Check: Test (windows-latest, Node 18.x, yarn)
  • GitHub Check: Test (windows-latest, Node 20.x, pnpm)
  • GitHub Check: Test (macos-latest, Node 18.x, yarn)
  • GitHub Check: Test (windows-latest, Node 22.x, pnpm)
  • GitHub Check: Test (windows-latest, Node 22.x, npm)
  • GitHub Check: Test (ubuntu-latest, Node 22.x, yarn)
  • GitHub Check: Test (windows-latest, Node 22.x, yarn)
  • GitHub Check: Test (macos-latest, Node 18.x, pnpm)
  • GitHub Check: Test (ubuntu-latest, Node 18.x, bun)
  • GitHub Check: Test (macos-latest, Node 18.x, npm)
  • GitHub Check: Test (macos-latest, Node 20.x, pnpm)
  • GitHub Check: Test (ubuntu-latest, Node 20.x, yarn)
  • GitHub Check: Test (ubuntu-latest, Node 22.x, npm)
  • GitHub Check: Test (ubuntu-latest, Node 18.x, yarn)
  • GitHub Check: Test (windows-latest, Node 18.x, pnpm)
  • GitHub Check: Test (ubuntu-latest, Node 18.x, pnpm)
  • GitHub Check: Test (ubuntu-latest, Node 20.x, bun)
  • GitHub Check: Test (ubuntu-latest, Node 22.x, bun)
  • GitHub Check: Coverage
🧰 Additional context used
📓 Path-based instructions (4)
skills/**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

Skills should be formatted as Markdown with clear sections for When to Use, How It Works, and Examples.

Files:

  • skills/config-health/SKILL.md
{agents,skills,commands}/**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

Use lowercase filenames with hyphens (e.g., python-reviewer.md, tdd-workflow.md) for agents, skills, and commands.

Files:

  • skills/config-health/SKILL.md
skills/**

📄 CodeRabbit inference engine (AGENTS.md)

New workflow contributions should land in skills/ first; skills/ is the canonical workflow surface.

Files:

  • skills/config-health/SKILL.md
{skills,commands,agents,rules}/**

⚙️ CodeRabbit configuration file

{skills,commands,agents,rules}/**: Focus on prompt-injection resilience, tool-permission scope, destructive action guards, and secret exfiltration risks.

Files:

  • skills/config-health/SKILL.md
🧠 Learnings (2)
📚 Learning: 2026-03-15T19:02:43.245Z
Learnt from: imrobinsingh
Repo: affaan-m/everything-claude-code PR: 503
File: skills/data-scraper-agent/SKILL.md:1-748
Timestamp: 2026-03-15T19:02:43.245Z
Learning: In this repository, skill folders should use a lowercase-hyphen name (e.g., data-scraper-agent, claude-api) and the skill description file inside each folder should be named SKILL.md (uppercase). Do not flag SKILL.md as a naming violation; treat SKILL.md as the canonical file name inside each skill directory.

Applied to files:

  • skills/config-health/SKILL.md
📚 Learning: 2026-04-15T15:52:59.963Z
Learnt from: manja316
Repo: affaan-m/everything-claude-code PR: 1360
File: skills/security-bounty-hunter/SKILL.md:11-18
Timestamp: 2026-04-15T15:52:59.963Z
Learning: In this repository’s skills documentation (skills/**/SKILL.md), use the canonical auto-activation skill section header `## When to Activate`—do not use `## When to Use`. CONTRIBUTING.md and docs/SKILL-DEVELOPMENT-GUIDE.md confirm the required header, and existing skills follow this convention. This header is important for the auto-activation mechanism to detect the correct section.

Applied to files:

  • skills/config-health/SKILL.md
🪛 SkillSpector (2.3.7)
skills/config-health/SKILL.md

[warning] 18: [RA2] Session Persistence: Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Remediation: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.

(Rogue Agent (RA2))


[warning] 18: [RA2] Session Persistence: Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Remediation: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.

(Rogue Agent (RA2))

@ecc-tools

ecc-tools Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

1 similar comment
@ecc-tools

ecc-tools Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@AGENTS.md`:
- Line 3: Update the project-structure entry in AGENTS.md to report 282 skills,
matching the synchronized count in the document and removing the contradictory
281 value.

In `@manifests/install-modules.json`:
- Line 342: Update the manifest entry for skills/config-health so it is
installed only for Claude-compatible targets, rather than the shared
workflow-quality target list; alternatively, make the skill content
harness-neutral before retaining it there. Preserve the existing target
configuration for other workflow-quality skills.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8c230ba9-8b24-4873-b816-03679c948dff

📥 Commits

Reviewing files that changed from the base of the PR and between 008412f and 7d0eaea.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • AGENTS.md
  • README.md
  • manifests/install-modules.json
📜 Review details
⏰ Context from checks skipped due to timeout. (27)
  • GitHub Check: Test (ubuntu-latest, Node 20.x, yarn)
  • GitHub Check: Test (windows-latest, Node 18.x, npm)
  • GitHub Check: Test (ubuntu-latest, Node 18.x, pnpm)
  • GitHub Check: Test (ubuntu-latest, Node 18.x, npm)
  • GitHub Check: Test (macos-latest, Node 18.x, pnpm)
  • GitHub Check: Test (ubuntu-latest, Node 18.x, yarn)
  • GitHub Check: Test (macos-latest, Node 18.x, bun)
  • GitHub Check: Test (ubuntu-latest, Node 20.x, bun)
  • GitHub Check: Test (windows-latest, Node 22.x, npm)
  • GitHub Check: Test (ubuntu-latest, Node 22.x, yarn)
  • GitHub Check: Test (macos-latest, Node 20.x, bun)
  • GitHub Check: Test (windows-latest, Node 20.x, yarn)
  • GitHub Check: Test (ubuntu-latest, Node 22.x, npm)
  • GitHub Check: Test (ubuntu-latest, Node 20.x, npm)
  • GitHub Check: Test (ubuntu-latest, Node 22.x, bun)
  • GitHub Check: Test (macos-latest, Node 22.x, yarn)
  • GitHub Check: Test (ubuntu-latest, Node 22.x, pnpm)
  • GitHub Check: Test (windows-latest, Node 20.x, npm)
  • GitHub Check: Test (windows-latest, Node 18.x, pnpm)
  • GitHub Check: Test (ubuntu-latest, Node 20.x, pnpm)
  • GitHub Check: Test (windows-latest, Node 22.x, yarn)
  • GitHub Check: Test (macos-latest, Node 20.x, yarn)
  • GitHub Check: Test (windows-latest, Node 18.x, yarn)
  • GitHub Check: Test (windows-latest, Node 22.x, pnpm)
  • GitHub Check: Test (ubuntu-latest, Node 18.x, bun)
  • GitHub Check: Test (windows-latest, Node 20.x, pnpm)
  • GitHub Check: Coverage
🧰 Additional context used
📓 Path-based instructions (4)
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Delegate complex features, architectural decisions, security-sensitive work, reviews, and other domain-specific tasks to the appropriate specialized agent; run independent agents in parallel where appropriate.
Plan complex features and refactors before implementation, including dependencies, risks, and phases.
Use test-driven development: write a failing test first, implement the minimum passing solution, then refactor and verify coverage.
Maintain at least 80% test coverage and provide unit, integration, and end-to-end tests for applicable functionality.
Never compromise security: validate external input, prevent injection and XSS, enable CSRF protection, verify authentication and authorization, apply endpoint rate limiting, and avoid leaking sensitive error details.
Never hardcode secrets; use environment variables or a secret manager, validate required secrets at startup, and rotate exposed secrets immediately.
If a security issue is found, stop, invoke security review, fix critical issues, rotate exposed secrets, and search for similar vulnerabilities.
Always preserve immutability: create new objects and return updated copies instead of mutating existing objects.
Organize code by feature or domain with high cohesion and low coupling; prefer many small focused files, typically 200–400 lines and no more than 800 lines.
Handle errors at every level, show user-friendly UI messages, log detailed server-side context, and never silently swallow errors.
Validate all user input at system boundaries with schema-based validation, fail fast with clear messages, and never trust external data.
Keep functions under 50 lines, files focused and under 800 lines, avoid nesting deeper than four levels, avoid hardcoded values, and use readable, well-named identifiers.
Encapsulate data access behind a repository interface such as findAll, findById, create, update, and delete; business logic must depend on the abstraction rather than the storage mechanism.
Capture personal deb...

Files:

  • AGENTS.md
  • manifests/install-modules.json
  • README.md
**/*.{js,ts,jsx,tsx,py,java,cs,rb,go,php,swift,kt,rs,c,cpp,h,hpp,properties,yml,yaml,json,env,config}

📄 CodeRabbit inference engine (.cursor/rules/common-security.md)

NEVER hardcode secrets in source code - ALWAYS use environment variables or a secret manager

Files:

  • manifests/install-modules.json
**/*.{js,ts,jsx,tsx,json,env*}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Do not hardcode secrets, API keys, passwords, or tokens

Files:

  • manifests/install-modules.json
README.md

📄 CodeRabbit inference engine (CLAUDE.md)

When working on README.md files, use the /readme skill.

Files:

  • README.md
🔇 Additional comments (1)
README.md (1)

119-124: LGTM!

Also applies to: 609-609, 911-911, 1165-1165, 1176-1176, 1417-1417, 1452-1452, 1545-1545, 1578-1578, 1665-1665, 1707-1707

Comment thread AGENTS.md Outdated
# Everything Claude Code (ECC) — Agent Instructions

This is a **production-ready AI coding plugin** providing 67 specialized agents, 281 skills, 94 commands, and automated hook workflows for software development.
This is a **production-ready AI coding plugin** providing 67 specialized agents, 282 skills, 94 commands, and automated hook workflows for software development.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Synchronize the remaining skills count in this file.

Line 3 says 282 skills, but the project-structure entry at Line 155 still says 281. Update that entry to prevent contradictory agent instructions.

- skills/          — 281 workflow skills and domain knowledge
+ skills/          — 282 workflow skills and domain knowledge
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@AGENTS.md` at line 3, Update the project-structure entry in AGENTS.md to
report 282 skills, matching the synchronized count in the document and removing
the contradictory 281 value.

Comment thread manifests/install-modules.json Resolved
@ecc-tools

ecc-tools Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@haelyra

haelyra commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Thank you for developing the runtime configuration-health idea—the distinction between early, nonblocking warnings and the end-of-session delivery gate is useful. I’m sorry this waited so long for a maintainer review.

We would love another focused pass with these changes:

  • Ship the monitor referenced by the installation instructions. The skill tells users to copy and run scripts/config-health.py, but that file is not included, so both documented hooks invoke a missing executable. Please add a deterministic, read-only implementation supporting --startup and --pretool, and make the documented install path match the repository path.
  • Verify the real hook contract. Please cover present and missing scripts, malformed or absent settings, absent rule directories, and warning behavior. Success means every diagnostic remains nonblocking, exits cleanly, and does not echo raw hook input or secrets.
  • Complete the current distribution wiring. The skill is not registered in agent.yaml, package.json, or an install module. Please rebase on current main, add those surfaces, regenerate catalog counts, and run the exact-head catalog and hook tests.

If you do not have bandwidth for that implementation work, we can carry the deterministic config-health idea into our existing workspace-inventory/config-health task queue. We cannot merge this version while its documented executable is absent, but the underlying idea is worth preserving.

…ontract tests

Deterministic read-only non-blocking monitor (--startup/--pretool/--check):
hook wiring audit, rule reference audit, guard staleness. Never echoes
hook input or secrets; always exits 0. Wired as a Claude-only install
module (SessionStart/PreToolUse), added to full profile, package files,
and agent.yaml. Includes 9 hook-contract tests.
@ecc-tools

ecc-tools Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@YuhaoLin2005

Copy link
Copy Markdown
Contributor Author

All three focused-pass requirements are now addressed — the PR ships the executable, hook-contract tests, and full distribution wiring.

① Executable + path consistency
scripts/config-health.py (296 lines) is now in the PR — deterministic, read-only, non-blocking, no LLM calls. Three modes:

  • --startup (SessionStart): hook-wiring audit + rule-reference audit + guard-staleness
  • --pretool (PreToolUse): re-verifies matched hook scripts; reads stdin but never echoes it
  • --check (manual): tri-color overview

Paths in the SKILL.md Install section and Files table match the repo path (scripts/config-health.py); ~/.claude/scripts/ is only the standalone copy destination.

② Hook-contract tests
tests/hooks/config-health.test.js — 9 tests, all passing. Covers the requested matrix: present/missing referenced scripts, malformed/absent settings, absent rules dirs, and warning behavior. Assertions: every diagnostic exits 0 (never blocks), and --pretool never echoes raw hook input or secrets (stdout === '', secret absent from stdout+stderr).

③ Wiring + rebase + counts

  • Wiring: agent.yaml skills list, package.json files array (skills/config-health/ + scripts/config-health.py), new Claude-only install module config-health (targets only claude/claude-project — isolated from the shared multi-harness modules), added to the full profile.
  • Rebased onto current main. Count conflicts resolved by regenerating with catalog.js --write — skill count 288, consistent across README/AGENTS/zh-CN/plugin.json/marketplace.json.
  • Exact-head validation: validate-skills (288 ✓), validate-install-manifests (35 modules / 81 components / 7 profiles ✓), catalog.js --text ✓, check-unicode-safety ✓, tests/hooks/config-health.test.js (9/9 ✓). Full tests/run-all.js has failures in environment-dependent files (git hooks, platform audit, e2e) — verified identical on a clean main checkout (zero introduced by this change).

@ecc-tools

ecc-tools Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

Comment thread scripts/config-health.py Resolved
Comment thread scripts/config-health.py Resolved
@haelyra

haelyra commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

I carried the branch onto current main, resolved the catalog conflicts, and regenerated the combined 68-agent, 285-skill, 94-command counts in maintainer commit a10cb91. The refreshed tree passes all 9 focused config-health tests, Python compilation, install-manifest validation, strict validation of all 285 skills, catalog validation, and ESLint on the affected JavaScript. Hosted checks are now rerunning on the updated head. Thank you for working through the earlier review feedback and for the substantial test coverage.

@haelyra haelyra left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after the maintainer refresh at a10cb91. The hook stays non-blocking and keeps raw hook input off stdout, while the skill and manifests make the feature discoverable through the canonical install surface. Focused tests and combined-main catalog and manifest validation pass locally. Thank you for the thoughtful integrity checks and the revisions.

@ecc-tools

ecc-tools Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

Comment thread scripts/config-health.py Resolved
@ecc-tools

ecc-tools Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / Reference Set Readiness

Commit: f36e5d55a7f7e370ccbd1e9b4ca684fce1f627b6

Reference set readiness gaps detected (neutral)

Reference evidence present for 0/7 areas (0%) across 15 changed file(s).

This check is based on files changed in this PR. Repository-level readiness is still reported by /ecc-tools analyze comments and generated manifests.

Area Status Evidence / Next Step
Deep analyzer corpus Missing Add analyzer fixture, golden, benchmark, or reference-set files that can catch analyzer regressions.
RAG/evaluator comparison Missing Add retrieval or evaluator reference-set comparison fixtures with expected ranking behavior.
PR salvage/review corpus Missing Add stale-PR, review-thread, reopen-flow, or salvage reference cases for queue cleanup automation.
Discussion triage corpus Missing Add public discussion triage fixtures, golden cases, or reference sets for informational, answered, and no-response classifications.
Harness compatibility Missing Add cross-harness, adapter-compliance, or harness-audit evidence for Claude, Codex, OpenCode, Zed, dmux, and agent surfaces.
Security evidence Missing Attach security evidence such as SBOMs, SARIF, audit reports, or AgentShield evidence packs.
CI failure-mode evidence Missing Add captured CI failure logs, dry-run fixtures, or troubleshooting docs for common workflow failure modes.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / Hosted Promotion Readiness

Commit: f36e5d55a7f7e370ccbd1e9b4ca684fce1f627b6

Hosted promotion readiness passed (success)

No hosted promotion evidence gaps detected across 15 changed file(s); 0 corpus scenarios had matching evidence.

This check compares PR file changes against the evaluator/RAG promotion corpus in src/analyzers/fixtures/evaluator-rag-corpus.ts.
Hosted output scoring inspected 0 completed cached hosted job results.

No evaluator corpus scenarios matched this PR.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / PR Config Audit

Commit: f36e5d55a7f7e370ccbd1e9b4ca684fce1f627b6

No changed-config issues detected (success)

Scanned 1 config file(s) present at this commit across 1 changed config path(s) and found no issues in the supported security rules.

Changed config files:

  • AGENTS.md

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / PR Harness Audit

Commit: f36e5d55a7f7e370ccbd1e9b4ca684fce1f627b6

No harness issues detected (success)

Scanned 1 changed config file(s) and found no harness issues.

Changed config files:

  • AGENTS.md

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@YuhaoLin2005

Copy link
Copy Markdown
Contributor Author

@chenhz01 — thank you. You read config-health.py, found both bugs, wrote them
up clearly, and offered to do the work. I left you on read and then got it
wrong twice before landing. That part is mine.

Your diagnosis was correct on both counts.

${CLAUDE_PLUGIN_ROOT} was never expanded and SCRIPT_TOKEN matched the
literal — exactly as you described. Fixed in commit ab66f9f.

On your second point I partly disagreed, and the disagreement is with my
implementation, not with your idea:

  • I did build the tool_name gate, then removed it. In the wiring this repo's
    own docs recommend (matcher: "Edit|Write"), both tools are in the audited
    set, so the gate could never fire.
  • Your mtime-cache suggestion I agree with and could not use: the contract is
    read-only and a cache that outlives the process has to hit disk. My first
    draft did not honour that.
  • One defect in my version is worth recording because it was mine: setting
    CONFIG_HEALTH_AUDITED_TOOLS to "" deafened the monitor with no signal.
    You did not propose that variable.

The false-positive surface was larger than the two we found. On this repo's own
23 hook commands in hooks/hooks.json: 55 findings before, 0 after with
CLAUDE_PLUGIN_ROOT set. All 55 were the tokenizer scraping .js out of the
inside node -e "…p.join(r,'scripts/hooks/x.js')…" — I re-ran the old build to
check, and none of them came from a quoted path being cut at a space. That is a
real bug class the new tokenizer also fixes, but on this repo's hooks.json it
contributed none of these 55, and Program Files does not appear in that file at
all. A test reads hooks.json and asserts the after state (0 findings), so the
before-figure is not pinned by anything; what stops it drifting is that the old
tokenizer is no longer in the tree.

If you still want in: the remaining cost is that --pretool spawns Python on
every Edit and Write call — the two the documented matcher: "Edit|Write"
selects, not every tool the harness can make — and that spawn is ~42 ms of the
~55 ms. I do not have a design that avoids it, and it is a bigger win than
anything left inside the file.

Correction to my own wording, since I had it wrong above: I first wrote that
--pretool runs on every tool call. It does not, and saying so overstated the
cost of the thing I am asking you about. The docs had the same error in three
places; fixed in commit f36e5d5. The ~42 ms figure is per
invocation and is unchanged.

Comment thread scripts/config-health.py Outdated
Comment on lines +320 to +321
"""
words = _split_shell_words(command)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Split oversized monitor

The new monitor is 1,014 lines and its test file is 1,041 lines; scan_command also exceeds 50 lines. This violates the repository’s limits of 800 lines per file and fewer than 50 lines per function. Split these into focused files and functions. This repository requirement must be satisfied before merging.

File Used: AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/config-health.py
Line: 320-321

Comment:
**Split oversized monitor**

The new monitor is 1,014 lines and its test file is 1,041 lines; `scan_command` also exceeds 50 lines. This violates the repository’s limits of 800 lines per file and fewer than 50 lines per function. Split these into focused files and functions. This repository requirement must be satisfied before merging.

**File Used:** `AGENTS.md` ([source](https://github.com/affaan-m/ecc/blob/f36e5d55a7f7e370ccbd1e9b4ca684fce1f627b6/AGENTS.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@haelyra

haelyra commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Thank you for the measured cost breakdown and for exposing what the path audit leaves unjudged. Yes, please keep SessionStart as the documented default and remove PreToolUse from the recommended wiring. Running a configuration audit once per matched Edit or Write does not add tool-specific evidence, and your startup-only recommendation removes that recurring cost without creating a hidden disk cache.

The multi-root resolution can remain advisory if --check continues to expose cross-root matches and unresolved commands as you have documented. Please avoid describing zero findings as complete verification of plugin wiring: inline JavaScript bodies and missing provider placeholders remain unjudged. Keep optional PreToolUse invocation clearly opt-in, refresh onto current main with the canonical Claude data-root handling, and exercise the installed module in a disposable home through install, startup, repair and uninstall. In that fixture, a real missing plugin script should warn, an unresolved provider root should be reported as unjudged, and the default install should add no per-tool hook. That closes the default-cost decision while preserving the useful non-blocking monitor. Thank you for asking before changing the behavior.

@YuhaoLin2005

Copy link
Copy Markdown
Contributor Author

Hi haelyra — thank you for the careful read on 10 October, and I'm sorry for the silence since then. On 2 October I replied with a partial pass (ab66f9f); you came back with the remaining list; I then went quiet instead of finishing it. The reason is not a good excuse — I'm in my final year, and classes, autumn recruiting, and thesis defense prep took the time I had budgeted — but I should have posted a status rather than let it sit.

The branch now has current main merged in and is pushed, and the PR body is updated. Your August maintenance commits are still in the history. The head is e83576fe7d9b4b4df283200acf0cf940b0271e41. The executable ships at scripts/config-health.py, and agent.yaml, package.json, and manifests/install-modules.json register the config-health module with the catalog counts regenerated. Against your 10 October list:

  1. Default wiring and cost. SessionStart is the documented default. PreToolUse is no longer part of the recommended wiring; it remains as a clearly opt-in path, and the documented hook uses "matcher": "Edit|Write", so it runs only for the tool classes where a guard could matter. The payload is drained and discarded, never parsed or printed. The script still rescans the settings files on every matched call; the matcher narrows which calls reach it, it does not cache. I chose that over an mtime cache because the audit is a property of the settings files, and a cache adds its own invalidation failure mode. I did not gate on tool_name because the audit is about the configuration, not the tool. If you want the cache or the payload gate instead, say so and I will implement it. If you would rather remove the PreToolUse wiring from the skill entirely, that is also a clean option.

    You asked for the cost to go down; I did not deliver that. On this repository's 23 real hook commands (Python 3.12, Windows, interleaved A/B, median of 30 paired runs): the wiring audit is 4.33 ms → 3.83 ms, and the whole --pretool process is 50.6 ms → 54.7 ms, against python -c pass at 42.1 ms. That is +4.1 ms, about 8% slower on a matched call, not a reduction. What I delivered instead is a default that does not pay it, and the skill documents the number.

  2. Multi-root, unjudged, and zero findings. --check prints the cross-root count, unparsed commands, unresolved or single-quoted placeholders, substituted paths outside the audited roots, and node -e/python -c bodies that were skipped. The SKILL.md now says explicitly that zero findings is not complete verification of plugin wiring: inline JavaScript bodies and missing provider placeholders remain unjudged. --pretool only warns to stderr and stays non-blocking.

  3. Canonical data root. The monitor resolves the Claude data root as CLAUDE_CONFIG_DIR when set, else ~/.claude, and reads $CLAUDE_CONFIG_DIR/settings.json and the rule-health log under that root. The install note uses the same path. This is the canonical handling you asked for.

  4. Installed module, disposable home. The test runs the real install-apply.js → startup → repair.js → uninstall.js in a disposable home and data root. In that fixture: a real missing plugin script warns; an unresolved provider root is counted as not audited, not guessed; the default install adds no per-tool hook; and --pretool from the installed script runs against both an absolute project hook and a plugin-root hook. A separate test runs a real claude-project install into a disposable project and invokes --pretool with a project-relative .claude/scripts/config-health.py hook.

    The hook contract suite also covers present and missing scripts, malformed or absent settings, and absent rule directories. Every diagnostic exits 0, and --pretool never echoes the payload.

  5. The remaining gap. The plugin shape is covered by a plugin-root fixture and the repository's own 23 plugin hook commands, not by a full marketplace plugin install. I am stating that rather than calling all of item 3 done. If your item 3 requires the marketplace install specifically, tell me and I will add it before asking for another review.

This also answers chenhz01's 24 September points: ${CLAUDE_PLUGIN_ROOT} is expanded through an explicit environment map with CONFIG_HEALTH_PLUGIN_ROOT as an override, an unresolved provider placeholder is skipped and counted, and a substituted path outside the roots is skipped.

Locally: the hook suite is 71/71 (node tests/hooks/config-health.test.js), install-manifest validation passes (48 modules, 93 components, 7 profiles), catalog validation passes (71 agents, 98 commands, 315 skills), and skill validation passes (833 skill directories).

If the next check finds something, I will turn it around faster than this one. If you would rather move it into the maintainer queue at this point, I understand; the write-up and tests are on the branch either way. Thank you for keeping the contribution and attribution intact through two rounds.

@ecc-tools

ecc-tools Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / Security Evidence

Commit: e83576fe7d9b4b4df283200acf0cf940b0271e41

Security scanner evidence required (action_required)

Detected 1 security-sensitive predictive risk signal(s) without scanner evidence.

Mode: enforce

Findings:

  • Security-sensitive changes may ship without scanner evidence: The PR touches billing, secrets, auth, webhooks, agent, or CI-sensitive surfaces without adding obvious security scanner, code scanning, or security-focused validation evidence. (1 security-sensitive paths changed; 0 security scanner or security-focused validation artifacts changed)

Touched security-sensitive paths:

  • tests/hooks/config-health.test.js

Expected evidence:

  • Security scanner, code scanning, secret scanning, dependency/security review, or focused security regression output.
  • SARIF/code-scanning upload or equivalent pass/fail gate for the changed surface.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / PR Risk Taxonomy

Commit: e83576fe7d9b4b4df283200acf0cf940b0271e41

PR taxonomy review recommended (neutral)

Detected 7 PR taxonomy bucket(s): Security Evidence, Harness Drift, Install Manifest Integrity, CI/CD Recommendation, Reference Set Validation, Skill Quality, Agent Config Review.

Scanned 17 changed file(s).

Roadmap taxonomy buckets:

Security Evidence

Security-sensitive changes should carry explicit scanner, code-scanning, or focused regression evidence.

Signals:

  • Security-sensitive changes may ship without scanner evidence
  • 0 security-sensitive path(s) changed

Paths:

  • .claude-plugin/marketplace.json
  • .claude-plugin/plugin.json
  • .gemini/GEMINI.md

Harness Drift

Harness-facing changes can drift across Claude Code, Codex, OpenCode, and shared adapter surfaces.

Signals:

  • Harness config changes may ship without compatibility evidence
  • 4 harness-facing path(s) changed

Paths:

  • .claude-plugin/marketplace.json
  • .claude-plugin/plugin.json
  • AGENTS.md
  • skills/config-health/SKILL.md

Install Manifest Integrity

Install manifests, plugin metadata, and shipped skills should stay synchronized with user-facing setup guidance.

Signals:

  • 5 install or manifest path(s) changed

Paths:

  • .claude-plugin/marketplace.json
  • .claude-plugin/plugin.json
  • agent.yaml
  • package.json
  • skills/config-health/SKILL.md

CI/CD Recommendation

CI, dependency, coverage, and contract signals should be routed into follow-up checks or verification work.

Signals:

  • Dependency or CI drift could surface after merge
  • 2 CI or workflow path(s) changed

Paths:

  • package.json
  • tests/hooks/config-health.test.js
  • .claude-plugin/marketplace.json
  • .claude-plugin/plugin.json
  • agent.yaml
  • manifests/install-modules.json
  • manifests/install-profiles.json
  • scripts/config-health.py

Reference Set Validation

AI, analyzer, skill, agent, command, and harness guidance changes should be compared against a maintained eval, golden trace, benchmark, or reference set.

Signals:

  • AI or harness analysis changes may ship without reference-set validation
  • 1 reference-sensitive path(s) changed

Paths:

  • skills/config-health/SKILL.md

Skill Quality

Skill, agent, command, and rule guidance should carry examples, triggers, validation, or reference evidence.

Signals:

  • Skill or agent guidance may ship without quality evidence
  • 1 skill-quality path(s) changed

Paths:

  • skills/config-health/SKILL.md

Agent Config Review

Agent, command, skill, MCP, and local instruction changes should be reviewed as executable agent configuration.

Signals:

  • 2 agent-config path(s) changed

Paths:

  • AGENTS.md
  • skills/config-health/SKILL.md

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / Reference Set Readiness

Commit: e83576fe7d9b4b4df283200acf0cf940b0271e41

Reference set readiness gaps detected (neutral)

Reference evidence present for 0/7 areas (0%) across 17 changed file(s).

This check is based on files changed in this PR. Repository-level readiness is still reported by /ecc-tools analyze comments and generated manifests.

Area Status Evidence / Next Step
Deep analyzer corpus Missing Add analyzer fixture, golden, benchmark, or reference-set files that can catch analyzer regressions.
RAG/evaluator comparison Missing Add retrieval or evaluator reference-set comparison fixtures with expected ranking behavior.
PR salvage/review corpus Missing Add stale-PR, review-thread, reopen-flow, or salvage reference cases for queue cleanup automation.
Discussion triage corpus Missing Add public discussion triage fixtures, golden cases, or reference sets for informational, answered, and no-response classifications.
Harness compatibility Missing Add cross-harness, adapter-compliance, or harness-audit evidence for Claude, Codex, OpenCode, Zed, dmux, and agent surfaces.
Security evidence Missing Attach security evidence such as SBOMs, SARIF, audit reports, or AgentShield evidence packs.
CI failure-mode evidence Missing Add captured CI failure logs, dry-run fixtures, or troubleshooting docs for common workflow failure modes.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / Hosted Promotion Readiness

Commit: e83576fe7d9b4b4df283200acf0cf940b0271e41

Hosted promotion readiness passed (success)

No hosted promotion evidence gaps detected across 17 changed file(s); 0 corpus scenarios had matching evidence.

This check compares PR file changes against the evaluator/RAG promotion corpus in src/analyzers/fixtures/evaluator-rag-corpus.ts.
Hosted output scoring inspected 0 completed cached hosted job results.

No evaluator corpus scenarios matched this PR.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / PR Config Audit

Commit: e83576fe7d9b4b4df283200acf0cf940b0271e41

No changed-config issues detected (success)

Scanned 1 config file(s) present at this commit across 1 changed config path(s) and found no issues in the supported security rules.

Changed config files:

  • AGENTS.md

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / PR Harness Audit

Commit: e83576fe7d9b4b4df283200acf0cf940b0271e41

No harness issues detected (success)

Scanned 1 changed config file(s) and found no harness issues.

Changed config files:

  • AGENTS.md

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

Comment thread manifests/install-modules.json Resolved
Comment thread skills/config-health/SKILL.md Resolved
Comment thread scripts/config-health.py Resolved
Comment thread scripts/config-health.py Resolved
Comment thread scripts/config-health.py Resolved
- Add the config-health skill: a read-only monitor for hook wiring, rule references, and rule staleness; every mode exits 0.
- Ship its own SessionStart hook asset so installing the module registers the monitor; keep PreToolUse opt-in.
- Keep one install-state record per hook source, so hooks-runtime and config-health can share settings.json and uninstall removes both.
- Split the monitor into a CLI entry plus constants, paths, and scan modules; split scan_command and the hook contract suite. All files are under 800 lines and no function body reaches 50 lines.
`python3 ~/.claude/scripts/guard.py;` was discarded whole as a
separator-bearing word, so a missing hook reported healthy. The
separator now ends the word and the path is audited. Covers `;`,
`&&` and `|`.

Also document the hook-consent flag the installer requires: the bare
`npx ecc-universal install --modules config-health` command is refused
without --enable-hooks or --no-hooks.
@ecc-tools

ecc-tools Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / Security Evidence

Commit: 76398ce89c8da6c8b4b3b1dbb1bcbad5b11b4998

Security scanner evidence required (action_required)

Detected 1 security-sensitive predictive risk signal(s) without scanner evidence.

Mode: enforce

Findings:

  • Security-sensitive changes may ship without scanner evidence: The PR touches billing, secrets, auth, webhooks, agent, or CI-sensitive surfaces without adding obvious security scanner, code scanning, or security-focused validation evidence. (3 security-sensitive paths changed; 0 security scanner or security-focused validation artifacts changed)

Touched security-sensitive paths:

  • tests/hooks/config-health-helpers.js
  • tests/hooks/config-health-parser.test.js

Expected evidence:

  • Security scanner, code scanning, secret scanning, dependency/security review, or focused security regression output.
  • SARIF/code-scanning upload or equivalent pass/fail gate for the changed surface.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / PR Risk Taxonomy

Commit: 76398ce89c8da6c8b4b3b1dbb1bcbad5b11b4998

PR taxonomy review recommended (neutral)

Detected 8 PR taxonomy bucket(s): Security Evidence, Harness Drift, Install Manifest Integrity, CI/CD Recommendation, Cost/Token Risk, Reference Set Validation, Skill Quality, Agent Config Review.

Scanned 32 changed file(s).

Roadmap taxonomy buckets:

Security Evidence

Security-sensitive changes should carry explicit scanner, code-scanning, or focused regression evidence.

Signals:

  • Security-sensitive changes may ship without scanner evidence
  • 0 security-sensitive path(s) changed

Paths:

  • .claude-plugin/marketplace.json
  • .claude-plugin/plugin.json
  • .gemini/GEMINI.md

Harness Drift

Harness-facing changes can drift across Claude Code, Codex, OpenCode, and shared adapter surfaces.

Signals:

  • Harness config changes may ship without compatibility evidence
  • 4 harness-facing path(s) changed

Paths:

  • .claude-plugin/marketplace.json
  • .claude-plugin/plugin.json
  • AGENTS.md
  • skills/config-health/SKILL.md

Install Manifest Integrity

Install manifests, plugin metadata, and shipped skills should stay synchronized with user-facing setup guidance.

Signals:

  • 5 install or manifest path(s) changed

Paths:

  • .claude-plugin/marketplace.json
  • .claude-plugin/plugin.json
  • agent.yaml
  • package.json
  • skills/config-health/SKILL.md

CI/CD Recommendation

CI, dependency, coverage, and contract signals should be routed into follow-up checks or verification work.

Signals:

  • Dependency or CI drift could surface after merge
  • 5 CI or workflow path(s) changed

Paths:

  • package.json
  • tests/hooks/config-health-parser.test.js
  • tests/hooks/config-health.test.js
  • tests/scripts/install-apply.test.js
  • tests/scripts/uninstall.test.js
  • .claude-plugin/marketplace.json
  • .claude-plugin/plugin.json
  • agent.yaml

Cost/Token Risk

AI routing, usage, and token-budget changes should include budget or usage-limit evidence.

Signals:

  • Cost or token-risk changes may ship without budget evidence
  • 3 cost/token path(s) changed

Paths:

  • scripts/lib/install-targets/claude-home.js
  • scripts/lib/install-targets/claude-project.js
  • scripts/lib/install/claude-skill-migration.js

Reference Set Validation

AI, analyzer, skill, agent, command, and harness guidance changes should be compared against a maintained eval, golden trace, benchmark, or reference set.

Signals:

  • AI or harness analysis changes may ship without reference-set validation
  • 1 reference-sensitive path(s) changed

Paths:

  • skills/config-health/SKILL.md

Skill Quality

Skill, agent, command, and rule guidance should carry examples, triggers, validation, or reference evidence.

Signals:

  • Skill or agent guidance may ship without quality evidence
  • 1 skill-quality path(s) changed

Paths:

  • skills/config-health/SKILL.md

Agent Config Review

Agent, command, skill, MCP, and local instruction changes should be reviewed as executable agent configuration.

Signals:

  • 2 agent-config path(s) changed

Paths:

  • AGENTS.md
  • skills/config-health/SKILL.md

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / Reference Set Readiness

Commit: 76398ce89c8da6c8b4b3b1dbb1bcbad5b11b4998

Reference set readiness gaps detected (neutral)

Reference evidence present for 0/7 areas (0%) across 32 changed file(s).

This check is based on files changed in this PR. Repository-level readiness is still reported by /ecc-tools analyze comments and generated manifests.

Area Status Evidence / Next Step
Deep analyzer corpus Missing Add analyzer fixture, golden, benchmark, or reference-set files that can catch analyzer regressions.
RAG/evaluator comparison Missing Add retrieval or evaluator reference-set comparison fixtures with expected ranking behavior.
PR salvage/review corpus Missing Add stale-PR, review-thread, reopen-flow, or salvage reference cases for queue cleanup automation.
Discussion triage corpus Missing Add public discussion triage fixtures, golden cases, or reference sets for informational, answered, and no-response classifications.
Harness compatibility Missing Add cross-harness, adapter-compliance, or harness-audit evidence for Claude, Codex, OpenCode, Zed, dmux, and agent surfaces.
Security evidence Missing Attach security evidence such as SBOMs, SARIF, audit reports, or AgentShield evidence packs.
CI failure-mode evidence Missing Add captured CI failure logs, dry-run fixtures, or troubleshooting docs for common workflow failure modes.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / Hosted Promotion Readiness

Commit: 76398ce89c8da6c8b4b3b1dbb1bcbad5b11b4998

Hosted promotion readiness passed (success)

No hosted promotion evidence gaps detected across 32 changed file(s); 0 corpus scenarios had matching evidence.

This check compares PR file changes against the evaluator/RAG promotion corpus in src/analyzers/fixtures/evaluator-rag-corpus.ts.
Hosted output scoring inspected 0 completed cached hosted job results.

No evaluator corpus scenarios matched this PR.

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / PR Config Audit

Commit: 76398ce89c8da6c8b4b3b1dbb1bcbad5b11b4998

No changed-config issues detected (success)

Scanned 1 config file(s) present at this commit across 1 changed config path(s) and found no issues in the supported security rules.

Changed config files:

  • AGENTS.md

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@ecc-tools

ecc-tools Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

ECC Tools / PR Harness Audit

Commit: 76398ce89c8da6c8b4b3b1dbb1bcbad5b11b4998

No harness issues detected (success)

Scanned 1 changed config file(s) and found no harness issues.

Changed config files:

  • AGENTS.md

Check publication was denied or unavailable. An app owner must enable Checks: read and write, and the installation owner must approve the updated permission.

@YuhaoLin2005

Copy link
Copy Markdown
Contributor Author

Thanks for the 31 October review. All five findings from that round are fixed in 76398ce8, along with the 2 October “Split oversized monitor” and “Missing Hook Goes Unnoticed” findings.

Split oversized monitor

  • scripts/config-health.py — 553 lines: CLI entry, audit modes, settings/rule audits.
  • scripts/config_health_constants.py — 101 lines: constants, regexes, audit sets.
  • scripts/config_health_paths.py — 227 lines: path resolution and defensive reads.
  • scripts/config_health_scan.py — 263 lines: shell-command tokenising. scan_command is now a 49-line orchestrator over _scan_program_body and _word_tokens; the split is behaviour-preserving and covered by the parser suite.
  • Tests: tests/hooks/config-health.test.js 743 lines (48 tests), tests/hooks/config-health-parser.test.js 587 lines (31 tests), tests/hooks/config-health-helpers.js 163 lines. 79/79 pass.
  • The install manifest, npm files list, and standalone instructions copy the entry and all three helpers together. Helper imports sit behind the same non-blocking guard, and sys.dont_write_bytecode keeps the read-only monitor from leaving __pycache__ in the install directory.

31 October findings

  1. Installed monitor never starts — fixed. manifests/install-assets/config-health-hooks.json registers a SessionStart hook, merged into the target settings.json with the install root substituted. Hook consent gates it: --enable-hooks wires it, --no-hooks installs the payload only. A disposable-home test covers install → startup → repair → uninstall; a disposable-project test covers install → startup → pre-tool for the project target.
  2. Install command selects wrong package — fixed. SKILL.md now uses npx ecc-universal install --modules config-health --enable-hooks for the default SessionStart wiring, with the --no-hooks variant documented below it. The installer refuses to apply a hook-shipping module without one of those two flags, so the bare command would not have been runnable as written.
  3. Live hooks escape the audit — fixed. The audit reads the user settings.json, the project settings.json, the project .claude/settings.local.json, and the plugin’s hooks/hooks.json when the plugin root is known.
  4. Nested rule references go unchecked — fixed. The rule pattern accepts nested segments (.claude/rules/ecc/common/security.md), with tests for both missing nested and flat references.
  5. Recently fired rules look dead — fixed. Any positive count inside the five-record window — including a short session the complexity filter leaves out of the judgment — suppresses the warning. The wording is now “has not fired in the last five sessions”.

The same summary also lists two older 2 October findings, both covered here: a separator attached to a script path (python3 guard.py;) is now split off and the path is audited, with a regression test for ;, && and |; and the cross-root fallback count only counts a relative path when it actually resolved outside the project.

Verification on 76398ce8

  • node tests/hooks/config-health.test.js — 48/48
  • node tests/hooks/config-health-parser.test.js — 31/31
  • node tests/scripts/install-apply.test.js — 50/50
  • node tests/scripts/uninstall.test.js — 15/15
  • node scripts/ci/validate-install-manifests.js — 48 modules, 93 components, 7 profiles
  • npm pack --dry-run includes all three helper modules; pyflakes is clean.

One unchanged caveat: validate-context-profiles reports that manifests/context-packs/skill-triggers@1.json is stale — its registry digest no longer matches the generated registry. The same mismatch is on e83576fe, the merged base this branch sits on, so it is pre-existing and untouched here.

The branch head is now 76398ce8. If the next review finds anything, I will fix it on this branch.

"hooks": [
{
"type": "command",
"command": "python3 \"${CLAUDE_PLUGIN_ROOT}/scripts/config-health.py\" --startup",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Startup cannot find Python

If a host exposes Python 3 only as python, this new SessionStart command cannot launch the monitor because it hardcodes python3. Installation can succeed, but ordinary sessions get a startup error instead of configuration checks. Executing the materialized command with only a working python on PATH failed before the monitor ran; invoking the same installed script through python successfully reported the seeded configuration problem. Resolve an available Python 3 interpreter or provide a version-checked fallback.

Artifacts

Full executed reproduction script — local collector file

  • Saved during the original validation and contains the full executed harness; remote upload is not verified.

Hook output with python3 available — local collector file

  • Captured during the original validation and records successful hook execution; remote upload is not verified.

Hook output with only python available — local collector file

  • Captured during the original validation and records the interpreter-name failure and successful python control; remote upload is not verified.

Executable path-expansion reproduction

  • The executed harness materializes the real HEAD hook and compares direct and shell invocation in one disposable installation, isolating path expansion.

Direct invocation control with literal dollar-client path

  • The installed monitor was invoked directly with the literal script path and reported the deliberately missing guard, proving the monitor works.

Generated startup command with literal dollar-client path

  • The materialized command was executed through /bin/sh and Python attempted the expanded nonexistent path, proving startup monitoring fails.

Complete reproduction run and assertions

  • The harness captured both subprocess results and passed its behavioral assertions with exit code 0, confirming the path-expansion defect.

View artifacts

TREX Ran code and verified through TREX

Prompt To Fix With AI
This is a comment left during a code review.
Path: manifests/install-assets/config-health-hooks.json
Line: 10

Comment:
**Startup cannot find Python**

If a host exposes Python 3 only as `python`, this new SessionStart command cannot launch the monitor because it hardcodes `python3`. Installation can succeed, but ordinary sessions get a startup error instead of configuration checks. Executing the materialized command with only a working `python` on PATH failed before the monitor ran; invoking the same installed script through `python` successfully reported the seeded configuration problem. Resolve an available Python 3 interpreter or provide a version-checked fallback.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

"hooks": [
{
"type": "command",
"command": "python3 \"${CLAUDE_PLUGIN_ROOT}/scripts/config-health.py\" --startup",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Install paths change at startup

If the install directory contains shell expansion characters, this command can point Python at the wrong script. materializeManagedHooks inserts the root unchanged inside double quotes, which still allow expansion. In an executed fixture with a literal install-$client directory and client unset, the generated command tried to open install-/scripts/config-health.py and exited 2 instead of running the existing monitor. Direct invocation of the same installed script succeeded. Encode the root or escape it for the shell before inserting it.

Artifacts

Full executed reproduction script — local collector file

  • Saved during the original validation and contains the full executed harness; remote upload is not verified.

Hook output with python3 available — local collector file

  • Captured during the original validation and records successful hook execution; remote upload is not verified.

Hook output with only python available — local collector file

  • Captured during the original validation and records the interpreter-name failure and successful python control; remote upload is not verified.

Executable path-expansion reproduction

  • The executed harness materializes the real HEAD hook and compares direct and shell invocation in one disposable installation, isolating path expansion.

Direct invocation control with literal dollar-client path

  • The installed monitor was invoked directly with the literal script path and reported the deliberately missing guard, proving the monitor works.

Generated startup command with literal dollar-client path

  • The materialized command was executed through /bin/sh and Python attempted the expanded nonexistent path, proving startup monitoring fails.

Complete reproduction run and assertions

  • The harness captured both subprocess results and passed its behavioral assertions with exit code 0, confirming the path-expansion defect.

View artifacts

TREX Ran code and verified through TREX

Prompt To Fix With AI
This is a comment left during a code review.
Path: manifests/install-assets/config-health-hooks.json
Line: 10

Comment:
**Install paths change at startup**

If the install directory contains shell expansion characters, this command can point Python at the wrong script. `materializeManagedHooks` inserts the root unchanged inside double quotes, which still allow expansion. In an executed fixture with a literal `install-$client` directory and `client` unset, the generated command tried to open `install-/scripts/config-health.py` and exited 2 instead of running the existing monitor. Direct invocation of the same installed script succeeded. Encode the root or escape it for the shell before inserting it.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@haelyra
haelyra merged commit ba3042a into affaan-m:main Nov 16, 2026
3 checks passed
@haelyra

haelyra commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Thank you for contributing feat: add config-health — runtime config integrity monitoring. Your complete reviewed head is preserved with attribution in maintainer integration #3945.

I am sorry this waited for maintainer review. The delivered main commit now passes CI, CodeQL and a fresh Supply-Chain Watch after the focused coverage-report and dependency recovery in #3947. We appreciate your patience and your help improving ECC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants