Health CLI (tools/health)
Project health analysis CLI covering 60+ categories across 5 domains with health score, action items, and production readiness.
Overview
The @booking/tools-health package analyzes project health across 5 domains: User-Facing, Security & Compliance, Backend & Data, Infrastructure, and Code & Architecture. It uses Clean Architecture with 4 layers and provides both table and JSON output formats.
Tech Stack
| Layer | Technology | Version |
|---|---|---|
| Runtime | Bun | >= 1.3.0 |
| Language | TypeScript | ^7.0.2 |
| Architecture | Clean Architecture | — |
| Bundling | bunup | ^0.16.32 |
| Linting | Biome | ^2.5.4 |
| Type Checking | tsc | — |
| Testing | Vitest | ^4.1.10 |
Architecture
tools/health/src/
├── index.ts # Library entry point
├── domain/ # Pure business logic (no side effects)
│ ├── types/
│ │ ├── index.ts # Type exports
│ │ └── health.ts # Health types (Category, Finding, Score, etc.)
│ └── analyzers/
│ ├── index.ts # Analyzer registry + runAllAnalyzers
│ ├── helpers.ts # Shared analyzer utilities
│ ├── user-facing.ts # 9 categories
│ ├── security.ts # 8 categories
│ ├── backend-data.ts # 16 categories
│ ├── infrastructure.ts # 10 categories
│ ├── code-arch.ts # 10 categories
│ └── code-quality.ts # 7 categories
├── application/ # Orchestration layer
│ ├── index.ts # Service exports
│ ├── scorer.ts # Health score calculator
│ └── reporter.ts # Report generator (table + JSON)
├── adapters/ # I/O layer (side effects only)
│ ├── index.ts # Adapter exports
│ ├── file-utils.ts # File walking, reading
│ └── git-grep.ts # Git grep utility
└── presentation/ # Entry points
├── cli.ts # CLI entry point with argument parsing
└── format.ts # Table/JSON formattingHealth Domains (60+ Categories)
| Domain | Categories | Description |
|---|---|---|
| User-Facing | 9 | Accessibility, responsive design, i18n, UX/UI, PWA |
| Security & Compliance | 8 | Auth, RBAC, secrets, input sanitization, data leak |
| Backend & Data | 16 | API, database, caching, queue, webhooks, migrations |
| Infrastructure | 10 | Deployment, CI/CD, monitoring, caching, cost |
| Code & Architecture | 17 | Code quality, types, naming, testing, dependencies |
Key Scripts
bash
# Run health analysis (table output)
bun run health
# JSON output
bun run health:json
# Build
moon run tools-health:build
# Quality
moon run tools-health:lint
moon run tools-health:typecheck
moon run tools-health:verifyCLI Usage
bash
# Table format (default)
bun run health --format table
# JSON format
bun run health --format json
# Output to file
bun run health --output report.jsonRelated
- Project Overview — Architecture and tech stack
- Code Review — Review workflows and tools
- Development — Contributing and testing guides