codebeacon 0.1.2__tar.gz

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 (102) hide show
  1. codebeacon-0.1.2/.cursorrules +61 -0
  2. codebeacon-0.1.2/.github/workflows/ci.yml +30 -0
  3. codebeacon-0.1.2/.gitignore +85 -0
  4. codebeacon-0.1.2/AGENTS.md +61 -0
  5. codebeacon-0.1.2/CLAUDE.md +71 -0
  6. codebeacon-0.1.2/LICENSE +21 -0
  7. codebeacon-0.1.2/PKG-INFO +319 -0
  8. codebeacon-0.1.2/README.de.md +219 -0
  9. codebeacon-0.1.2/README.es.md +218 -0
  10. codebeacon-0.1.2/README.fr.md +218 -0
  11. codebeacon-0.1.2/README.ja.md +276 -0
  12. codebeacon-0.1.2/README.ko.md +277 -0
  13. codebeacon-0.1.2/README.md +276 -0
  14. codebeacon-0.1.2/README.pt-BR.md +218 -0
  15. codebeacon-0.1.2/README.zh-CN.md +277 -0
  16. codebeacon-0.1.2/codebeacon/__init__.py +1 -0
  17. codebeacon-0.1.2/codebeacon/__main__.py +3 -0
  18. codebeacon-0.1.2/codebeacon/cache.py +136 -0
  19. codebeacon-0.1.2/codebeacon/cli.py +391 -0
  20. codebeacon-0.1.2/codebeacon/common/__init__.py +0 -0
  21. codebeacon-0.1.2/codebeacon/common/filters.py +170 -0
  22. codebeacon-0.1.2/codebeacon/common/symbols.py +121 -0
  23. codebeacon-0.1.2/codebeacon/common/types.py +98 -0
  24. codebeacon-0.1.2/codebeacon/config.py +144 -0
  25. codebeacon-0.1.2/codebeacon/contextmap/__init__.py +0 -0
  26. codebeacon-0.1.2/codebeacon/contextmap/generator.py +602 -0
  27. codebeacon-0.1.2/codebeacon/discover/__init__.py +0 -0
  28. codebeacon-0.1.2/codebeacon/discover/detector.py +388 -0
  29. codebeacon-0.1.2/codebeacon/discover/scanner.py +192 -0
  30. codebeacon-0.1.2/codebeacon/export/__init__.py +0 -0
  31. codebeacon-0.1.2/codebeacon/export/mcp.py +515 -0
  32. codebeacon-0.1.2/codebeacon/export/obsidian.py +812 -0
  33. codebeacon-0.1.2/codebeacon/extract/__init__.py +22 -0
  34. codebeacon-0.1.2/codebeacon/extract/base.py +372 -0
  35. codebeacon-0.1.2/codebeacon/extract/components.py +357 -0
  36. codebeacon-0.1.2/codebeacon/extract/dependencies.py +140 -0
  37. codebeacon-0.1.2/codebeacon/extract/entities.py +575 -0
  38. codebeacon-0.1.2/codebeacon/extract/queries/README.md +116 -0
  39. codebeacon-0.1.2/codebeacon/extract/queries/actix.scm +115 -0
  40. codebeacon-0.1.2/codebeacon/extract/queries/angular.scm +155 -0
  41. codebeacon-0.1.2/codebeacon/extract/queries/aspnet.scm +159 -0
  42. codebeacon-0.1.2/codebeacon/extract/queries/django.scm +122 -0
  43. codebeacon-0.1.2/codebeacon/extract/queries/express.scm +124 -0
  44. codebeacon-0.1.2/codebeacon/extract/queries/fastapi.scm +152 -0
  45. codebeacon-0.1.2/codebeacon/extract/queries/flask.scm +120 -0
  46. codebeacon-0.1.2/codebeacon/extract/queries/gin.scm +142 -0
  47. codebeacon-0.1.2/codebeacon/extract/queries/ktor.scm +144 -0
  48. codebeacon-0.1.2/codebeacon/extract/queries/laravel.scm +172 -0
  49. codebeacon-0.1.2/codebeacon/extract/queries/nestjs.scm +183 -0
  50. codebeacon-0.1.2/codebeacon/extract/queries/rails.scm +114 -0
  51. codebeacon-0.1.2/codebeacon/extract/queries/react.scm +111 -0
  52. codebeacon-0.1.2/codebeacon/extract/queries/spring_boot.scm +204 -0
  53. codebeacon-0.1.2/codebeacon/extract/queries/svelte.scm +73 -0
  54. codebeacon-0.1.2/codebeacon/extract/queries/vapor.scm +130 -0
  55. codebeacon-0.1.2/codebeacon/extract/queries/vue.scm +123 -0
  56. codebeacon-0.1.2/codebeacon/extract/routes.py +910 -0
  57. codebeacon-0.1.2/codebeacon/extract/semantic.py +280 -0
  58. codebeacon-0.1.2/codebeacon/extract/services.py +597 -0
  59. codebeacon-0.1.2/codebeacon/graph/__init__.py +1 -0
  60. codebeacon-0.1.2/codebeacon/graph/analyze.py +281 -0
  61. codebeacon-0.1.2/codebeacon/graph/build.py +320 -0
  62. codebeacon-0.1.2/codebeacon/graph/cluster.py +160 -0
  63. codebeacon-0.1.2/codebeacon/graph/enrich.py +206 -0
  64. codebeacon-0.1.2/codebeacon/skill/SKILL.md +127 -0
  65. codebeacon-0.1.2/codebeacon/wave.py +292 -0
  66. codebeacon-0.1.2/codebeacon/wiki/__init__.py +0 -0
  67. codebeacon-0.1.2/codebeacon/wiki/generator.py +376 -0
  68. codebeacon-0.1.2/codebeacon/wiki/index.py +95 -0
  69. codebeacon-0.1.2/codebeacon/wiki/templates.py +467 -0
  70. codebeacon-0.1.2/codebeacon.yaml.example +26 -0
  71. codebeacon-0.1.2/docs/TRANSLATION_STATUS.md +38 -0
  72. codebeacon-0.1.2/public-plan.md +129 -0
  73. codebeacon-0.1.2/pyproject.toml +63 -0
  74. codebeacon-0.1.2/skill/SKILL.md +127 -0
  75. codebeacon-0.1.2/skill/install.py +75 -0
  76. codebeacon-0.1.2/tests/__init__.py +0 -0
  77. codebeacon-0.1.2/tests/conftest.py +43 -0
  78. codebeacon-0.1.2/tests/fixtures/actix/main.rs +43 -0
  79. codebeacon-0.1.2/tests/fixtures/angular/app.component.ts +21 -0
  80. codebeacon-0.1.2/tests/fixtures/aspnet/UserController.cs +46 -0
  81. codebeacon-0.1.2/tests/fixtures/django/views.py +39 -0
  82. codebeacon-0.1.2/tests/fixtures/express/userRouter.js +37 -0
  83. codebeacon-0.1.2/tests/fixtures/fastapi/main.py +57 -0
  84. codebeacon-0.1.2/tests/fixtures/flask/app.py +39 -0
  85. codebeacon-0.1.2/tests/fixtures/gin/main.go +36 -0
  86. codebeacon-0.1.2/tests/fixtures/ktor/UserRoutes.kt +36 -0
  87. codebeacon-0.1.2/tests/fixtures/laravel/UserController.php +39 -0
  88. codebeacon-0.1.2/tests/fixtures/nestjs/user.controller.ts +41 -0
  89. codebeacon-0.1.2/tests/fixtures/rails/users_controller.rb +38 -0
  90. codebeacon-0.1.2/tests/fixtures/react/UserPage.tsx +28 -0
  91. codebeacon-0.1.2/tests/fixtures/spring_boot/UserController.java +58 -0
  92. codebeacon-0.1.2/tests/fixtures/sveltekit/+page.svelte +16 -0
  93. codebeacon-0.1.2/tests/fixtures/vapor/routes.swift +32 -0
  94. codebeacon-0.1.2/tests/fixtures/vue/UserList.vue +26 -0
  95. codebeacon-0.1.2/tests/test_discover.py +147 -0
  96. codebeacon-0.1.2/tests/test_entities.py +131 -0
  97. codebeacon-0.1.2/tests/test_filters.py +161 -0
  98. codebeacon-0.1.2/tests/test_graph.py +167 -0
  99. codebeacon-0.1.2/tests/test_resolve.py +123 -0
  100. codebeacon-0.1.2/tests/test_routes.py +114 -0
  101. codebeacon-0.1.2/tests/test_services.py +73 -0
  102. codebeacon-0.1.2/tests/test_wiki.py +139 -0
@@ -0,0 +1,61 @@
1
+ <!-- codebeacon:start -->
2
+ # Project Context
3
+
4
+ ## Lookup Strategy
5
+
6
+ > Always follow this 3-step lookup before editing code.
7
+
8
+ ### Step 1 → codebeacon wiki (routes, controllers, services, entities) — ALWAYS
9
+ ```
10
+ .codebeacon/wiki/index.md ← MUST read at session start
11
+ .codebeacon/wiki/{project}/controllers/{Name}.md ← for controller logic
12
+ .codebeacon/wiki/{project}/services/{Name}.md ← for service methods
13
+ .codebeacon/wiki/{project}/entities/{Name}.md ← for data models
14
+ .codebeacon/wiki/routes.md ← all API routes across projects
15
+ ```
16
+
17
+ ### Step 2 → codebeacon obsidian (methods, fields, connections) — ALWAYS
18
+ **MUST read even if Step 1 found results.** Obsidian notes contain method lists,
19
+ field definitions, and class-level connections that wiki articles do not have.
20
+
21
+ Look up by class name — replace `{project}` with the relevant folder:
22
+ ```
23
+ .codebeacon/obsidian/{project}/{ClassName}.md
24
+ ```
25
+
26
+ | Project | Notes | Example |
27
+ | --- | --- | --- |
28
+ | codebeacon | — | `example.md` |
29
+
30
+ ### Step 3 → source file (ONLY files identified in Steps 1-2)
31
+ Read only the specific source files whose paths were found in Steps 1-2.
32
+ No directory exploration, no Glob scans, no broad Grep searches.
33
+
34
+ ---
35
+
36
+ ## Projects
37
+
38
+ | Project | Framework | Routes | Services | Entities | Components |
39
+ | --- | --- | --- | --- | --- | --- |
40
+ | codebeacon | python | 0 | 0 | 0 | 0 |
41
+
42
+ ---
43
+
44
+ ## Common Commands
45
+
46
+ ### codebeacon (python)
47
+ ```bash
48
+ # see project README # build
49
+ # see project README # run
50
+ # see project README # all tests
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Architecture
56
+
57
+ **codebeacon**: **python** · python
58
+ Routes: 0 | Services: 0 | Entities: 0 | Components: 0
59
+
60
+ _Generated by [codebeacon](https://github.com/codebeacon/codebeacon) · 2026-04-14_
61
+ <!-- codebeacon:end -->
@@ -0,0 +1,30 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ name: test (Python ${{ matrix.python-version }})
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ python-version: ["3.10", "3.11", "3.12"]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - uses: actions/setup-python@v5
22
+ with:
23
+ python-version: ${{ matrix.python-version }}
24
+ cache: "pip"
25
+
26
+ - name: Install dependencies
27
+ run: pip install -e ".[dev]"
28
+
29
+ - name: Run tests
30
+ run: pytest --tb=short
@@ -0,0 +1,85 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ share/python-wheels/
20
+ *.egg-info/
21
+ .installed.cfg
22
+ *.egg
23
+ MANIFEST
24
+
25
+ # Virtual environments
26
+ .venv/
27
+ venv/
28
+ env/
29
+ ENV/
30
+ .env
31
+
32
+ # Distribution / packaging
33
+ *.whl
34
+ *.tar.gz
35
+
36
+ # Testing
37
+ .pytest_cache/
38
+ .coverage
39
+ htmlcov/
40
+ .tox/
41
+ .nox/
42
+ coverage.xml
43
+ *.cover
44
+ *.py,cover
45
+ nosetests.xml
46
+
47
+ # Type checking
48
+ .mypy_cache/
49
+ .dmypy.json
50
+ dmypy.json
51
+ .pyright/
52
+
53
+ # IDEs
54
+ .idea/
55
+ .vscode/
56
+ *.swp
57
+ *.swo
58
+ *~
59
+
60
+ # macOS
61
+ .DS_Store
62
+ .AppleDouble
63
+ .LSOverride
64
+ Icon
65
+ ._*
66
+
67
+ # Project output
68
+ .codebeacon/
69
+ *.beacon.json
70
+ beacon.html
71
+
72
+ # Claude Code session data
73
+ .claude/
74
+
75
+ # Internal planning docs
76
+ merry-coalescing-beacon.md
77
+
78
+ # Runtime temp files
79
+ .codebeacon_python
80
+ .graphify_python
81
+ .graphify_detect.json
82
+
83
+ # Misc
84
+ *.log
85
+ *.tmp
@@ -0,0 +1,61 @@
1
+ <!-- codebeacon:start -->
2
+ # AGENTS.md
3
+
4
+ ## Context Lookup Protocol
5
+
6
+ > All agents MUST follow this 3-step lookup before writing or modifying code.
7
+
8
+ ### Step 1 → codebeacon wiki (routes, controllers, services, entities) — ALWAYS
9
+ ```
10
+ .codebeacon/wiki/index.md ← MUST read at session start
11
+ .codebeacon/wiki/{project}/controllers/{Name}.md ← for controller logic
12
+ .codebeacon/wiki/{project}/services/{Name}.md ← for service methods
13
+ .codebeacon/wiki/{project}/entities/{Name}.md ← for data models
14
+ .codebeacon/wiki/routes.md ← all API routes across projects
15
+ ```
16
+
17
+ ### Step 2 → codebeacon obsidian (methods, fields, connections) — ALWAYS
18
+ **MUST read even if Step 1 found results.** Obsidian notes contain method lists,
19
+ field definitions, and class-level connections that wiki articles do not have.
20
+
21
+ Look up by class name — replace `{project}` with the relevant folder:
22
+ ```
23
+ .codebeacon/obsidian/{project}/{ClassName}.md
24
+ ```
25
+
26
+ | Project | Notes | Example |
27
+ | --- | --- | --- |
28
+ | codebeacon | — | `example.md` |
29
+
30
+ ### Step 3 → source file (ONLY files identified in Steps 1-2)
31
+ Read only the specific source files whose paths were found in Steps 1-2.
32
+ No directory exploration, no Glob scans, no broad Grep searches.
33
+
34
+ ---
35
+
36
+ ## Projects
37
+
38
+ | Project | Framework | Routes | Services | Entities | Components |
39
+ | --- | --- | --- | --- | --- | --- |
40
+ | codebeacon | python | 0 | 0 | 0 | 0 |
41
+
42
+ ---
43
+
44
+ ## Common Commands
45
+
46
+ ### codebeacon (python)
47
+ ```bash
48
+ # see project README # build
49
+ # see project README # run
50
+ # see project README # all tests
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Architecture
56
+
57
+ **codebeacon**: **python** · python
58
+ Routes: 0 | Services: 0 | Entities: 0 | Components: 0
59
+
60
+ _Generated by [codebeacon](https://github.com/codebeacon/codebeacon) · 2026-04-14_
61
+ <!-- codebeacon:end -->
@@ -0,0 +1,71 @@
1
+ <!-- codebeacon:start -->
2
+ # CLAUDE.md
3
+
4
+ ## MANDATORY: Lookup Strategy
5
+
6
+ > **Read these before ANY code exploration. No exceptions.**
7
+ >
8
+ > Skipping these steps and reading source files directly is a rule violation.
9
+
10
+ ### Step 1 → codebeacon wiki (routes, controllers, services, entities) — ALWAYS
11
+ ```
12
+ .codebeacon/wiki/index.md ← MUST read at session start
13
+ .codebeacon/wiki/{project}/controllers/{Name}.md ← for controller logic
14
+ .codebeacon/wiki/{project}/services/{Name}.md ← for service methods
15
+ .codebeacon/wiki/{project}/entities/{Name}.md ← for data models
16
+ .codebeacon/wiki/routes.md ← all API routes across projects
17
+ ```
18
+
19
+ ### Step 2 → codebeacon obsidian (methods, fields, connections) — ALWAYS
20
+ **MUST read even if Step 1 found results.** Obsidian notes contain method lists,
21
+ field definitions, and class-level connections that wiki articles do not have.
22
+
23
+ Look up by class name — replace `{project}` with the relevant folder:
24
+ ```
25
+ .codebeacon/obsidian/{project}/{ClassName}.md
26
+ ```
27
+
28
+ | Project | Notes | Example |
29
+ | --- | --- | --- |
30
+ | codebeacon | — | `example.md` |
31
+
32
+ ### Step 3 → source file (ONLY files identified in Steps 1-2)
33
+ Read only the specific source files whose paths were found in Steps 1-2.
34
+ No directory exploration, no Glob scans, no broad Grep searches.
35
+
36
+ ### Prohibited actions (before completing Steps 1-2)
37
+ - **DO NOT use Explore agent**
38
+ - **DO NOT use Glob for directory scans**
39
+ - **DO NOT use Grep for broad searches**
40
+ - **DO NOT Read source files directly without checking Steps 1-2 first**
41
+
42
+ Proceed to Step 3 only when Steps 1-2 are insufficient.
43
+
44
+ ---
45
+
46
+ ## Projects
47
+
48
+ | Project | Framework | Routes | Services | Entities | Components |
49
+ | --- | --- | --- | --- | --- | --- |
50
+ | codebeacon | python | 0 | 0 | 0 | 0 |
51
+
52
+ ---
53
+
54
+ ## Common Commands
55
+
56
+ ### codebeacon (python)
57
+ ```bash
58
+ # see project README # build
59
+ # see project README # run
60
+ # see project README # all tests
61
+ ```
62
+
63
+ ---
64
+
65
+ ## Architecture
66
+
67
+ **codebeacon**: **python** · python
68
+ Routes: 0 | Services: 0 | Entities: 0 | Components: 0
69
+
70
+ _Generated by [codebeacon](https://github.com/codebeacon/codebeacon) · 2026-04-14_
71
+ <!-- codebeacon:end -->
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 codebeacon contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,319 @@
1
+ Metadata-Version: 2.4
2
+ Name: codebeacon
3
+ Version: 0.1.2
4
+ Summary: Source code AST analysis tool for AI context generation — unified multi-framework knowledge graph
5
+ Project-URL: Homepage, https://github.com/codebeacon/codebeacon
6
+ Project-URL: Repository, https://github.com/codebeacon/codebeacon
7
+ Project-URL: Issues, https://github.com/codebeacon/codebeacon/issues
8
+ License: MIT
9
+ License-File: LICENSE
10
+ Keywords: ai-context,ast,claude,codebase,knowledge-graph,mcp
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Software Development :: Build Tools
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Requires-Python: >=3.10
21
+ Requires-Dist: networkx>=3.0
22
+ Requires-Dist: pyyaml>=6.0
23
+ Requires-Dist: tree-sitter-c-sharp>=0.23
24
+ Requires-Dist: tree-sitter-go>=0.23
25
+ Requires-Dist: tree-sitter-html>=0.23
26
+ Requires-Dist: tree-sitter-java>=0.23
27
+ Requires-Dist: tree-sitter-javascript>=0.23
28
+ Requires-Dist: tree-sitter-kotlin>=0.23
29
+ Requires-Dist: tree-sitter-php>=0.23
30
+ Requires-Dist: tree-sitter-python>=0.23
31
+ Requires-Dist: tree-sitter-ruby>=0.23
32
+ Requires-Dist: tree-sitter-rust>=0.23
33
+ Requires-Dist: tree-sitter-svelte>=0.23
34
+ Requires-Dist: tree-sitter-swift>=0.0.1
35
+ Requires-Dist: tree-sitter-typescript>=0.23
36
+ Requires-Dist: tree-sitter>=0.23
37
+ Provides-Extra: cluster
38
+ Requires-Dist: graspologic>=1.0; extra == 'cluster'
39
+ Provides-Extra: dev
40
+ Requires-Dist: pytest-cov>=4.0; extra == 'dev'
41
+ Requires-Dist: pytest>=7.0; extra == 'dev'
42
+ Description-Content-Type: text/markdown
43
+
44
+ <p align="center">
45
+ <a href="https://github.com/codebeacon/codebeacon/blob/main/README.md"><img src="https://img.shields.io/badge/lang-English-blue" alt="English"></a>
46
+ <a href="https://github.com/codebeacon/codebeacon/blob/main/README.ko.md"><img src="https://img.shields.io/badge/lang-한국어-red" alt="Korean"></a>
47
+ <a href="https://github.com/codebeacon/codebeacon/blob/main/README.ja.md"><img src="https://img.shields.io/badge/lang-日本語-green" alt="Japanese"></a>
48
+ <a href="https://github.com/codebeacon/codebeacon/blob/main/README.zh-CN.md"><img src="https://img.shields.io/badge/lang-简体中文-orange" alt="Chinese"></a>
49
+ <a href="https://github.com/codebeacon/codebeacon/blob/main/README.es.md"><img src="https://img.shields.io/badge/lang-Español-yellow" alt="Spanish"></a>
50
+ <a href="https://github.com/codebeacon/codebeacon/blob/main/README.fr.md"><img src="https://img.shields.io/badge/lang-Français-blueviolet" alt="French"></a>
51
+ <a href="https://github.com/codebeacon/codebeacon/blob/main/README.de.md"><img src="https://img.shields.io/badge/lang-Deutsch-lightgrey" alt="German"></a>
52
+ <a href="https://github.com/codebeacon/codebeacon/blob/main/README.pt-BR.md"><img src="https://img.shields.io/badge/lang-Português_(BR)-brightgreen" alt="Portuguese (Brazil)"></a>
53
+ </p>
54
+
55
+ <h1 align="center">codebeacon</h1>
56
+
57
+ <p align="center">
58
+ Source code AST analysis and AI context generation — unified multi-framework knowledge graph
59
+ </p>
60
+
61
+ <p align="center">
62
+ <a href="https://pypi.org/project/codebeacon/"><img src="https://img.shields.io/pypi/v/codebeacon" alt="PyPI"></a>
63
+ <a href="https://pypi.org/project/codebeacon/"><img src="https://img.shields.io/pypi/pyversions/codebeacon" alt="Python"></a>
64
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="MIT License"></a>
65
+ <a href="https://github.com/codebeacon/codebeacon/stargazers"><img src="https://img.shields.io/github/stars/codebeacon/codebeacon" alt="GitHub Stars"></a>
66
+ <a href="https://github.com/codebeacon/codebeacon/commits/main"><img src="https://img.shields.io/github/last-commit/codebeacon/codebeacon" alt="Last Commit"></a>
67
+ </p>
68
+
69
+ ---
70
+
71
+ ## Why codebeacon?
72
+
73
+ Every time you open a new AI coding session, your assistant starts blind. It doesn't know your routes, your service layer, your entity model, or how your microservices call each other. You spend the first chunk of every session just getting the AI back up to speed — pasting files, explaining structure, re-establishing context.
74
+
75
+ Existing tools solve this partially. Route analyzers map your controllers but miss service dependencies. Knowledge graph tools capture relationships but ignore your API surface. You end up running both, stitching output manually, and repeating it every time the codebase changes.
76
+
77
+ **codebeacon unifies both approaches in a single CLI.** One command scans your entire codebase with tree-sitter AST parsing, resolves dependency injection across files, detects community clusters in your architecture, and writes a ready-to-use context map directly into `CLAUDE.md`, `.cursorrules`, and `AGENTS.md` — so your AI assistant walks into every session already knowing your codebase.
78
+
79
+ ---
80
+
81
+ ## Key Features
82
+
83
+ - **Unified pipeline** — route/controller analysis + knowledge graph in one tool, no manual stitching
84
+ - **17 frameworks, 9 languages** — Spring Boot, NestJS, Django, FastAPI, Rails, Express, React, Vue, Angular, Svelte, Gin, Laravel, Actix-Web, ASP.NET Core, Vapor, Ktor, and more
85
+ - **Tree-sitter based** — structural AST parsing, not regex; all 17 language grammars included out of the box
86
+ - **Two-pass DI resolution** — Pass 1 extracts local AST nodes; Pass 2 builds a global symbol table and resolves Interface → Implementation mappings that single-pass tools miss
87
+ - **Wave merge architecture** — files processed in parallel chunks, results merged globally; handles large monorepos without memory blowouts
88
+ - **Multiple output formats** — JSON knowledge graph, Markdown wiki, Obsidian vault, AI context maps, MCP server
89
+ - **Community detection** — Leiden/Louvain clustering reveals your actual architectural boundaries
90
+ - **Incremental cache** — SHA-256 based; only re-extracts files that changed since the last scan
91
+ - **Zero configuration** — auto-detects frameworks and languages; generates `codebeacon.yaml` for repeat runs
92
+
93
+ ---
94
+
95
+ ## Quick Start
96
+
97
+ ```bash
98
+ pip install codebeacon
99
+
100
+ codebeacon scan .
101
+ ```
102
+
103
+ That's it. codebeacon detects your project types, extracts routes/services/entities/components, builds a knowledge graph, and writes everything to `.codebeacon/`.
104
+
105
+ For a multi-project workspace:
106
+
107
+ ```bash
108
+ codebeacon scan /path/to/workspace # auto-detects all projects, generates codebeacon.yaml
109
+ codebeacon sync # subsequent runs via config
110
+ ```
111
+
112
+ ---
113
+
114
+ ## Supported Frameworks
115
+
116
+ | Language | Frameworks |
117
+ |----------|-----------|
118
+ | Java / Kotlin | Spring Boot, Ktor |
119
+ | Python | Django, FastAPI, Flask |
120
+ | JavaScript / TypeScript | Express, NestJS, React, Vue, Angular, Svelte |
121
+ | Go | Gin |
122
+ | Ruby | Rails |
123
+ | PHP | Laravel |
124
+ | Rust | Actix-Web |
125
+ | C# | ASP.NET Core |
126
+ | Swift | Vapor |
127
+
128
+ ---
129
+
130
+ ## Architecture
131
+
132
+ codebeacon runs a two-pass extraction pipeline:
133
+
134
+ ```
135
+ [Config] → [Discover] → [Wave / Extract] → [Resolve] → [Filter] → [Enrich] → [Graph] → [Wiki] → [ContextMap] → [Export]
136
+ │ │ │ │
137
+ Local AST Symbol Cross-lang HTTP API
138
+ per chunk table artifact Shared DB
139
+ (Pass 1) matching removal entity edges
140
+ (Pass 2)
141
+ ```
142
+
143
+ **Pass 1 — Wave extraction:** Files are processed in parallel chunks via `ThreadPoolExecutor`. Each file runs through five extractors: routes, services, entities, components, and dependencies. Results are cached by SHA-256 for incremental re-scans.
144
+
145
+ **Pass 2 — Graph build:** All wave results are merged. A global symbol table resolves unresolved dependency injection references — mapping interfaces to implementations in the way Spring's implicit Bean wiring or TypeScript's injection tokens require. Filters remove build artifacts, spurious cross-language imports, and false cross-service edges.
146
+
147
+ **Post-processing:** HTTP API edges connect frontend URL calls to matching backend routes. Community detection (Leiden → Louvain → connected components fallback) partitions the graph into architectural clusters. A structural report identifies god nodes, surprising cross-cluster connections, and hub files.
148
+
149
+ ---
150
+
151
+ ## Output Structure
152
+
153
+ After a scan, everything lands in `.codebeacon/`:
154
+
155
+ ```
156
+ .codebeacon/
157
+ beacon.json ← full knowledge graph (node-link JSON, queryable)
158
+ REPORT.md ← god nodes, surprising connections, hub files
159
+ CLAUDE.md ← AI context map (also written to project root)
160
+ .cursorrules ← Cursor IDE context
161
+ AGENTS.md ← OpenAI Agents / Codex context
162
+ wiki/
163
+ index.md ← global index (~200 tokens)
164
+ overview.md ← platform stats + cross-project connections
165
+ routes.md ← all routes table
166
+ cross-project/
167
+ connections.md ← cross-service edges
168
+ <project>/
169
+ index.md
170
+ routes.md
171
+ controllers/<Name>.md
172
+ services/<Name>.md
173
+ entities/<Name>.md
174
+ components/<Name>.md
175
+ obsidian/ ← Obsidian vault (one note per graph node)
176
+ ```
177
+
178
+ ---
179
+
180
+ ## Installation Options
181
+
182
+ ```bash
183
+ pip install codebeacon # all 17 language grammars included
184
+ pip install codebeacon[cluster] # + Leiden community detection (graspologic)
185
+ pip install --upgrade codebeacon # upgrade to latest version with all dependencies
186
+ ```
187
+
188
+ All language parsers (Java, Kotlin, Python, JavaScript, TypeScript, Go, Ruby, PHP, C#, Rust, Swift, HTML, Svelte) are bundled by default — no extra flags needed.
189
+
190
+ ---
191
+
192
+ ## CLI Reference
193
+
194
+ ```bash
195
+ # Scan a project or workspace
196
+ codebeacon scan <path> [options]
197
+ codebeacon scan . # current directory
198
+ codebeacon scan /workspace # workspace root (multi-project)
199
+ codebeacon scan . --update # incremental: only re-extract changed files
200
+ codebeacon scan . --wiki-only # regenerate wiki without re-extracting
201
+ codebeacon scan . --obsidian-dir <path> # write Obsidian vault to custom location
202
+ codebeacon scan . --semantic # enable LLM semantic extraction
203
+ codebeacon scan . --list-only # detect frameworks only, don't extract
204
+
205
+ # Config-driven mode
206
+ codebeacon init [path] # auto-generate codebeacon.yaml
207
+ codebeacon sync # run from codebeacon.yaml
208
+ codebeacon sync --config <file> # use a specific config file
209
+
210
+ # Query the knowledge graph (coming soon)
211
+ codebeacon query <term> # search nodes and edges
212
+ codebeacon path <source> <target> # shortest path between two nodes
213
+
214
+ # Integrations
215
+ codebeacon serve [--dir .codebeacon] # start MCP server (stdio)
216
+ codebeacon install # install Claude Code skill
217
+ ```
218
+
219
+ ---
220
+
221
+ ## Configuration
222
+
223
+ Run `codebeacon init` to generate `codebeacon.yaml`, or write it manually:
224
+
225
+ ```yaml
226
+ version: 1
227
+
228
+ projects:
229
+ - name: api-server
230
+ path: ./api-server
231
+ type: spring-boot # optional: auto-detected if omitted
232
+
233
+ - name: frontend
234
+ path: ./frontend
235
+ type: react
236
+
237
+ output:
238
+ dir: .codebeacon
239
+ wiki: true
240
+ obsidian: true
241
+ graph_html: true
242
+ context_map:
243
+ targets: [CLAUDE.md, .cursorrules, AGENTS.md]
244
+
245
+ wave:
246
+ auto: true
247
+ chunk_size: 300 # files per chunk
248
+ max_parallel: 5 # parallel threads
249
+
250
+ semantic:
251
+ enabled: false # override with --semantic flag
252
+ ```
253
+
254
+ ---
255
+
256
+ ## How It Compares
257
+
258
+ | | codesight | graphify | **codebeacon** |
259
+ |---|---|---|---|
260
+ | Route / controller analysis | ✅ | ❌ | ✅ |
261
+ | Service / DI graph | partial | ✅ | ✅ |
262
+ | Interface → Impl resolution | ❌ | ❌ | ✅ |
263
+ | Entity / ORM model extraction | ✅ | ❌ | ✅ |
264
+ | Frontend component analysis | ✅ | ❌ | ✅ |
265
+ | Community detection | ❌ | ✅ | ✅ |
266
+ | Obsidian vault export | ❌ | ✅ | ✅ |
267
+ | MCP server | ✅ | ❌ | ✅ |
268
+ | AI context map (CLAUDE.md) | ✅ | ✅ | ✅ |
269
+ | Multi-project workspace | partial | ❌ | ✅ |
270
+ | Python-based | ❌ | ✅ | ✅ |
271
+
272
+ codebeacon is not a replacement for either tool — it's the union of what both do, built around a shared extraction and graph layer.
273
+
274
+ ---
275
+
276
+ ## Benchmarks
277
+
278
+ | Codebase | Stack | Files | Nodes | Edges | Communities | Scan time |
279
+ |----------|-------|-------|-------|-------|-------------|-----------|
280
+ | multi-service SaaS app | SvelteKit + Next.js + Spring Boot (3 projects) | 444 | 382 | 553 | 175 | ~12s |
281
+
282
+ ---
283
+
284
+ ## Privacy & Security
285
+
286
+ All processing is local. Your source code never leaves your machine.
287
+
288
+ - Tree-sitter AST parsing runs entirely in-process
289
+ - No telemetry, no analytics, no network calls during normal operation
290
+ - The `--semantic` flag (disabled by default) sends code excerpts to your configured LLM API — only enable it explicitly
291
+
292
+ ---
293
+
294
+ ## Contributing
295
+
296
+ ```bash
297
+ git clone https://github.com/codebeacon/codebeacon
298
+ cd codebeacon
299
+ pip install -e ".[dev,cluster]"
300
+ pytest
301
+ ```
302
+
303
+ The easiest entry point for adding new framework support is writing a tree-sitter query file in `codebeacon/extract/queries/`. See [`codebeacon/extract/queries/README.md`](codebeacon/extract/queries/README.md) for the full guide — it walks through grammar setup, `.scm` query syntax, capture naming conventions, and how to wire up a new extractor.
304
+
305
+ Contributions welcome: new framework queries, language parsers, output formats, and benchmark datasets.
306
+
307
+ ---
308
+
309
+ ## License
310
+
311
+ MIT — see [LICENSE](LICENSE).
312
+
313
+ ---
314
+
315
+ ## Acknowledgments
316
+
317
+ Built on [tree-sitter](https://tree-sitter.github.io/tree-sitter/) for structural AST parsing, [NetworkX](https://networkx.org/) for graph operations, and [graspologic](https://microsoft.github.io/graspologic/) for Leiden community detection.
318
+
319
+ Inspired by the complementary approaches of [codesight](https://github.com/Houseofmvps/codesight) and [graphify](https://github.com/safishamsi/graphify).