# Clean Code

> Clean code enforcement for workspace-hub Python repos: file/function size limits, God Object detection, naming rules, dead code removal, and refactor decision guidance. Consult before writing new modules or accepting large files.

- Skill: `vamseeachanta/clean-code` (Agent Skill)
- Install (CLI): `npx skillmds@latest add vamseeachanta/clean-code`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vamseeachanta/clean-code/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: vamseeachanta (https://skillmd.com/u/vamseeachanta)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/vamseeachanta/clean-code

---


# Clean Code

## Sub-Skills

- [Hard Limits (Zero-Tolerance)](hard-limits-zero-tolerance/SKILL.md)
- [Quick Scan Commands](quick-scan-commands/SKILL.md)
- [File Size Decision Tree](file-size-decision-tree/SKILL.md)
- [Pattern 1: Responsibility Split (most common) (+5)](pattern-1-responsibility-split-most-common/SKILL.md)
- [Naming Rules (Enforcement)](naming-rules-enforcement/SKILL.md)
- [Dead Code Identification and Removal](dead-code-identification-and-removal/SKILL.md)
- [God Object Detection](god-object-detection/SKILL.md)
- [Top P1 Candidates (2026-02-25 audit)](top-p1-candidates-2026-02-25-audit/SKILL.md)
- [Pre-commit Integration](pre-commit-integration/SKILL.md)
- [Git Plumbing for Repos with Large Pack Files (+1)](git-plumbing-for-repos-with-large-pack-files/SKILL.md)
- [Step 1: API Compatibility Check (MANDATORY before writing shims) (+2)](step-1-api-compatibility-check-mandatory-before-wr/SKILL.md)
- [See Also](see-also/SKILL.md)

## Iron Law

> No file shall exceed the hard limit, and no function shall exceed 50 lines — no exceptions, no deferrals, no "I'll refactor later."

## Rationalization Defense

| Excuse | Reality |
|--------|---------|
| "It's only slightly over the limit" | Limits exist at exact thresholds for a reason — 301 lines is a violation, not a rounding error. Split now. |
| "Splitting this file would be premature" | The limit exists precisely because developers always say this. The file is already too large; splitting is overdue, not premature. |
| "I'll refactor after I finish the feature" | Post-feature refactors have a near-zero completion rate. The limit is enforced at write time, not review time. |
| "This function is complex — it needs to be long" | Complex functions need to be decomposed, not excused. Length is a symptom of missing abstractions. |
| "The tests pass so the structure is fine" | Tests validate behavior, not maintainability. Passing tests do not exempt code from structural rules. |

## Red Flags

These phrases signal you are about to violate the Iron Law:
- "just a few lines over"
- "I'll clean this up in a follow-up"
- "splitting would add unnecessary complexity"
- "this is a one-off / special case"
- "the logic is tightly coupled — it has to stay together"

