@vibecodeqa/cli 0.42.0 → 0.44.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.
Files changed (47) hide show
  1. package/README.md +130 -165
  2. package/dist/check-meta.js +59 -6
  3. package/dist/cli.js +299 -762
  4. package/dist/commands/explain.d.ts +2 -0
  5. package/dist/commands/explain.js +33 -0
  6. package/dist/commands/fix.d.ts +6 -0
  7. package/dist/commands/fix.js +157 -0
  8. package/dist/commands/init.d.ts +2 -0
  9. package/dist/commands/init.js +96 -0
  10. package/dist/commands/shared.d.ts +4 -0
  11. package/dist/commands/shared.js +80 -0
  12. package/dist/core.d.ts +1 -0
  13. package/dist/core.js +12 -1
  14. package/dist/delta.d.ts +45 -0
  15. package/dist/delta.js +158 -0
  16. package/dist/detect.js +2 -2
  17. package/dist/pr-comment.d.ts +1 -1
  18. package/dist/pr-comment.js +23 -4
  19. package/dist/report/html.d.ts +1 -1
  20. package/dist/report/html.js +7 -2
  21. package/dist/report/pages.d.ts +2 -0
  22. package/dist/report/pages.js +167 -0
  23. package/dist/report/styles.d.ts +1 -1
  24. package/dist/report/styles.js +37 -0
  25. package/dist/runners/accessibility.js +4 -1
  26. package/dist/runners/best-practices.js +1 -1
  27. package/dist/runners/confusion.js +28 -17
  28. package/dist/runners/design-consistency.d.ts +12 -0
  29. package/dist/runners/design-consistency.js +125 -0
  30. package/dist/runners/error-handling.js +18 -2
  31. package/dist/runners/file-cohesion.d.ts +17 -0
  32. package/dist/runners/file-cohesion.js +177 -0
  33. package/dist/runners/frontend-health.d.ts +14 -0
  34. package/dist/runners/frontend-health.js +206 -0
  35. package/dist/runners/html-quality.d.ts +8 -0
  36. package/dist/runners/html-quality.js +203 -0
  37. package/dist/runners/lint.js +6 -1
  38. package/dist/runners/react.js +1 -0
  39. package/dist/runners/secrets.js +7 -2
  40. package/dist/runners/security.js +7 -1
  41. package/dist/runners/standards.d.ts +2 -2
  42. package/dist/runners/standards.js +45 -12
  43. package/dist/runners/structure.js +1 -1
  44. package/dist/runners/styling.d.ts +15 -0
  45. package/dist/runners/styling.js +280 -0
  46. package/dist/runners/testing.js +3 -1
  47. package/package.json +2 -2
package/README.md CHANGED
@@ -2,249 +2,214 @@
2
2
 
3
3
  **Code health scanner for the AI coding era.**
4
4
 
5
- One command. 25 checks. Full report. Zero config.
5
+ One command. 34 checks. AI-powered fixes. Zero config.
6
6
 
7
7
  ```bash
8
8
  npx @vibecodeqa/cli
9
9
  ```
10
10
 
11
- ![Grade](https://img.shields.io/badge/checks-25-blue) ![TypeScript](https://img.shields.io/badge/TypeScript-first-3178C6) ![License](https://img.shields.io/badge/license-MIT-green)
11
+ ![Grade](https://img.shields.io/badge/checks-34-blue) ![TypeScript](https://img.shields.io/badge/TypeScript-first-3178C6) ![License](https://img.shields.io/badge/license-MIT-green) ![npm](https://img.shields.io/npm/v/@vibecodeqa/cli)
12
12
 
13
13
  ## What it does
14
14
 
15
- vcqa scans your TypeScript/JavaScript/Dart/Flutter codebase and produces a scored health report with actionable findings. It auto-detects your stack (React, Flutter, Vite, vitest, Biome, etc.) and runs 25 checks across 7 categories.
15
+ vcqa scans your codebase and produces a scored health report with actionable findings. Auto-detects your stack (React, Vue, Svelte, Flutter, monorepos) and runs 34 checks across 7 categories.
16
16
 
17
- The output is a self-contained HTML report with radar charts, architecture diagrams, score timeline, testing pyramid, and drill-down issue lists — all navigable via sidebar and tab navigation.
17
+ **Scan See issues AI fixes them Score improves.**
18
18
 
19
- ## Quick start
19
+ ```bash
20
+ npx @vibecodeqa/cli # scan + full HTML report
21
+ npx @vibecodeqa/cli fix --ai # AI-powered code fixes
22
+ npx @vibecodeqa/cli --skip-tests --top # fast scan + top issues
23
+ ```
24
+
25
+ ## Install everywhere
20
26
 
21
27
  ```bash
22
- # Scan current directory (runs tests + coverage)
28
+ # CLI (one command, no install needed)
23
29
  npx @vibecodeqa/cli
24
30
 
25
- # Fast mode (skip test execution)
26
- npx @vibecodeqa/cli --skip-tests
31
+ # GitHub Action (automatic PR scanning)
32
+ - uses: vibecodeqa/action@v1
33
+ with:
34
+ fail-under: "70"
27
35
 
28
- # Watch mode (re-scan on file changes)
29
- npx @vibecodeqa/cli --watch
36
+ # VS Code Extension
37
+ ext install vibecodeqa
30
38
 
31
- # CI mode (exit code 1 if score < 60)
32
- npx @vibecodeqa/cli --ci
39
+ # MCP Server (for AI coding agents)
40
+ claude mcp add vcqa -- npx @vibecodeqa/mcp
33
41
 
34
- # JSON output (pipe to other tools)
35
- npx @vibecodeqa/cli --json
42
+ # Programmatic API
43
+ import { scan } from "@vibecodeqa/cli/core";
44
+ const report = await scan("./src");
45
+ ```
36
46
 
37
- # Generate badge SVG for README
38
- npx @vibecodeqa/cli --badge
47
+ ## AI-Powered Fix
39
48
 
40
- # SARIF output for GitHub Security tab
41
- npx @vibecodeqa/cli --sarif
49
+ Don't just find problems fix them:
42
50
 
43
- # Scan a specific directory
44
- npx @vibecodeqa/cli /path/to/project
51
+ ```bash
52
+ npx @vibecodeqa/cli fix --ai # fix all issues
53
+ npx @vibecodeqa/cli fix --ai --check security # fix only security
54
+ npx @vibecodeqa/cli fix --ai --dry-run # preview without applying
45
55
  ```
46
56
 
47
- Output goes to `.vibe-check/`:
48
- - `report/index.html` — navigable multi-page dashboard (open in browser)
49
- - `report.json` — machine-readable results
50
- - `badge.svg` — shields.io-style badge (with `--badge`)
51
- - `report.sarif` — SARIF 2.1.0 for GitHub Code Scanning (with `--sarif`)
52
- - `history/` — last 30 reports for trend tracking
57
+ Uses Claude to read your code context, understand the issue, and generate a targeted fix. Requires `ANTHROPIC_API_KEY`.
53
58
 
54
- ## Checks
59
+ ## 34 Checks
55
60
 
56
61
  ### Foundations (23%)
57
62
 
58
63
  | Check | Weight | What it measures |
59
64
  |-------|--------|-----------------|
60
- | **Structure** | 6% | Standard files (package.json, tsconfig, LICENSE, README, .gitignore), lockfile, test-to-source ratio |
61
- | **Lint** | 5% | Biome or ESLint errors/warnings (auto-detected) |
62
- | **Types** | 6% | TypeScript compilation errors (`tsc --noEmit`) |
63
- | **Type Safety** | 3% | `as any`, `: any`, `@ts-ignore`, `@ts-nocheck` counts |
64
- | **Standards** | 3% | File naming, large files (>300 lines), code smells (console.log, var, ==, eval), config hygiene |
65
+ | Structure | 6% | Standard files, lockfile, test-to-source ratio |
66
+ | Lint | 5% | Biome or ESLint errors/warnings |
67
+ | Types | 6% | TypeScript compilation errors |
68
+ | Type Safety | 3% | `as any`, `@ts-ignore`, non-null assertions |
69
+ | Standards | 3% | File naming, large files, code smells |
65
70
 
66
- ### Quality (26%)
71
+ ### Quality (28%)
67
72
 
68
73
  | Check | Weight | What it measures |
69
74
  |-------|--------|-----------------|
70
- | **Complexity** | 5% | Cognitive complexity per function, functions >60 lines |
71
- | **Duplication** | 5% | Copy-pasted 6+ line blocks |
72
- | **Error Handling** | 3% | Empty catch blocks, throw string, missing Error Boundaries, [error info leakage](https://cheatsheetseries.owasp.org/cheatsheets/Error_Handling_Cheat_Sheet.html) (stack traces sent to client) |
73
- | **React Patterns** | 3% | Conditional hooks, missing keys, index keys, prop spreading |
74
- | **Accessibility** | 4% | img alt, click on non-interactive elements, form labels, html lang |
75
- | **Docs** | 3% | README quality, JSDoc coverage of exports |
76
- | **Best Practices** | 3% | CI/CD, lockfile, linter, test scripts, supply chain, [health endpoints](https://nodejs.org/learn/getting-started/security-best-practices), graceful shutdown, [Helmet.js](https://helmetjs.github.io/), input validation ([Zod](https://zod.dev)/Joi), [GitHub Actions security](https://docs.github.com/en/actions/security) (pwn requests, script injection, permissions). Severity-weighted: warnings=8pts, infos=2pts |
77
-
78
- ### Testing (15%)
79
-
80
- One deep check with 6 sub-dimensions:
81
-
82
- - **Pyramid presence** unit, integration, component, E2E layers detected
83
- - **Execution** — pass/fail from vitest/jest
84
- - **Coverage** — statement, branch, line, function (v8/istanbul)
85
- - **File pairing** — test file per source file
86
- - **Quality** assertion density, mock ratio, snapshot ratio
87
- - **E2E detection** — Playwright/Cypress configured?
75
+ | Complexity | 5% | Cognitive complexity per function |
76
+ | Duplication | 3% | Copy-pasted 6+ line blocks |
77
+ | Error Handling | 3% | Empty catch, throw string, floating promises |
78
+ | React Patterns | 3% | Conditional hooks, missing keys |
79
+ | Accessibility | 4% | img alt, click handlers, form labels |
80
+ | Docs | 3% | README quality, JSDoc coverage |
81
+ | Best Practices | 3% | CI/CD, supply chain, repo hygiene |
82
+ | HTML Quality | — | Static site: meta tags, broken links, heading hierarchy, render-blocking scripts |
83
+ | Frontend Health | 2% | UI framework conflicts, mixed icons, unoptimized images, heavy imports |
84
+ | Styling | 1% | Hardcoded colors, mixed approaches, !important, inconsistent spacing |
85
+ | Env Validation | 1% | .env hygiene, .env.example drift |
86
+ | Git Hygiene | 1% | Merge conflicts, commit quality, large/binary files |
87
+ | Memory Safety | 1% | Interval/listener leaks, unclosed observers, global pollution |
88
+
89
+ ### Testing (13%)
90
+
91
+ Deep assessment: pyramid presence, execution, coverage, file pairing, quality metrics, E2E detection.
88
92
 
89
93
  ### Architecture (9%)
90
94
 
91
95
  | Check | Weight | What it measures |
92
96
  |-------|--------|-----------------|
93
- | **Architecture** | 5% | Import graph, circular deps, god modules, orphan files, fan-out, SVG diagram with legend |
94
- | **Performance** | 4% | Barrel imports, heavy dependencies, dynamic import opportunities, CSS-in-JS overhead |
97
+ | Architecture | 5% | Import graph, circular deps, god modules, orphans |
98
+ | Performance | 4% | Barrel imports, heavy deps, dynamic import opportunities |
99
+ | Container Health | — | Dockerfile best practices, .dockerignore, pinned images |
95
100
 
96
101
  ### Security (16%)
97
102
 
98
103
  | Check | Weight | What it measures |
99
104
  |-------|--------|-----------------|
100
- | **Secrets** | 6% | 14 patterns (AWS, GitHub, Stripe, OpenAI, Anthropic, Google, private keys) |
101
- | **Security** | 5% | 36 CWE-mapped patterns (XSS, injection, SSRF, CORS, credential storage, cookies, redirects, debug mode). Delegates to [eslint-plugin-security](https://github.com/eslint-community/eslint-plugin-security) when installed |
102
- | **Dependencies** | 5% | npm audit vulnerabilities, outdated packages, [license compliance](https://www.npmjs.com/package/license-checker) (GPL/AGPL/copyleft detection) |
103
-
104
- ### AI Readiness (11%)
105
+ | Secrets | 6% | Hardcoded keys (AWS, GitHub, Stripe, OpenAI, Anthropic) |
106
+ | Security | 5% | 31 CWE patterns (XSS, injection, SSRF, CORS) |
107
+ | Dependencies | 5% | npm audit CVEs, outdated packages |
105
108
 
106
- Novel checks that no other tool offers:
109
+ ### AI Readiness (9%)
107
110
 
108
111
  | Check | Weight | What it measures |
109
112
  |-------|--------|-----------------|
110
- | **Confusion Index** | 6% | File name similarity, generic names, export collisions, ambiguous abbreviations |
111
- | **Context Locality** | 5% | Token density, import depth, circular deps, context sinks |
113
+ | Confusion Index | 4% | Naming ambiguity that confuses LLMs |
114
+ | Context Locality | 5% | Token density, import depth, circular deps |
112
115
 
113
116
  ### AI Analysis (PRO)
114
117
 
115
118
  | Check | What it measures |
116
119
  |-------|-----------------|
117
- | **Doc Coherence** | LLM-powered detection of contradictions between docs and code (JSDoc mismatch, stale README refs) |
118
- | **Code Coherence** | LLM-powered detection of internal inconsistencies (mixed error patterns, duplicate exports) |
119
- | **Comment Staleness** | Stale TODOs (>6 months), numeric mismatches ("3 cases" but 5 exist), commented-out code blocks, @deprecated without replacement |
120
+ | Doc Coherence | Contradictions between docs and code |
121
+ | Code Coherence | Internal inconsistencies across modules |
122
+ | Comment Staleness | Stale TODOs, numeric mismatches, commented-out code |
123
+ | Dead Patterns | Leftover code from incomplete refactors |
124
+ | Test Audit | Fake/shallow tests that inflate coverage |
125
+ | File Cohesion | Files mixing multiple responsibilities |
126
+ | Design Consistency | Visual inconsistency across components |
120
127
 
121
- ## Scoring
128
+ ## GitHub Action
122
129
 
123
- Each check produces a score from 0-100. The composite score is a **weighted average**:
124
-
125
- ```
126
- composite = Σ(check_score × weight) / Σ(weight)
130
+ ```yaml
131
+ - uses: vibecodeqa/action@v1
132
+ with:
133
+ fail-under: "70" # quality gate
134
+ auto-fix: "true" # AI fixes pushed to PR
135
+ anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
127
136
  ```
128
137
 
129
- Weights sum to 100% (see table above). Skipped checks are excluded from both numerator and denominator. Within each check, scoring is **proportional to codebase size** — no absolute-count cliffs. The `best-practices` check uses **severity-weighted penalties** (error=15pts, warning=8pts, info=2pts) so missing nice-to-haves like CODEOWNERS don't tank your score.
130
-
131
- | Grade | Score | Meaning |
132
- |-------|-------|---------|
133
- | **A** | 90-100 | Excellent — production-ready |
134
- | **B** | 75-89 | Good — minor issues |
135
- | **C** | 60-74 | Fair — needs attention |
136
- | **D** | 40-59 | Poor — significant issues |
137
- | **F** | 0-39 | Critical — major problems |
138
-
139
- ## Report features
140
-
141
- - **Primary nav**: Overview + 7 dimension tabs (Foundations, Quality, Testing, Architecture, Security, AI Readiness, AI Analysis)
142
- - **Secondary nav**: Issues + Files (cross-cutting data views)
143
- - **Score ring + radar chart** — 6-axis view of category scores
144
- - **Score timeline** — last 30 runs with grade-colored dots
145
- - **Testing pyramid** — proportional SVG showing unit/integration/component/e2e distribution
146
- - **Architecture SVG** — modules grouped by directory, bezier edges with arrows, color-coded nodes (god module, cycle, orphan), legend
147
- - **File health map** — heatmap bars showing issue density per file
148
- - **Trend comparison** — score delta vs. previous run
149
- - **GitHub links** — click any file:line to open in GitHub (auto-detected from git remote)
150
- - **Actionable prompts** — clipboard button on every issue copies a fix prompt for Claude/Codex
151
- - **Info panels** — each check has What/Risk/Fix explanations with research citations
152
- - **Priority badges** — critical/high/medium/low on each check
138
+ Features: PR comments, SARIF upload, quality gates, AI autofix.
153
139
 
154
- ## CLI options
140
+ ## Programmatic API
155
141
 
156
- | Flag | Description |
157
- |------|-------------|
158
- | `--skip-tests` | Skip test execution and coverage (fast mode) |
159
- | `--ci` | Exit code 1 if composite score < 60 |
160
- | `--fail-under N` | Exit code 1 if composite score < N |
161
- | `--json` | Output JSON to stdout (no HTML, no browser) |
162
- | `--badge` | Generate badge.svg in output directory |
163
- | `--sarif` | Generate SARIF 2.1.0 for GitHub Code Scanning |
164
- | `--upload` | Upload report to app.vibecodeqa.online |
165
- | `--top [N]` | Show top N issues to fix (default: 5) |
166
- | `--diff [base]` | Only show issues in changed files (vs HEAD or branch) |
167
- | `--markdown` | Output markdown summary (pipe to file or clipboard) |
168
- | `--pr-comment` | Post score as GitHub PR comment (needs `GITHUB_TOKEN`) |
169
- | `--annotations` | Emit GitHub Actions `::warning`/`::error` inline annotations |
170
- | `--watch` | Re-scan automatically on file changes |
142
+ ```typescript
143
+ import { scan, CHECK_META } from "@vibecodeqa/cli/core";
171
144
 
172
- ## Stack detection
145
+ const report = await scan("./src", {
146
+ skipTests: true,
147
+ checks: ["security", "testing"],
148
+ onProgress: (check, result, i, total) => {
149
+ console.log(`${i + 1}/${total} ${check}: ${result.grade}`);
150
+ },
151
+ });
152
+
153
+ console.log(`${report.grade} ${report.score}/100`);
154
+ ```
155
+
156
+ ## MCP Server
157
+
158
+ Give AI coding agents real-time code health context:
173
159
 
174
- Auto-detects from `package.json`, `pubspec.yaml`, and config files:
175
- - **Language:** TypeScript, JavaScript, Dart
176
- - **Framework:** React, Vue, Svelte, Flutter
177
- - **Bundler:** Vite, Webpack, esbuild
178
- - **Test runner:** vitest, jest, flutter_test, dart_test
179
- - **Linter:** Biome, ESLint, dart analyze
180
- - **Package manager:** pnpm, npm, yarn, bun, pub
160
+ ```bash
161
+ claude mcp add vcqa -- npx @vibecodeqa/mcp
162
+ ```
163
+
164
+ 6 tools: `vcqa_score`, `vcqa_scan`, `vcqa_file_health`, `vcqa_check`, `vcqa_explain`, `vcqa_fix`.
181
165
 
182
166
  ## Configuration
183
167
 
184
- Create `.vcqa.json` in your project root (or add a `"vcqa"` field to `package.json`):
168
+ Create `.vcqa.json`:
185
169
 
186
170
  ```json
187
171
  {
188
172
  "checks": {
189
- "confusion": { "enabled": false },
190
- "react": { "enabled": false }
173
+ "react": { "enabled": false },
174
+ "container-health": { "ignore": ["Dockerfile.dev"] }
191
175
  },
192
- "ignore": ["generated/**", "*.pb.ts", "vendor/**"],
176
+ "ignore": ["generated/**", "vendor/**"],
193
177
  "failUnder": 70
194
178
  }
195
179
  ```
196
180
 
197
- | Field | Description |
198
- |-------|-------------|
199
- | `checks` | Disable individual checks with `"enabled": false` |
200
- | `ignore` | Extra glob patterns to skip when scanning source files |
201
- | `failUnder` | Default score threshold (overridden by `--fail-under` flag) |
202
-
203
181
  ## Monorepo support
204
182
 
205
- Automatically detects and scans all packages in:
206
- - **pnpm** — `pnpm-workspace.yaml` (with comments, flow-style YAML, negation patterns)
207
- - **npm/yarn** — `workspaces` in `package.json`
208
- - **bun** — `workspaces` in `package.json` + `bun.lockb`
209
- - **lerna** — `lerna.json`
210
- - **turborepo** — `turbo.json` (overlay on pnpm/npm/yarn)
211
- - **nx** — `nx.json` (overlay on pnpm/npm/yarn)
212
- - **melos** — `melos.yaml` (Dart/Flutter monorepos)
213
- - **Conventional layouts** — `server/` + `client/`, `apps/` + `packages/`, etc.
214
-
215
- Framework detection aggregates deps from all workspace packages — React in `packages/web/package.json` is detected even if root has no React dependency.
216
-
217
- ## GitHub Actions
183
+ Auto-detects: pnpm, npm, yarn, bun, lerna, turborepo, nx, melos.
218
184
 
219
- Add this to `.github/workflows/vibecodeqa.yml` for automatic PR scanning:
185
+ ## Stack detection
220
186
 
221
- ```yaml
222
- name: VibeCode QA
223
- on: [pull_request]
224
- permissions:
225
- contents: read
226
- pull-requests: write
227
- jobs:
228
- scan:
229
- runs-on: ubuntu-latest
230
- steps:
231
- - uses: actions/checkout@v4
232
- - run: npx @vibecodeqa/cli --skip-tests --ci --sarif --pr-comment
233
- env:
234
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
235
- - uses: github/codeql-action/upload-sarif@v3
236
- if: always()
237
- with:
238
- sarif_file: .vibe-check/report.sarif
239
- ```
187
+ Auto-detects: TypeScript/JavaScript/Dart, React/Vue/Svelte/Flutter, Vite/Webpack/esbuild, vitest/jest, Biome/ESLint, pnpm/npm/yarn/bun.
240
188
 
241
- ## License
189
+ ## CLI options
242
190
 
243
- MIT Free forever as a CLI tool.
191
+ | Flag | Description |
192
+ |------|-------------|
193
+ | `--skip-tests` | Skip test execution (fast mode) |
194
+ | `--ci` | CI mode (exit 1 if score < 60) |
195
+ | `--fail-under N` | Exit 1 if score < N |
196
+ | `--json` | JSON output |
197
+ | `--badge` | Generate SVG badge |
198
+ | `--sarif` | SARIF for GitHub Code Scanning |
199
+ | `--upload` | Upload to dashboard |
200
+ | `--top [N]` | Show top N issues |
201
+ | `--diff [base]` | Issues in changed files only |
202
+ | `--markdown` | Markdown summary |
203
+ | `--pr-comment` | PR comment (needs `GITHUB_TOKEN`) |
204
+ | `--annotations` | GitHub Actions annotations |
205
+ | `--watch` | Re-scan on file changes |
244
206
 
245
207
  ## Links
246
208
 
247
- - **GitHub:** https://github.com/vibecodeqa/cli
248
209
  - **Website:** https://vibecodeqa.online
249
- - **npm:** https://www.npmjs.com/package/@vibecodeqa/cli
250
- - **Issues:** https://github.com/vibecodeqa/cli/issues
210
+ - **Dashboard:** https://app.vibecodeqa.online
211
+ - **GitHub Action:** https://github.com/vibecodeqa/action
212
+ - **VS Code:** https://github.com/vibecodeqa/vscode
213
+ - **MCP:** https://github.com/vibecodeqa/mcp
214
+
215
+ MIT — Free forever as a CLI tool.
@@ -46,10 +46,10 @@ export const CHECK_META = {
46
46
  name: "standards",
47
47
  label: "Code Standards",
48
48
  category: "Foundations",
49
- priority: "medium",
49
+ priority: "high",
50
50
  weight: 3,
51
- description: "Checks coding conventions: file naming (PascalCase for components, kebab-case for modules), file size limits (>300 lines flagged), code smells (console.log, var, ==, eval, innerHTML, TODO/FIXME), config hygiene (strict mode), and framework best practices (Tailwind vs inline styles).",
52
- risk: "Large files are hard to review and test. console.log in production leaks internal data. var causes hoisting bugs. == causes type coercion surprises. eval/innerHTML are security vulnerabilities. Inconsistent naming makes the codebase harder to navigate.",
51
+ description: "Checks coding conventions: file naming (PascalCase for components, kebab-case for modules), file size limits (>250 lines warning, >400 error), code smells (console.log, var, ==, eval, innerHTML, TODO/FIXME), config hygiene (strict mode), and framework best practices.",
52
+ risk: "Large files are hard to review and test — AI-generated code accumulates in monolithic files that become impossible to refactor. console.log in production leaks internal data. var causes hoisting bugs. == causes type coercion surprises. Inconsistent naming makes the codebase harder to navigate.",
53
53
  recommendation: "Split files over 300 lines. Replace console.log with a proper logger or remove it. Use const/let, ===, and safe DOM APIs. Enable TypeScript strict mode.",
54
54
  },
55
55
  "error-handling": {
@@ -271,7 +271,7 @@ export const CHECK_META = {
271
271
  label: "Environment Validation",
272
272
  category: "Quality",
273
273
  priority: "medium",
274
- weight: 2,
274
+ weight: 1,
275
275
  description: "Checks .env file hygiene: .gitignore coverage, .env.example existence and drift, hardcoded secrets in env files, and empty required variables.",
276
276
  risk: "A missing .env.example means new developers can't onboard without asking which env vars to set. Drift between .env and .env.example causes 'works on my machine' failures. Committed .env files leak secrets.",
277
277
  recommendation: "Create .env.example with all required vars (values blanked). Ensure .env is in .gitignore. Keep .env.example in sync with .env.",
@@ -281,7 +281,7 @@ export const CHECK_META = {
281
281
  label: "Git Hygiene",
282
282
  category: "Quality",
283
283
  priority: "medium",
284
- weight: 2,
284
+ weight: 1,
285
285
  description: "Checks git repository health: merge conflict markers in source, commit message quality, large/binary files tracked, and .gitignore completeness.",
286
286
  risk: "Merge conflict markers cause syntax errors. Large binary files bloat the repo forever (git history is append-only). Poor commit messages make git blame and bisect useless for debugging.",
287
287
  recommendation: "Resolve all merge conflicts. Use Git LFS for files over 5MB. Write descriptive commit messages (what and why, not just 'fix').",
@@ -291,11 +291,64 @@ export const CHECK_META = {
291
291
  label: "Memory Safety",
292
292
  category: "Quality",
293
293
  priority: "high",
294
- weight: 2,
294
+ weight: 1,
295
295
  description: "Detects resource leak patterns: setInterval without clearInterval, addEventListener without removeEventListener, unclosed WebSockets/Observers, and global variable pollution.",
296
296
  risk: "Resource leaks cause memory growth over time, eventually crashing the app or browser tab. Leaked event listeners fire on stale state, causing bugs. Global pollution creates hard-to-trace conflicts between modules.",
297
297
  recommendation: "Always pair setInterval with clearInterval in cleanup. Remove event listeners in componentWillUnmount/useEffect return. Call .disconnect() on Observers. Avoid window.* assignments.",
298
298
  },
299
+ "html-quality": {
300
+ name: "html-quality",
301
+ label: "HTML Quality",
302
+ category: "Quality",
303
+ priority: "medium",
304
+ weight: 0,
305
+ description: "Checks static HTML sites for meta tags (title, description, viewport, OG), image optimization (alt, dimensions, lazy loading), broken internal links, heading hierarchy, render-blocking scripts, mixed content, SEO files (robots.txt, sitemap.xml), and accessibility (lang attribute).",
306
+ risk: "Missing viewport meta means the page isn't mobile-responsive. Missing alt attributes make images invisible to screen readers. Render-blocking scripts delay page load. Broken links frustrate users and hurt SEO. Missing OG tags make social sharing look unprofessional.",
307
+ recommendation: "Add meta viewport and description to every page. Set alt on all images. Use async/defer on scripts in <head>. Add robots.txt and sitemap.xml. Ensure each page has a unique title.",
308
+ },
309
+ "frontend-health": {
310
+ name: "frontend-health",
311
+ label: "Frontend Health",
312
+ category: "Quality",
313
+ priority: "high",
314
+ weight: 2,
315
+ description: "Detects frontend antipatterns: conflicting UI frameworks (MUI + Tailwind), mixed icon libraries, unoptimized images (no width/height), heavy full-library imports, missing loading states for async data, DOM nesting violations, and inline base64 images.",
316
+ risk: "Conflicting UI frameworks bloat the bundle and create visual inconsistency — MUI buttons look different from Tailwind buttons. Mixed icon libraries add hundreds of KB. Images without dimensions cause layout shift (CLS). Heavy imports slow initial page load.",
317
+ recommendation: "Pick one UI framework and one icon library. Use next/image or set width/height on all images. Import specific components, not entire libraries. Add loading states for all async data fetches.",
318
+ },
319
+ styling: {
320
+ name: "styling",
321
+ label: "Styling Consistency",
322
+ category: "Quality",
323
+ priority: "medium",
324
+ weight: 1,
325
+ description: "Delegates to Stylelint for CSS/SCSS linting when installed. Adds cross-file analysis no CSS linter covers: mixed styling approaches, hardcoded colors in JSX, inconsistent spacing scale, !important abuse, duplicate Tailwind class strings, and inline style overuse.",
326
+ deeperTools: ["stylelint", "stylelint-config-standard"],
327
+ risk: "AI-generated components pile up inconsistent styles — hardcoded hex colors, random pixel values, inline styles. This creates an accidental design system where every component looks slightly different and nothing is reusable. Changing the brand color means finding 47 hex values across 30 files.",
328
+ recommendation: "Pick one styling approach (Tailwind or CSS Modules). Define colors and spacing as design tokens (CSS variables or Tailwind theme). Extract repeated class strings into shared components. Use a 4px/8px spacing scale.",
329
+ },
330
+ "design-consistency": {
331
+ name: "design-consistency",
332
+ label: "Design Consistency",
333
+ category: "AI Analysis",
334
+ priority: "high",
335
+ weight: 0,
336
+ description: "LLM-powered audit of visual consistency across components. Finds duplicate visual patterns, inconsistent spacing/color/typography, and missing component extraction opportunities.",
337
+ risk: "Components that look similar but are styled differently are impossible to maintain. Changing a button style means editing 7 files. Users notice the inconsistency — different border radius, slightly different padding, mismatched colors.",
338
+ recommendation: "Enable design-consistency with a VibeCode QA Pro subscription. The LLM analyzes styling patterns across all components to surface inconsistencies and suggest shared components.",
339
+ premium: true,
340
+ },
341
+ "file-cohesion": {
342
+ name: "file-cohesion",
343
+ label: "File Cohesion",
344
+ category: "AI Analysis",
345
+ priority: "critical",
346
+ weight: 0,
347
+ description: "AI-powered detection of files with multiple responsibilities — the #1 code smell in AI-generated code. Detects when a single file handles auth + email + database, or mixes HTTP routing with business logic. Provides concrete split suggestions.",
348
+ risk: "AI coding assistants pile features into existing files instead of creating new ones. A file handling auth, sessions, AND email is untestable, unreviewable, and impossible to refactor safely. Every change risks breaking unrelated functionality. This is the root cause of 'vibe-coded' technical debt.",
349
+ recommendation: "Enable file-cohesion with a VibeCode QA Pro subscription. The LLM analyzes each file's exports and logic to label responsibility clusters and suggest concrete splits.",
350
+ premium: true,
351
+ },
299
352
  "container-health": {
300
353
  name: "container-health",
301
354
  label: "Container Health",