Manages the server startup sequence, dependency initialization, and health checks. Use this skill to understand, debug, or extend the server's bootstrap process, including adding new dependencies, configuring timeouts, and integrating with monitoring systems.
The Startup Dependency Graph is a deterministic initialization system for server startup that prevents race conditions and provides clear visibility into which dependencies are ready.
server/src/startup/dependencyGraph.ts)The core graph engine that manages dependency lifecycle:
export interface Dependency {
name: string
critical: boolean // true = required for server operation
timeout: number // milliseconds
init: () => Promise<void> // initialization logic
validate: () => Promise<boolean> // validation after init
shutdown?: () => Promise<void> // cleanup on shutdown
}
server/src/startup/startupManager.ts)Orchestrates the complete startup sequence using the dependency graph. Registers all dependencies in order of criticality:
Enable via environment variable:
FAIL_FAST_MODE=true npm run dev
In fail-fast mode, the server refuses to boot if ANY critical dependency fails. This is useful for:
Edit the timeout in each dependency file:
// server/src/startup/dependencies/database.ts