بنقرة واحدة
conventions
Defines the rule base every skill in this pack obeys: file layout, frontmatter, vocabulary, OOP/typing/decoupling axioms, and anti-patterns. Load FIRST before authoring or applying any other skill in this pack.
القائمة
Defines the rule base every skill in this pack obeys: file layout, frontmatter, vocabulary, OOP/typing/decoupling axioms, and anti-patterns. Load FIRST before authoring or applying any other skill in this pack.
Designs NestJS feature modules with clean dependency boundaries, provider scopes, and dynamic modules. Use when adding a new feature module, splitting a monolithic AppModule, or fixing tangled imports between modules.
Builds thin NestJS controllers that parse input, invoke a single use case, and map the Result to ApiResponse<T>. Use when adding HTTP endpoints, refactoring fat controllers, or applying API versioning.
Prepares a NestJS service for production: graceful shutdown, health/readiness, structured logs, config, Dockerfile, CI gates, and rollout safety. Use when promoting a service to staging/production or auditing readiness.
Designs NestJS application services as use-case classes that orchestrate domain logic and ports without leaking the framework. Use when creating new use cases, refactoring services that mix HTTP/DB/domain, or moving from anemic services to OOP.
Maps internal AppError hierarchy to HTTP responses through a single global exception filter and a Result-to-HttpException helper. Use when adding new error types, fixing inconsistent error responses, or removing scattered try/catch in controllers.
Implements the Repository pattern with TypeORM in NestJS so domain entities stay framework-free, ORM models live in infrastructure, and transactions are explicit. Use when adding persistence, refactoring leaky ORM usage, or handling transactions across aggregates.
| name | _conventions |
| description | Defines the rule base every skill in this pack obeys: file layout, frontmatter, vocabulary, OOP/typing/decoupling axioms, and anti-patterns. Load FIRST before authoring or applying any other skill in this pack. |
| license | MIT |
This document is the single source of truth for every other skill in this pack. It defines:
SKILL.md must follow,If a skill ever contradicts this document, this document wins.
Every skill in this pack uses this exact skeleton:
---
name: <gerund-skill-name>
description: <one sentence: what + when to use>
license: MIT
---
# <Title>
## When to use
## Core rules
## Reference shape (TypeScript)
## Examples — Do
## Examples — Don't
## Checklist
Rules:
name is gerund form (designing-..., building-...,
handling-...) and equals the parent folder name.description includes both what the skill does and when to load it.SKILL.md under 500 lines. Move long references to
reference/*.md.| Term | Meaning in this pack |
|---|---|
| Domain | Pure business rules. No framework, no I/O, no console.log. |
| Application | Use-cases / orchestrators. Calls domain, calls ports. |
| Infrastructure | Adapters: HTTP, DB, queue, cache, mailer, 3rd-party SDKs. |
| Port | A TypeScript interface declared by the domain/application layer. |
| Adapter | A concrete class implementing a port, lives in infrastructure. |
| DTO | Data Transfer Object — shape that crosses a process boundary. |
| Entity | Object with identity and lifecycle. Lives in domain. |
| Value Object | Immutable, equality-by-value. Lives in domain. |
| Use case | One application service method = one business intent. |
| Result<T,E> | Typed success/error union returned by use cases. |
| ApiResponse | The single envelope shape returned by every HTTP endpoint. |
The agent must use these exact terms in code, comments, commit messages, and PR descriptions.
public/protected/private always
written, never relying on default).any.ApiResponse<T> for HTTP responses,Paginated<T> for list responses,Result<T, E> for use-case outputs,Repository<T, ID> for persistence ports.unknown is preferred over any. any is forbidden unless commented
with a justification.*.types.ts or *.contracts.ts and are
re-exported via a barrel.infrastructure → application → domain. Domain depends on nothing.madge --circular or dpdm in CI.Result<T,E> to the transport response.AppError class. All thrown errors extend it.Result<T, E extends AppError> instead of throwing for
expected business failures.process.env exactly once, at boot, through a typed schema
(Zod / class-validator). The rest of the code consumes a typed
AppConfig object.SIGTERM/SIGINT.The agent must recognize and apply these patterns by name:
| Pattern | Where it appears |
|---|---|
| Dependency Injection | Every class receives its collaborators through constructor. |
| Repository | All persistence access. Domain defines port; infra implements. |
| Factory | Constructing aggregates with invariants. |
| Strategy | Pluggable algorithms (pricing, retry, hashing). |
| Adapter | Wrapping 3rd-party SDKs into project ports. |
| Decorator | Cross-cutting concerns (logging, caching, retry). |
| Facade | Simplified entrypoint over a complex subsystem. |
| Observer / Pub-Sub | Domain events, async side-effects. |
| Command / Use Case | Each application method = one command/query. |
| Specification | Composable business rules / query predicates. |
Each is documented in applying-design-patterns/.
static methods used as utility singletons.Promise<any> or Promise<object>.@nestjs/*, typeorm, axios, etc.try { ... } catch (e) { console.log(e) } — swallowing errors.const enum or named constant.dist/, src/internal/, or non-exported
files.as any, // @ts-ignore, // @ts-expect-error without a written
justification.When asked to load a skill from this pack, the agent should:
_conventions document first (only once per session).SKILL.md.