code-graph-builder 0.2.0__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 (119) hide show
  1. code_graph_builder-0.2.0/.claude/commands/api-browse.md +13 -0
  2. code_graph_builder-0.2.0/.claude/commands/api-detail.md +11 -0
  3. code_graph_builder-0.2.0/.claude/commands/api-doc-gen.md +16 -0
  4. code_graph_builder-0.2.0/.claude/commands/api-find.md +16 -0
  5. code_graph_builder-0.2.0/.claude/commands/api-list.md +12 -0
  6. code_graph_builder-0.2.0/.claude/commands/cgb-start.md +32 -0
  7. code_graph_builder-0.2.0/.claude/commands/code-locate.md +13 -0
  8. code_graph_builder-0.2.0/.claude/commands/code-search.md +15 -0
  9. code_graph_builder-0.2.0/.claude/commands/code-snippet.md +9 -0
  10. code_graph_builder-0.2.0/.claude/commands/embed-gen.md +14 -0
  11. code_graph_builder-0.2.0/.claude/commands/graph-build.md +15 -0
  12. code_graph_builder-0.2.0/.claude/commands/graph-query.md +16 -0
  13. code_graph_builder-0.2.0/.claude/commands/list-repos.md +7 -0
  14. code_graph_builder-0.2.0/.claude/commands/repo-info.md +11 -0
  15. code_graph_builder-0.2.0/.claude/commands/repo-init.md +23 -0
  16. code_graph_builder-0.2.0/.claude/commands/switch-repo.md +11 -0
  17. code_graph_builder-0.2.0/.claude/commands/wiki-gen.md +16 -0
  18. code_graph_builder-0.2.0/.claude/commands/wiki-list.md +7 -0
  19. code_graph_builder-0.2.0/.claude/commands/wiki-read.md +10 -0
  20. code_graph_builder-0.2.0/.env.example +23 -0
  21. code_graph_builder-0.2.0/.gitignore +57 -0
  22. code_graph_builder-0.2.0/CLAUDE_CODE_GUIDE.md +1025 -0
  23. code_graph_builder-0.2.0/PKG-INFO +321 -0
  24. code_graph_builder-0.2.0/README.md +289 -0
  25. code_graph_builder-0.2.0/code_graph_builder/__init__.py +82 -0
  26. code_graph_builder-0.2.0/code_graph_builder/builder.py +366 -0
  27. code_graph_builder-0.2.0/code_graph_builder/cgb_cli.py +32 -0
  28. code_graph_builder-0.2.0/code_graph_builder/cli.py +564 -0
  29. code_graph_builder-0.2.0/code_graph_builder/commands_cli.py +1288 -0
  30. code_graph_builder-0.2.0/code_graph_builder/config.py +340 -0
  31. code_graph_builder-0.2.0/code_graph_builder/constants.py +708 -0
  32. code_graph_builder-0.2.0/code_graph_builder/embeddings/__init__.py +40 -0
  33. code_graph_builder-0.2.0/code_graph_builder/embeddings/qwen3_embedder.py +573 -0
  34. code_graph_builder-0.2.0/code_graph_builder/embeddings/vector_store.py +584 -0
  35. code_graph_builder-0.2.0/code_graph_builder/examples/__init__.py +0 -0
  36. code_graph_builder-0.2.0/code_graph_builder/examples/example_configuration.py +276 -0
  37. code_graph_builder-0.2.0/code_graph_builder/examples/example_kuzu_usage.py +109 -0
  38. code_graph_builder-0.2.0/code_graph_builder/examples/example_semantic_search_full.py +347 -0
  39. code_graph_builder-0.2.0/code_graph_builder/examples/generate_wiki.py +915 -0
  40. code_graph_builder-0.2.0/code_graph_builder/examples/graph_export_example.py +100 -0
  41. code_graph_builder-0.2.0/code_graph_builder/examples/rag_example.py +206 -0
  42. code_graph_builder-0.2.0/code_graph_builder/examples/test_cli_demo.py +129 -0
  43. code_graph_builder-0.2.0/code_graph_builder/examples/test_embedding_api.py +153 -0
  44. code_graph_builder-0.2.0/code_graph_builder/examples/test_kuzu_local.py +190 -0
  45. code_graph_builder-0.2.0/code_graph_builder/examples/test_rag_redis.py +390 -0
  46. code_graph_builder-0.2.0/code_graph_builder/graph_updater.py +605 -0
  47. code_graph_builder-0.2.0/code_graph_builder/guidance/__init__.py +1 -0
  48. code_graph_builder-0.2.0/code_graph_builder/guidance/agent.py +123 -0
  49. code_graph_builder-0.2.0/code_graph_builder/guidance/prompts.py +74 -0
  50. code_graph_builder-0.2.0/code_graph_builder/guidance/toolset.py +264 -0
  51. code_graph_builder-0.2.0/code_graph_builder/language_spec.py +536 -0
  52. code_graph_builder-0.2.0/code_graph_builder/mcp/__init__.py +21 -0
  53. code_graph_builder-0.2.0/code_graph_builder/mcp/api_doc_generator.py +764 -0
  54. code_graph_builder-0.2.0/code_graph_builder/mcp/file_editor.py +207 -0
  55. code_graph_builder-0.2.0/code_graph_builder/mcp/pipeline.py +777 -0
  56. code_graph_builder-0.2.0/code_graph_builder/mcp/server.py +161 -0
  57. code_graph_builder-0.2.0/code_graph_builder/mcp/tools.py +1800 -0
  58. code_graph_builder-0.2.0/code_graph_builder/models.py +115 -0
  59. code_graph_builder-0.2.0/code_graph_builder/parser_loader.py +344 -0
  60. code_graph_builder-0.2.0/code_graph_builder/parsers/__init__.py +7 -0
  61. code_graph_builder-0.2.0/code_graph_builder/parsers/call_processor.py +306 -0
  62. code_graph_builder-0.2.0/code_graph_builder/parsers/call_resolver.py +139 -0
  63. code_graph_builder-0.2.0/code_graph_builder/parsers/definition_processor.py +796 -0
  64. code_graph_builder-0.2.0/code_graph_builder/parsers/factory.py +119 -0
  65. code_graph_builder-0.2.0/code_graph_builder/parsers/import_processor.py +293 -0
  66. code_graph_builder-0.2.0/code_graph_builder/parsers/structure_processor.py +145 -0
  67. code_graph_builder-0.2.0/code_graph_builder/parsers/type_inference.py +143 -0
  68. code_graph_builder-0.2.0/code_graph_builder/parsers/utils.py +134 -0
  69. code_graph_builder-0.2.0/code_graph_builder/rag/__init__.py +68 -0
  70. code_graph_builder-0.2.0/code_graph_builder/rag/camel_agent.py +429 -0
  71. code_graph_builder-0.2.0/code_graph_builder/rag/client.py +298 -0
  72. code_graph_builder-0.2.0/code_graph_builder/rag/config.py +239 -0
  73. code_graph_builder-0.2.0/code_graph_builder/rag/cypher_generator.py +67 -0
  74. code_graph_builder-0.2.0/code_graph_builder/rag/llm_backend.py +210 -0
  75. code_graph_builder-0.2.0/code_graph_builder/rag/markdown_generator.py +352 -0
  76. code_graph_builder-0.2.0/code_graph_builder/rag/prompt_templates.py +440 -0
  77. code_graph_builder-0.2.0/code_graph_builder/rag/rag_engine.py +640 -0
  78. code_graph_builder-0.2.0/code_graph_builder/rag/review_report.md +172 -0
  79. code_graph_builder-0.2.0/code_graph_builder/rag/tests/__init__.py +3 -0
  80. code_graph_builder-0.2.0/code_graph_builder/rag/tests/test_camel_agent.py +313 -0
  81. code_graph_builder-0.2.0/code_graph_builder/rag/tests/test_client.py +221 -0
  82. code_graph_builder-0.2.0/code_graph_builder/rag/tests/test_config.py +177 -0
  83. code_graph_builder-0.2.0/code_graph_builder/rag/tests/test_markdown_generator.py +240 -0
  84. code_graph_builder-0.2.0/code_graph_builder/rag/tests/test_prompt_templates.py +160 -0
  85. code_graph_builder-0.2.0/code_graph_builder/services/__init__.py +39 -0
  86. code_graph_builder-0.2.0/code_graph_builder/services/graph_service.py +465 -0
  87. code_graph_builder-0.2.0/code_graph_builder/services/kuzu_service.py +665 -0
  88. code_graph_builder-0.2.0/code_graph_builder/services/memory_service.py +171 -0
  89. code_graph_builder-0.2.0/code_graph_builder/settings.py +75 -0
  90. code_graph_builder-0.2.0/code_graph_builder/tests/ACCEPTANCE_CRITERIA_PHASE2.md +401 -0
  91. code_graph_builder-0.2.0/code_graph_builder/tests/__init__.py +1 -0
  92. code_graph_builder-0.2.0/code_graph_builder/tests/run_acceptance_check.py +378 -0
  93. code_graph_builder-0.2.0/code_graph_builder/tests/test_api_find.py +231 -0
  94. code_graph_builder-0.2.0/code_graph_builder/tests/test_api_find_integration.py +226 -0
  95. code_graph_builder-0.2.0/code_graph_builder/tests/test_basic.py +78 -0
  96. code_graph_builder-0.2.0/code_graph_builder/tests/test_c_api_extraction.py +388 -0
  97. code_graph_builder-0.2.0/code_graph_builder/tests/test_call_resolution_scenarios.py +504 -0
  98. code_graph_builder-0.2.0/code_graph_builder/tests/test_embedder.py +411 -0
  99. code_graph_builder-0.2.0/code_graph_builder/tests/test_integration_semantic.py +434 -0
  100. code_graph_builder-0.2.0/code_graph_builder/tests/test_mcp_protocol.py +298 -0
  101. code_graph_builder-0.2.0/code_graph_builder/tests/test_mcp_user_flow.py +190 -0
  102. code_graph_builder-0.2.0/code_graph_builder/tests/test_rag.py +404 -0
  103. code_graph_builder-0.2.0/code_graph_builder/tests/test_settings.py +135 -0
  104. code_graph_builder-0.2.0/code_graph_builder/tests/test_step1_graph_build.py +264 -0
  105. code_graph_builder-0.2.0/code_graph_builder/tests/test_step2_api_docs.py +323 -0
  106. code_graph_builder-0.2.0/code_graph_builder/tests/test_step3_embedding.py +278 -0
  107. code_graph_builder-0.2.0/code_graph_builder/tests/test_vector_store.py +552 -0
  108. code_graph_builder-0.2.0/code_graph_builder/tools/__init__.py +40 -0
  109. code_graph_builder-0.2.0/code_graph_builder/tools/graph_query.py +495 -0
  110. code_graph_builder-0.2.0/code_graph_builder/tools/semantic_search.py +387 -0
  111. code_graph_builder-0.2.0/code_graph_builder/types.py +333 -0
  112. code_graph_builder-0.2.0/code_graph_builder/utils/__init__.py +0 -0
  113. code_graph_builder-0.2.0/code_graph_builder/utils/path_utils.py +30 -0
  114. code_graph_builder-0.2.0/core_system_prompt.md +9 -0
  115. code_graph_builder-0.2.0/mcp.json +8 -0
  116. code_graph_builder-0.2.0/npm-package/bin/cli.mjs +314 -0
  117. code_graph_builder-0.2.0/npm-package/package.json +28 -0
  118. code_graph_builder-0.2.0/pyproject.toml +54 -0
  119. code_graph_builder-0.2.0/scripts/install_global.py +159 -0
@@ -0,0 +1,13 @@
1
+ Browse the hierarchical API documentation. Without arguments, returns the L1 module index. With a module name, returns the L2 module detail page.
2
+
3
+ ```bash
4
+ python3 ~/.claude/commands/code-graph/cgb_cli.py api-docs $ARGUMENTS
5
+ ```
6
+
7
+ Options:
8
+ - `--module <name>` : Show L2 detail for a specific module
9
+
10
+ Workflow:
11
+ 1. `/api-browse` — see all modules (L1 index)
12
+ 2. `/api-browse --module project.parser` — see all functions in that module (L2)
13
+ 3. `/api-detail project.parser.parse_expr` — see detailed doc for one function (L3)
@@ -0,0 +1,11 @@
1
+ Read detailed API documentation for a specific function. Includes signature, docstring, and full call graph (who calls it and what it calls).
2
+
3
+ ```bash
4
+ python3 ~/.claude/commands/code-graph/cgb_cli.py api-doc $ARGUMENTS
5
+ ```
6
+
7
+ The argument is the fully qualified function name.
8
+
9
+ Example: `/api-detail project.parser.parse_expression`
10
+
11
+ Use `/api-browse` first to browse available modules and functions.
@@ -0,0 +1,16 @@
1
+ Generate hierarchical API documentation from the existing knowledge graph. This is step 2 of the pipeline. Produces L1 module index, L2 per-module pages, and L3 per-function detail pages with call graphs.
2
+
3
+ Requires only a graph database — no embeddings or LLM API keys needed.
4
+
5
+ ```bash
6
+ python3 ~/.claude/commands/code-graph/cgb_cli.py api-doc-gen $ARGUMENTS
7
+ ```
8
+
9
+ Supported options:
10
+ - `--rebuild` : Force regenerate API docs even if cached
11
+
12
+ Examples:
13
+ - `/api-doc-gen` — generate API docs (uses cache if available)
14
+ - `/api-doc-gen --rebuild` — force full regeneration
15
+
16
+ Requires `/graph-build` or `/repo-init` to have been run at least once (graph must exist).
@@ -0,0 +1,16 @@
1
+ **Use this FIRST before writing any implementation code.** Find existing interfaces in this codebase that match the requirement.
2
+
3
+ ```bash
4
+ python3 ~/.claude/commands/code-graph/cgb_cli.py api-find "$ARGUMENTS"
5
+ ```
6
+
7
+ After getting results:
8
+ 1. Check if any returned function already solves the problem — if yes, use it directly, don't rewrite it
9
+ 2. Note the call graph to understand calling order and dependencies
10
+ 3. If nothing matches exactly, use the found implementations as your coding template — not general language conventions
11
+
12
+ Add `--top-k N` to get more results (default: 5).
13
+
14
+ Example: `/api-find PWM duty cycle update`
15
+
16
+ Requires embeddings to have been built via `/repo-init`.
@@ -0,0 +1,12 @@
1
+ List public API interfaces for a module or the entire project. Returns function signatures, struct/enum definitions, and type declarations.
2
+
3
+ ```bash
4
+ python3 ~/.claude/commands/code-graph/cgb_cli.py list-api $ARGUMENTS
5
+ ```
6
+
7
+ Options:
8
+ - `--module <name>` : Filter by module qualified name (omit for all modules)
9
+ - `--visibility public|static|extern|all` : Visibility filter (default: public)
10
+ - `--include-types` : Include struct/enum/typedef definitions (default: true)
11
+
12
+ Example: `/api-list --module project.parser --visibility all`
@@ -0,0 +1,32 @@
1
+ Initialize the codebase-expert assistant session. Run this once at the start of any working session before implementing features or answering architecture questions.
2
+
3
+ Adopt the following role for this **entire conversation**:
4
+
5
+ ---
6
+
7
+ You are an AI pair programming assistant embedded in an embedded software development team that builds inverter power control firmware in C.
8
+
9
+ Your purpose is to bridge the gap between hardware requirements and software implementation. Hardware engineers describe what they need in domain-specific, often ambiguous terms — your role is to transform those descriptions into precise, executable software tasks, and then help implement them correctly within an existing, mature codebase.
10
+
11
+ This codebase has a stable foundation: all low-level interfaces are already encapsulated. Development work is purely logic-driven — calling existing interfaces to achieve new behaviors. The team's deepest pain is not writing code, but knowing which interfaces to use, in what order, with what preconditions and postconditions — knowledge that currently lives only in the heads of a few engineers or buried in previously verified implementations.
12
+
13
+ You have access to the full structure of this codebase: its call graphs, interface dependencies, semantic relationships between functions, and the documented behavior of every module. Use this knowledge actively. When a requirement arrives, your first instinct should be to search what already exists before considering what needs to be created. When generating code, your reference is always the verified implementations already present in the codebase — not general C programming conventions.
14
+
15
+ Your goal is not to be a code generator. Your goal is to be the experienced engineer that every team member can consult — one who knows the codebase deeply, asks the right questions before writing a single line, and ensures that what gets written is consistent with how this specific system works.
16
+
17
+ ---
18
+
19
+ Now load the active repository context:
20
+
21
+ ```bash
22
+ python3 ~/.claude/commands/code-graph/cgb_cli.py info
23
+ ```
24
+
25
+ ```bash
26
+ python3 ~/.claude/commands/code-graph/cgb_cli.py get-wiki index
27
+ ```
28
+
29
+ After running these commands:
30
+ 1. State which repository is active and when it was last indexed
31
+ 2. Summarize in one sentence what this codebase does (from the wiki)
32
+ 3. Confirm you will always search existing code via `/api-find` or `/code-search` before proposing any implementation
@@ -0,0 +1,13 @@
1
+ Locate a function or method in the repository using Tree-sitter AST parsing. Returns source code, line numbers, and qualified name.
2
+
3
+ ```bash
4
+ python3 ~/.claude/commands/code-graph/cgb_cli.py locate $ARGUMENTS
5
+ ```
6
+
7
+ Arguments:
8
+ - First: relative file path from repo root
9
+ - Second: function or method name (use `ClassName.method` for methods)
10
+ - `--line N` : optional line number to disambiguate overloads
11
+
12
+ Example: `/code-locate src/parser.c parse_expression`
13
+ Example: `/code-locate src/main.py MyClass.run --line 42`
@@ -0,0 +1,15 @@
1
+ Search for existing implementations. Run this before proposing new code — the answer is almost always "use existing function X" rather than "write something new".
2
+
3
+ ```bash
4
+ python3 ~/.claude/commands/code-graph/cgb_cli.py search "$ARGUMENTS"
5
+ ```
6
+
7
+ After getting results:
8
+ - If a match covers the need, **reference its source directly as the implementation**
9
+ - Use `--top-k 10` when exploring unfamiliar areas to get broader coverage
10
+
11
+ Add `--top-k N` to control the number of results (default: 5).
12
+
13
+ Example: `/code-search initialize PWM output channel`
14
+
15
+ Requires embeddings to have been built via `/repo-init`.
@@ -0,0 +1,9 @@
1
+ Retrieve source code of a function, method, or class by its fully qualified name from the knowledge graph.
2
+
3
+ ```bash
4
+ python3 ~/.claude/commands/code-graph/cgb_cli.py snippet $ARGUMENTS
5
+ ```
6
+
7
+ The argument is the fully qualified name (e.g. `mymodule.MyClass.my_method`).
8
+
9
+ Example: `/code-snippet tinycc.tcc.tcc_compile_string`
@@ -0,0 +1,14 @@
1
+ Rebuild vector embeddings using the existing knowledge graph. Use this when embeddings are missing, corrupted, or when you want to re-embed after changing the embedding model or configuration — without rebuilding the graph.
2
+
3
+ ```bash
4
+ python3 ~/.claude/commands/code-graph/cgb_cli.py embed-gen $ARGUMENTS
5
+ ```
6
+
7
+ Supported options:
8
+ - `--rebuild` : Force rebuild embeddings even if cached
9
+
10
+ Examples:
11
+ - `/embed-gen` — rebuild embeddings (uses cache if available)
12
+ - `/embed-gen --rebuild` — force full re-embedding
13
+
14
+ Requires `/repo-init` to have been run at least once (graph must exist).
@@ -0,0 +1,15 @@
1
+ Build the code knowledge graph from source code using Tree-sitter AST parsing. This is step 1 of the pipeline — it only creates the graph database, without generating API docs, embeddings, or wiki.
2
+
3
+ ```bash
4
+ python3 ~/.claude/commands/code-graph/cgb_cli.py graph-build $ARGUMENTS
5
+ ```
6
+
7
+ Supported options:
8
+ - `--rebuild` : Force rebuild graph even if cached
9
+ - `--backend kuzu|memgraph|memory` : Graph database backend (default: kuzu)
10
+
11
+ Examples:
12
+ - `/graph-build /home/user/my-project` — build graph
13
+ - `/graph-build /home/user/my-project --rebuild` — force full rebuild
14
+
15
+ After building, use `/api-doc-gen`, `/embed-gen`, and `/wiki-gen` as separate steps.
@@ -0,0 +1,16 @@
1
+ Query the code knowledge graph for structural relationships. Particularly useful for understanding calling order, initialization sequences, and module dependencies.
2
+
3
+ ```bash
4
+ python3 ~/.claude/commands/code-graph/cgb_cli.py query "$ARGUMENTS"
5
+ ```
6
+
7
+ Typical use cases:
8
+ - **Calling order**: "what functions must be called before X?"
9
+ - **Init sequence**: "what is the startup sequence for module Y?"
10
+ - **Callers**: "which functions call Z?"
11
+ - **Dependencies**: "what does function W depend on?"
12
+ - **Module boundaries**: "what does module A export that module B uses?"
13
+
14
+ Requires an LLM API key configured (LLM_API_KEY, OPENAI_API_KEY, or MOONSHOT_API_KEY).
15
+
16
+ Example: `/graph-query what must be initialized before calling Inverter_Start?`
@@ -0,0 +1,7 @@
1
+ List all previously indexed repositories in the workspace. Shows each repo's name, path, last indexed time, completed pipeline steps (graph, api_docs, embeddings, wiki), and which one is currently active.
2
+
3
+ ```bash
4
+ python3 ~/.claude/commands/code-graph/cgb_cli.py list-repos
5
+ ```
6
+
7
+ Use this at the start of a new session to discover available repos, then `/switch-repo` to activate one.
@@ -0,0 +1,11 @@
1
+ Show information about the currently active (indexed) repository, including graph statistics, wiki pages, and service availability.
2
+
3
+ ```bash
4
+ python3 ~/.claude/commands/code-graph/cgb_cli.py info
5
+ ```
6
+
7
+ Present the JSON result in a readable format, highlighting:
8
+ - Repository path and indexing time
9
+ - Graph node/relationship counts
10
+ - Available services (Cypher query, semantic search, API docs)
11
+ - Number of wiki pages generated
@@ -0,0 +1,23 @@
1
+ Index a code repository by running the full pipeline: graph-build → api-doc-gen → embed-gen → wiki-gen.
2
+
3
+ This is the all-in-one command. Each step can also be run individually:
4
+ - `/graph-build` — step 1: build knowledge graph
5
+ - `/api-doc-gen` — step 2: generate API docs (needs graph only)
6
+ - `/embed-gen` — step 3: build vector embeddings (needs graph)
7
+ - `/wiki-gen` — step 4: generate wiki (needs graph + embeddings + LLM)
8
+
9
+ ```bash
10
+ python3 ~/.claude/commands/code-graph/cgb_cli.py init $ARGUMENTS
11
+ ```
12
+
13
+ Supported options:
14
+ - `--rebuild` : Force rebuild even if cached data exists
15
+ - `--mode comprehensive|concise` : comprehensive = 8-10 pages (default), concise = 4-5 pages
16
+ - `--backend kuzu|memgraph|memory` : Graph database backend (default: kuzu)
17
+ - `--no-wiki` : Skip wiki generation (graph + api-docs + embeddings only)
18
+ - `--no-embed` : Skip embeddings and wiki (graph + api-docs only, fastest)
19
+
20
+ Example: `/repo-init /home/user/my-project --mode concise`
21
+
22
+ This takes 2-10 minutes depending on repo size. Progress will be printed inline.
23
+ After completion, other commands (`/graph-query`, `/code-search`, `/wiki-list`, etc.) become available.
@@ -0,0 +1,11 @@
1
+ Switch the active repository to a previously indexed one. After switching, all query commands (`/graph-query`, `/code-search`, `/wiki-list`, `/api-browse`, etc.) will operate on the selected repo.
2
+
3
+ ```bash
4
+ python3 ~/.claude/commands/code-graph/cgb_cli.py switch-repo $ARGUMENTS
5
+ ```
6
+
7
+ The argument is the repository name or artifact directory name (use `/list-repos` to see available names).
8
+
9
+ Examples:
10
+ - `/switch-repo my-project` — switch by repo name
11
+ - `/switch-repo my-project_a1b2c3d4` — switch by artifact dir name
@@ -0,0 +1,16 @@
1
+ Regenerate wiki pages using existing graph and embeddings. Use this when wiki generation failed during `/repo-init`, or when you want to regenerate with different settings — without rebuilding the graph or recomputing embeddings.
2
+
3
+ ```bash
4
+ python3 ~/.claude/commands/code-graph/cgb_cli.py wiki-gen $ARGUMENTS
5
+ ```
6
+
7
+ Supported options:
8
+ - `--rebuild` : Force regenerate wiki structure and all pages (ignores cache)
9
+ - `--mode comprehensive|concise` : comprehensive = 8-10 pages (default), concise = 4-5 pages
10
+
11
+ Examples:
12
+ - `/wiki-gen` — regenerate with default settings
13
+ - `/wiki-gen --rebuild` — force full regeneration
14
+ - `/wiki-gen --mode concise` — generate fewer pages
15
+
16
+ Requires `/repo-init` to have been run at least once (graph + embeddings must exist).
@@ -0,0 +1,7 @@
1
+ List all generated wiki pages for the active repository.
2
+
3
+ ```bash
4
+ python3 ~/.claude/commands/code-graph/cgb_cli.py list-wiki
5
+ ```
6
+
7
+ Use `/wiki-read <page-id>` to read a specific page.
@@ -0,0 +1,10 @@
1
+ Read the content of a generated wiki page.
2
+
3
+ ```bash
4
+ python3 ~/.claude/commands/code-graph/cgb_cli.py get-wiki $ARGUMENTS
5
+ ```
6
+
7
+ Use `index` for the summary page, or a specific page ID like `page-1`, `page-2`, etc.
8
+ Run `/wiki-list` first to see available page IDs.
9
+
10
+ Example: `/wiki-read index` or `/wiki-read page-3`
@@ -0,0 +1,23 @@
1
+ # LLM Configuration (for Wiki generation, Cypher translation, etc.)
2
+ # Priority: LLM_API_KEY > OPENAI_API_KEY > MOONSHOT_API_KEY (first match wins)
3
+ # Recommended: use LLM_API_KEY for any OpenAI-compatible provider
4
+ LLM_API_KEY=sk-xxxxxx
5
+ LLM_BASE_URL=https://api.openai.com/v1
6
+ LLM_MODEL=gpt-4o
7
+
8
+ # Alternative: OpenAI-specific
9
+ # OPENAI_API_KEY=sk-xxxxxx
10
+ # OPENAI_BASE_URL=https://api.openai.com/v1
11
+ # OPENAI_MODEL=gpt-4o
12
+
13
+ # Alternative: Moonshot / Kimi (legacy)
14
+ # MOONSHOT_API_KEY=sk-xxxxxx
15
+ # MOONSHOT_MODEL=kimi-k2.5
16
+
17
+ # Alibaba Cloud DashScope (Qwen3 Embedding for semantic search)
18
+ DASHSCOPE_API_KEY=sk-xxxxxx
19
+ DASHSCOPE_BASE_URL=https://dashscope.aliyuncs.com/api/v1
20
+
21
+ # Memgraph (only needed for memgraph backend)
22
+ MEMGRAPH_HOST=localhost
23
+ MEMGRAPH_PORT=7687
@@ -0,0 +1,57 @@
1
+ # Environment variables (sensitive - never commit)
2
+ .env
3
+ .env.local
4
+ .env.*.local
5
+
6
+ # Python
7
+ __pycache__/
8
+ *.py[cod]
9
+ *$py.class
10
+ *.so
11
+ .Python
12
+ build/
13
+ dist/
14
+ *.egg-info/
15
+ .eggs/
16
+ *.egg
17
+ pip-wheel-metadata/
18
+
19
+ # Virtual environments
20
+ .venv/
21
+ venv/
22
+ env/
23
+ ENV/
24
+
25
+ # Database files
26
+ *.db
27
+ *.db-wal
28
+ *.db-shm
29
+
30
+ # Graph data exports (may contain private code)
31
+ *.json
32
+ !*example*.json
33
+ !mcp.json
34
+ !npm-package/package.json
35
+
36
+ # IDE
37
+ .idea/
38
+ .vscode/
39
+ *.swp
40
+ *.swo
41
+ .DS_Store
42
+
43
+ # Test / coverage
44
+ .pytest_cache/
45
+ .coverage
46
+ htmlcov/
47
+ .tox/
48
+
49
+ # uv
50
+ uv.lock
51
+
52
+ # Generated output
53
+ rag_output/
54
+ tinycc_analysis/
55
+ tinycc_kuzu/
56
+ tinycc_memory/
57
+ extracted_prompts/