detect-overengineering
Skill1 starsChanged 5 days agoMITView on GitHub
Use when the user asks to "check for over-engineering", "detect over-engineering", "find over-engineered code", "simplify this code", "audit for over-engineering", "check yagni violations", "reduce accidental complexity", "eliminate premature abstractions", "check code bloat", "is this over-engineered", "refactor for simplicity", or wants to analyze source files or projects for unnecessary layers, trampoline indirection, and design pattern overkill.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Smirnov-Labs/claude-skillstheir own version, first seen Nov 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Smirnov-Labs/claude-skills★ 6same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository32 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-orchestratorSkill
- algorithmic-complexity-analyzerSkill
- api-securitySkill
- architectural-planningSkill
- caching-queues-reviewerSkill
- code-reviewerSkill
- csharp-developerSkill
- design-pattern-detectorSkill
- github-security-scanner-hookSkill
- java-developerSkill
- legacy-code-modernizationSkill
- llm-as-judgeSkill
- load-memorySkill
- nodejs-executorSkill
- playwright-bdd-testerSkill
- powershell-writerSkill
- python-api-writerSkill
- python-developerSkill
- python-linterSkill
- react-developerSkill
- remote-pod-log-analyzerSkill
- save-memorySkill
- scan-halucinated-testsSkill
- scan-repo-readmeSkill
- skill-creatorSkill
- sql-connectorSkill
- sql-executorSkill
- sync-github-forksSkill
- trace-code-contextSkill
- troubleshoot-and-fixSkill
- typescript-developerSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
Single-Implementation Interfaces: Not all 1:1 interfaces are over-engineering.
- Distinctive: line 49
Run the deterministic extractor with the target file path:
- Very specific: line 80
If stale: false and the user did not specify --force, read the existing report at output_path and present the findings.
- Very specific: line 81
If stale: true, read the source file content and cross-reference the extracted smells and signals against the Taxonomy of Over-Engineering …
- Very specific: line 99
Write a markdown report to the path indicated by output_path (.overengineering-analysis/<path>.md):
- Distinctive: line 143
Before/After simplification code snippet
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Detect Over-Engineering
Analyze source files and architectures to detect over-engineering, premature abstractions, speculative generality (YAGNI violations), layer bloat, trampoline pass-through methods, and pattern overkill. Uses deterministic structural extraction (Python AST for Python, structural regex for TS/JS, Java, C#, Go) coupled with contextual reasoning to calculate an over-engineering risk score and provide concrete, simplified refactoring diffs.
When to Use This Skill
- User asks whether a piece of code or architecture is over-engineered.
- Code review / refactoring tasks focused on code simplification and reduction.
- Identifying YAGNI violations, single-implementation interfaces, and pass-through delegation.
- Auditing new or legacy codebases for accidental complexity before adding features.
- Quantifying boilerplates, builder ceremony, and anemic DTO layers.
- Embedded anti-bloat guardrail for all language writer skills (
typescript-developer,python-developer,java-developer,csharp-developer,react-developer).
Agent Guidance: Essential vs Accidental Complexity
Over-engineering is context-dependent. The structural extractor generates signals and metrics, but the agent must evaluate them as heuristics, not deterministic verdicts:
- Essential vs Accidental Complexity: Essential complexity stems from the problem domain (e.g., banking compliance, distributed state, cryptography). Accidental complexity is introduced by speculative patterns, redundant layers, and premature generality.
- Single-Implementation Interfaces: Not all 1:1 interfaces are over-engineering. They are justified when serving as:
- Architectural ports/boundaries (Hexagonal/Clean Architecture).
- Mocking seams for external I/O (payment gateways, cloud storage, databases).
- Flag as over-engineering only when they exist purely out of habit for internal trivial services with no test boundary or polymorphism benefit.
- Builders & Factories: Justified when constructing complex immutable objects with invariant validation or multi-step configuration. Discourage when simple constructors, object literals, or keyword arguments are sufficient.
- Layer Indirection: Distinct layers (controller $\to$ service $\to$ repository) are healthy in growing applications, but become accidental complexity when 3+ layers simply forward identical arguments with zero business logic or transformation (trampoline methods).
Prerequisites
- Python 3.8+ available on PATH or in
.venv - Target source file or directory path
Workflow — Single-File Mode
Step 1 — Run extract-signals.py
Run the deterministic extractor with the target file path:
[ -d .venv ] || python -m venv .venv
PYTHON=$(if [ -f .venv/Scripts/python ]; then echo .venv/Scripts/python; else echo .venv/bin/python; fi)
$PYTHON .github/skills/detect-overengineering/scripts/extract-signals.py "<file-path>" --prettyOn Windows (PowerShell):
python .github/skills/detect-overengineering/scripts/extract-signals.py "<file-path>" --prettyTo force re-analysis even if the report is up to date, pass --force:
python .github/skills/detect-overengineering/scripts/extract-signals.py "<file-path>" --force --prettyThe script outputs a JSON object with:
source_path— relative path to source filelanguage— detected languageoutput_path— output report location under.overengineering-analysis/stale— boolean whether report needs regenerationoverengineering_score— 0 to 100 risk scoreseverity—clean,low,moderate,high, orextrememetrics— counts of classes, interfaces, pass-through methods, builder methods, custom exceptions, etc.signals— structural boolean flagssmells— automated smell detections with line numbers and explanations
Step 2 — Read Source & Analyze Context
- If
stale: falseand the user did not specify--force, read the existing report atoutput_pathand present the findings. - If
stale: true, read the source file content and cross-reference the extractedsmellsandsignalsagainst the Taxonomy of Over-Engineering (seereferences/detect-overengineering-reference.md):- Premature Abstraction: Single-implementer interfaces, empty protocols, generic parameters where concrete types suffice.
- Layer Bloat & Trampoline Indirection: Methods that only forward calls without business rules, validation, or transformation.
- Speculative Generality (YAGNI): Unused arguments (
*args, **kwargs,options: dict), no-op hook methods (pass), dynamic plugin structures for static requirements. - Design Pattern Overkill: Builder patterns for 2-3 fields, Strategy/Factory for 2 branches, Command pattern for sequential execution.
- Premature Optimization: Custom caches, manual bitmasks, async/thread pools in simple batch paths.
- DTO / Model Churn: Redundant classes mirroring database records with 1:1 identical fields.
- Exception Proliferation: 5+ custom exception classes in small modules where standard exceptions suffice.
Step 3 — Generate Simplification Plan
Formulate concrete simplification recommendations:
- What can be deleted? (unused interfaces, pass-through methods, empty hooks)
- What can be collapsed? (merge 3 layers into 1, replace class with a function or dataclass/record)
- Estimated LOC and file reduction percentage.
Step 4 — Write Analysis Report
Write a markdown report to the path indicated by output_path (.overengineering-analysis/<path>.md):
# Over-Engineering Analysis: <source_path>
**Risk Score:** `<score>/100` | **Severity:** `<severity>` | **Language:** `<language>`
## Executive Summary
<2-3 sentences summarizing the degree of over-engineering and highest-impact simplifications>
## Structural Metrics
- **Total LOC:** `<total_loc>`
- **Classes:** `<total_classes>` | **Interfaces / Protocols:** `<total_interfaces>`
- **Pass-Through Trampoline Methods:** `<pass_through_count>`
- **Custom Exceptions:** `<exceptions_count>`
## Detected Over-Engineering Smells
### 1. <Smell Name> (Line <line_number>)
- **Location:** `<symbol / class / method>`
- **Problem:** <Explanation of accidental complexity>
- **YAGNI / KISS Violation:** <Why this is unnecessary>
- **Recommendation:** <Concrete simplification instruction>
## Proposed Simplification (Before vs After)
### Before (Over-Engineered)
```<lang>
<existing complex snippet>After (Simplified)
<clean, idiomatic replacement>Net Code Impact: <e.g., -45 LOC (-65%), eliminated 2 interfaces, removed 3 indirection layers>
### Step 5 — Present Findings to the User
Output a concise summary in the conversation:
1. Severity badge & Risk score (`Clean`, `Low`, `Moderate`, `High`, `Extreme`)
2. Top 2-3 over-engineering smells detected
3. Before/After simplification code snippet
4. Link to the detailed report at `[Report](file:///<repo_root>/.overengineering-analysis/<path>.md)`
---
## Workflow — Directory / Repo-Wide Mode
### Step 1 — Run Repo-Wide Extraction
```bash
python .github/skills/detect-overengineering/scripts/extract-signals.py --all --prettyOr for a specific subsystem:
python .github/skills/detect-overengineering/scripts/extract-signals.py --dir "src/services" --prettyStep 2 — Triage High-Risk Files
Filter the JSON output for files with severity: high or severity: extreme (or overengineering_score >= 65).
Step 3 — Write Summary Index
Create .overengineering-analysis/_summary.md detailing:
- Total files scanned, clean count, high-risk count
- Top 5 most over-engineered files in the repository
- Repository-wide systemic anti-patterns (e.g., global 1:1 interface paranoia, excessive DTO mapping layers)
- Prioritized refactoring roadmap
Additional Resources
references/detect-overengineering-reference.md— Comprehensive taxonomy, decision trees (Do I need an interface? Do I need a pattern?), quantitative thresholds, and before/after code examples across Python, TypeScript, and Java.scripts/extract-signals.py— Deterministic AST and structural signal extraction script.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

