feat(core): add 8 AGENTS.md files (package, layer, domain levels)
This commit is contained in:
24
packages/core/src/infrastructure/AGENTS.md
Normal file
24
packages/core/src/infrastructure/AGENTS.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Infrastructure Layer — Implementations
|
||||
|
||||
## Rules
|
||||
|
||||
- Implements interfaces from application/
|
||||
- Imports from application/ and entities/
|
||||
- NEVER imported by application/ or entities/
|
||||
- Can import external libraries (Drizzle, Better Auth, Sentry, etc.)
|
||||
- Can import @repo/cms-client
|
||||
- Always provide a mock implementation for every real implementation
|
||||
|
||||
## Naming
|
||||
|
||||
- Real: `{provider}-{name}.repository.ts` (e.g., `payload-users.repository.ts`)
|
||||
- Mock: `mock-{name}.repository.ts`
|
||||
- All implementations must use `@injectable()` decorator for InversifyJS
|
||||
|
||||
## Adding a New Implementation
|
||||
|
||||
1. Create `src/infrastructure/repositories/{provider}-{name}.repository.ts`
|
||||
2. Implement the interface from application/
|
||||
3. Add `@injectable()` decorator
|
||||
4. Create corresponding mock: `mock-{name}.repository.ts`
|
||||
5. Register both in DI module (production binds real, test binds mock)
|
||||
Reference in New Issue
Block a user