Skip to content

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

LayerTechnologyVersion
RuntimeBun>= 1.3.0
LanguageTypeScript^7.0.2
ArchitectureClean Architecture
Bundlingbunup^0.16.32
LintingBiome^2.5.4
Type Checkingtsc
TestingVitest^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 formatting

Health Domains (60+ Categories)

DomainCategoriesDescription
User-Facing9Accessibility, responsive design, i18n, UX/UI, PWA
Security & Compliance8Auth, RBAC, secrets, input sanitization, data leak
Backend & Data16API, database, caching, queue, webhooks, migrations
Infrastructure10Deployment, CI/CD, monitoring, caching, cost
Code & Architecture17Code 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:verify

CLI 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.json

Released under the MIT License.