This skill should be used when designing features, refactoring code, reviewing code quality, making architectural decisions, writing tests, or applying design principles like DRY, SOLID, KISS, and YAGNI. It covers feature slicing, testing strategies, and code quality standards.
From mnpx claudepluginhub molcajeteai/plugin --plugin mThis skill uses the workspace's default tool permissions.
references/DRY.mdreferences/KISS.mdreferences/SOLID.mdreferences/YAGNI.mdreferences/code-comments.mdreferences/code-quality.mdreferences/feature-slicing.mdreferences/testing-standards.mdSearches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Executes pre-written implementation plans: critically reviews, follows bite-sized steps exactly, runs verifications, tracks progress with checkpoints, uses git worktrees, stops on blockers.
Fundamental design principles, testing strategies, and code quality standards for building maintainable software.
Every piece of knowledge must have a single, unambiguous, authoritative representation within the system. DRY applies to knowledge and intent, not just code text.
Rule of Three: Wait until code appears three times before extracting an abstraction. Premature extraction creates wrong abstractions. Two instances of similar code may be coincidental — three confirms a real pattern.
Key distinctions:
Prevention strategies: extract common logic into named functions, use configuration-driven approaches for repeated patterns, prefer composition over inheritance for code reuse.
See references/DRY.md for detection methods, prevention strategies, and code examples.
Five principles for object-oriented design by Robert C. Martin:
User class should not handle database operations, email sending, and validation — split those into UserRepository, UserNotifier, and UserValidator.PaymentMethod interface and add new implementations.Shape, any subclass of Shape must work without surprises.Robot class should not be forced to implement eat() and sleep() just because it shares a Worker interface with Human.database parameter to a service constructor instead of hard-coding new MySQLDatabase() inside it.Application order: start with SRP and DIP (foundational). Add OCP where change is frequent. Apply LSP when using inheritance. Use ISP when interfaces grow large.
Common mistakes: applying all principles everywhere regardless of need, creating interfaces before understanding the domain, spending too much time on design instead of building.
See references/SOLID.md for detailed examples and application guidance.
Favor simplicity over cleverness. Simple code is easier to understand, maintain, test, and debug. Complexity should be justified by real, measured need — not hypothetical future requirements.
Core rules:
adultNames is better than r.arr.sort() is better than a custom quicksort.database.query() call is better than a DataAccessLayerFactory chain.Red flags: more than 3 levels of indentation, functions longer than 30 lines, configuration for settings that never change, generic solutions for one-off problems, multiple abstraction layers for simple operations.
Simplification strategies: extract complex conditions into named functions, remove unnecessary configuration options, replace custom implementations with standard library methods, split large functions into smaller focused ones.
See references/KISS.md for examples of over-engineering and simplification strategies.
Build for today, not for tomorrow. Do not add functionality until it is actually needed — not when it is merely foreseen.
Every line of unneeded code costs: development time, maintenance burden, increased complexity, wrong abstractions, and opportunity cost. Features built on speculation are often based on incorrect assumptions and end up being rewritten or deleted.
Red flag phrases that signal YAGNI violations: "We might need this someday", "Let's future-proof this", "We should support multiple X", "What if we want to Y?"
When to ignore YAGNI:
See references/YAGNI.md for decision frameworks and common violations.
Organize code by business features (vertical slices) rather than technical layers (horizontal slices). Each feature contains all its own code — UI, business logic, data access — in one cohesive module.
Vertical (feature-sliced) vs Horizontal (layered):
# Horizontal (BAD for most projects) # Vertical (GOOD)
/controllers /features
userController.js /user-management
productController.js controller.js
/services service.js
userService.js repository.js
productService.js tests/
/models /product-catalog
user.js controller.js
product.js service.js
Key rules:
Benefits: high cohesion within features, low coupling between features, easy navigation (all related code in one place), parallel development without merge conflicts, clear ownership, easy to remove or disable a feature.
When NOT to use: very small applications (fewer than 5 features), single-developer projects with simple requirements.
Anti-patterns to avoid: starting with horizontal layers, premature shared abstractions, features depending directly on other features, over-abstracting on first implementation, mixing framework code with business logic, god features that are too large (split them), inconsistent directory structures across features.
See references/feature-slicing.md for workflow steps, anti-patterns, and comparison with layered architecture.
Distribute tests by speed, cost, and confidence:
Arrange (set up data), Act (execute code under test), Assert (verify results). One logical assertion per test. Separate sections with blank lines. Keep the Arrange section focused — extract complex setup to helper functions.
test('calculates order total with tax', () => {
// Arrange
const items = [{ price: 10, quantity: 2 }];
const calculator = new OrderCalculator(0.1);
// Act
const total = calculator.calculateTotal(items);
// Assert
expect(total).toBe(22);
});
| Code Type | Target |
|---|---|
| Business logic | 80–100% |
| Utilities/helpers | 90–100% |
| Data access layer | 70–90% |
| API controllers | 60–80% |
| UI components | 40–70% |
| Configuration | 20–40% |
Focus on branch coverage over line coverage. Do not chase 100% — diminishing returns above ~85%. Test behavior, not implementation details.
What NOT to test: third-party libraries, framework internals, trivial getters/setters, constants.
'creates user with valid email' is better than 'test1' or 'user test'.createTestUser(overrides) reduce setup boilerplate and keep tests focused.See references/testing-standards.md for the full testing pyramid, test structure patterns, and coverage analysis guidance.
Comments explain why, not what. Good code is self-documenting.
When to comment:
When NOT to comment:
Rules:
Prefer code clarity over comments:
See references/code-comments.md for detailed comment style guidelines. See references/code-quality.md for documentation standards, quality checklists, and anti-patterns.
These principles sometimes create tension. Apply judgment:
| File | Description |
|---|---|
| references/DRY.md | Detection methods, prevention strategies, Rule of Three, when NOT to DRY |
| references/SOLID.md | Each SOLID principle with examples, application order, common violations |
| references/KISS.md | Simplicity guidelines, over-engineering examples, simplification strategies |
| references/YAGNI.md | Cost of premature features, decision framework, when NOT to apply |
| references/feature-slicing.md | Vertical vs horizontal, workflow, anti-patterns, trade-offs |
| references/testing-standards.md | Testing pyramid, AAA pattern, coverage targets, FIRST principles |
| references/code-comments.md | When to comment, comment styles, self-documenting code techniques |
| references/code-quality.md | Documentation standards, quality checklists, code review criteria |