/codeprobe:codeprobe-architecturefrom codeprobe
Analyzes code architecture for layer violations, circular dependencies, god objects, anemic domain models, missing boundaries, directory structure issues, and configuration problems. Generates severity-scored findings with fix prompts.
Ships in codeprobe. 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.
If invoked directly (not via the orchestrator), you must first:
../codeprobe/shared-preamble.md (resolve relative to this SKILL.md's location — the sibling codeprobe skill directory — not the user's project) for the output contract, execution modes, and constraints.../codeprobe/references/ (same resolution) based on the project's tech stack.full mode unless the user specifies otherwise.This sub-skill detects architectural and structural issues across these categories:
dist/, build/, .next/, __pycache__/).| ID Prefix | What to Detect | How to Detect | Severity |
|---|---|---|---|
ARCH | Controllers containing business logic | Scan files in controller directories (controllers/, Controllers/, routes/, api/). Flag controllers that contain: database queries (SQL, ORM query builders beyond simple find()/findById()), complex conditionals with business rules (3+ branches), calculations, data transformations, or validation logic beyond simple field presence checks. Controllers should delegate to services/actions. | Major |
ARCH | Models/entities containing presentation logic | Scan model/entity files. Flag models that contain: HTML generation, string formatting for display (e.g., toHtml(), formatForDisplay()), view-specific transformations, CSS class computation, or response formatting. Models should contain domain logic, not presentation. | Major |
ARCH | Views/components calling database directly | Scan view files (.blade.php, .vue, .jsx/.tsx components, .ejs, .pug, Jinja templates). Flag views that contain: direct database queries, ORM calls, raw SQL, or repository method calls. Views should receive data from controllers/props, never fetch it themselves. | Major |
| ID Prefix | What to Detect | How to Detect | Severity |
|---|---|---|---|
ARCH | Module A imports B, B imports A (direct or transitive) | Prefer the pre-loaded dependency graph (see "Dependency Graph" subsection below). When present, the graph includes a circular_dependencies array with each cycle's full file-path chain — report one ARCH finding per cycle with that chain as evidence. When the graph is absent (degraded mode), fall back to tracing import/require/use statements across files and looking for direct cycles (A→B→A) and transitive cycles (A→B→C→A). Focus on module-level (directory-level) cycles which are more architecturally significant than file-level cycles within the same module. | Major |
When invoked via /codeprobe audit or /codeprobe architecture, the orchestrator pre-computes the import graph by running scripts/dependency_mapper.py and provides the JSON in-context between === DEPENDENCY_GRAPH === and === END DEPENDENCY_GRAPH === markers. The JSON schema:
graph: {file_path: [files it imports]} — the full dependency graph.circular_dependencies: list of cycle objects, each with the full file-path chain (e.g., ["a.py", "b.py", "c.py", "a.py"]).summary: {total_files, total_cycles, most_imported, most_dependencies} — aggregate stats.When the graph is present, treat it as ground truth: every cycle in circular_dependencies becomes an ARCH finding. Do NOT attempt your own cycle detection — the script runs deterministic DFS and is more reliable than LLM import-tracing.
When the graph is absent (script failed, Python 3 missing, or degraded mode), fall back to LLM-based import tracing as described in the Circular Dependencies row above.
| ID Prefix | What to Detect | How to Detect | Severity |
|---|---|---|---|
ARCH | File exceeds 500 LOC | Count total lines in each source file (excluding blank lines and comments). Flag files exceeding 500 LOC. Note the overage in the finding (a 2,000-LOC file is a stronger Major than a 550-LOC one), but never escalate beyond Major — oversized files are a maintainability risk, not a production defect. | Major |
ARCH | Class with 20+ methods | Count public, protected, and private methods in each class. Flag classes with 20+ methods. List the method groups to suggest how the class could be split. | Major |
ARCH | Single file handling request-to-response lifecycle | Look for files that handle the full request lifecycle: receiving/parsing the request, validating input, executing business logic, performing persistence, formatting the response, and logging — all in one file or class. Flag when 4+ of these concerns are in a single file. | Major |
| ID Prefix | What to Detect | How to Detect | Severity |
|---|---|---|---|
ARCH | Entity/model classes with only getters/setters, zero behavior | Scan model/entity classes. If a class has only property declarations, getters, setters, and constructor assignment — with no business logic methods (no validation, no calculations, no state transitions, no domain rules) — it is an anemic entity. | Minor |
ARCH | All logic in "Service" classes operating on dumb data bags | Check if the codebase has a pattern where entity classes are pure data containers and all behavior (validation, calculation, state transitions) lives in separate *Service classes that manipulate the entity externally. Flag when this pattern is pervasive (3+ services operating on the same entity). | Minor |
| ID Prefix | What to Detect | How to Detect | Severity |
|---|---|---|---|
ARCH | No clear module/domain separation in medium+ projects | For projects with 20+ source files, check whether the code is organized into modules, domains, or bounded contexts. If all source files live in a single flat directory or are only separated by technical layer (controllers/, models/, services/) with no domain grouping, flag it. | Major |
ARCH | Shared database tables accessed directly across unrelated features | Search for the same database table name, model, or entity being imported/queried from multiple unrelated modules or feature directories. If users table is accessed from billing/, notifications/, reports/, and admin/ without going through a shared user module, flag it. | Major |
ARCH | Cross-feature direct imports instead of events/interfaces | Check whether feature modules import directly from other feature modules' internal files. For example, billing/InvoiceService importing shipping/ShippingCalculator directly instead of through an interface or event system. Flag tight inter-feature coupling. | Minor |
| ID Prefix | What to Detect | How to Detect | Severity |
|---|---|---|---|
ARCH | Framework conventions violated | Check whether the project follows its framework's expected directory structure. Examples: business logic classes in a Controllers/ directory, SQL queries in view templates, route definitions scattered across non-route files, test files mixed with source files without naming convention. | Minor |
ARCH | No separation between layers for 20+ files | For projects with 20+ source files, check whether there is any directory-based separation between layers (controllers, services, models, views) or domains. If everything lives in one flat directory, flag it. | Major |
| ID Prefix | What to Detect | How to Detect | Severity |
|---|---|---|---|
ARCH | Hardcoded environment-specific values in source code | Search for hardcoded URLs (http://localhost, https://api.example.com), port numbers (:3000, :8080, :5432), hostnames, IP addresses, and file system paths in source code files (not config files). These should come from environment variables or config. | Major |
ARCH | Missing environment abstraction | Check whether the project has an environment abstraction layer (.env file + config loader, environment variables, config service). If source files read process.env.X or os.environ['X'] directly in 5+ places without a centralized config module, or if there is no .env/config layer at all, flag it. | Minor |
file_stats.pyWhen available, run the file_stats.py script via Bash to get LOC, class count, and method count per file. The script is located in the codeprobe skill's scripts/ directory (resolve relative to the skill installation, not the user's project):
python3 scripts/file_stats.py <target_path>
Note: The orchestrator typically runs this script and passes results. If invoked standalone, locate the script in the sibling codeprobe/scripts/ directory.
Use this data to:
If Python 3 or the file_stats.py script is unavailable, estimate from reading files directly using Read. Do not fail the analysis — proceed with manual counting.
All findings use the ARCH- prefix, numbered sequentially: ARCH-001, ARCH-002, etc.
OrderController@store (lines 40-75) into a new PricingService class under app/Services/. The controller should inject PricingService and call $this->pricingService->calculate($order). The controller should only handle request parsing, service delegation, and response formatting."UserManager (850 LOC) into focused services: extract authentication methods (lines 50-200) into UserAuthService, profile management (lines 201-450) into UserProfileService, and notification methods (lines 451-700) into UserNotificationService. UserManager becomes a thin facade that delegates to these three services."billing/InvoiceService and shipping/ShippingCalculator: extract the shared interface ShippingCostProvider into a shared/contracts/ directory. Have ShippingCalculator implement ShippingCostProvider, and have InvoiceService depend on the interface instead of the concrete class."http://localhost:3000/api at line 23 of src/services/ApiClient.ts with an environment variable: use process.env.API_BASE_URL loaded through the config module. Add API_BASE_URL=http://localhost:3000/api to .env.example."UserController, UserService, UserRepository, and UserPolicy into a app/Domains/User/ directory. Repeat for Order, Payment, and Notification domains. Each domain directory should contain its own controllers, services, models, and policies."What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub machineroom-dev/codeprobe --plugin codeprobe10 skills in this plugin
/codeprobeWhole-codebase code quality audit system with 9 specialized sub-skills covering security, SOLID principles, architecture, error handling, performance, test quality, code smells, design patterns, and framework best practices. Produces a scored health dashboard (0-100 per category), severity-rated findings (P0-P3) with severity rationales, and copy-pasteable fix prompts; also does PR-style diff review vs a base branch. Strictly read-only — never modifies user code. Use when the user says "codeprobe", "audit", "full code review", "code health", "check my code", "security scan", "code smells", "SOLID check", or asks how healthy, risky, or maintainable a codebase is. (For reviewing just the working diff, the built-in /code-review may be more appropriate unless the user asks for codeprobe.)
/codeprobe-code-smellsDetects code smells and anti-patterns — long methods, large classes, feature envy, data clumps, primitive obsession, dead code, magic numbers, deep nesting, and more. Uses configurable thresholds from .codeprobe-config.json when available. Trigger phrases: "code smells", "smell check", "anti-patterns", "clean code review".
/codeprobe-error-handlingScans code for error handling and resilience issues — swallowed exceptions, missing try/catch on external calls, unhandled promise rejections, missing transactions, validation gaps, retry/timeout omissions, and logging blind spots. Generates severity-scored findings with copy-pasteable fix prompts. Trigger phrases: "error handling check", "exception audit", "resilience check", "try/catch review", "error handling audit".