claude-dev-env 1.30.0 → 1.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CLAUDE.md CHANGED
@@ -9,6 +9,14 @@
9
9
 
10
10
  Full rule including the decision table, examples, and exemption details: [`packages/claude-dev-env/rules/file-global-constants.md`](rules/file-global-constants.md).
11
11
 
12
+ ## SOLID Principles
13
+
14
+ **SRP (Single Responsibility)** always applies: one reason to change per function, class, or module — regardless of paradigm.
15
+
16
+ **OCP, LSP, ISP, DIP** apply where two or more concrete implementations already share a contract. With a single concretion, Right-Sized Engineering takes precedence: use concrete classes, functions when no state, and direct imports. Refactor toward OCP/DIP at the commit that introduces the second concrete implementation.
17
+
18
+ Full rule including the reconciliation with Right-Sized Engineering, misapplication signals, and when-it-adds-value criteria: [`packages/claude-dev-env/docs/CODE_RULES.md`](docs/CODE_RULES.md) §7.5.
19
+
12
20
  ## Core Philosophy
13
21
 
14
22
  **TDD IS NON-NEGOTIABLE.** Build it right, build it simple. Maintainable > Clever.
@@ -169,6 +169,44 @@ Always: Functions when no state, concrete classes, simple imports
169
169
 
170
170
  ---
171
171
 
172
+ ## 7.5 SOLID PRINCIPLES
173
+
174
+ **Apply where two or more concrete implementations already share a contract. For code with a single concretion, §7 (Right-Sized Engineering) takes precedence: use concrete classes, functions when no state, and direct imports.**
175
+
176
+ Reference: Robert C. Martin, *Agile Software Development: Principles, Patterns, and Practices* (2002), Ch. 8–12.
177
+
178
+ | Letter | Principle | What it means here |
179
+ |--------|-----------|--------------------|
180
+ | **S** | Single Responsibility Principle | A class, function, or module has one reason to change. One unit = one axis of variation. Ties to §6.5 (file length as smell signal) and Fowler's "Large Class" / "Long Function" smells. |
181
+ | **O** | Open/Closed Principle | Extend behavior by adding new code. Favor a new branch/handler/subclass over editing the same switch in five places. |
182
+ | **L** | Liskov Substitution Principle | A subtype must be usable anywhere its parent type is expected without surprising the caller. If a subclass override breaks caller assumptions, flatten the hierarchy or prefer composition. |
183
+ | **I** | Interface Segregation Principle | Each client depends on exactly the methods it calls. Split one fat interface into several role-specific ones so each caller imports only the role it needs. |
184
+ | **D** | Dependency Inversion Principle | When two or more concretions exist or are imminent, depend on the shared abstraction. With exactly one concretion, import the concrete type directly (see §7). |
185
+
186
+ ### Reconciling SOLID with Right-Sized Engineering (§7)
187
+
188
+ SOLID was written for OO codebases where most abstract types have two or more concrete subclasses. In this codebase:
189
+
190
+ - **SRP always applies.** Functions, classes, and modules must have one reason to change regardless of paradigm. This is the only SOLID letter that applies immediately, without waiting for a second implementation.
191
+ - **OCP, LSP, ISP, DIP apply where two or more concrete implementations already share a contract.** A single concrete class satisfies SOLID by default. Introduce interfaces, ABCs, or DI containers only when the second concretion lands.
192
+ - **For code with fewer than two concretions, §7 wins:** concrete classes, functions when no state, direct imports. Refactor toward OCP/DIP at the commit that introduces the second concrete implementation (YAGNI).
193
+
194
+ ### Signals that SOLID is being misapplied
195
+
196
+ - Creating an interface or ABC with exactly one implementation (violates §7 DIP guard)
197
+ - Splitting a cohesive 80-line class with one reason to change into four 20-line classes because "SRP" — SRP counts distinct change reasons; size is a separate signal tracked in §6.5
198
+ - Abstract factories for types that have exactly one concrete product
199
+ - Dependency-injection containers where every injected type has exactly one concrete implementation across production and tests
200
+
201
+ ### When SOLID adds value
202
+
203
+ - Two or more concrete implementations already exist → DIP and ISP earn their keep
204
+ - A class shows multiple unrelated change reasons in git history → SRP split is justified
205
+ - Subclass overrides break caller assumptions → LSP violation; fix or flatten the hierarchy
206
+ - Editing the same `if`/`switch` block every time a new case is added → OCP refactor is justified
207
+
208
+ ---
209
+
172
210
  ## 8. TDD PROCESS
173
211
 
174
212
  1. **RED** - Failing test first
@@ -221,5 +259,7 @@ Manual check:
221
259
  [ ] No abbreviations?
222
260
  [ ] Complete type hints?
223
261
  [ ] Self-contained components?
262
+ [ ] SRP holds (one reason to change per function/class/module)?
263
+ [ ] OCP/LSP/ISP/DIP only applied where abstractions already earn their keep (see §7.5)?
224
264
  [ ] Readability: /check or /readability-review
225
265
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-dev-env",
3
- "version": "1.30.0",
3
+ "version": "1.30.1",
4
4
  "description": "Claude Code development standards — rules, hooks, agents, commands, and skills",
5
5
  "type": "module",
6
6
  "bin": {