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.

Forge enforces specific, consistent code patterns for every artifact it generates. This consistency is not stylistic preference — it is what makes automated analysis possible. When inspect checks Decorators, it knows exactly where @injectable() should appear. When forgeSentinel analyzes a modified file, it knows the canonical import path structure. When quench reports an R8 cross-feature violation, it has a reliable way to identify which layer a file belongs to. The patterns below are the ground truth for every file Forge generates via cast, and the baseline that inspect, quench, and the runtime hooks measure against.

Artifact Patterns

Domain entities are plain TypeScript classes. They carry identity (id), domain state, and invariants. They have no ORM decorators, no framework imports, and no knowledge of how they are persisted. A static create() factory encapsulates construction logic.
// src/features/users/domain/entities/User.entity.ts
export class User {
  constructor(
    public readonly id: string,
    public readonly email: string,
    public readonly name: string,
    public readonly createdAt: Date,
  ) {}

  static create(email: string, name: string): User {
    return new User(crypto.randomUUID(), email, name, new Date());
  }
}
Naming: <Domain>.entity.tsUser.entity.ts, Order.entity.ts
Location: src/features/<name>/domain/entities/

Import Rules

All code generated by Forge and all code audited by quench must follow these import conventions. Violations are reported as R10, R11, or R12 with ERROR or CRITICAL severity.
import { User } from './domain/entities/User.entity.js';
import { IUserRepository } from '../domain/repositories/IUser.repository.js';
Summary of import rules:
RuleRequirementSeverity
R10All local imports must use ./, ../, or @/ prefix — no bare specifiersERROR
R11All local imports must use .js extension, never .ts or no extensionERROR
R12Never import from bootstrap.di.js — use ./di.js or feature-specific DI fileCRITICAL
R12bNever use registerSingleton() with Mongoose model() — use register({ useValue })CRITICAL
Forge’s cast command generates all artifacts following these exact patterns automatically. If you are writing files manually, use forge quench to verify import conventions before committing.

Build docs developers (and LLMs) love