Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ronaldjdev/forge/llms.txt
Use this file to discover all available pages before exploring further.
quench is Forge’s rule validator. It runs all 13 architectural dependency rules (R1–R13) against your codebase and reports every violation with its severity level. Unlike inspect — which produces a full scored report across 10 categories — quench is focused and fast, designed to run after every meaningful change to guarantee the rule baseline is clean. Use it in CI pipelines, as a pre-commit check, or immediately after cast, reforge, or any manual refactoring to confirm the architectural constraints are still intact.
Usage
Rules Checked
quench evaluates 13 rules organized by the type of dependency they protect:
| Rule | Description | Severity |
|---|---|---|
| R1 | feature → infra (prohibited) | CRITICAL |
| R2 | platform → feature (prohibited) | CRITICAL |
| R3 | shared → feature (prohibited) | ERROR |
| R4 | shared → infra (prohibited) | ERROR |
| R5 | domain → infra (prohibited) | CRITICAL |
| R6 | domain → platform (prohibited) | CRITICAL |
| R7 | infra → feature (prohibited) | WARNING |
| R8 | Cross-feature direct imports | ERROR |
| R9 | Dependency cycles | ERROR |
| R10 | Bare specifiers in local imports | ERROR |
| R11 | .ts extension in imports (must be .js) | ERROR |
| R12 | Import to bootstrap.di.js | CRITICAL |
| R12b | registerSingleton with Mongoose model() | CRITICAL |
| R13 | Domain artifacts in platform/ | CRITICAL |
Understanding the Rules
Layer Boundary Rules (R1–R7)
Protect the four-layer boundary model. R1–R6 are CRITICAL because they represent fundamental inversions of the dependency direction that underpins hexagonal architecture. R7 is WARNING because
infra → feature is architecturally wrong but rarely causes immediate runtime failures.Coupling Rules (R8–R9)
R8 prevents feature-to-feature coupling that creates hidden dependencies. R9 catches circular dependency chains that make the build order undefined and testing nearly impossible.
Import Convention Rules (R10–R12)
R10–R12 enforce ESM import hygiene. R10 and R11 ensure the codebase runs correctly under
verbatimModuleSyntax. R12 prevents controllers from depending on the bootstrap entrypoint, which creates a global coupling point.Structural Rules (R13)
R13 prevents domain artifacts (entities, use cases, mappers, repository interfaces) from being placed in
platform/, where they would pollute the technical backbone with business logic.Inline Ignores
When a violation is intentional (e.g., a deliberate bridge between layers during a migration), you can suppress it with inline ignore comments:- Ignore all rules on next line
- Ignore a specific rule
- Ignore multiple rules
—fix Auto-Corrections
Runningquench --fix automatically corrects violations at the WARNING and INFO severity levels. What --fix handles:
- Missing
@injectable()decorators on use cases, controllers, and repositories (for tsyringe profiles) - Missing
@inject()decorators where constructor injection is required tsconfig.jsonissues (e.g., missingemitDecoratorMetadata,experimentalDecorators)- Naming convention violations (file and directory casing)
container.resolve()patterns in use cases (replaced with constructor injection)
Integration with CI
quench exits with a non-zero status code when any violations are found, making it suitable as a CI gate: