DevDoctor
Zero-Config Local Project Setup Scanner & CLI Diagnostics

Project at a Glance
- Problem: Developer onboarding often stalls with "Why won't this project run on my machine?" due to mismatched runtime versions, missing
.envkeys, conflicting lockfiles, occupied ports, or stale README instructions rather than broken application code. - Deliverables: A zero-config, local-first TypeScript + Node.js CLI (
v0.1.0) with a modular stack scanner architecture: 9 deep JavaScript/Node.js/Bun diagnostic checkers, 4 basic ecosystem detectors (Docker, Go, PHP, Deno), a weighted 0-100 scoring engine, and Terminal, JSON, and Markdown reporters. - Core Stack: TypeScript 5, Node.js (ESM), Commander, Ora.
- Practical Value: Built solo in 2026 as an open-source developer-experience tool on GitHub, designed to be read-only, evidence-based, and strictly privacy-conscious (never leaking
.envsecret values into reports).
Project Overview
DevDoctor is a zero-config local project setup scanner designed to act like a calm senior engineer helping a teammate diagnose onboarding blockers. Running devdoctor scan inspects the local project directory without requiring a configuration file, detects the project ecosystem, runs targeted read-only checks, calculates per-stack and overall health scores, and produces actionable suggestions backed by concrete evidence.
Every check is engineered around two core safety invariants:
- Read-Only & Safe by Default: DevDoctor diagnoses issues and recommends next steps; it does not auto-install packages, kill running processes, or mutate user project files beyond writing report outputs.
- Privacy-Conscious Reporting: Environment variable checks inspect
.env.example,.env, and source usage, but reports only record variable names and presence status (missingvspresent), never secret values.
Modular Scanner Architecture
+-------------------------------------------------------------+
| DEVDOCTOR CLI (Commander + Ora) |
| devdoctor scan [--output | --markdown | --json] |
+------------------------------+------------------------------+
|
v
+-------------------------------------------------------------+
| CORE ENGINE (src/core/) |
| detector.ts -> scanner.ts -> diagnosis.ts -> scoring.ts |
+--------------+-------------------------------+--------------+
| |
v v
+-----------------------------+ +-----------------------------+
| DEEP STACK MODULE (js) | | BASIC DETECTORS (4) |
| - runtimeVersion | | - docker (Dockerfile / |
| - packageManager | | docker-compose) |
| - dependencyInstalled | | - go (go.mod / go.sum) |
| - envExample & envUsage | | - php (composer / artisan) |
| - portConflict | | - deno (deno.json / lock) |
| - readmeMismatch | | (includedInOverall: false) |
| - scripts & workspace | | |
+--------------+--------------+ +--------------+--------------+
| |
+---------------+---------------+
|
v
+-------------------------------------------------------------+
| REPORTERS (src/core/reporters/) |
| Terminal Summary | .devdoctor/report.json | Markdown |
+-------------------------------------------------------------+
Implemented Diagnostic Capabilities (v0.1.0)
1. Deep JavaScript / Node.js / Bun Checkers
Located under src/core/modules/js/checkers/, the primary module performs nine focused checks:
- Runtime Version (
runtimeVersion.ts): Compares local runtime versions against project version constraints using semver checks. - Package Manager & Lockfiles (
packageManager.ts): Infersbun,yarn,pnpm, ornpmfrom lockfiles and flags multiple conflicting lockfiles as a warning. - Dependency Installation (
dependencyInstalled.ts): Verifies whether local dependencies are installed cleanly. - Environment Variable Coverage (
envExample.ts&envUsage.ts): Cross-checks.env.exampleagainst.envand scans source code references without ever persisting secret values. - Port Conflict Detection (
portConflict.ts): Checks whether expected local development ports are already occupied. - README & Scripts Validation (
readmeMismatch.ts&scripts.ts): Inspectspackage.jsonscripts and surfaces mismatches against documented setup commands. - Monorepo / Workspace Detection (
workspace.ts): Detectspackage.jsonworkspaces andpnpm-workspace.yamlsafely as informational guidance without unfairly penalizing the score.
2. Extensible Multi-Ecosystem Detection
Basic detection modules (docker, go, php, deno) inspect standard manifests (Dockerfile, docker-compose.yml, go.mod, composer.json, artisan, deno.json) and local tool binaries. Basic-only modules set includedInOverall: false so incomplete ecosystems do not distort the project's overall health score.
3. Weighted Scoring & Multi-Format Reporting
- Scoring Engine (
scoring.ts): Starts each eligible stack at100and applies severity-weighted penalties (failed high -25,failed medium -15,failed low -8,warning high -12,warning medium -8,warning low -3), classifying projects intohealthy(85-100),warning(60-84), orcritical(0-59). - Reporters (
reporters/): Renders a compact terminal summary withoraprogress states, writes.devdoctor/report.jsonby default, and supports--output <path>,--markdown <path>, and--jsonstdout streaming.
Sample CLI Report Format
DevDoctor report
Project: my-app
Stacks: js, docker
Overall score: 76/100 (warning)
JS score: 68/100 (warning)
Docker score: 90/100 (healthy)
Failed:
x Node version mismatch
x Missing env variables: DATABASE_URL, JWT_SECRET
Warnings:
! Multiple lockfiles detected
! Port 3000 is already in use
Info:
i Workspace detected, deep workspace scanning is not supported yet
Report written to:
.devdoctor/report.json
Current Status & Roadmap
- Implemented (
v0.1.0on GitHub): Modular CLI scanner, 9 deep JS/Node/Bun checkers, 4 basic stack detectors, weighted scoring engine, and Terminal/JSON/Markdown reporters. Currently available as open-source code on GitHub (not yet published to the npm registry). - Planned / In Progress: The static read-only web dashboard (
src/dashboard/is currently a placeholder), deeper diagnostics for Go/PHP/Docker Compose, deep monorepo workspace scanning, and npm registry distribution.