Skip to main content

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

forge quench

Rules Checked

quench evaluates 13 rules organized by the type of dependency they protect:
RuleDescriptionSeverity
R1feature → infra (prohibited)CRITICAL
R2platform → feature (prohibited)CRITICAL
R3shared → feature (prohibited)ERROR
R4shared → infra (prohibited)ERROR
R5domain → infra (prohibited)CRITICAL
R6domain → platform (prohibited)CRITICAL
R7infra → feature (prohibited)WARNING
R8Cross-feature direct importsERROR
R9Dependency cyclesERROR
R10Bare specifiers in local importsERROR
R11.ts extension in imports (must be .js)ERROR
R12Import to bootstrap.di.jsCRITICAL
R12bregisterSingleton with Mongoose model()CRITICAL
R13Domain 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:
// forge-ignore-next-line
import { something } from '../infra/prisma';  // not reported
To list every active ignore comment across the entire codebase, run:
forge quench --show-ignores
This outputs each ignore with its file path, line number, and the rules being suppressed — useful for auditing whether ignores are still justified over time.

—fix Auto-Corrections

Running quench --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.json issues (e.g., missing emitDecoratorMetadata, experimentalDecorators)
  • Naming convention violations (file and directory casing)
  • container.resolve() patterns in use cases (replaced with constructor injection)
CRITICAL violations (R1, R2, R5, R6, R12, R13) cannot be auto-fixed. These represent fundamental architectural violations — a feature reaching directly into infra/, domain logic depending on platform internals, or business logic placed in the wrong layer. They require deliberate manual refactoring. Use forge relocate or forge reforge to restructure the code correctly.

Integration with CI

quench exits with a non-zero status code when any violations are found, making it suitable as a CI gate:
# In your CI pipeline
forge quench || exit 1
For severity-filtered output (only fail on ERROR and above):
node .opencode/skills/forge/scripts/detect.mjs --severity ERROR

Build docs developers (and LLMs) love