/gabbe-architecture:arch-debtfrom gabbe-architecture
Analyzes architecture debt by detecting circular dependencies, layer violations, and god classes. Generates coupling metrics and phased migration plans for structural, behavioral, and evolutionary debt.
Ships in gabbe-architecture. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Identify architectural anti-patterns through dependency analysis and propose concrete, phased migration paths. Architecture debt is more expensive than code debt — it blocks entire teams.
Run import/dependency graph analysis
JavaScript/TypeScript:
# Circular dependency detection
npx [email protected] --circular --extensions ts,js,tsx src/
# Full dependency graph visualization
npx [email protected] --image dependency-graph.svg --extensions ts,js src/
# Dependency rules enforcement
npx dependency-cruiser --config .dependency-cruiser.cjs src/
PHP:
# Deptrac for DDD layer enforcement
vendor/bin/deptrac analyse
# PHPStan for dependency analysis
vendor/bin/phpstan analyse --level=9
# PHP Metrics for coupling
vendor/bin/phpmetrics --report-html=metrics-report/ app/
Python:
# Import Linter for layer enforcement
lint-imports --config .import-linter.ini
# Pydeps for visualization
pydeps src/ --noshow --max-bacon 2 --output dependency-graph.svg
Analyze coupling metrics
For each module/class, calculate:
Target: Core domain (stable = abstract), infrastructure (unstable = concrete)
Classify architecture debt types
Structural Debt (wrong layers):
Behavioral Debt (wrong responsibilities):
Evolutionary Debt (outdated patterns):
Identify specific anti-patterns
God Object → Split by Single Responsibility:
UserService.ts (800 lines, handles: auth, profile, billing, notifications)
→
UserAuthService.ts (authentication logic)
UserProfileService.ts (profile management)
UserBillingService.ts (billing operations)
UserNotificationService.ts (notification orchestration)
Fat Controller → Extract Use Cases:
OrderController.create() (80 lines of business logic)
→
CreateOrderUseCase.execute() (business logic extracted)
OrderController.create() (5 lines: validate input, call use case, format response)
Circular Dependency → Extract Shared Abstraction:
UserService → OrderService → UserService (circular)
→
IUserQueryPort (interface in domain layer)
UserService implements nothing from OrderService
OrderService depends on IUserQueryPort (implemented by UserService)
Strangler Fig for large migrations:
Legacy monolith → New modular structure (gradual migration)
Step 1: Add facade/gateway in front of legacy code
Step 2: Route NEW requests to new module
Step 3: Gradually migrate existing logic to new module
Step 4: Remove legacy code when fully migrated (propose the exact removal command; run it only after the human confirms)
Prioritize architecture debt
Use same Impact×Effort as tech-debt.skill:
Create ADR for major migration approach
Create tasks in project/TASKS.md (15-min rule applies to architecture work too)
Generate architecture debt report
## Architecture Debt Report
### Circular Dependencies Found
- [CRITICAL] src/users/UserService.ts <-> src/orders/OrderService.ts
Fix: Extract IUserQueryPort interface
### Layer Violations
- [HIGH] src/domain/User.ts imports from src/infrastructure/PrismaClient
Fix: Apply Dependency Inversion (create repository interface in domain)
### God Objects
- [HIGH] UserService.ts: 28 public methods, 4 unrelated responsibilities
Fix: Extract into 4 specialized services
### Instability Analysis
- UserService: Ca=12, Ce=8, Instability=0.4 (acceptable)
- OrderRepository: Ca=3, Ce=15, Instability=0.83 (too high — too many deps)
### Migration Roadmap
Phase 1 (this sprint): Fix circular deps (2 days)
Phase 2 (next sprint): Split UserService God object (3 days)
Phase 3 (following sprint): Fix layer violations via DI (4 days)
Architecture debt report + prioritized migration roadmap + ADR for major changes + tasks in project/TASKS.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub andreibesleaga/gabbe --plugin gabbe-architecture30 skills in this plugin
/adaptive-architectureDesign offline-first and local-first systems — sync strategy (CRDT or last-write-wins), WASM plugin boundaries, edge versus cloud AI split. Use when an app must work offline, sync between devices, or run plugins or models on the user's device./api-standardsReview of OpenAPI or GraphQL schemas against naming, status code, versioning, pagination and error standards, with an updated spec. Use when API conventions must be checked across services or API governance rules set./architecture-governanceEnforce layer and dependency rules as architecture tests in CI (ArchUnit, dependency-cruiser, Deptrac). Use when a layering rule keeps being broken or a pipeline needs an architecture gate./arch-patternsShortlist of one or two architecture patterns (modular monolith, microservices, event-driven, serverless, CQRS) with pros and cons for the project. Use when someone asks which architecture style fits the requirements./arch-reviewATAM-lite review of an existing architecture — scenario verdicts, smells, sensitivity and tradeoff points, fitness functions and prioritised recommendations. Use when you must judge whether an architecture still fits its requirements before a change, growth or a commitment./attribute-driven-designADD 3.0 workbook that traces each structural decision to a quality scenario, one element per round. Use when architecture must be derived step by step from drivers and each choice must be explainable.Other plugins' skills for the same job