Architecture
DevForge is split into focused layers instead of one large command module.
Layers
CLI Surface
src/bin/: executable entrypointssrc/cli.ts: argument parsing, help/version behavior, command dispatch
Command Layer
src/commands/init.ts: orchestrates theinitworkflow
Engines
environment.ts: inspects Node and package manager availabilityprompts.ts: collects and defaults user choicesdecision.ts: normalizes incompatible combinationsgenerator.ts: writes the scaffold and project planinstaller.ts: installs dependencies and initializes gitai-rules.ts: writes AI rule files and rule-source docs
Output Templates
src/templates.ts: generates package files, docs, testing setup, tooling files, and starter codesrc/devforge-rules.ts: maps stack choices to DevForge-curated rule pack recommendations
Design Principles
- keep user-facing commands thin
- make normalization explicit before generation
- generate docs as part of the scaffold
- keep logic testable and modular