arch-audit
БесплатноЗапускает вложенные скриптыНе проверенArchitecture dependency analysis to ensure proper feature isolation and composition root pattern.
от huseyindeniz★ 15 звёзд на GitHubОб этом скилле
Purpose
Enforce architectural boundaries and dependency rules across the codebase.
What it checks (8 checks, each with its own script):
- Core → Domain dependencies (core features cannot depend on domain features)
- Service imports (services only imported in composition root)
- Service boundaries (services can only import interfaces/types/config from features)
- Pages boundaries (pages can only import components/hooks/hocs from features)
- Model internals encapsulation (cross-feature cannot import model internals)
- Slice imports (slice.ts only imported in composition root)
- Sagas imports (sagas.ts only imported in composition root)
- Circular dependencies (A ↔ B or A → B → C → A)
What it doesn't check:
- Code quality patterns (relative imports, exports, etc.) - see
code-auditskill
Architecture Context
This template uses core/domain separation and composition root pattern:
Composition Root (src/config/)
- Top-level wiring layer (NOT a feature)
- Imports services, registers features, defines routes
- ALL architecture rules suspended here
Core Features (src/core/features/)
- Infrastructure: app, auth, components, i18n, layout, router, slice-manager
- Auto-discovered by scanning directory
Domain Features (src/domain/features/)
- Business logic: wallet, oauth, blog-demo, ai-assistant, site
- Auto-discovered by scanning directory
- Users create their own (products, orders, inventory, etc.)
Running Checks
All checks:
node ./.claude/skills/arch-audit/scripts/run_all_checks.mjs
Generate report:
node ./.claude/skills/arch-audit/scripts/generate_report.mjs
Individual checks:
node ./.claude/skills/arch-audit/scripts/check_core_to_domain.mjs
node ./.claude/skills/arch-audit/scripts/check_service_imports.mjs
node ./.claude/skills/arch-audit/scripts/check_service_boundaries.mjs
node ./.claude/skills/arch-audit/scripts/check_pages_boundaries.mjs
node ./.claude/skills/arch-audit/scripts/check_model_internals.mjs
node ./.claude/skills/arch-audit/scripts/check_slice_imports.mjs
node ./.claude/skills/arch-audit/scripts/check_sagas_imports.mjs
node ./.claude/skills/arch-audit/scripts/check_circular_deps.mjs
Architecture Rules
1. Core → Domain Dependencies
RULE: Core features (infrastructure) MUST NOT depend on domain features (business logic).
Allowed:
- ✅ Core → Core (infrastructure can use infrastructure)
- ✅ Domain → Core (business can use infrastructure)
Violations:
- ❌ Core → Domain (infrastructure cannot know about business)
Exception:
src/config/is composition root, can import anything
Check: check_core_to_domain.mjs
2. Service Imports (Dependency Injection)
RULE: Services (@/services/*) MUST ONLY be imported in composition root (src/config/).
Allowed:
- ✅
src/config/services.ts(root services) - ✅
src/config/{feature}/services.ts(feature-specific services)
Violations:
- ❌ Any file OUTSIDE
src/config/importing@/services/*
Why: Enforces dependency injection pattern - features receive services through interfaces.
Check: check_service_imports.mjs
3. Service Boundaries
RULE: Services can ONLY import interfaces, types, and config from features.
Allowed:
- ✅
@/(core|domain)/features/{feature}/I{Feature}Api.ts(interfaces) - ✅
@/(core|domain)/features/{feature}/types/*(feature types) - ✅
@/(core|domain)/features/{feature}/models/{model}/types/*(model types) - ✅
@/(core|domain)/features/{feature}/config(feature config) - ✅
@/services/*(other services) - ✅ External libraries
Violations:
- ❌
@/pages/* - ❌
@/hooks/* - ❌
@/(core|domain)/features/{feature}/models/{model}/actions.ts - ❌
@/(core|domain)/features/{feature}/models/{model}/slice.ts - ❌
@/(core|domain)/features/{feature}/models/{model}/actionEffects/* - ❌
@/(core|domain)/features/{feature}/hooks/* - ❌
@/(core|domain)/features/{feature}/components/*
Why: Services implement interfaces - they work with data contracts (interfaces + types + config), not implementation details.
Check: check_service_boundaries.mjs
4. Pages Boundaries
RULE: Pages can ONLY import presentation layer (components, hooks, hocs) from features.
Allowed:
- ✅
@/(core|domain)/features/{feature}/components/* - ✅
@/(core|domain)/features/{feature}/hooks/* - ✅
@/(core|domain)/features/{feature}/hocs/* - ✅
@/(core|domain)/features/{feature}/config - ✅
@/hooks/*(root hooks) - ✅ External libraries
Violations:
- ❌
@/services/* - ❌
@/(core|domain)/features/{feature}/models/* - ❌
@/(core|domain)/features/{feature}/types/* - ❌
@/(core|domain)/features/{feature}/slice.ts - ❌
@/(core|domain)/features/{feature}/sagas.ts - ❌
@/(core|domain)/features/{feature}/I{Feature}Api.ts
Why: Pages are presentation layer - they orchestrate UI, not business logic. All business logic should be in feature hooks.
Установить arch-audit в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл arch-audit?
Architecture dependency analysis to ensure proper feature isolation and composition root pattern.
Как установить скилл arch-audit?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл arch-audit запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic