{
  "markdown": "<div align=\"center\">\n\n<img width=\"125\" height=\"125\" alt=\"image\" src=\"https://github.com/user-attachments/assets/d0e5d020-38ce-44f7-9426-f7fb1b931130\" />\n\n\n# CodeMore\n\n### The static analyzer your AI agent reads.\n\nAI agents ship code fast — and ship bugs fast. CodeMore scans the code, then hands the **agent that wrote it** a machine-readable report with the exact fix and the criteria to verify it. The agent closes its own findings.\n\n[**Website**](https://codemore.tech) · [**Docs**](https://codemore.tech/docs) · [**Rule Catalog**](docs/rules) · [**Report Schema**](docs/schema.md) · [**Changelog**](CHANGELOG.md)\n\n[![npm](https://img.shields.io/npm/v/codemore?style=flat-square&color=cb3837&logo=npm)](https://www.npmjs.com/package/codemore)\n[![License: MIT](https://img.shields.io/badge/license-MIT-4ef2ca.svg?style=flat-square)](LICENSE)\n[![Rules](https://img.shields.io/badge/native%20rules-64-success.svg?style=flat-square)](docs/rules)\n[![Adapters](https://img.shields.io/badge/external%20adapters-8-blueviolet.svg?style=flat-square)](docs/external-tools.md)\n[![Audit](https://img.shields.io/badge/last%20audit-2026--07--07-ff69b4.svg?style=flat-square)](accuracy-report-2026-07-07.md)\n[![BLOCKER TP rate](https://img.shields.io/badge/BLOCKER%20TP%20rate-~90%25-4ef2ca.svg?style=flat-square)](accuracy-report-2026-07-07.md)\n\n```bash\nnpx codemore@latest scan .\n```\n\n**64 native rules · 8 external adapters · CLI · MCP server · VS Code extension · GitHub Action — one report, byte-identical on every surface.**\n\n</div>\n\n---\n\n## Table of contents\n\n- [Why CodeMore](#why-codemore)\n- [Quick start](#quick-start) — [CLI](#cli) · [MCP server](#mcp-server--cursor-claude-code-codex-claude-desktop) · [VS Code](#vs-code-extension) · [GitHub Action](#github-action) · [Hosted](#web-scanner-hosted)\n- [What it catches](#what-it-catches)\n- [The report is the product](#the-report-is-the-product)\n- [Agentic fix loop](#agentic-fix-loop)\n- [Accuracy, measured honestly](#accuracy-measured-honestly)\n- [What CodeMore does *not* catch](#what-codemore-does-not-catch)\n- [Architecture](#architecture)\n- [Development](#development) · [Contributing](#contributing) · [License](#license)\n\n---\n\n## Why CodeMore\n\nAI-assisted coding ships vulnerabilities at a measured, growing rate:\n\n| Finding | Source |\n|---|---|\n| **45%** of AI-generated code carries an OWASP Top-10 vulnerability | Veracode 2025/26 |\n| **98%** of 1,072 scanned vibe-coded sites had ≥ 1 security flaw | Symbiotic |\n| **70%** of audited Lovable apps shipped with Supabase RLS disabled | DEV |\n| **2×** baseline secret-leak rate on AI-tool-assisted commits | GitGuardian SOSS 2026 |\n| **35 CVEs/month** attributed to AI-generated code (was 6/month in January) | March 2026 |\n\nExisting scanners (SonarQube, DeepSource, Snyk) target **human reviewers sitting at dashboards**. But this code wasn't written by a human — and the LLM that wrote it is fully capable of fixing its own bug, *if the report is shaped for a machine reader*.\n\nThat's the wedge. CodeMore is not another SAST dashboard. **It's the report contract between a scanner and a coding agent**: every finding carries a `suggestedFix` with a patch template and explicit `verificationCriteria` — not just \"here's a problem,\" but \"here's exactly how to know you fixed it.\"\n\n> **The agent that wrote the bug can also write the fix — if it can read the report.**\n\n---\n\n## Quick start\n\n### CLI\n\n```bash\nnpx codemore@latest scan .\n```\n\nPrints a summary to the terminal. Add `--json` for the full [report](docs/schema.md) on stdout, or `--out codemore-report.json` to write it to disk: every finding pinned to `file:line:column` with rule citation, fix template, and verification criteria. Pipe it to your agent and watch findings close.\n\n```bash\nnpm install -g codemore                        # once — or prefix each command below with `npx codemore@latest`\ncodemore update                                # global install pinned an old version? this pulls latest\ncodemore scan . --fail-on BLOCKER              # CI gate: non-zero exit on any BLOCKER\ncodemore scan . --external-tools ruff,biome    # opt in to external tools\ncodemore scan . --external-tools all           # ruff · golangci-lint · clippy · biome · bandit · gitleaks · npm-audit · pip-audit\ncodemore scan . --format sarif --out codemore.sarif   # GitHub code scanning (upload-sarif)\ncodemore fix . --rule <id> --write             # agentic fix loop from the CLI (needs an LLM API key)\ncodemore baseline create                       # adopt on an existing repo without drowning in legacy findings\n```\n\n### MCP server — Cursor, Claude Code, Codex, Claude Desktop\n\n```bash\nnpx codemore mcp                              # print config snippet + every client's config path\nnpx codemore mcp install --client cursor      # merge into existing config (backs up first, --dry-run supported)\n```\n\n<details>\n<summary>Manual config snippet</summary>\n\n```jsonc\n{\n  \"mcpServers\": {\n    \"codemore\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"codemore@latest\", \"serve-mcp\"]\n    }\n  }\n}\n```\n\n</details>\n\nSix tools exposed: `scan_project` · `scan_file` · `explain_issue` · `suggest_fix` · `apply_fix` · `validate_fix`.\n\nPer-client setup, exact config paths, and verified handshake evidence (Claude Code, Cursor, Claude Desktop, Codex CLI): [docs/ide-matrix.md](docs/ide-matrix.md).\n\n### VS Code extension\n\nInstall **CodeMore** from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=codemore.codemore) (Extensions → search \"CodeMore\" → Install), or build the VSIX yourself:\n\n```bash\nnpm run vsce:package                             # builds codemore-<version>.vsix\ncode --install-extension codemore-<version>.vsix\n```\n\nInline diagnostics; code-action quick-fix invokes the agentic loop (plan → generate → validate → retry, max 3 attempts).\n\n### GitHub Action\n\n```yaml\n# .github/workflows/codemore.yml\non:\n  pull_request:\n    branches: [main]\njobs:\n  scan:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      pull-requests: write\n    steps:\n      - uses: actions/checkout@v4\n      - uses: abhinavteja123/codemore@v1\n        with:\n          fail-on: BLOCKER\n```\n\nPR-comment bot; only fails the build on findings **new since** the committed `.codemore-baseline.json`. A full copy-paste security gate chaining CodeMore + Ruff + Biome + Bandit + Gitleaks + npm-audit + pip-audit + Checkov lives at [`templates/.github/workflows/codemore-security-gate.yml`](templates/.github/workflows/codemore-security-gate.yml) ([walkthrough](docs/security-gate.md)).\n\n### Web Scanner (hosted)\n\nSign in at [**codemore.tech**](https://codemore.tech), paste a public GitHub URL or upload a ZIP — same report, same fingerprint, zero install.\n\n---\n\n## What it catches\n\n**64 native rules** across **6 packs**, every rule mapped to a *cited real-world incident class* — not a hypothetical:\n\n| Pack | Rules | Highlights |\n|---|---:|---|\n| `core-security` | 22 | SQL injection (concat), path traversal, weak crypto, insecure deserialization, `eval`, shell injection, TLS-off, hardcoded secret patterns, hardcoded passwords (B105-class), SSRF, secret-in-log, LLM-output → eval/exec/SQL sinks, prompt-injection sinks, DB write-without-WHERE, hallucinated imports |\n| `core-quality` | 21 | Unused vars/imports/exports, cyclomatic complexity, dead conditionals, leftover console/prints, async-without-await, unreachable code, loose equality, `as any`, non-null-assertion abuse |\n| `vibe-frontend` | 9 | XSS (`dangerouslySetInnerHTML`), CORS-with-credentials, missing rate limit, missing cookie flags, file-upload validation, missing input validation — CORS, cookie flags and input validation each in TS + Python (Flask/FastAPI) form |\n| `vibe-secrets` | 4 | Public env leaks (`NEXT_PUBLIC_*` / `VITE_*` / `REACT_APP_*`), hardcoded JWTs, MCP config secrets, CI/CD YAML secrets |\n| `vibe-auth` | 5 | BOLA (TS + Python), missing session/auth checks (TS + Python), inverted auth |\n| `vibe-supabase` | 3 | RLS-off, RLS-permissive (`USING (true)`), anon-key bundled to client |\n\n**8 external adapters** (off by default, opt in via `--external-tools`): `ruff` · `golangci-lint` · `clippy` · `biome` · `bandit` · `gitleaks` · `npm-audit` · `pip-audit`. Findings are namespaced `ext:<tool>:<rule-id>` — no collision with native rules; a missing binary skips silently instead of crashing.\n\n**The walker catches what `.gitignore` hides.** When a developer \"hides\" a leaked secret file by gitignoring it, most scanners stop seeing it — but it's still on disk, in tarballs, in Docker images. CodeMore always scans secret-shaped filenames (`.env*`, `*.pem`, `*.key`, `firebase-adminsdk*.json`, `credentials.json`, `.npmrc`, `.pypirc`, …) even when gitignored. This is exactly how the audits found real production OpenAI keys, Google API keys, and Firebase admin SDK creds that other tools silently missed. Opt out with `--respect-gitignore-fully`.\n\nPer-rule documentation: [`docs/rules`](docs/rules) — 64 pages, one per rule.\n\n---\n\n## The report is the product\n\nEvery surface emits the same schema-stable [`codemore-report.json`](docs/schema.md) — verified **byte-identical** (modulo timestamps and instance IDs) on every release by [`test/parity.test.ts`](test/parity.test.ts):\n\n```\nCLI    : issues=224  BLOCKER=5  fingerprint=sha256:7f95f2c62e0d3ecea6f23…\nMCP    : issues=224  BLOCKER=5  fingerprint=sha256:7f95f2c62e0d3ecea6f23…\nDaemon : issues=224  BLOCKER=5  fingerprint=sha256:7f95f2c62e0d3ecea6f23…\n```\n\n**One brain, four skins.** The schema is the API; surfaces are interchangeable.\n\n<details>\n<summary><b>Full report example</b> — <code>codemore-report.json</code> v1.0.0</summary>\n\n```jsonc\n{\n  \"schemaVersion\": \"1.0.0\",\n  \"tool\":    { \"name\": \"codemore\", \"version\": \"0.3.0\" },\n  \"project\": { \"root\": \".\", \"framework\": \"next.js\", \"language\": \"typescript\",\n               \"fingerprint\": \"sha256:7f95f2c62e0d3ecea6f23…\" },\n  \"summary\": {\n    \"issuesTotal\": 42,\n    \"bySeverity\":  { \"BLOCKER\": 2, \"CRITICAL\": 5, \"MAJOR\": 15, \"MINOR\": 18, \"INFO\": 2 },\n    \"byCategory\":  { \"security\": 12, \"bug\": 7, \"…\": \"…\" },\n    \"filesAnalyzed\": 87,\n    \"linesOfCode\":   12450,\n    \"technicalDebtMinutes\": 1840\n  },\n  \"issues\": [\n    {\n      \"id\":          \"vibe-supabase-rls-disabled\",\n      \"ruleVersion\": \"1.2.0\",\n      \"instanceId\":  \"01HZ…\",\n      \"severity\":    \"BLOCKER\",\n      \"confidence\":  0.95,\n      \"category\":    \"security\",\n      \"title\":       \"Supabase table has no RLS policy\",\n      \"evidence\": {\n        \"file\": \"supabase/migrations/001_init.sql\",\n        \"line\": 14, \"column\": 1, \"endLine\": 14, \"endColumn\": 60,\n        \"snippet\": \"create table profiles (id uuid primary key, …);\",\n        \"matchedPattern\": \"create-table-without-rls\"\n      },\n      \"whyItMatters\": \"Public Supabase client can read/write all rows. 70 % of Lovable apps leak data through this.\",\n      \"citation\":     \"https://codemore.tech/rules/vibe-supabase-rls-disabled\",\n      \"suggestedFix\": {\n        \"type\":             \"code-patch\",\n        \"instructions\":     \"Add `ALTER TABLE profiles ENABLE ROW LEVEL SECURITY;` plus at least one policy scoped to authenticated users.\",\n        \"patchTemplate\":    \"…\",\n        \"verificationCriteria\": [\n          \"Migration contains ALTER TABLE … ENABLE ROW LEVEL SECURITY\",\n          \"At least one CREATE POLICY exists for the table\",\n          \"Re-scan no longer reports vibe-supabase-rls-disabled for this file\"\n        ]\n      },\n      \"suppression\": {\n        \"available\": true,\n        \"directive\": \"// codemore-ignore: vibe-supabase-rls-disabled\",\n        \"scope\":     \"same-line | next-line | file\"\n      }\n    }\n  ],\n  \"agentInstructions\": {\n    \"preamble\":     \"You are fixing issues found by CodeMore. Apply patches one issue at a time. After each, request re-scan via validate_fix.\",\n    \"orderingHint\": \"blockers → criticals → majors\",\n    \"doNotTouch\":   [\"node_modules/**\", \"*.lock\", \".env*\"],\n    \"stopOn\":       \"first-validator-failure\"\n  },\n  \"meta\": {\n    \"rulesEnabled\": 64,\n    \"packsLoaded\":  [\"core-security\", \"core-quality\", \"vibe-supabase\", \"…\"],\n    \"scanDurationMs\": 4321\n  }\n}\n```\n\n</details>\n\nSchema source-of-truth: [`shared/report/schema.json`](shared/report/schema.json). Breaking changes bump `schemaVersion` major and ship a migration guide.\n\n---\n\n## Agentic fix loop\n\n`apply_fix` runs a four-stage loop, up to 3 retries per finding — it terminates on first PASS and **never silently keeps a failing patch**:\n\n```\ndetect  ──►  plan  ──►  generate  ──►  validate\n                                          │\n                                          ├──► (fail) → re-plan, retry (≤ 3)\n                                          └──► (pass) → apply patch · next finding\n```\n\n- [`agenticFixer.ts`](daemon/services/agenticFixer.ts) — orchestrator; reads finding + rule citation + framework context\n- [`validatorHarness.ts`](daemon/services/validatorHarness.ts) — applies the patch in a tempdir copy, re-runs the rule, re-runs file-scoped tests, returns `pass | fail` + diagnostics\n- LLM provider plug-ins: OpenAI · Anthropic · Gemini · local, configurable via workspace setting (VS Code) or `CODEMORE_LLM_PROVIDER` env (CLI)\n\n---\n\n## Accuracy, measured honestly\n\nSynthetic benchmarks lie; real codebases don't. Every release is audited against real projects, and the numbers are published — including the bad ones.\n\n**2026-07-07 audit** ([full report](accuracy-report-2026-07-07.md)) — 7 codebases (Python app, 1.35M-LOC TS monorepo, polyglot Rust, synthetic ground-truth apps, self-scan): **100% of planted vulnerabilities detected**, a real OpenAI key caught in a production `.env`, **~90% BLOCKER true-positive rate**, self-scan noise reduced 85% after fixing four false-positive classes.\n\n**2026-06-12 audit** ([full report](accuracy-report-2026-06-12.md)) — 10 real codebases, aggregate **~85% BLOCKER TP rate**, above DeepSource's ≥ 75% production bar:\n\n<details>\n<summary>Per-project results</summary>\n\n| Project | Findings | BLOCKERs | TP rate | Notes |\n|---|---:|---:|---:|---|\n| EchoVault | 122 | 10 | **100%** | Real Supabase RLS holes |\n| ProofSnap | 134 | 4 | **100%** | |\n| AImentor | 224 | 5 | **100%** | Real OpenAI keys hidden by `.gitignore` |\n| Hackathonnn | 129 | 3 | **100%** | |\n| shopsec | 113 | 5 | **100%** | |\n| Senti | 155 | 8 | **100%** | |\n| open-design | 8,615 | 101 | ~80% | |\n| Gen ai | 63 | 4 | 75% | Real Firebase admin SDK creds |\n| codemore self | 282 | 6 | 17% | Intentional landing-demo data |\n| **Aggregate (excl. self)** | **9,755** | **140** | **~85%** | |\n\n</details>\n\n### Quality gates, enforced in CI\n\n- **100% TP / 100% FP** on the 128-fixture corpus regression suite — every rule ships with at least one true-positive and one false-positive fixture under `corpus/rules/<rule-id>/{tp,fp}/`\n- Lifecycle gating: rules are `experimental` → `beta` → `stable`, promotion requires fixture pairs plus real-world FP-rate evidence via opt-in telemetry; rules below the precision bar are gated behind `--enable-experimental` or ship with reduced confidence so agents weight them lower\n\n| Lifecycle | Default | Promotion bar |\n|---|---|---|\n| `experimental` | off by default | one fixture pair |\n| `beta` | on by default | ≥ 3 fixture pairs + 14-day FP rate < 15% |\n| `stable` | ships in default pack | 30-day FP rate < 5% + reference apps clean |\n| `deprecated` | warns, removed next major | — |\n\n---\n\n## What CodeMore does *not* catch\n\nOut of scope **by design** — static analysis can't judge these, and an agent can't auto-fix them from a source diff. The rule is *\"agent-actionable or it's not a rule\"*:\n\nWeak password policies · audit-log completeness · business-logic flaws · race conditions · open S3/GCS buckets · DAST findings · MFA presence.\n\nFull list with reasoning: [`docs/limitations.md`](docs/limitations.md). For these, pair CodeMore with OWASP ZAP, Burp Suite, `checkov`, or your IdP's compliance dashboard.\n\n---\n\n## Telemetry — opt-in only\n\nOff by default. Enable per-scan with `--telemetry`. Collected: tool version, hashed project fingerprint, surface, rule-fire events. **Never collected:** file paths, contents, snippets, evidence text — the endpoint enforces a Zod `strict()` schema and rejects any payload containing those keys with HTTP 400. 64 KB payload cap, per-fingerprint rate limiting, RLS denies all reads.\n\n---\n\n## Architecture\n\n```\ncodemore/\n├── shared/                       ← one brain, shared across all surfaces\n│   ├── packs/                    ← 64 rule modules across 6 packs\n│   ├── rules/                    ← registry, lifecycle gating, suppression, AST helpers (TS + Python)\n│   └── report/                   ← codemore-report.json v1.0.0 schema + types + writer\n├── daemon/\n│   ├── cli/                      ← CLI entry · walker · ignore resolver · baseline diff\n│   ├── mcp/                      ← MCP server (6 tools)\n│   ├── external/                 ← 8 opt-in adapters, fail-loud parsers\n│   ├── services/                 ← agentic fixer · validator harness · scan orchestrator\n│   └── llm/                      ← OpenAI · Anthropic · Gemini · local provider plug-ins\n├── src/                          ← VS Code extension (forks daemon, renders diagnostics)\n├── web/                          ← Next.js: landing · dashboard · docs · /api/telemetry\n├── corpus/rules/<id>/{tp,fp}/    ← 64 TP/FP fixture pairs, 1:1 with the rule catalog\n├── docs/                         ← schema · limitations · security-gate · 64 per-rule pages\n└── templates/                    ← copy-paste GitHub Action workflows\n```\n\n**One brain (`shared/`), four skins (CLI, MCP, extension, Action), one report schema** — kept honest by the parity test, not by a slogan.\n\n---\n\n## Development\n\n```bash\ngit clone https://github.com/abhinavteja123/codemore\ncd codemore\nnpm ci                                         # postinstall skips binary downloads in dev automatically\n\nnpx tsc -p tsconfig.publish.json               # type-check the publishable surface\nnpm run test:unit                              # unit tests (mocha + ts-node)\nnpx mocha --require ts-node/register test/parity.test.ts   # surface-parity proof\n\nnode cli.js scan corpus/rules/vibe-no-rate-limit/tp --json --enable-experimental\n\ncd web && npm ci && npm run dev                # landing + dashboard + docs → localhost:3000\n```\n\nVS Code extension: `F5` in VS Code, or `npm run watch` + `code --extensionDevelopmentPath=.`\n\n---\n\n## Contributing\n\nTwo paths:\n\n1. **New rules** — read [`CONTRIBUTING-RULES.md`](CONTRIBUTING-RULES.md). The PR bot gates every submission: rule module + TP fixture (must fire) + FP fixture (must not fire) + docs page + pack registration. The bot is the first reviewer; humans review after it passes.\n2. **Everything else** (CLI, MCP, extension, daemon, web, docs) — read [`CONTRIBUTING.md`](CONTRIBUTING.md).\n\nBefore opening a PR:\n\n```bash\nnpx tsc -p tsconfig.publish.json           # type-check\nnode scripts/validate-rule-pr.js           # rule-PR bot equivalent (must report \"passed\")\nnode scripts/measure-accuracy.js           # corpus regression (must stay 100% TP / 100% FP)\nnpm run test:unit                          # full unit suite\n```\n\nFound a false positive? [Open a rule-FP report](.github/ISSUE_TEMPLATE) — FP reports directly feed the beta→stable promotion pipeline.\n\n**Security findings:** do **not** open a public issue — use GitHub's private vulnerability reporting flow ([`SECURITY.md`](SECURITY.md)).\n\n---\n\n## Roadmap\n\n- MCP registry listing (VS Code Marketplace: live)\n- Demo video: open a real vibe-coded app, scan, hand the report to Claude Code, watch every BLOCKER close\n- 50-app benchmark study with published dataset — live: [`benchmark/REPORT.md`](benchmark/REPORT.md) (40% of 50 AI-built repos had ≥ 1 BLOCKER; 24% after honest FP triage)\n- Telemetry-driven rule auto-demotion — live: nightly [`auto-demote-rules.yml`](.github/workflows/auto-demote-rules.yml) opens a review issue when a rule's FP rate crosses 10%\n- JetBrains plugin · cross-language taint tracking (research)\n\nDetails: [`docs/roadmap.md`](docs/roadmap.md).\n\n---\n\n## License\n\nMIT — see [LICENSE](LICENSE). CodeMore is open source from line one and stays that way. The wedge is the report contract, not gatekeeping.\n\n---\n\n<div align=\"center\">\n\n**The static analyzer your AI agent reads.**\n\n[Website](https://codemore.tech) · [Docs](https://codemore.tech/docs) · [Rules](https://codemore.tech/docs/rules) · [Schema](https://codemore.tech/docs/schema) · [npm](https://www.npmjs.com/package/codemore) · [Code of Conduct](CODE_OF_CONDUCT.md)\n\n</div>\n",
  "bytes": 20502,
  "sha": "4d34f83c6458e702a1cbf78247cea6276ca19ef32aafe2d0f4a16eae0d7d3419",
  "repo_slug": "abhinavteja123/codemore",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_abhinavteja123_codemore_c3fff834/readme"
}