tlc-claude-code 1.6.0 → 1.6.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.
|
@@ -6,6 +6,55 @@ Write failing tests, then implement to make them pass.
|
|
|
6
6
|
|
|
7
7
|
**Code like a senior engineer with 15+ years experience.** Every line should reflect:
|
|
8
8
|
|
|
9
|
+
### Project Structure (NestJS-Style Modules)
|
|
10
|
+
|
|
11
|
+
**Group by domain entity, not by file type.** Each entity gets its own module folder:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
src/modules/{entity}/
|
|
15
|
+
├── interfaces/ # Types and interfaces (NEVER at module root)
|
|
16
|
+
│ ├── {entity}.interface.ts
|
|
17
|
+
│ └── index.ts
|
|
18
|
+
├── dto/ # Request/Response DTOs
|
|
19
|
+
│ ├── create.dto.ts
|
|
20
|
+
│ └── index.ts
|
|
21
|
+
├── enums/ # Enums (no magic strings)
|
|
22
|
+
├── constants/ # Configuration constants
|
|
23
|
+
├── guards/ # Auth/permission middleware
|
|
24
|
+
├── {entity}.service.ts # Business logic
|
|
25
|
+
├── {entity}.controller.ts # HTTP handlers
|
|
26
|
+
├── {entity}.repository.ts # Data access
|
|
27
|
+
├── {entity}.seed.ts # Seed data (per-entity, not monolithic)
|
|
28
|
+
├── {entity}.test.ts # Tests
|
|
29
|
+
└── index.ts # Barrel exports
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Server/src root should ONLY contain:**
|
|
33
|
+
- `index.ts` - Entry point
|
|
34
|
+
- `lib/` - Core shared libraries
|
|
35
|
+
- `modules/` - Feature modules
|
|
36
|
+
- `shared/` - Cross-cutting utilities
|
|
37
|
+
- Config files
|
|
38
|
+
|
|
39
|
+
**❌ NEVER do this:**
|
|
40
|
+
```
|
|
41
|
+
src/
|
|
42
|
+
services/ # ❌ All services dumped together
|
|
43
|
+
interfaces/ # ❌ All types dumped together
|
|
44
|
+
controllers/ # ❌ Flat controller folder
|
|
45
|
+
|
|
46
|
+
server/
|
|
47
|
+
auth.ts # ❌ Loose file at root (should be modules/auth/)
|
|
48
|
+
helpers.ts # ❌ Should be in lib/ or shared/
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Key rules:**
|
|
52
|
+
- Interfaces ALWAYS in `interfaces/` subdirectory, never at module root
|
|
53
|
+
- No inline interfaces in service files - import from `interfaces/`
|
|
54
|
+
- No magic strings - use `enums/` or `constants/`
|
|
55
|
+
- Seeds per-entity, not one giant seeds.ts
|
|
56
|
+
- Every module has `index.ts` barrel export
|
|
57
|
+
|
|
9
58
|
### Code Quality
|
|
10
59
|
- **Clean Architecture**: Separate concerns. Domain logic never depends on infrastructure.
|
|
11
60
|
- **SOLID Principles**: Single responsibility, open/closed, Liskov substitution, interface segregation, dependency inversion.
|