docs/ARCHITECTURE-IMPROVEMENTS.md
This document captures architect-level improvements for the Everything Claude Code (ECC) project. It is written from the perspective of a Claude Code coding architect aiming to improve maintainability, consistency, and long-term quality.
Issue: AGENTS.md states "13 specialized agents, 50+ skills, 33 commands" while the repo has 16 agents, 65+ skills, and 40 commands. README and other docs also vary. This causes confusion for contributors and users.
Recommendation:
scripts/ci/catalog.js) that scans agents/*.md, commands/*.md, and skills/*/SKILL.md and outputs JSON/Markdown. CI and docs can consume this.docs/catalog.json (or YAML) that lists agents, commands, and skills with metadata; scripts and docs read from it. Requires discipline to update on add/remove.Impact: High — affects first impression and contributor trust.
Issue: There is no single machine- or human-readable map of "which command uses which agent(s) or skill(s)." This lives in README tables and individual command .md files, which can drift.
Recommendation:
docs/ or as frontmatter in command files) that lists for each command: name, description, primary agent(s), skills referenced. Can be generated from command file content or maintained by hand.docs/COMMAND-AGENT-MAP.md) or in the generated catalog for discoverability and for tooling (e.g. "which commands use tdd-guide?").Impact: Medium — improves discoverability and refactoring safety.
Issue: tests/run-all.js uses a hardcoded list of test files. New test files are not run unless someone updates run-all.js, so coverage can be incomplete by omission.
Recommendation:
**/*.test.js under tests/) and run them, with an optional allowlist/denylist for special cases. This makes new tests automatically part of the suite.tests/run-all.js) that runs discovered tests and aggregates results.Impact: High — prevents regression where new tests exist but are never executed.
Issue: There is no coverage tool (e.g. nyc/c8/istanbul). The project cannot assert "80%+ coverage" for its own scripts; coverage is implicit.
Recommendation:
c8 or nyc) and run it in CI. Start with a baseline (e.g. 60%) and raise over time; or at least report coverage in CI without failing so the team can see trends.scripts/ (lib + hooks + ci) as the primary target; exclude one-off scripts if needed.Impact: Medium — aligns the project with its own AGENTS.md guidance (80%+ coverage) and surfaces untested paths.
Issue: schemas/hooks.schema.json exists and defines the hook configuration shape, but scripts/ci/validate-hooks.js does not use it. Validation is duplicated (VALID_EVENTS, structure) and can drift from the schema.
Recommendation:
ajv) in validate-hooks.js to validate hooks/hooks.json against schemas/hooks.schema.json. Keep the validator as the single source of truth for structure; retain only hook-specific checks (e.g. inline JS syntax) in the script.$schema in hooks.json.Impact: Medium — reduces drift and improves contributor experience when editing hooks.
Issue: .agents/skills/ (Codex) and .cursor/skills/ are subsets of skills/. Adding or removing a skill in the main repo requires manually updating these subsets, which can be forgotten.
Recommendation:
.agents/skills and .cursor/skills (and how to do it).skills/ to the subsets and fails or warns if a skill is in one set but not the other when it should be (e.g. by convention or by a small manifest).Impact: Low–Medium — reduces cross-harness drift.
Issue: Translations in docs/ duplicate agents, commands, skills. As the English source evolves, translations can become outdated without clear process or tooling.
Recommendation:
docs/i18n-status.md) or CI that checks translation file existence/timestamps and warns if English was updated more recently than a translation.Impact: Medium — improves experience for non-English users and reduces confusion from outdated translations.
Issue: Most hooks invoke Node scripts via run-with-flags.js; one path uses run-with-flags-shell.sh + observe.sh. The mixed runtime is documented but could be simplified over time.
Recommendation:
ECC_HOOK_PROFILE and ECC_DISABLED_HOOKS are respected in all code paths (including shell) so behavior is consistent.Impact: Low — maintains current design; improves if more hooks migrate to Node.
| Area | Improvement | Priority | Effort |
|---|---|---|---|
| Doc sync | Sync AGENTS.md/README counts & table | High | Low |
| Single source | Catalog script or manifest | High | Medium |
| Test discovery | Glob-based test runner | High | Low |
| Coverage | Add c8/nyc and CI coverage | Medium | Medium |
| Hook schema in CI | Validate hooks.json via schema | Medium | Low |
| Command map | Command → agent/skill registry | Medium | Medium |
| Subset sync | Document/CI for .agents/.cursor | Low–Med | Low–Med |
| Translations | Process + stale detection | Medium | Medium |
| Hook runtime | Prefer Node; document shell use | Low | Low |
run-all.js to discover **/*.test.js under tests/ (with optional allowlist) so new tests are always run.validate-hooks.js, validate hooks/hooks.json against schemas/hooks.schema.json using ajv (or similar) and keep only hook-specific checks in the script.These three can be done in one or two sessions and materially improve consistency and reliability.