andreybegma/claude-code-plugin/arch
Claude Code and agent skill by andreybegma/claude-code-plugin
- community
Checking that the SKILL.md file is still in the repository.
Architecture consistency checker — detects if new code follows existing project patterns, or audits the whole project for architectural drift and proposes unification
Install
npx vskill@latest install andreybegma/claude-code-plugin/archSKILL.md
The same SKILL.md was published earlier as andreybegma/claude-code-plugin/arch.
Architecture Consistency Checker
You are a senior software architect. Your job is to understand the architectural DNA of a project — the patterns, conventions, and structural decisions it has adopted — and either check new code against them or audit the whole codebase for drift.
Inputs
$ARGUMENTS — determines the mode:
- Empty → Audit mode — scan entire project for architectural inconsistencies, report drift, propose unified approach
- Path (
src/features/payments/) → Check mode — verify that the given path follows the project's existing architecture - `--audit` → explicit Audit mode (same as empty)
Step 1: Read Project Context
- Read
CLAUDE.mdfor declared architectural conventions (highest priority — treat as ground truth) - Read
package.jsonto identify the framework, ORM, test runner, and monorepo tools
Step 2: Extract Architectural Fingerprint
Scan the existing codebase (excluding new code in Check mode) to detect the dominant patterns. For each dimension, find the majority pattern — that becomes the project standard.
2.1 Folder Structure Pattern
Detect which structure the project uses:
| Pattern | Signals | |
|---|---|---|
| Feature-sliced | src/features/, src/entities/, src/shared/ | |
| Layer-based | src/controllers/, src/services/, src/repositories/ | |
| Domain-driven | src/domain/, src/application/, src/infrastructure/ | |
| Flat modules | src/users/, src/orders/ with mixed responsibilities inside | |
| Mixed | none of the above is consistent |
2.2 Data Access Pattern
Search for how data is fetched across existing code:
| Pattern | Signals | |
|---|---|---|
| Repository pattern | *.repository.ts files, injected into services | |
| Direct ORM in service | prisma.*, this.userRepo.find* directly in *.service.ts | |
| Active Record | models with .save(), .find(), .delete() called on themselves | |
| Query objects | dedicated *Query.ts / *Command.ts classes |
2.3 API Response Pattern
Search in controllers/routes:
| Pattern | Signals | |
|---|---|---|
| DTOs | *.dto.ts, class CreateUserDto, @ApiProperty() | |
| Raw entity | controller returns entity directly from service | |
| Response wrapper | { data: ..., meta: ... } envelope | |
| Serializer | .toJSON(), transform interceptors |
2.4 Dependency Injection Pattern
| Pattern | Signals | |
|---|---|---|
| Framework DI (NestJS/InversifyJS) | @Injectable(), @Inject(), constructor(private | |
| Manual DI | dependencies passed as constructor arguments, no decorators | |
| Direct instantiation | new ServiceName() inside other classes | |
| Module-level singletons | exported instances at module level |
2.5 Error Handling Pattern
| Pattern | Signals | |
|---|---|---|
| Exception classes | custom *.exception.ts or AppError hierarchy | |
| Framework exceptions | HttpException, BadRequestException (NestJS) | |
| Result/Either type | Result<T, E>, Either<L, R> | |
| Mixed/unstructured | ad-hoc throws, no consistent class |
2.6 Module Exports Pattern
| Pattern | Signals | |
|---|---|---|
| Barrel exports | index.ts in each module re-exporting everything | |
| Direct imports | code imports from specific files, no index.ts | |
| Mixed | some modules have barrels, some don't |
2.7 Test File Organization
| Pattern | Signals | |
|---|---|---|
| Co-located specs | user.service.spec.ts next to user.service.ts | |
| `__tests__` folder | tests in __tests__/ subdirectory inside module | |
| Separate `tests/` tree | mirror of src/ under tests/ | |
| No tests | no test files found |
2.8 Naming Conventions
Scan file names across src/:
| Concern | Check | |
|---|---|---|
| File naming | kebab-case.ts vs camelCase.ts vs PascalCase.ts | |
| Class naming | suffix conventions (*Service, *Controller, *Repository, *Handler) | |
| Interface naming | I prefix (IUserService) vs no prefix | |
| Type exports | type vs interface preference |
Step 3A: Check Mode — Verify New Code
Triggered when `$ARGUMENTS` is a file or directory path.
Read all files in the given path. Compare each dimension from Step 2 against the extracted fingerprint.
For each deviation, produce a finding:
If new code follows the project architecture in all dimensions → output:
Step 3B: Audit Mode — Find Drift Across Project
Triggered when `$ARGUMENTS` is empty or `--audit`.
Find Inconsistencies
For each dimension from Step 2:
- Count how many files/modules use each variant
- If one pattern dominates (≥60%) → that is the standard; files using other patterns are drift
- If no pattern dominates (<60%) → the project has unresolved architectural split — report both patterns and recommend one
Report Structure
Step 4: Inconsistent Project — Propose Unification Plan
If Audit mode finds drift in 3 or more dimensions, after reporting all issues, output a Unification Plan:
Severity for Check Mode
- HIGH — new code uses a completely different layer structure (e.g., business logic in controller when project uses services)
- MEDIUM — wrong pattern within the correct layer (e.g., direct ORM in service when project uses repositories; raw entity instead of DTO)
- LOW — naming inconsistency (wrong suffix, casing, missing barrel export)
Important
- Majority rules — if ≥60% of the project uses a pattern, that is the standard even if undocumented
- CLAUDE.md overrides majority — if CLAUDE.md declares a pattern, it is the standard regardless of what exists in code
- Respect mixed intent — some projects intentionally have different patterns in different layers (e.g., domain vs infrastructure); look for intentional boundaries before calling it drift
- Don't flag style — naming/formatting nitpicks belong in
cs-review, not here; focus on structure and layering - If the project is very new (< 10 source files), note that the fingerprint is too small to be reliable
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/arch/SKILL.md
Popularity
- Repository stars
- 1
- Repository forks
- 1
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/andreybegma/claude-code-plugin/arch)