jorgex-stack 1.0.2 → 1.0.4

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.
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: lean-code
3
+ description: Lean / anti-overengineering skill. Use when deciding whether code should exist, when to prefer stdlib or native APIs, and when to simplify recently changed code without changing behavior.
4
+ ---
5
+
6
+ # Lean Code
7
+
8
+ Use the smallest change that genuinely solves the problem.
9
+
10
+ ## The ladder
11
+
12
+ Work top-down. Stop as soon as a step solves it:
13
+
14
+ 1. **Do nothing / delete it** if the need is speculative or nothing depends on the code.
15
+ 2. **Reuse existing project code** if a helper, component, command or module already solves the same need.
16
+ 3. **Use stdlib first** before adding a package or custom helper.
17
+ 4. **Use native/platform APIs** before wrapping them in new abstractions.
18
+ 5. **Use an already-installed dependency** when it safely covers the case.
19
+ 6. **Write the smallest obvious code** only when the previous steps do not fit.
20
+
21
+ ## Questions to ask
22
+
23
+ - Does this need new code at all?
24
+ - Is there already a project helper or pattern that does it?
25
+ - Can stdlib or the platform do it directly?
26
+ - Can an existing dependency already cover this safely without adding a new one?
27
+ - Can the same result be expressed with one clear step instead of a new layer?
28
+
29
+ ## Guardrails
30
+
31
+ Lean code does **not** mean weaker code.
32
+
33
+ Keep explicit code when the change touches:
34
+
35
+ - security or permissions
36
+ - validation or sanitisation
37
+ - accessibility
38
+ - data-loss or persistence boundaries
39
+ - public contracts, types, schemas, or APIs
40
+ - tests or regression seams
41
+
42
+ If simplification weakens any of those, stop.
43
+
44
+ Do not add a new dependency unless the task explicitly requires it or the project already has approval for that dependency.
45
+
46
+ ## How to use it
47
+
48
+ ### Implementation
49
+
50
+ Before adding a new helper, wrapper, abstraction, or dependency, run the ladder again.
51
+ Prefer the narrowest change that solves the real need.
52
+
53
+ ### Review / simplification
54
+
55
+ Use it as a bloat filter: delete, stdlib, native/platform, reuse, or shrink.
56
+ If the code is already minimal and clear, leave it alone.
57
+
58
+ ### Audit
59
+
60
+ Rank findings as:
61
+
62
+ - delete
63
+ - stdlib
64
+ - native/platform
65
+ - reuse
66
+ - yagni
67
+ - shrink
68
+
69
+ Do not propose rewrites that only move complexity around.