- Home
- Skills
- Code Quality & Review
- Overengineering & Code Bloat Gate for AI-Written Code
Works with the AI Agents you already use
Overengineering & Code Bloat Gate for AI-Written Code
They write factories for one product, interfaces with one implementation, retry wrappers around calls that can't fail, and a config system for three constants.
$14
Overengineering & Code Bloat Gate for AI-Written Code
Example session with this skill installed
Run the bloat gate on my PR that adds user profile editing. It feels way bigger than it should be.
- Read your context and instructions
- Compiled the overengineering & code
BLOAT GATE: PR #214 add profile editing · VERDICT: TRIM
Task in one sentence: let a signed-in user update their display name and avatar.
Lines added: 612 · Removable: 241 (39% of logic, plus 58 comment lines) · Dependencies removable: 1
Findings (largest saving first)
| Pattern | Location | Saving | Why it's safe |
|---|---|---|---|
| B3 pass-through layer | src/services/ProfileService.ts:1-96 | -88 | Only forwards to profileRepo; sole caller routes/profile.ts:22 |
| B2 single implementation | src/ports/IProfileStore.ts | -41 | One implementer, no test double uses it |
| B5 dependency for one-liner | lodash.clonedeep in ProfileForm.tsx:8 | -1 dep | structuredClone covers it on your Node version |
| B6 impossible-case defense | routes/profile.ts:40-71 | -32 | Zod schema already rejects these shapes at line 18 |
| B7 dead flexibility | config/profile.ts (MAX_NAME_LEN via env) | -24 | Read once, never set in any environment |
| B12 scope creep | utils/date.ts reformat | -56 | Unrelated to the task; move to its own PR |
Lean diff
- import { ProfileService } from '../services/ProfileService'
- const svc = new ProfileService(new PgProfileStore(db))
- router.patch('/me', async (req, res) => res.json(await svc.update(req.user.id, req.body)))
+ router.patch('/me', async (req, res) => {
+ const data = profileSchema.parse(req.body)
+ res.json(await profileRepo.update(req.user.id, data))
+ })
(full diff: 9 files, -299 / +17)
Verified: test suite run on the lean branch, 48/48 passing.
Kept on purpose: the avatar size check in upload.ts:30 looks defensive, but it guards real user input.
Connects securely to your tools. The creator never sees your data.
About this skill
Coding agents rarely write too little code. They write factories for one product, interfaces with one implementation, retry wrappers around calls that can't fail, and a config system for three constants. The best code is the code you never wrote, and every extra line is something to read, test and maintain.
This gate checks every addition in a diff or PR against one question: would the code still do its job if this were deleted or inlined? If yes, it flags it and shows the shorter version, and it proves the cut is safe before recommending it.
12 bloat patterns it hunts, each cited by file and line: speculative generality · single-implementation abstractions · pass-through layers · reinvented standard library · dependencies added for one-liners · defensive code for impossible states · dead config and feature flags · premature caching and optimization · stateless "ceremony" classes · duplicate DTOs across layers · comment and log noise · scope creep unrelated to the task
What it won't flag: validation at real trust boundaries, error handling for real I/O, abstractions with two or more real implementations, patterns your repo uses everywhere, security and accessibility code, tests.
Every cut is checked: it searches the whole repo for other callers (tests, scripts, dynamic imports), keeps your public API unless you agree, and runs your tests on the lean version when they exist. Anything it can't verify is labelled unverified, not removed.
You get: the task in one sentence, lines added vs removable (with %), findings ranked by lines saved, a ready-to-apply lean diff, test results, and a LEAN / TRIM / REWRITE verdict. For REWRITE it sketches the simpler design before writing code.
A different job from a bug or security review: pair it with a quality gate that hunts defects. Works with Claude Code, Codex CLI, Cursor, Gemini CLI and any SKILL.md agent, in any language.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Code Quality & Review.
Cuts it cannot trace all callers for (for example code reached through reflection or string-built dynamic imports) are listed as unverified instead of removed. Behavior checks rely on your existing tests; without tests, cuts are marked unverified. Skips patterns that are established conventions across your repo.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 19 days ago