@rijalpermana/spec-forge 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/templates/rules.md +25 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rijalpermana/spec-forge",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Spec-driven development CLI: scaffolds specs, schemas, API contracts, task lists, and test cases; bridges into Claude Code as slash commands.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -27,6 +27,31 @@
27
27
  `dto/`, `entities/`, `*.controller.ts`, `*.service.ts`, `*.repository.ts`,
28
28
  `*.module.ts`. The AI should scaffold new work to match this.]
29
29
 
30
+ ## Code design principles
31
+
32
+ - **SOLID:**
33
+ - Single Responsibility — each module, class, or function has one reason
34
+ to change; separate data-fetching, business logic, and presentation.
35
+ - Open/Closed — extend behavior through new code (props, composition,
36
+ new implementations of an interface), not by editing working, tested
37
+ code to bolt on a special case.
38
+ - Liskov Substitution — a derived/extended type must work anywhere its
39
+ base type is accepted, without the caller needing to know the
40
+ difference or handle extra edge cases.
41
+ - Interface Segregation — depend only on the fields/methods actually
42
+ used; don't pass a whole object through when one field is needed, and
43
+ don't force implementers to satisfy methods they don't need.
44
+ - Dependency Inversion — depend on abstractions (interfaces, hooks,
45
+ an injected client), not concrete implementations, so the
46
+ implementation can be swapped or mocked without touching the caller.
47
+ - **KISS:** prefer the simplest design that satisfies the requirement.
48
+ No speculative abstraction, config options, or generalization for
49
+ needs that don't exist yet.
50
+ - **DRY:** don't duplicate logic — extract it once a second real
51
+ duplicate appears, not preemptively on the first occurrence. Two
52
+ similar-looking blocks that change for different reasons are not
53
+ duplication; don't force them into one abstraction.
54
+
30
55
  ## API design
31
56
 
32
57
  - Versioning: [TODO — e.g. URI versioning `/v1/`, `/v2/`]