skills/principles/SKILL.md
Apply SOLID, KISS, DRY, YAGNI principles to code design decisions. Use when building new features from scratch and need to decide on class structure, interface boundaries, or dependency direction. Make sure to use this skill when the user faces design trade-offs, asks about SOLID principles, debates whether to abstract or keep things simple, or needs to evaluate competing design approaches — but not for code smell detection (use refactoring skill instead).
npx skillsauth add elct9620/ai-coding-skills principlesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Condition | Pass | Fail | |-----------|------|------| | New feature from scratch | Building without existing reference | Modifying existing code | | Design trade-off | Choosing between competing approaches | Implementation path is clear | | Interface/boundary design | Defining class responsibilities or contracts | Internal implementation detail | | Dependency structure | Deciding coupling and injection strategy | No dependency decisions |
Apply when: Any condition passes Do NOT apply when: The task is purely about restructuring existing code (use refactoring) or detecting code smells (use refactoring)
| Principle | Description | Violation Sign | |-----------|-------------|----------------| | Single Responsibility | One reason to change | Class does too many things | | Open/Closed | Open for extension, closed for modification | Frequent changes to existing code | | Liskov Substitution | Subtypes must be substitutable | Type checks or conditional logic on types | | Interface Segregation | Many specific interfaces over one general | Clients implement unused methods | | Dependency Inversion | Depend on abstractions, not concretions | Direct instantiation of dependencies |
Module type (application vs library) decides which default applies — see architecture Module Type.
Use the Violation Sign column in the SOLID table above as the primary checklist. Additionally verify:
| Criterion | Pass | Fail | |-----------|------|------| | Describable | Each class/function describable in one sentence | Needs a paragraph to explain | | Simplest solution | Chosen approach is the simplest that works | Over-engineered for hypothetical needs | | Dependencies injected | High-level modules depend on abstractions | Direct instantiation of concretions |
This skill addresses design-level decisions (abstraction level, coupling, interface shape). For code-level restructuring (long methods, duplicated code, feature envy), use the refactoring skill — it has specific techniques and safe steps for each smell.
development
Plan how a system is structured — which layers, modules, or contexts exist and how code is laid out — driven by the forces at play, not by a fixed pattern. The default is to add no extra structure; structure is introduced only when complexity calls for it, and the chosen shape (Clean Architecture, DDD, DCI, or another) is judged in the moment. Use this skill when following a recorded structure in docs/architecture.md, or when deciding the structural shape for a non-trivial feature, a new module, or a restructuring — especially after a design-forces memo recommends a layered or partitioned structure.
development
Surface design forces and lay out the option space — including framework defaults, scaffolds, and deferring — before committing to Clean Architecture, DDD, or any heavier pattern. Produces a Design Analysis Memo at the start of /write, /refactor, or non-trivial /fix. Make sure to use this skill whenever the user starts a non-trivial feature, restructures code, or asks "do we really need Clean Architecture / DDD / pattern X here".
development
Write tests using TDD (Red-Green-Refactor) and AAA pattern. Use for every new feature, behavior change, or bug fix. Covers unit, integration, and E2E test selection. Make sure to use this skill whenever the user asks to add tests, fix a bug (tests should come first), implement a feature with test coverage, or asks about what kind of tests to write — even for small one-line changes or trivial-looking fixes.
development
Prevent security vulnerabilities through threat modeling, trust boundary analysis, and defense in depth. Use when writing code that crosses trust boundaries, handles authentication or authorization, processes external input, manages secrets, or stores sensitive data. Make sure to use this skill whenever the user works on login flows, processes data from external sources, builds interfaces between systems, manages credentials, or writes code that moves data across trust zones — even for seemingly simple changes like accepting a new parameter or calling an external service.