launch-doctor 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +107 -0
- package/LICENSE +21 -0
- package/README.md +501 -2
- package/dist/src/baseline.d.ts +14 -0
- package/dist/src/baseline.js +71 -0
- package/dist/src/checks/common.d.ts +16 -0
- package/dist/src/checks/common.js +33 -0
- package/dist/src/checks/costs.d.ts +9 -0
- package/dist/src/checks/costs.js +245 -0
- package/dist/src/checks/database.d.ts +2 -0
- package/dist/src/checks/database.js +358 -0
- package/dist/src/checks/email.d.ts +19 -0
- package/dist/src/checks/email.js +270 -0
- package/dist/src/checks/first-impressions.d.ts +2 -0
- package/dist/src/checks/first-impressions.js +270 -0
- package/dist/src/checks/legal.d.ts +2 -0
- package/dist/src/checks/legal.js +136 -0
- package/dist/src/checks/monitoring.d.ts +2 -0
- package/dist/src/checks/monitoring.js +122 -0
- package/dist/src/checks/payments.d.ts +2 -0
- package/dist/src/checks/payments.js +315 -0
- package/dist/src/checks/secrets.d.ts +23 -0
- package/dist/src/checks/secrets.js +451 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +491 -0
- package/dist/src/comments.d.ts +8 -0
- package/dist/src/comments.js +143 -0
- package/dist/src/demo.d.ts +15 -0
- package/dist/src/demo.js +110 -0
- package/dist/src/detect.d.ts +10 -0
- package/dist/src/detect.js +132 -0
- package/dist/src/fixes.d.ts +3 -0
- package/dist/src/fixes.js +67 -0
- package/dist/src/github.d.ts +80 -0
- package/dist/src/github.js +288 -0
- package/dist/src/grade.d.ts +16 -0
- package/dist/src/grade.js +52 -0
- package/dist/src/history.d.ts +16 -0
- package/dist/src/history.js +88 -0
- package/dist/src/index.d.ts +13 -0
- package/dist/src/index.js +149 -0
- package/dist/src/init.d.ts +9 -0
- package/dist/src/init.js +49 -0
- package/dist/src/live.d.ts +16 -0
- package/dist/src/live.js +509 -0
- package/dist/src/mcp.d.ts +140 -0
- package/dist/src/mcp.js +381 -0
- package/dist/src/project.d.ts +105 -0
- package/dist/src/project.js +820 -0
- package/dist/src/report.d.ts +8 -0
- package/dist/src/report.js +147 -0
- package/dist/src/routes.d.ts +40 -0
- package/dist/src/routes.js +227 -0
- package/dist/src/sarif.d.ts +14 -0
- package/dist/src/sarif.js +54 -0
- package/dist/src/summary.d.ts +9 -0
- package/dist/src/summary.js +48 -0
- package/dist/src/types.d.ts +104 -0
- package/dist/src/types.js +1 -0
- package/dist/src/util.d.ts +15 -0
- package/dist/src/util.js +77 -0
- package/dist/src/version.d.ts +2 -0
- package/dist/src/version.js +21 -0
- package/package.json +61 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.3.0] - 2026-11-27
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- GitHub Action (`uses: SHARAJ379/launch-doctor@v0`): runs the checkup on pull requests, posts inline comments with fix prompts on the lines the pull request adds, and keeps one summary comment up to date. Inputs: `path`, `fail-on` (`critical`, `warning` or `never`), `comment`, `args`, `github-token`.
|
|
15
|
+
- `--pr-comment` posts the same pull request comments from the CLI. It never fails the run: outside a pull request, or without write access, it explains why it skipped.
|
|
16
|
+
- When `GITHUB_OUTPUT` is set, the grade, score, critical and warning counts are saved as step outputs.
|
|
17
|
+
- `launch-doctor mcp` runs a Model Context Protocol server, so Claude Code, Cursor and other AI tools can run the checkup themselves. Tools: `scan_project` (grade, findings with file, line and fix prompt, and the checklist), `scan_url` (the live site scan) and `list_checks`. Stdio only, no dependencies, protocol versions 2024-11-05 to 2025-11-25.
|
|
18
|
+
- Five more providers. Clerk: secret keys are told apart from Stripe's (same `sk_live_` prefix), and apps get a "switch to a production instance" checklist item. Paddle and Lemon Squeezy: webhooks that never verify the signature are critical, webhooks that sign re-encoded JSON or that are missing are warnings, and their API keys are found in code. Convex: deploy keys in code, and public mutations and actions that never check who is calling (in apps with accounts). Appwrite: API keys passed to `setKey()`, and permissions that let anyone (critical) or every signed-in user (warning) change data, in code and in `appwrite.json`.
|
|
19
|
+
- Mobile apps (Expo and React Native). Keys in app code are critical, since they ship inside the app, and `EXPO_PUBLIC_` variables are treated like `NEXT_PUBLIC_` ones. Monitoring looks for crash reporting (Sentry, Crashlytics, Instabug and others). Legal asks every store app for a privacy policy link. First impressions finds placeholder app IDs (`com.anonymous...`), cleartext HTTP on Android, `NSAllowsArbitraryLoads` on iOS and development addresses like `10.0.2.2`, and adds the store-readiness checklist (listing, privacy forms, a reviewer account, a release build on a real phone). Website-only checks no longer run on a mobile app, and a monorepo with both gets both.
|
|
20
|
+
- FastAPI, Flask, Django and Gemini are recognised and shown in the report header.
|
|
21
|
+
- Findings that have no file and line ("no rate limiting", "no error tracking") now say what Launch Doctor looked for, so you can check the claim yourself.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- The workflow written by `launch-doctor init` uses `actions/checkout@v7` and `actions/setup-node@v7`.
|
|
26
|
+
- The README now says plainly what Launch Doctor can and cannot do: a "Read this first" summary, a "What it cannot do" section (production settings, runtime errors, authorization logic, code-level vulnerabilities, dependency vulnerabilities, stack coverage and skipped files), how it is tested, and how to report a wrong finding. The live scan's network use is described fully: it also fetches the page's scripts and source maps, which may be on other domains.
|
|
27
|
+
- The terminal report and `LAUNCH_FIXES.md` end with a link for reporting wrong or missed findings.
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- A separate git repository inside the project folder (a folder with its own `.git`, like a tool you cloned to try out) is no longer scanned as part of your app. Its findings used to drag your grade down. The report names what was left out, and `--json` lists it under `nestedRepos`. Submodules are still scanned, and a folder outside git is scanned as before.
|
|
32
|
+
- Stopping `--demo` with Ctrl+C (or SIGTERM/SIGHUP) no longer leaves its sample project in the temp folder, and `--demo` removes `launch-doctor-demo-*` folders over an hour old that earlier killed runs left behind.
|
|
33
|
+
- A hand-written rate limiter (for example a counter kept in your database or Redis that answers with HTTP 429) now counts as rate limiting. Passing on the AI provider's own `RateLimitError` still doesn't.
|
|
34
|
+
- A Paddle webhook that never imports the Paddle SDK (the dangerous, unverified kind) was reported as "no webhook"; it is now found when its file path names Paddle, and reported as unverified.
|
|
35
|
+
- The MCP server said "No problems found" when every finding was in the baseline, right under an F grade. It now says no new problems were found and that the grade still counts the accepted ones.
|
|
36
|
+
- Expo, React Native, Paddle, Lemon Squeezy and Appwrite are named in the report header.
|
|
37
|
+
- The rate-limit fix prompt suggests a library for your stack (slowapi for FastAPI, Flask-Limiter, django-ratelimit, express-rate-limit, @upstash/ratelimit for serverless...) instead of always @upstash/ratelimit, and first asks your AI tool to check for an existing limiter.
|
|
38
|
+
|
|
39
|
+
## [0.2.1] - 2026-11-27
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
|
|
43
|
+
- Settings that only mention a sensitive word (for example `VITE_PASSWORD_MIN_LENGTH`) are no longer reported as secrets exposed through a public variable.
|
|
44
|
+
- A DNS lookup that times out or is refused (common for long SPF records, which need DNS over TCP) is retried, and if it still fails the report says it couldn't check, instead of warning that the SPF or DMARC record is missing.
|
|
45
|
+
- An `import ... from "pkg"` written inside a string (help text, prompts, docs) no longer counts as using that package, which caused false payment and AI findings.
|
|
46
|
+
|
|
47
|
+
## [0.2.0] - 2026-11-04
|
|
48
|
+
|
|
49
|
+
### Added
|
|
50
|
+
|
|
51
|
+
- `launch-doctor scan <url>` checks a deployed site from the outside: downloadable `.env`, `.git` and SQL backups, public source maps, API keys in the JavaScript, Supabase tables readable with the public key, and HTTPS and security headers. `--no-db` skips the Supabase test.
|
|
52
|
+
- AI endpoints are now judged one handler at a time: auth and rate limiting must be reachable from that handler, including through local imports.
|
|
53
|
+
- `--fail-on <critical|warning>` chooses the lowest severity that makes `--ci` exit with code 1.
|
|
54
|
+
- Inline ignores: a `launch-doctor-ignore <id>` comment on a finding's line or the line above silences that one finding (`//`, `#`, `/* */`, `<!-- -->` and SQL `--` comments).
|
|
55
|
+
- `--only <ids>` and `--skip <ids>` run or skip categories; skipped categories don't count toward the grade.
|
|
56
|
+
- GitHub Actions job summary: when `GITHUB_STEP_SUMMARY` is set, a Markdown summary is added to the job page.
|
|
57
|
+
- `--sarif <file>` writes SARIF 2.1.0 for GitHub code scanning.
|
|
58
|
+
- Baselines: `--update-baseline` writes `.launchdoctor-baseline.json`; later runs mark known findings, collapse them and leave them out of `--ci`. `--no-baseline` ignores the file.
|
|
59
|
+
- `launch-doctor init` creates a commented `.launchdoctorignore` and a GitHub Actions workflow without overwriting existing files.
|
|
60
|
+
- `--history` and `--history-depth <n>` find API keys that were removed from the code but are still in git history.
|
|
61
|
+
- Comment-aware matching: commented-out code no longer counts as an error boundary, account deletion, rate limiter, auth check or webhook verification.
|
|
62
|
+
- Supabase policies are graded by how open they are: open write policies are critical, write policies open to any signed-in user are a warning, and public read policies go on the checklist.
|
|
63
|
+
- Email: a sender domain that doesn't exist in DNS gets one clear warning, and a missing root SPF record is a checklist item (not a warning) for Amazon SES, Postmark and SendGrid.
|
|
64
|
+
- Web-app detection: monitoring, legal and first-impressions checks only run on web apps.
|
|
65
|
+
- Unknown ids in `.launchdoctorignore` are reported as a warning.
|
|
66
|
+
|
|
67
|
+
### Changed
|
|
68
|
+
|
|
69
|
+
- Any critical finding now gives an F, in its category and overall.
|
|
70
|
+
- Removed all emojis from the terminal report, `LAUNCH_FIXES.md`, `--help` and the docs. The report uses `[CRITICAL]`, `[WARN]`, `[PASS]` and `[ ]` labels.
|
|
71
|
+
- `--json` and `--ci` no longer write `LAUNCH_FIXES.md` unless `--out` is given.
|
|
72
|
+
- An existing `LAUNCH_FIXES.md` is rewritten (with an "All clear" section) when nothing is left to fix.
|
|
73
|
+
- In `.launchdoctorignore`, a bare word that names an existing file or folder is treated as a path.
|
|
74
|
+
- Requires Node.js 22 or newer.
|
|
75
|
+
- Match line numbers use cached line starts and a binary search, which is faster on large files.
|
|
76
|
+
|
|
77
|
+
### Fixed
|
|
78
|
+
|
|
79
|
+
- Middleware only counts as protecting AI routes when it actually blocks signed-out requests and covers `/api` (Supabase's `updateSession()` alone doesn't).
|
|
80
|
+
- The rate-limit check no longer passes on comments, `RateLimitError` handling, or a package that is installed but never imported.
|
|
81
|
+
- Sending an `Authorization` header to the AI provider is no longer mistaken for a user auth check.
|
|
82
|
+
- A global `app.use(express.json())` with no `express.raw()` is reported, because it breaks Stripe signature checks.
|
|
83
|
+
- Every Stripe webhook route is checked on its own; one verified webhook no longer hides an unverified one.
|
|
84
|
+
- DKIM records that contain only the public key (`p=...`) are recognised.
|
|
85
|
+
- Truncated scans (more than 20,000 files) are still sorted.
|
|
86
|
+
- The `--demo` temp folder is deleted even if the scan crashes.
|
|
87
|
+
- Every git command runs with `core.fsmonitor=false`, so scanning an untrusted folder can't make git run a program from that folder's `.git/config`.
|
|
88
|
+
|
|
89
|
+
## [0.1.0] - 2026-11-02
|
|
90
|
+
|
|
91
|
+
First release.
|
|
92
|
+
|
|
93
|
+
### Added
|
|
94
|
+
|
|
95
|
+
- `npx launch-doctor`: grades a project A-F in eight categories (secrets and keys, database and backups, payments, AI and API costs, email delivery, errors and monitoring, legal and trust, first impressions).
|
|
96
|
+
- Plain-English explanations and a copy-paste fix prompt for every finding, saved to `LAUNCH_FIXES.md`.
|
|
97
|
+
- "Check yourself" checklist items for things code can't show.
|
|
98
|
+
- Live DNS check of SPF, DKIM and DMARC for the sending domain.
|
|
99
|
+
- `--json`, `--ci`, `--offline`, `--out`, `--no-file`, `--domain` and `--demo`.
|
|
100
|
+
- `.launchdoctorignore` for silencing findings by id or skipping paths.
|
|
101
|
+
- Support for JavaScript / TypeScript and Python projects.
|
|
102
|
+
|
|
103
|
+
[Unreleased]: https://github.com/SHARAJ379/launch-doctor/compare/v0.3.0...HEAD
|
|
104
|
+
[0.3.0]: https://github.com/SHARAJ379/launch-doctor/compare/v0.2.1...v0.3.0
|
|
105
|
+
[0.2.1]: https://github.com/SHARAJ379/launch-doctor/compare/v0.2.0...v0.2.1
|
|
106
|
+
[0.2.0]: https://github.com/SHARAJ379/launch-doctor/compare/v0.1.0...v0.2.0
|
|
107
|
+
[0.1.0]: https://github.com/SHARAJ379/launch-doctor/releases/tag/v0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sharaj R Shetty
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,502 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Launch Doctor
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**A pre-launch checkup for vibe-coded apps: one command, an A-F grade, and a fix prompt for every problem.**
|
|
4
|
+
|
|
5
|
+
[](https://github.com/SHARAJ379/launch-doctor/actions/workflows/ci.yml)
|
|
6
|
+
[](https://www.npmjs.com/package/launch-doctor)
|
|
7
|
+
[](https://nodejs.org/)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
|
|
10
|
+
Launch Doctor scans your project for common problems that hurt apps after launch: leaked API keys, databases anyone can read, payments that can be faked, emails that land in spam, AI endpoints that can run up your bill, missing legal pages, and leftover template defaults. It is built for developers who ship with AI coding tools (Claude Code, Cursor, Lovable, Bolt, Windsurf) and may not read every line of generated code. Every finding is explained in plain English and includes a prompt you can paste straight back into your AI assistant. It has no runtime dependencies, requires no account, sends no telemetry, and your code never leaves your machine.
|
|
11
|
+
|
|
12
|
+
## Read this first
|
|
13
|
+
|
|
14
|
+
Launch Doctor is a **quick checklist with teeth, not a security audit**. Please trust it accordingly:
|
|
15
|
+
|
|
16
|
+
- **It reads your code with pattern rules.** It does not run your app, log in, or understand your business logic. It will sometimes flag code that is fine (a false alarm) and sometimes miss a real problem.
|
|
17
|
+
- **It cannot see your production settings.** Environment variables in Vercel or Netlify, and settings in the Supabase, Firebase or Stripe dashboards, are invisible to it. A typo in a production key or URL will not be caught.
|
|
18
|
+
- **A grade A means "none of the problems we look for were found"**, not "your app is secure".
|
|
19
|
+
- **It is new.** Version 0.x, first released in November 2026, maintained by one person. The checks are tested (see [How it is tested](#how-it-is-tested)), but it has not yet been used on many real projects, so expect rough edges and please [report them](#found-a-wrong-finding).
|
|
20
|
+
|
|
21
|
+
The full list is in [What it cannot do](#what-it-cannot-do).
|
|
22
|
+
|
|
23
|
+
## Quick start
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npx launch-doctor
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Scan the built-in sample app full of common mistakes:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx launch-doctor --demo
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Initialize configuration and GitHub Actions files:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx launch-doctor init
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Requires Node.js 22 or newer. That is the version range the automated tests cover (22 and 24). In a manual check it also ran on Node 18 and 20, but those versions are not tested on every change, so they are not officially supported.
|
|
42
|
+
|
|
43
|
+
## Example output
|
|
44
|
+
|
|
45
|
+
This is the `--demo` report, shortened. On a real project the last line tells you where `LAUNCH_FIXES.md` was saved (the demo doesn't write it).
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
Launch Doctor v0.3.0
|
|
49
|
+
Checked my-weekend-saas · 12 files · Vite, React, Supabase, Stripe, OpenAI
|
|
50
|
+
|
|
51
|
+
Overall grade F Not ready to launch: fix 6 critical issues first
|
|
52
|
+
|
|
53
|
+
F Secrets & keys 2 critical · 1 to fix · 1 to check
|
|
54
|
+
F Database & backups 2 critical · 1 to check
|
|
55
|
+
F Payments 1 critical · 2 to check
|
|
56
|
+
F AI & API costs 1 critical · 1 to fix · 1 to check
|
|
57
|
+
B Email delivery 1 to fix · 3 to check
|
|
58
|
+
C Errors & monitoring 2 to fix · 2 to check
|
|
59
|
+
D Legal & trust 5 to fix
|
|
60
|
+
D First impressions 5 to fix · 3 to check
|
|
61
|
+
|
|
62
|
+
MUST FIX BEFORE LAUNCH (6)
|
|
63
|
+
|
|
64
|
+
[CRITICAL] Stripe live secret key is written directly in your code
|
|
65
|
+
src/lib/stripe.ts:1
|
|
66
|
+
This file is sent to every visitor's browser, so anyone can copy the key
|
|
67
|
+
(sk_live_…exe9) and use your account.
|
|
68
|
+
|
|
69
|
+
[CRITICAL] Secret exposed through the public variable VITE_OPENAI_API_KEY
|
|
70
|
+
.env:3
|
|
71
|
+
Anything starting with VITE_ gets copied into your website's JavaScript,
|
|
72
|
+
so every visitor can read it. That prefix is only for values that are safe
|
|
73
|
+
to be public.
|
|
74
|
+
...
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Project workflow
|
|
78
|
+
|
|
79
|
+
Launch Doctor operates across two integrated workflows: an automated internal analysis pipeline that inspects your repository, and a developer-in-the-loop remediation lifecycle designed to pair with AI coding assistants.
|
|
80
|
+
|
|
81
|
+
### 1. Internal analysis pipeline
|
|
82
|
+
|
|
83
|
+
The following diagram outlines the multi-stage static analysis pipeline executed on every scan:
|
|
84
|
+
|
|
85
|
+
```mermaid
|
|
86
|
+
flowchart TD
|
|
87
|
+
Start["User / CI triggers: launch-doctor"] --> ParseArgs["1. Argument & Option Parsing"]
|
|
88
|
+
ParseArgs --> LoadContext["2. Project Ingestion & File Discovery"]
|
|
89
|
+
LoadContext --> DetectStack["3. Technology Stack & Environment Detection"]
|
|
90
|
+
DetectStack --> ChecksSuite
|
|
91
|
+
|
|
92
|
+
subgraph ChecksSuite["4. Evaluation across 8 Check Modules"]
|
|
93
|
+
direction TB
|
|
94
|
+
C1["Secrets & Keys Scan"]
|
|
95
|
+
C2["Database Security & RLS"]
|
|
96
|
+
C3["Payment Webhooks & Verification"]
|
|
97
|
+
C4["AI Endpoints & Cost Controls"]
|
|
98
|
+
C5["Email DNS & Configuration"]
|
|
99
|
+
C6["Error Boundaries & Monitoring"]
|
|
100
|
+
C7["Legal & Compliance Pages"]
|
|
101
|
+
C8["First Impressions & Defaults"]
|
|
102
|
+
C_Hist["Optional: Git History Commit Walk"]
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
ChecksSuite --> FilterIgnore["5. Suppression & Baseline Filtering"]
|
|
106
|
+
FilterIgnore --> ScoringEngine["6. Scoring & Grading Engine"]
|
|
107
|
+
ScoringEngine --> OutputDispatch
|
|
108
|
+
|
|
109
|
+
subgraph OutputDispatch["7. Multi-Target Outputs"]
|
|
110
|
+
direction TB
|
|
111
|
+
Out1["Terminal Dashboard Output"]
|
|
112
|
+
Out2["LAUNCH_FIXES.md Prompt Catalog"]
|
|
113
|
+
Out3["JSON / SARIF 2.1.0 Reports"]
|
|
114
|
+
Out4["GitHub Actions Step Summary"]
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
OutputDispatch --> ExitEval["8. Exit Code Evaluation (0, 1, or 2)"]
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
#### Pipeline stages in detail
|
|
121
|
+
|
|
122
|
+
1. **Argument parsing and validation (`src/cli.ts`):**
|
|
123
|
+
Evaluates CLI flags, path arguments, targeted categories (`--only`, `--skip`), severity thresholds (`--fail-on`), output destinations (`--out`, `--sarif`), and runtime modifiers (`--ci`, `--offline`, `--history`, `--demo`).
|
|
124
|
+
2. **Project ingestion and tree traversal (`src/project.ts`):**
|
|
125
|
+
Walks the project root, automatically skipping `node_modules`, build artifacts (`dist`, `build`, `.next`), binary formats, and hidden folders (except `.github`). Ingests package manifests (`package.json`, `requirements.txt`, `pyproject.toml`), git status, and `.launchdoctorignore` patterns.
|
|
126
|
+
3. **Stack and environment detection (`src/detect.ts`, `src/comments.ts`):**
|
|
127
|
+
Identifies frameworks (Next.js, Vite, React, Vue, Express, FastAPI, Flask, Django), server routes, database configurations (Supabase, Firebase, Prisma), payment gateways (Stripe, Razorpay), error trackers (Sentry, PostHog), and email services. Prepares a comment-stripped view of source files so commented-out code is not mistaken for active protection.
|
|
128
|
+
4. **Multi-category check execution (`src/checks/`):**
|
|
129
|
+
Runs audits across all 8 categories. If `--history` is enabled, an incremental git commit walker inspects the last `n` commits (default 500) for secrets that were removed from HEAD but remain exposed in commit history.
|
|
130
|
+
5. **Suppression and baseline matching (`src/baseline.ts`):**
|
|
131
|
+
Applies inline `launch-doctor-ignore <id>` comments and `.launchdoctorignore` path or id rules. If `.launchdoctor-baseline.json` is present and baseline mode is active, matches existing findings by ID, relative file path, and line content fingerprint.
|
|
132
|
+
6. **Scoring and grading engine (`src/grade.ts`):**
|
|
133
|
+
Calculates category and overall scores from weighted deductions. Strict scoring ceilings ensure that any critical finding caps both the category score and the overall score at 39 (grade F).
|
|
134
|
+
7. **Multi-target reporting and artifact generation (`src/report.ts`, `src/fixes.ts`, `src/sarif.ts`, `src/summary.ts`):**
|
|
135
|
+
Renders the CLI terminal dashboard, generates `LAUNCH_FIXES.md` with copy-paste prompts for AI models, outputs structured JSON or SARIF 2.1.0 files when requested, and populates GitHub Actions job summaries via `GITHUB_STEP_SUMMARY`.
|
|
136
|
+
8. **Process exit resolution (`src/cli.ts`):**
|
|
137
|
+
Returns exit code 0 whenever the scan finishes (with `--ci`, only when nothing is at or above `--fail-on`), code 1 for CI gate failures, and code 2 for invalid arguments or unexpected runtime errors.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
### 2. Developer and AI remediation lifecycle
|
|
142
|
+
|
|
143
|
+
Launch Doctor is built to fit directly into your daily development cycle, especially when pairing with AI assistants:
|
|
144
|
+
|
|
145
|
+
```mermaid
|
|
146
|
+
flowchart LR
|
|
147
|
+
Dev["1. Local Development (AI / Human)"] --> Scan["2. Run npx launch-doctor"]
|
|
148
|
+
Scan --> Check{"Grade & Findings?"}
|
|
149
|
+
Check -- "Issues Found (Grade < A)" --> ReadFixes["3. Open LAUNCH_FIXES.md"]
|
|
150
|
+
ReadFixes --> PastePrompt["4. Paste Prompts to AI Tool"]
|
|
151
|
+
PastePrompt --> ReScan["5. Re-run Scan to Verify"]
|
|
152
|
+
ReScan --> Check
|
|
153
|
+
Check -- "Clean (Grade A or Baseline)" --> Commit["6. Commit & Push Code"]
|
|
154
|
+
Commit --> CI["7. CI/CD PR Gate (--ci)"]
|
|
155
|
+
CI --> Deploy["8. Deploy (and check the manual checklist)"]
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
1. **Pre-flight scan:** Before shipping changes or merging a branch, run `npx launch-doctor` in your workspace.
|
|
159
|
+
2. **Review findings:** Check your letter grade (A-F), category breakdown, and critical blockers in the terminal.
|
|
160
|
+
3. **Copy prompts to AI tools:** Open `LAUNCH_FIXES.md`. Copy the specific problem prompt or the single batch prompt and paste it into Claude Code, Cursor, Windsurf, Lovable, or Bolt.
|
|
161
|
+
4. **Verify remediation:** Re-run `npx launch-doctor` to verify the fixes and watch your grade increase.
|
|
162
|
+
5. **Establish baseline for legacy debt:** If you are adopting Launch Doctor on an existing project, run `npx launch-doctor --update-baseline` so CI only reports new issues.
|
|
163
|
+
6. **Automate CI gating:** Add `npx launch-doctor --ci` to your pull request workflow to catch regressions before they merge.
|
|
164
|
+
|
|
165
|
+
## What it checks
|
|
166
|
+
|
|
167
|
+
| Category | What it catches | Severity range |
|
|
168
|
+
|---|---|---|
|
|
169
|
+
| Secrets & keys (`secrets`) | Stripe, Clerk, OpenAI, Anthropic, OpenRouter, Groq, Hugging Face, Supabase, AWS, GitHub, Slack, SendGrid, Resend, Paddle, Convex, Appwrite, and Lemon Squeezy keys in code; Supabase `service_role` keys; private keys; database URLs with passwords; secrets in `NEXT_PUBLIC_` / `VITE_` / `EXPO_PUBLIC_` variables; keys in mobile app code (they ship inside the app); `.env` files committed or not in `.gitignore`; with `--history`, keys still in git history | Warning to critical |
|
|
170
|
+
| Database & backups (`database`) | Supabase tables without Row Level Security; policies that let anyone write (`using (true)`); write policies open to any signed-in user; Firebase test-mode or open rules; Convex mutations and actions anyone can call without signing in; Appwrite permissions that let anyone (or every signed-in user) change data; SQLite on serverless hosting; `prisma db push` / `--accept-data-loss` instead of migrations | Warning to critical |
|
|
171
|
+
| Payments (`payments`) | Stripe, Lemon Squeezy, and Paddle webhooks that don't verify the signature (each route checked separately); webhooks or global `express.json()` that parse the body before verifying, or sign re-encoded JSON; no webhook at all; Razorpay payments never verified on the server | Warning to critical |
|
|
172
|
+
| AI & API costs (`costs`) | Paid AI or SMS APIs called from the browser; `dangerouslyAllowBrowser: true`; AI endpoints with no login check (middleware only counts if it really blocks `/api`); no real rate limiter | Warning to critical |
|
|
173
|
+
| Email delivery (`email`) | Resend's test sender; personal Gmail SMTP; sender domains that don't exist; missing SPF or DMARC (live DNS check); a checklist reminder when Supabase Auth still uses its built-in test mailer | Warning |
|
|
174
|
+
| Errors & monitoring (`monitoring`) | No error tracking or crash reporting (Sentry, PostHog, Crashlytics, and others); no error boundary or `error.tsx`, so crashes show a blank page | Warning |
|
|
175
|
+
| Legal & trust (`legal`) | No privacy policy, terms, refund policy, or contact page; no way for users to delete their account; a store app with no privacy policy link; a checklist reminder about cookie consent when analytics set cookies | Warning |
|
|
176
|
+
| First impressions (`first-impressions`) | "Vite + React" / "Create Next App" titles and descriptions; Vite favicon; Lovable default meta tags; no description or social preview image; hard-coded `localhost` URLs. For mobile apps: placeholder app IDs (`com.anonymous...`), cleartext HTTP on Android, `NSAllowsArbitraryLoads` on iOS, development addresses like `10.0.2.2` | Warning |
|
|
177
|
+
|
|
178
|
+
Most categories also add **"check yourself"** items for things code cannot show, such as automated database backups, provider spending limits, a real test purchase, uptime monitoring, switching Clerk to a production instance, and the app store listing and privacy forms.
|
|
179
|
+
|
|
180
|
+
Monitoring, legal, and first impressions checks run on web apps (a frontend framework, server routes, or an `index.html`) and on mobile apps (Expo and React Native), which get mobile versions of them: crash reporting, a privacy policy link for the stores, app ID and network security settings, and a store-readiness checklist. Command-line tools and libraries skip them automatically. In a monorepo with a website and an app, both sets run. A folder inside your project that is a separate git repository (it has its own `.git` folder and isn't a submodule) is left out, and the report says so.
|
|
181
|
+
|
|
182
|
+
## Live site scan
|
|
183
|
+
|
|
184
|
+
`npx launch-doctor scan https://myapp.com` checks your deployed site from the outside for a few things attackers and bots look for first. It makes a few dozen ordinary `GET` requests (at most about 90, when Supabase tables are tested) and never changes anything. Only scan sites you own or are allowed to test.
|
|
185
|
+
|
|
186
|
+
What it looks at: your home page, up to 20 JavaScript files that page loads, their source maps, a fixed list of file paths (`/.env`, `/.git/...`, `backup.sql` and similar), and Supabase tables named in that JavaScript. It does not crawl other pages, log in, fill in forms, or call your API, and it only tests whether Supabase tables can be **read**, not written.
|
|
187
|
+
|
|
188
|
+
| Category | What it catches | Severity range |
|
|
189
|
+
|---|---|---|
|
|
190
|
+
| Exposed files & keys (`live-exposure`) | `/.env`, `/.git` and SQL backups that can be downloaded (the content is verified, so single-page apps that answer 200 for every path are not flagged); public source maps; API keys inside the JavaScript every visitor downloads | Warning to critical |
|
|
191
|
+
| Open database (`live-database`) | Supabase `service_role` key in the page; tables that return rows to anyone holding the public anon key (only `GET`, one row per table, and rows are never saved or shown) | Critical |
|
|
192
|
+
| HTTPS & headers (`live-headers`) | Plain http; http that doesn't redirect to https; missing HSTS, Content-Security-Policy, `X-Content-Type-Options`, frame protection and `Referrer-Policy` | Warning to critical |
|
|
193
|
+
|
|
194
|
+
The report uses the same grades and `--json`, `--ci`, `--fail-on`, `--out` and `--no-file` options. Fix prompts go to `LAUNCH_FIXES_LIVE.md` in the current folder. Run `npx launch-doctor scan --help` for the options.
|
|
195
|
+
|
|
196
|
+
## Grading
|
|
197
|
+
|
|
198
|
+
- **Category score** = 100 − 50 per critical finding − 15 per warning.
|
|
199
|
+
- Any critical finding caps the category at 39, which is an F.
|
|
200
|
+
- Without a critical finding the score never drops below 40, so warnings alone cannot produce an F.
|
|
201
|
+
- **Overall score** is the weighted average of the categories that ran:
|
|
202
|
+
- Weights: secrets (3), database (3), payments (3), costs (2), email (1), monitoring (1), legal (1), and first impressions (1).
|
|
203
|
+
- Categories that do not apply, or are skipped with `--only` / `--skip`, are excluded.
|
|
204
|
+
- **Caps on the overall score:**
|
|
205
|
+
- Any critical finding anywhere caps the overall score at 39 (F).
|
|
206
|
+
- Any warning caps it at 89, so an A requires zero warnings and zero critical issues.
|
|
207
|
+
- **Grade tiers:** A ≥ 90, B ≥ 75, C ≥ 60, D ≥ 40, F < 40.
|
|
208
|
+
- "Check yourself" items do not alter the numerical grade. Baseline findings count toward the grade for awareness, but are ignored by the `--ci` exit code.
|
|
209
|
+
|
|
210
|
+
## CLI reference
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
npx launch-doctor [folder] [options]
|
|
214
|
+
npx launch-doctor init [folder]
|
|
215
|
+
npx launch-doctor scan <url> [options]
|
|
216
|
+
npx launch-doctor mcp
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
| Flag | Default | Description |
|
|
220
|
+
|---|---|---|
|
|
221
|
+
| `[folder]` | `.` | Project folder to check |
|
|
222
|
+
| `--domain <domain>` | auto-detected | Domain you send email from; checks SPF, DKIM and DMARC |
|
|
223
|
+
| `--out <file>` | `LAUNCH_FIXES.md` in the project | Where to save the fix prompts |
|
|
224
|
+
| `--no-file` | off | Don't write the fix prompts file |
|
|
225
|
+
| `--json` | off | Print the full report as JSON (no fix file unless `--out` is given) |
|
|
226
|
+
| `--sarif <file>` | off | Also write a SARIF 2.1.0 file for GitHub code scanning |
|
|
227
|
+
| `--pr-comment` | off | On a GitHub pull request, post a summary comment and inline fix prompts (see [Pull request comments](#pull-request-comments)) |
|
|
228
|
+
| `--offline` | off | Skip network checks (email DNS) |
|
|
229
|
+
| `--ci` | off | Exit with code 1 on findings at or above `--fail-on` (no fix file unless `--out`) |
|
|
230
|
+
| `--fail-on <level>` | `critical` | With `--ci`, the lowest severity that fails: `critical` or `warning` |
|
|
231
|
+
| `--only <ids>` | all | Run only these categories (comma-separated) |
|
|
232
|
+
| `--skip <ids>` | none | Skip these categories (comma-separated) |
|
|
233
|
+
| `--history` | off | Also look for keys still in git history |
|
|
234
|
+
| `--history-depth <n>` | `500` | How many commits `--history` reads |
|
|
235
|
+
| `--update-baseline` | off | Save today's findings to `.launchdoctor-baseline.json` as accepted |
|
|
236
|
+
| `--no-baseline` | off | Ignore `.launchdoctor-baseline.json` and show every finding |
|
|
237
|
+
| `--demo` | off | Scan a built-in sample app full of mistakes |
|
|
238
|
+
| `-h`, `--help` | | Show help |
|
|
239
|
+
| `-v`, `--version` | | Show the version |
|
|
240
|
+
| `init [folder]` | `.` | Create `.launchdoctorignore` and `.github/workflows/launch-doctor.yml` (never overwrites) |
|
|
241
|
+
| `scan <url>` | | Check your deployed site from the outside (see [Live site scan](#live-site-scan)) |
|
|
242
|
+
| `mcp` | | Start an MCP server so AI coding tools can run checks themselves (see [MCP server](#mcp-server)) |
|
|
243
|
+
| `--no-db` | off | With `scan`, don't test Supabase tables with the public key found in the page |
|
|
244
|
+
|
|
245
|
+
Category ids for `--only` and `--skip`: `secrets`, `database`, `payments`, `costs`, `email`, `monitoring`, `legal`, `first-impressions`. Skipped categories show as "skipped" and don't count toward the grade.
|
|
246
|
+
|
|
247
|
+
**Exit codes**
|
|
248
|
+
|
|
249
|
+
| Code | Meaning |
|
|
250
|
+
|---|---|
|
|
251
|
+
| `0` | The scan finished (and with `--ci`, no findings at or above `--fail-on`) |
|
|
252
|
+
| `1` | `--ci` was given and there are findings at or above `--fail-on` (baseline findings excluded) |
|
|
253
|
+
| `2` | Usage error (unknown flag, invalid argument, folder not found) or a crash |
|
|
254
|
+
|
|
255
|
+
## Configuration
|
|
256
|
+
|
|
257
|
+
### `.launchdoctorignore`
|
|
258
|
+
|
|
259
|
+
One entry per line. Run `npx launch-doctor init` to generate a starter template.
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
no-error-tracking
|
|
263
|
+
no-account-deletion
|
|
264
|
+
legacy/
|
|
265
|
+
scripts/seed.ts
|
|
266
|
+
**/*.fixture.ts
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
A plain word without path characters represents a finding id. Anything containing `/`, `*`, or `.`, or matching an existing file or folder on disk, is treated as a path pattern. Finding ids that do not correspond to any known check produce a warning to catch typos.
|
|
270
|
+
|
|
271
|
+
### Inline ignores
|
|
272
|
+
|
|
273
|
+
To silence a specific finding at a single line, place a `launch-doctor-ignore <id>` directive on that line or the line directly above it. All directive styles are supported (`//`, `#`, `/* */`, `<!-- -->`, SQL `--`), and multiple ids can be separated by commas:
|
|
274
|
+
|
|
275
|
+
```ts
|
|
276
|
+
// launch-doctor-ignore stripe-test-key
|
|
277
|
+
const STRIPE_TEST_KEY = 'sk_test_...';
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Baseline
|
|
281
|
+
|
|
282
|
+
When adding Launch Doctor to an existing codebase, record current findings so CI checks focus exclusively on new issues:
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
npx launch-doctor --update-baseline
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
On subsequent runs:
|
|
289
|
+
- Matching findings are tagged with `baseline: true` in JSON output.
|
|
290
|
+
- They are summarized in terminal output as a single "N existing issues (baseline)" line.
|
|
291
|
+
- They are excluded from `--ci` / `--fail-on` failure checks.
|
|
292
|
+
|
|
293
|
+
Findings are tracked by check ID, file path, and a fingerprint of the offending line, preserving baseline matches even as line numbers shift. Run with `--no-baseline` to display all suppressed findings.
|
|
294
|
+
|
|
295
|
+
## CI integration
|
|
296
|
+
|
|
297
|
+
The `npx launch-doctor init` command creates this GitHub Actions workflow:
|
|
298
|
+
|
|
299
|
+
```yaml
|
|
300
|
+
name: Launch Doctor
|
|
301
|
+
on: [pull_request]
|
|
302
|
+
jobs:
|
|
303
|
+
check:
|
|
304
|
+
runs-on: ubuntu-latest
|
|
305
|
+
steps:
|
|
306
|
+
- uses: actions/checkout@v7
|
|
307
|
+
- uses: actions/setup-node@v7
|
|
308
|
+
with:
|
|
309
|
+
node-version: 22
|
|
310
|
+
- run: npx launch-doctor --ci
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
- **Severity gating:** By default, `--ci` exits with code 1 only on critical findings. Add `--fail-on warning` to fail builds on warnings as well.
|
|
314
|
+
- **Job summaries:** When running in GitHub Actions, Launch Doctor automatically writes a markdown summary (including overall grade, category scorecard, and itemized issues with their file and line) to the GitHub Actions job summary tab via `GITHUB_STEP_SUMMARY`.
|
|
315
|
+
- **Step outputs:** When `GITHUB_OUTPUT` is set, the `grade`, `score`, `critical` and `warnings` values are saved as step outputs.
|
|
316
|
+
- **Code scanning alerts:** Export findings to SARIF 2.1.0 format to populate alerts directly in your repository Security tab. The upload step needs permission to write security events, so add it to the job:
|
|
317
|
+
|
|
318
|
+
```yaml
|
|
319
|
+
permissions:
|
|
320
|
+
contents: read
|
|
321
|
+
security-events: write
|
|
322
|
+
steps:
|
|
323
|
+
# ...checkout and setup-node as above...
|
|
324
|
+
- run: npx launch-doctor --sarif launch-doctor.sarif --no-file
|
|
325
|
+
- uses: github/codeql-action/upload-sarif@v3
|
|
326
|
+
if: always()
|
|
327
|
+
with:
|
|
328
|
+
sarif_file: launch-doctor.sarif
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Pull request comments
|
|
332
|
+
|
|
333
|
+
The Launch Doctor GitHub Action reviews each pull request like a teammate would:
|
|
334
|
+
|
|
335
|
+
- **Inline comments** on the lines the pull request adds, each with the plain-English risk, a fix prompt you can paste into your AI tool, and the `launch-doctor-ignore` comment that silences it.
|
|
336
|
+
- **One summary comment** with the grade, what this pull request added, what was already in the project, and the category scorecard. It is edited in place on every push, not posted again.
|
|
337
|
+
- Findings that were already commented on are not repeated, findings in `.launchdoctor-baseline.json` are left out, and each run posts at most 20 inline comments (the rest are listed in the summary).
|
|
338
|
+
|
|
339
|
+
```yaml
|
|
340
|
+
name: Launch Doctor
|
|
341
|
+
on: [pull_request]
|
|
342
|
+
permissions:
|
|
343
|
+
contents: read
|
|
344
|
+
pull-requests: write
|
|
345
|
+
jobs:
|
|
346
|
+
check:
|
|
347
|
+
runs-on: ubuntu-latest
|
|
348
|
+
steps:
|
|
349
|
+
- uses: actions/checkout@v7
|
|
350
|
+
- uses: SHARAJ379/launch-doctor@v0
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
| Input | Default | Description |
|
|
354
|
+
|---|---|---|
|
|
355
|
+
| `path` | `.` | Folder to check, relative to the repository root |
|
|
356
|
+
| `fail-on` | `critical` | Lowest severity that fails the check: `critical`, `warning` or `never` |
|
|
357
|
+
| `comment` | `true` | Post the summary and inline comments on pull requests |
|
|
358
|
+
| `args` | | Extra options, for example `--offline --skip legal` |
|
|
359
|
+
| `github-token` | `${{ github.token }}` | Token used for the comments |
|
|
360
|
+
|
|
361
|
+
The action also sets the `grade`, `score`, `critical` and `warnings` outputs. Pull requests from forks get a read-only token, so they can't be commented on; the check still runs and the job summary still has the results.
|
|
362
|
+
|
|
363
|
+
Using the CLI directly instead? Add `--pr-comment` and pass the token: `npx launch-doctor --ci --pr-comment` with `env: GITHUB_TOKEN: ${{ github.token }}`.
|
|
364
|
+
|
|
365
|
+
## Using with AI coding tools
|
|
366
|
+
|
|
367
|
+
Launch Doctor outputs `LAUNCH_FIXES.md` directly into your project root. Each entry includes the exact file and line number, an explanation of the risk, and a tailored prompt ready to paste into your AI assistant. It also includes a single batch prompt at the top of the file.
|
|
368
|
+
|
|
369
|
+
### With Claude Code
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
! npx launch-doctor
|
|
373
|
+
Fix the issues in LAUNCH_FIXES.md one at a time, starting with the critical ones. Explain each change before making it.
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
### With Cursor, Windsurf, Lovable, or Bolt
|
|
377
|
+
|
|
378
|
+
1. Run `npx launch-doctor` in your integrated terminal.
|
|
379
|
+
2. Open `LAUNCH_FIXES.md`.
|
|
380
|
+
3. Copy one fix prompt into the chat window.
|
|
381
|
+
4. Review and accept the code edit.
|
|
382
|
+
5. Re-run `npx launch-doctor` to observe your score improve.
|
|
383
|
+
|
|
384
|
+
### MCP server
|
|
385
|
+
|
|
386
|
+
`launch-doctor mcp` starts a [Model Context Protocol](https://modelcontextprotocol.io) server, so your AI assistant can run the checkup itself, read the findings and fix them without you copying anything.
|
|
387
|
+
|
|
388
|
+
**Claude Code:**
|
|
389
|
+
|
|
390
|
+
```bash
|
|
391
|
+
claude mcp add launch-doctor -- npx -y launch-doctor mcp
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
**Cursor** (`.cursor/mcp.json`) and other tools that use the same format:
|
|
395
|
+
|
|
396
|
+
```json
|
|
397
|
+
{
|
|
398
|
+
"mcpServers": {
|
|
399
|
+
"launch-doctor": { "command": "npx", "args": ["-y", "launch-doctor", "mcp"] }
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
Then ask: *"Run Launch Doctor on this project and fix the critical findings one at a time."*
|
|
405
|
+
|
|
406
|
+
| Tool | What it does |
|
|
407
|
+
|---|---|
|
|
408
|
+
| `scan_project` | Checks a folder (default: the one the assistant works in). Returns the grade, every finding with its file, line, explanation and fix prompt, and the checklist of things to verify by hand. Options: `path`, `only`, `skip`, `offline`, `domain`, `history`, `includeBaseline`. |
|
|
409
|
+
| `scan_url` | Checks a deployed site from the outside, like `launch-doctor scan <url>`. Options: `url`, `skipDatabase`. |
|
|
410
|
+
| `list_checks` | Lists the categories and every finding id, for `only`, `skip` and `.launchdoctorignore`. |
|
|
411
|
+
|
|
412
|
+
The tools only read: nothing is written to your project, and results also come back as structured data for clients that use it. The server speaks MCP over stdio (protocol versions 2024-11-05 to 2025-11-25) and has no dependencies.
|
|
413
|
+
|
|
414
|
+
## Privacy and network use
|
|
415
|
+
|
|
416
|
+
Launch Doctor analyzes your codebase locally on your device. Your source code, findings, and credentials are never uploaded to any remote server. Detected secrets are masked in reports (for example, `sk_live_…exe9`).
|
|
417
|
+
|
|
418
|
+
- **Email DNS validation:** This is the only network check a folder scan performs. When your project sends transactional email and a domain is identified (either discovered in code or specified via `--domain`), Launch Doctor queries your system DNS resolver for NS and TXT records (including root SPF, `send.<domain>`, `_dmarc.<domain>`, and common DKIM selectors). No code or private data is transmitted. Pass `--offline` to disable DNS lookups entirely. The `--demo` command never touches the network.
|
|
419
|
+
- **Live site scan (`scan <url>`):** sends ordinary `GET` requests to the address you give, to the JavaScript files and source maps that page loads (which may be on another domain, such as a CDN), and to your Supabase project when the page uses one. For the Supabase test it sends the public anon key it found in your page back to your own Supabase project. Nothing else is sent, and nothing is uploaded.
|
|
420
|
+
- **No telemetry:** Launch Doctor does not collect usage data or phone home.
|
|
421
|
+
- **Git history analysis (`--history`):** Runs local `git log` commands directly on your system without network requests.
|
|
422
|
+
- **Pull request comments (`--pr-comment`):** calls the GitHub API with the workflow's token to read the pull request's changed files and post comments. It only runs on GitHub Actions and sends finding titles, explanations, fix prompts and file paths, never your source code.
|
|
423
|
+
- **MCP server (`mcp`):** talks to your AI tool over stdin and stdout only; it opens no port. Its tools make the same network calls as the CLI: email DNS lookups for `scan_project` (unless `offline`), and the requests to the site you name for `scan_url`.
|
|
424
|
+
- **Package installation:** standard `npx` retrieval via the npm registry.
|
|
425
|
+
|
|
426
|
+
## What it cannot do
|
|
427
|
+
|
|
428
|
+
Launch Doctor is useful because it is fast and specific. That also means it has clear blind spots. If any of these matter for your app, use another tool or a human review as well.
|
|
429
|
+
|
|
430
|
+
**It doesn't see your running app or your production settings**
|
|
431
|
+
- Production environment variables (Vercel, Netlify, Render and others) are invisible. A malformed URL, a wrong key or a bad model name in production will not be caught.
|
|
432
|
+
- Settings made in the Supabase, Firebase or Stripe dashboards are invisible. Tables created in the Supabase dashboard (rather than in SQL migrations in your repo) can't be checked for Row Level Security from the code, so you only get a reminder (`scan` can at least test whether they can be read on your live site).
|
|
433
|
+
- It doesn't run your app, call your API or read your logs (apart from the `GET` requests of `scan`), so errors that only happen at runtime are not found.
|
|
434
|
+
|
|
435
|
+
**It doesn't do a full security review**
|
|
436
|
+
- It doesn't check your own authorization logic, for example whether user A can open user B's order through your API. The only access-control rules it understands are Supabase RLS in SQL files, Firebase rules files, Appwrite permissions, and whether Convex functions check who is calling.
|
|
437
|
+
- It doesn't look for XSS, SQL injection, CSRF, SSRF or similar code-level vulnerabilities.
|
|
438
|
+
- It doesn't check your dependencies for known vulnerabilities. Use `npm audit`, `pip-audit` or Dependabot for that.
|
|
439
|
+
- It is not a penetration test, and its legal-page checks are reminders, not legal advice.
|
|
440
|
+
|
|
441
|
+
**It decides by patterns, so it can be wrong both ways**
|
|
442
|
+
- Logins, rate limiters and webhook checks are recognised by common names and libraries. Code written in an unusual way may be reported as missing (a false alarm), and code that only looks right may pass (a miss).
|
|
443
|
+
- Route analysis follows local imports 2 levels deep. Dynamic imports and unusual route shapes may not be followed.
|
|
444
|
+
- API-only backends can get legal-page warnings (privacy policy, terms) that may not apply to them.
|
|
445
|
+
- A folder with very little code (for example only a README) can get an A, because there was nothing to find.
|
|
446
|
+
|
|
447
|
+
**Coverage depends on your stack**
|
|
448
|
+
- **Deepest:** JavaScript and TypeScript web apps (Next.js, Vite/React, Express and similar), with Supabase, Firebase, Prisma, Stripe, Razorpay, and the common AI and email providers.
|
|
449
|
+
- **Good:** Python (FastAPI, Flask, Django): secrets, AI costs, Stripe webhooks, Supabase and the web-app checks. Clerk, Convex, Appwrite, Paddle and Lemon Squeezy have their own checks (new in 0.3.0, so less tried than the ones above).
|
|
450
|
+
- **Mobile (new in 0.3.0):** Expo and React Native apps get mobile versions of the checks. Launch Doctor reads the Expo config (`app.json`, `app.config.*`), `AndroidManifest.xml` and `Info.plist`; Gradle and Xcode project files are not read, and native Swift, Kotlin and Java code is not scanned at all.
|
|
451
|
+
- **Basic:** Ruby, PHP and Go are scanned for hard-coded secrets and a few patterns, but their frameworks and dependency files are not understood.
|
|
452
|
+
|
|
453
|
+
**It skips some files**
|
|
454
|
+
- `node_modules`, `dist`, `build`, `out`, `coverage`, `vendor`, `venv`, `target`, `generated` and a few other build or dependency folders, and hidden folders other than `.github` (such as `.venv` and `.next`).
|
|
455
|
+
- Files over 1 MB, minified `.min.js` files, source maps and binary files.
|
|
456
|
+
- Everything after the first 20,000 files (the report says when this happens).
|
|
457
|
+
|
|
458
|
+
For apps that handle significant money or sensitive personal or health data, use Launch Doctor as a first pass and get a human security review.
|
|
459
|
+
|
|
460
|
+
## How it is tested
|
|
461
|
+
|
|
462
|
+
- 170 automated tests run on every change, on Windows, macOS and Linux, with Node.js 22 and 24.
|
|
463
|
+
- Every check that existed in 0.2 has been confirmed against a small project (or fake site) that contains exactly that problem, and every command in this README has been run (the `scan` examples against a local test site rather than a real one).
|
|
464
|
+
- The features new in 0.3.0 (the GitHub Action, the MCP server, mobile apps, and Clerk, Convex, Appwrite, Paddle and Lemon Squeezy) have their own tests and were spot-checked by hand, which found and fixed two bugs before release. They have been tried less than the older checks. Posting pull request comments is tested against a fake GitHub API; it has not yet run on many real pull requests.
|
|
465
|
+
- Every bug fix gets a regression test, so the same mistake doesn't come back.
|
|
466
|
+
- What hasn't happened yet is wide real-world use. Most false alarms are found when the tool meets code written differently from what it has seen, so your reports make the biggest difference.
|
|
467
|
+
|
|
468
|
+
## Found a wrong finding?
|
|
469
|
+
|
|
470
|
+
If Launch Doctor reports something that is fine, misses a real problem, or crashes, please open an issue: [report a false alarm](https://github.com/SHARAJ379/launch-doctor/issues/new?template=false_positive.yml) or [report a bug](https://github.com/SHARAJ379/launch-doctor/issues/new?template=bug_report.yml). A short code snippet that reproduces it (with any keys removed) is the most helpful thing you can include. Fixes are released as small patch versions.
|
|
471
|
+
|
|
472
|
+
Meanwhile you can silence a finding with `.launchdoctorignore` or an inline `launch-doctor-ignore` comment (see [Configuration](#configuration)).
|
|
473
|
+
|
|
474
|
+
## Roadmap
|
|
475
|
+
|
|
476
|
+
Planned work, in no fixed order and without dates:
|
|
477
|
+
|
|
478
|
+
- [x] Live URL inspection (`launch-doctor scan <url>`: exposed `.env`, source maps, security headers, open Supabase tables via anonymous key)
|
|
479
|
+
- [x] GitHub Action that posts a summary and inline fix prompts on pull requests ([Pull request comments](#pull-request-comments))
|
|
480
|
+
- [x] Model Context Protocol (MCP) server for direct Claude Code and Cursor integration ([MCP server](#mcp-server))
|
|
481
|
+
- [x] Extended provider coverage (Clerk, Convex, Appwrite, Lemon Squeezy, Paddle)
|
|
482
|
+
- [x] Mobile framework support (Expo, React Native)
|
|
483
|
+
|
|
484
|
+
## Contributing
|
|
485
|
+
|
|
486
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for local environment setup, architecture notes, and instructions on creating new checks. All contributors are expected to adhere to the [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
487
|
+
|
|
488
|
+
## Contributors
|
|
489
|
+
|
|
490
|
+
Thanks to everyone who has helped build Launch Doctor. Contributors are listed here once their pull request is merged.
|
|
491
|
+
|
|
492
|
+
- [@SHARAJ379](https://github.com/SHARAJ379): creator and maintainer
|
|
493
|
+
|
|
494
|
+
Want to be on this list? Reporting a false alarm with a small example is a great first contribution, and issues labelled `good first issue` or `help wanted` are a good place to start once there are some.
|
|
495
|
+
|
|
496
|
+
## Security
|
|
497
|
+
|
|
498
|
+
Please do not report security vulnerabilities in public issues. Refer to [SECURITY.md](SECURITY.md) for instructions on confidential disclosure.
|
|
499
|
+
|
|
500
|
+
## License
|
|
501
|
+
|
|
502
|
+
[MIT](LICENSE)
|