{
  "markdown": "<p align=\"center\">\n  <img src=\"assets/LensPR.png\" alt=\"LensPR\" width=\"200\">\n</p>\n\n<p align=\"center\"><strong>Code intelligence for AI coding agents. Your AI sees dependencies before making changes.</strong></p>\n\n> Alpha (0.1.x) — works on real projects, used daily by the author. Expect rough edges.\n\nAI assistants edit your code one file at a time. They don't see dependencies. They grep, read, guess — and break things three files away.\n\nLensPR builds a dependency graph of your codebase and gives your AI structural understanding before it changes anything.\n\n<!-- TODO: Add demo GIF here -->\n<!-- ![Demo](assets/demo.gif) -->\n\n## Quick Start\n\nRequires **Python 3.11+**, **macOS or Linux**. For TypeScript/JS projects, also **Node.js 18+**.\n\n```bash\npip install 'lenspr[all]'\nlenspr init .\nlenspr setup .\n```\n\nRestart your IDE. Done. Your AI now has `lens_*` tools.\n\n> Add `.lens/` to your `.gitignore` — the graph is local and rebuilt from source.\n\n---\n\n## What It Does\n\n### \"What depends on this function?\"\n\nOne call returns source code, who calls it, what it calls, and related tests:\n\n```\n> lens_context(\"auth.login_handler\")\n\nsource: 42 lines\ncallers: auth_routes.create_routes, test_auth.test_login_success\ncallees: db.get_user, crypto.verify_password, jwt.create_token\ntests: test_login_success, test_login_wrong_password\n```\n\nWithout LensPR your AI makes 5-7 grep/read calls and still misses things. With LensPR — one call, full picture.\n\n### \"What breaks if I change this?\"\n\nBefore any modification, the AI sees the blast radius:\n\n```\n> lens_check_impact(\"models.User\")\n\nseverity: CRITICAL\ndirect_dependents: 15\nindirect_dependents: 23\naffected_modules: auth, payments, notifications\ntests_covering: 3\n```\n\nThe AI warns you, changes its approach, or asks for confirmation. No more blind edits.\n\n### \"How healthy is this codebase?\"\n\n```\n> lens_vibecheck()\n\nscore: 86/100 (B)\n  test_coverage:    17/25 — 67% functions tested\n  dead_code:        20/20 — 0% dead code\n  circular_imports: 15/15 — 0 cycles\n  architecture:     12/15 — 1 violation\n  documentation:     8/10 — 81% documented\n  graph_confidence: 14/15 — 94% edges resolved\n```\n\nTrack whether the codebase is improving or degrading over time.\n\n### Cross-language visibility\n\nLensPR connects frontend and backend into a single graph:\n\n```\nLoginModal.tsx → fetch(\"/api/auth/login\")\n                        ↓ CALLS_API\nBackend:  @router.post(\"/login\") → login_handler()\n            → db.query(User)        [reads: users]\n            → verify_password()\n            → create_jwt_token()\n```\n\nAlso tracks: database tables, Docker services, env vars, CI/CD workflows, SQL migrations.\n\n---\n\n## Works With\n\n| IDE | Setup |\n|-----|-------|\n| **Claude Code** | `lenspr setup .` — automatic |\n| **Cursor** | Copy `.mcp.json` to `.cursor/mcp.json` |\n| **Any MCP client** | `lenspr serve <path>` |\n\n**Languages:** Python (95%+ resolution via Jedi/Pyright) and TypeScript/JavaScript (85-95% via tree-sitter + TS Compiler API).\n\n**Infrastructure:** `.sql` files, Dockerfiles, `docker-compose.yml`, GitHub Actions workflows, `.env` files — all parsed into the same graph.\n\nEverything runs locally. Your code never leaves your machine.\n\n---\n\n## Key Features\n\n| | |\n|---|---|\n| **Impact Analysis** | Severity (LOW → CRITICAL) before any change |\n| **One-Call Context** | Source + callers + callees + tests in one request |\n| **Cross-Language** | Frontend HTTP → backend routes, DB tables, Docker, env vars, CI/CD |\n| **Surgical Edits** | Targeted find/replace within a function — no full file rewrites |\n| **Dead Code** | Find unreachable functions (Django, FastAPI, Celery entry points) |\n| **Architecture Rules** | Enforce layer boundaries — violations warn before changes apply |\n| **Git per Function** | Blame, history, commit scope at function level |\n| **Session Memory** | AI picks up where it left off across context resets |\n| **Auto-Sync** | File watcher updates graph on every save |\n| **Health Score** | 0-100 score across 6 dimensions — track quality over time |\n\n60+ tools organized in 12 groups — enable only what you need with `lenspr tools`.\n\n<details>\n<summary>All tools by category</summary>\n\n**Navigation & Search (8):** `lens_context`, `lens_get_node`, `lens_search`, `lens_grep`, `lens_find_usages`, `lens_get_structure`, `lens_list_nodes`, `lens_get_connections`\n\n**Modification (6):** `lens_update_node`, `lens_patch_node`, `lens_add_node`, `lens_delete_node`, `lens_rename`, `lens_batch`\n\n**Analysis (6):** `lens_check_impact`, `lens_validate_change`, `lens_health`, `lens_dead_code`, `lens_dependencies`, `lens_diff`\n\n**Quality (7):** `lens_vibecheck`, `lens_nfr_check`, `lens_test_coverage`, `lens_security_scan`, `lens_dep_audit`, `lens_fix_plan`, `lens_generate_test_skeleton`\n\n**Architecture (9):** `lens_arch_rule_add`, `lens_arch_rule_list`, `lens_arch_rule_delete`, `lens_arch_check`, `lens_class_metrics`, `lens_project_metrics`, `lens_largest_classes`, `lens_compare_classes`, `lens_components`\n\n**Git (4):** `lens_blame`, `lens_node_history`, `lens_commit_scope`, `lens_recent_changes`\n\n**Infrastructure (5):** `lens_api_map`, `lens_db_map`, `lens_env_map`, `lens_ffi_map`, `lens_infra_map`\n\n**Testing & Tracing (3):** `lens_run_tests`, `lens_trace`, `lens_trace_stats`\n\n**Annotations (5):** `lens_annotate`, `lens_save_annotation`, `lens_batch_save_annotations`, `lens_annotate_batch`, `lens_annotation_stats`\n\n**Session (4):** `lens_session_write`, `lens_session_read`, `lens_session_handoff`, `lens_resume`\n\n**Temporal (2):** `lens_hotspots`, `lens_node_timeline`\n\n**Explanation (1):** `lens_explain`\n\n</details>\n\n---\n\n## Known Limitations\n\n- **Windows** — not supported. macOS and Linux only.\n- **`self.method()` calls** — static parser can't fully resolve instance method dispatch. Workaround: `lens_trace` (Python 3.12+) resolves these at runtime.\n- **Go, Rust, Java** — not yet supported. Parser interface is ready for contributors.\n- **Dynamic code** — `getattr`, `eval`, dynamic imports can't be tracked statically.\n\n---\n\n## Contributing\n\nTry it. If it breaks, tell me.\n\n- **Bug reports** — even \"this doesn't work\" is helpful\n- **Language parsers** — Go, Rust, Java (BaseParser interface is ready)\n- **Ideas** — [open an issue](https://github.com/kyrylopr/lenspr/issues)\n\n## License\n\nMIT\n\n---\n\nBuilt because AI kept breaking my code.\n\n<!-- mcp-name: io.github.kyrylopr/lenspr -->\n",
  "bytes": 6375,
  "sha": "281b5aebd16b239215963b83e0591d622121d78ed4ee5bb7c656ed2ce62625b2",
  "repo_slug": "kyrylopr/lenspr",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_kyrylopr_lenspr_306a01b7/readme"
}