elevate-code
Interactive Clean Code Mentor & SOLID Architecture Gate
- ✓ When reviewing pull requests or newly written code for clean architecture and SOLID compliance.
- ✓ When refactoring legacy spaghetti code into decoupled, testable design patterns.
- ✓ When learning clean code principles through guided, hands-on interactive exercises.
- ✓ When auditing software for security anti-patterns (injection vectors, hardcoded secrets).
Trigger: Activated when the user requests a clean code review, SOLID principle analysis, or interactive code quality mentoring.
"Review this service for SOLID principles and clean code violations."
Interactive Socratic Mentorship & 12-Dimension Quality Analysis
100,000 token budget focused strictly on target diffs and relevant domain interfaces.
Archives formal audit reports to docs/reviews/review-[date].md.
Reference Specifications (`references/`)
12-dimension evaluation checklist covering SRP, OCP, LSP, ISP, DIP, DRY, and cyclomatic complexity.
Detailed instructional workflows for both Tutorial Mode and Auto-Apply Mode.
Standardized audit report markdown template saved to docs/reviews/.
Executive Overview
Linters catch syntax errors and formatting discrepancies, but they cannot evaluate whether a class violates the Single Responsibility Principle, whether tight coupling will break downstream tests, or whether an abstraction introduces dangerous side-effects.
elevate-code is an interactive clean code mentor and architectural quality gate. It analyzes code through 12 rigorous software design dimensions and operates in two distinct modes.
Dual Operating Modes
1. Tutorial Mode (The Mentor Approach)
Designed for active skill elevation and architectural learning:
- Presents the Smell: Identifies a specific violation (e.g., “This
OrderServicemethod handles both database transactions and third-party SMS dispatch”). - Issues the Challenge: Asks the developer: “How would you decouple this notification logic using the Dependency Inversion Principle?”
- Evaluates & Teaches: Analyzes the developer’s attempt, explains the underlying OOP design pattern (e.g., Strategy or Observer), and presents the idiomatic solution.
2. Auto-Apply Mode (The Production Gatekeeper)
Designed for rapid CI/CD pipelines and high-velocity development:
- Automatically diagnoses code smells, categorizes findings into
[MUST-FIX]and[NICE-TO-HAVE], applies refactored diffs directly to the file tree, and outputs an audit report indocs/reviews/review-[date].md.
The 12-Dimension Quality Analysis Checklist
elevate-code audits code against 12 core engineering criteria:
- Single Responsibility Principle (SRP): Classes and functions must have only one reason to change.
- Open-Closed Principle (OCP): Open for extension, closed for modification via interfaces.
- Liskov Substitution Principle (LSP): Subtypes must be substitutable for base types without breaking behavior.
- Interface Segregation Principle (ISP): Clients must not be forced to depend on methods they do not use.
- Dependency Inversion Principle (DIP): Depend on abstractions, never on concrete implementations.
- Don’t Repeat Yourself (DRY): Eliminate logic duplication while avoiding premature abstraction.
- Naming Clarity & Intent: Self-documenting identifiers with zero ambiguous abbreviations.
- Cyclomatic Complexity: Flattens deeply nested conditionals and extracts guard clauses.
- Error Encapsulation: Replaces generic error throwing with typed domain exceptions (e.g., RFC 9457 Problem Details).
- Separation of Concerns: Strict isolation between persistence, business logic, and presentation.
- Security Anti-Patterns: Immediate flagging of SQL injection vectors, unsanitized inputs, and leaked tokens.
- Testability: Decoupled dependencies to allow friction-free unit test mocking.