Mewra PreFlight — Pre-Push Sanity Pipeline
Mewra PreFlight is an open-source VS Code extension that runs an in-editor pre-push sanity pipeline scoped to your git diff. It surfaces linter, formatter, type-checker, and sanity issues across your project in a live dashboard, and unlocks a one-click PR launch button once the pipeline is clean. PreFlight acts as the control tower of the Mewra developer tooling ecosystem, orchestrating built-in polyglot checks, project-defined manual checklists, community JSON checks, and companion extensions like Mewra Pounce (blast radius analysis). Website: preflight.mewra.app · Part of the Mewra developer tooling ecosystem. WhyPre-push hooks catch issues too late — they block the push in the terminal, force you out of your editor, and break your flow. Mewra PreFlight gives you real-time feedback inside VS Code before you even hit push.
Features
Visual Demo & Workflow1. Instant Diff-Scoped Sanity Check (
|
| Command | Title | Default keybinding | Description |
|---|---|---|---|
mewra-preflight.runPipeline |
Run PreFlight Pipeline | Alt+Shift+P |
Re-scans git diff and runs all enabled checks |
mewra-preflight.openDashboard |
Open Dashboard | — | Focuses or reveals the PreFlight Webview panel |
mewra-preflight.launchPR |
Create PR / MR | Dashboard button | Creates and opens its PR or MR after you push the branch |
mewra-preflight.openConfig |
Open Configuration | — | Opens .mewra-preflight.json in the active editor |
Multi-Repository Workspaces
Each pipeline run targets one Git repository. When several projects are open, PreFlight uses the repository containing the active file. When you open a parent folder that contains several repositories, it asks you to select the repository to check and keeps that selection for the open dashboard.
Settings
Configure via VS Code Settings (settings.json):
| Setting | Type | Default | Description |
|---|---|---|---|
mewraPreflight.targetBranch |
string |
"main" |
Base branch to diff against |
mewraPreflight.diffScope |
string |
"branch" |
Scope to analyze: "branch" (vs target branch), "staged", or "working" |
mewraPreflight.enabledPacks |
string[] |
["universal", "js-ts", "go", "python", "php", "orm-cost-sentry", "style-guardian"] |
Active built-in check packs |
mewraPreflight.blockingOnWarnings |
boolean |
false |
When true, warning-severity findings also block PR launch |
mewraPreflight.gitHost |
string |
"github" |
Hosting platform for PR generation ("github" or "gitlab") |
Check Packs & Tool Contracts
1. Universal Pack (Always active)
| Check | Severity | What it detects |
|---|---|---|
| No debug statements | error |
console.log, debugger, print(), var_dump() in added source-code diff lines |
| No environment leaks | error |
Accidentally staged sensitive environment variables or keys |
| No hardcoded localhost | error |
Added URLs matching localhost or 127.0.0.1 |
| No merge conflicts | error |
Unresolved git conflict marker syntax in modified files |
| Large file warning | warning |
Newly added files exceeding threshold (default 1 MB) |
2. Polyglot Language Packs
| Pack | Tool | Resolution order | Command / Behavior |
|---|---|---|---|
| JS / TS | Prettier | node_modules/.bin/prettier → PATH |
prettier --check <files> |
| ESLint | node_modules/.bin/eslint → PATH |
eslint --format json <files> |
|
| TypeScript | node_modules/.bin/tsc → PATH |
tsc --noEmit (filtered to diff lines) |
|
| Test Pairing | Built-in | Checks whether new source files have matching test files | |
| Python | Ruff / Black | .venv/bin → venv/bin → PATH |
ruff format --check <files> or black --check <files> |
| Ruff / Flake8 | .venv/bin → venv/bin → PATH |
ruff check <files> or flake8 <files> |
|
| MyPy | .venv/bin → venv/bin → PATH |
mypy <files> |
|
| Test Pairing | Built-in | Checks whether new modules have test_<module>.py |
|
| Go | gofmt | GOROOT / PATH | gofmt -l <files> |
| go vet | GOROOT / PATH | go vet ./... (scoped to changed packages) |
|
| golangci-lint | PATH | golangci-lint run <packages> |
|
| Test Pairing | Built-in | Checks whether new *.go files have *_test.go |
|
| PHP | php-cs-fixer | vendor/bin → PATH |
php-cs-fixer fix --dry-run --diff <files> |
| phpstan / psalm | vendor/bin → PATH |
phpstan analyse <files> |
|
| Test Pairing | Built-in | Checks whether new classes have *Test.php |
Configuration (.mewra-preflight.json)
Mewra PreFlight is Zero-Config by default — it automatically detects your project's ecosystem and applies diff checks without requiring any configuration.
If you wish to customize checks, define manual checklist items, or add custom tools:
- Click the ⚙️ Settings icon in the PreFlight Dashboard header (or run
Mewra PreFlight: Open Configurationvia the Command Palette) to create a minimal starter using your configured target branch. Existing files are never overwritten. - Or copy and edit
.mewra-preflight.json.example:
{
"targetBranch": "main",
"manualChecklist": []
}
Omitted checks keep their defaults and tool auto-detection. Change main to your target branch. See configuration and ignore guide for per-check overrides and safe exceptions. Schema completion is provided offline by the installed extension; no repository-local schema file is required.
Model Context Protocol (MCP) Integration
Mewra PreFlight provides built-in Model Context Protocol (MCP) support for workspace diagnostics and agent automation:
get_preflight_status— Retrieves the live pipeline snapshot (checks, statuses, blockers).get_check_findings— Retrieves line-level findings for a specific check.run_check— Runs a specific registered check to verify code fixes.mark_manual_check— Toggles anagentCheckablechecklist item upon verified criteria.
VS Code discovers this server through its MCP tools picker after the extension starts. Run the PreFlight dashboard once before asking an agent to re-run a check or update a checklist item, so it has a current diff-scoped snapshot. MCP is enabled by default; use the workspace config to restrict it:
{
"mcp": {
"enabled": true,
"exposedTools": ["get_preflight_status", "get_check_findings", "run_check"],
"agentCheckableManualChecks": ["manual-migration"]
}
}
An agent can modify a manual item only when it is named in agentCheckableManualChecks and the checklist item itself has "agentCheckable": true. The server is a VS Code-managed loopback endpoint with an ephemeral bearer token; it is not exposed to the network.
External agents do not automatically inherit VS Code's MCP server definitions. Run Mewra PreFlight: Copy MCP Connection for AI Agent, choose Codex, Claude Code, Cursor, VS Code/Copilot, or another HTTP MCP client, and confirm the credential warning. Paste the generated configuration into the client's private user configuration. See MCP setup and verification. Never commit connection credentials. An empty exposedTools array exposes no tools; enabled: false rejects existing connections as well.
The Mewra Tooling Ecosystem
Mewra PreFlight is designed as the orchestration host for the Mewra suite:
┌──────────────────────────────────────────────────────────┐
│ MEWRA PREFLIGHT │
│ (Sanity Pipeline) │
└────────────┬─────────────┬─────────────┬─────────────┬───┘
│ │ │ │
┌──────▼──────┐ ┌────▼───────┐ ┌───▼────────┐ ┌──▼───────────┐
│mewra-pounce │ │ Dependency │ │ ORM Cost │ │Style Guardian │
│Blast Radius │ │ Guard │ │ Sentry │ │AST Conventions│
└─────────────┘ └────────────┘ └────────────┘ └───────────────┘
- Mewra Pounce (
mewra.mewra-pounce): Traces reverse call hierarchy and surfaces blast radius directly in the PreFlight dashboard (affected public API routes, background workers, and jobs). - Mewra Dependency Guard (
mewra.mewra-dependency-guard-companion): Registers a lockfile-only OSV and Trivy security scan plus the insecure dependency-source guard with PreFlight. Its check IDs remainmewra-dependency-guard:security-scananddependency-guard:unsafe-source. - ORM Cost Sentry: Detects N+1 query patterns and unindexed migration risks across Prisma, Drizzle, and SQLAlchemy.
- Mewra Style Guardian: Enforces AST design tokens and catches Tailwind CSS conflicts.
- Mewra Drift: Detects contract drift between API implementations and schemas.
Release History & Roadmap
GitHub is the source of truth for versioned release notes and future work:
Developing
See CONTRIBUTING.md for full development guidelines.
git clone https://github.com/mewra-lab/mewra-preflight.git
cd mewra-preflight
pnpm install
pnpm build
Press F5 in VS Code to launch the Extension Development Host. To test the
sibling Mewra Dependency Guard source at the same time, select **Run PreFlight
- Dependency Guard (Extension Development Host)** from Run and Debug. This builds and loads both development extensions rather than mixing PreFlight source with an installed Dependency Guard VSIX.
Quality gate:
pnpm validate
Runs: formatting check → TypeScript compilation check → unit test suite → production build.
Documentation
SPEC.md— Full product and technical specificationdocs/ARCHITECTURE.md— Architecture, data flow, and trust boundariesdocs/GIT-WORKFLOW.md— Git, branch, Conventional Commits & PR workflowdocs/UX.md— Webview UX, interaction patterns, and design tokensdocs/TESTING.md— Unit and extension testing strategydocs/RELEASE.md— Release and packaging guidelinesCONTRIBUTING.md— Contributing guide and PR rulesSECURITY.md— Security policy and threat modelPRIVACY.md— Local-first privacy statement
What's New in v0.4.0
Contributed Dependency Guard
- Versioned extension API: contributed checks now register against API version 1.
- Workspace controls:
.mewra-preflight.jsonnow appliescontributedChecks.<id>.enabledand.severityto registered checks, including MCP-triggered runs. - Dependency Guard companion: OSV and Trivy vulnerability scanning, plus the existing insecure dependency-source guard, now live in Mewra Dependency Guard, preserving PreFlight as the generic host.
What's New in v0.3.0
First-party local safety packs
- Dependency Guard (
dependency-guard:unsafe-source) fails a newly addedhttp://orgit+http://dependency source in supported manifest and lock files. - ORM Cost Sentry flags likely database queries added inside loops and destructive
DROPmigration statements for review. - Style Guardian flags conflicting static Tailwind utilities in changed JSX, Vue, HTML, Astro, and Svelte templates.
Each rule is enabled by default and can be disabled per workspace through the corresponding entry in ecosystems inside .mewra-preflight.json.
What's New in v0.2.0
Mewra Pounce Route Summary & .preflightignore
Route Summary (Mewra Pounce companion)
Install Mewra Pounce to contribute pounce:blast-radius. The companion scans changed supported route files for route declarations; PreFlight renders its route chips and includes Mermaid route/file summaries in the PR/MR draft. Control it per workspace with contributedChecks.pounce:blast-radius.
The dashboard surfaces colour-coded HTTP method/path chips (GET /api/users, POST /api/checkout, …) and the PR draft launcher auto-attaches dedicated per-route Mermaid summaries.
## 🗺️ Blast Radius — Impacted Entry Points
<details open>
<summary><code>GET /api/users</code> — routes/user.ts:3</summary>
```mermaid
graph TD
SRC["📄 routes/user.ts"]
EP["GET /api/users"]
EP --> SRC
SIB_0["POST /api/users"]
SIB_0 --> SRC
```
</details>
Supported frameworks: Next.js App Router route handlers, Express/Fastify router.get/post/…, Go net/http, mux, gin, Python Flask/FastAPI/Django decorators, PHP Laravel/Symfony routing.
.preflightignore
Create a .preflightignore file in your workspace root to exclude files from diff analysis:
# Prefer a narrow exception to excluding a file from every check
scripts/seed.ts: universal:no-console-log
tests/fixtures/fake-credentials.ts: universal:no-env-leak
Global rules bypass all checks, including security checks, for matching diff files. Start with .preflightignore.example, whose optional rules are commented out. This is a simple glob format, not full gitignore syntax: ! re-inclusion is not supported. Standalone full dependency scans have their own scope; these rules filter PreFlight's diff.
Contributing
Contributions are welcome. Please read CONTRIBUTING.md and docs/GIT-WORKFLOW.md before submitting a Pull Request.
Security
Please report security issues privately. See SECURITY.md.
Privacy
Mewra PreFlight is local-first and has no telemetry. See PRIVACY.md.
License
MIT — Copyright (c) Mewra Lab. Part of the Mewra open-source developer tooling ecosystem.