{"id":23099716,"url":"https://github.com/brandondocusen/cntxtjs","last_synced_at":"2026-04-02T01:11:59.663Z","repository":{"id":264911617,"uuid":"894645495","full_name":"brandondocusen/CntxtJS","owner":"brandondocusen","description":"A lightweight tool to optimize your Javascript / Typescript project for LLM context windows by using a knowledge graph | AI code understanding | LLM context enhancement | Code structure visualization | Static analysis for AI | Large Language Model tooling #LLM #AI #JavaScript #TypeScript #CodeAnalysis #ContextWindow #DeveloperTools","archived":false,"fork":false,"pushed_at":"2024-12-02T06:42:17.000Z","size":98,"stargazers_count":60,"open_issues_count":1,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T12:32:35.617Z","etag":null,"topics":["architecture-insights","code-documentation","code-visualization","codebase-analysis","context-management","dependency-analysis","dependency-mapping","developer-tools","ecmascript","javascript","knowledge-graph","large-language-models","llm-integration","machine-learning","module-relationships","nextjs","nodejs","open-source","python","token-reduction"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brandondocusen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-26T18:13:07.000Z","updated_at":"2025-10-09T22:01:56.000Z","dependencies_parsed_at":"2025-05-05T18:53:58.347Z","dependency_job_id":"9f4f720d-a051-464a-acc5-b7f164592c64","html_url":"https://github.com/brandondocusen/CntxtJS","commit_stats":null,"previous_names":["brandondocusen/cntxtjs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brandondocusen/CntxtJS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandondocusen%2FCntxtJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandondocusen%2FCntxtJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandondocusen%2FCntxtJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandondocusen%2FCntxtJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brandondocusen","download_url":"https://codeload.github.com/brandondocusen/CntxtJS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandondocusen%2FCntxtJS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31293662,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:05:07.454Z","status":"ssl_error","status_checked_at":"2026-04-02T00:56:46.496Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["architecture-insights","code-documentation","code-visualization","codebase-analysis","context-management","dependency-analysis","dependency-mapping","developer-tools","ecmascript","javascript","knowledge-graph","large-language-models","llm-integration","machine-learning","module-relationships","nextjs","nodejs","open-source","python","token-reduction"],"created_at":"2024-12-16T23:20:26.779Z","updated_at":"2026-04-02T01:11:59.634Z","avatar_url":"https://github.com/brandondocusen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧠 CntxtJS: Minify Your Codebase Context for LLMs\n\n[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n\n\u003e 🤯 **75% Token Reduction In Context Window Usage!**\n\n## Why CntxtJS?\n\n-  Boosts precision: Maps relationships and dependencies for clear analysis.\n-  Eliminates noise: Focuses LLMs on key code insights.\n-  Supports analysis: Reveals architecture for smarter LLM insights.\n-  Speeds solutions: Helps LLMs trace workflows and logic faster.\n-  Improves recommendations: Gives LLMs detailed metadata for better suggestions.\n-  Optimized prompts: Provides structured context for better LLM responses.\n-  Streamlines collaboration: Helps LLMs explain and document code easily.\n\n\n\u003e Supercharge your LLM's understanding of JavaScript/TypeScript codebases. CntxtJS generates comprehensive knowledge graphs that help LLMs navigate and comprehend your code structure with ease. \n\nIt's like handing your LLM the cliff notes instead of a novel.\n\n## **Active Enhancement Notice**\n\n- CntxtJS is **actively being enhanced at high velocity with improvements every day**. Thank you for your contributions! 🙌\n\n## ✨ Features\n\n- 🔍 Deep analysis of JavaScript/TypeScript codebases\n- 📊 Generates detailed knowledge graphs of:\n  - File relationships and dependencies\n  - Class hierarchies and methods\n  - Function signatures and parameters\n  - React components and hooks\n  - Import/export relationships\n  - Package dependencies\n- 🎯 Specially designed for LLM context windows\n- 📈 Built-in visualization capabilities of your projects knowledge graph\n- 🚀 Support for a large number of modern JS frameworks and patterns\n\n## 🚀 Quick Start\n\n```bash\n# Clone the repository\ngit clone https://github.com/brandondocusen/CntxtJS.git\n\n# Navigate to the directory\ncd CntxtJS\n\n# Install required packages\npip install networkx matplotlib\n\n# Run the analyzer\npython CntxtJS.py\n```\n\nWhen prompted, enter the path to your JavaScript/TypeScript codebase. The tool will generate a `code_knowledge_graph.json` file and offer to visualize the relationships.\n\n## 💡 Example Usage with LLMs\n\nThe LLM can now provide detailed insights about your codebase's implementations, understanding the relationships between components, functions, and files!\nAfter generating your knowledge graph, you can upload it as a single file to give LLMs deep context about your codebase. Here's a powerful example prompt:\n\n```Prompt Example\nBased on the knowledge graph, explain how the authentication flow works in this application, \nincluding which components and functions are involved in the process.\n```\n\n```Prompt Example\nBased on the knowledge graph, map out the core user experience flow - starting from the landing page through to the core-experience components and their interactions.\n```\n\n```Prompt Example\nUsing the knowledge graph, analyze the state management approach in this application. Which stores exist, what do they manage, and how do they interact with components?\n```\n\n```Prompt Example\nFrom the knowledge graph data, break down this application's UI component hierarchy, focusing on reusable elements and their implementation patterns.\n```\n\n```Prompt Example\nAccording to the knowledge graph, identify all error handling patterns in this codebase - where are errors caught, how are they processed, and how are they displayed to users?\n```\n\n```Prompt Example\nBased on the knowledge graph's dependency analysis, outline the key third-party libraries this project relies on and their primary use cases in the application.\n```\n\n```Prompt Example\nUsing the knowledge graph's function analysis, explain how the application handles data fetching and caching patterns across different components.\n```\n\n## 📊 Output Format\n\nThe tool generates two main outputs:\n1. A JSON knowledge graph (`js_code_knowledge_graph.json`)\n2. Optional visualization using matplotlib\n\nThe knowledge graph includes:\n- Detailed metadata about your codebase\n- Node and edge relationships\n- Function parameters and return types\n- Component hierarchies\n- Import/export mappings\n\n## 🤝 Contributing\n\nWe love contributions! Whether it's:\n- 🐛 Bug fixes\n- ✨ New features\n- 📚 Documentation improvements\n- 🎨 Visualization enhancements\n\nJust fork, make your changes, and submit a PR. Check out our [contribution guidelines](CONTRIBUTING.md) for more details.\n\n## 🎯 Future Goals\n\n- [ ] Deeper support for additional frameworks (Vue, Svelte)\n- [ ] Enhanced TypeScript type analysis\n- [ ] Interactive web-based visualizations\n- [ ] Custom graph export formats\n- [ ] Integration with popular IDEs\n\n## 📝 License\n\nMIT License - feel free to use this in your own projects!\n\n## 🌟 Show Your Support\n\nIf you find CntxtJS helpful, give it a star! ⭐️ \n\n---\n\nMade with ❤️ for the LLM and JavaScript communities\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrandondocusen%2Fcntxtjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrandondocusen%2Fcntxtjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrandondocusen%2Fcntxtjs/lists"}