How truekiwwy/rustiphy works
rustiphy builds and incrementally maintains a code graph, then serves compact architecture and code context to AI agents through MCP or CLI commands. The main indexing path is documented and partly visible in scan, extraction, graph, and storage sources. README statements establish user-facing capabilities; unsampled command handlers and MCP internals are represented only where documented, so some internal links are intentionally omitted.
Main entry points: main.rs Command dispatcher · mcp.rs MCP server · graph.rs Code graph · sync.rs Index reconciliation
Components 26
CLI and serving
- Command dispatcher
crates/rustiphy-cli/src/main.rs - Index loader
crates/rustiphy-cli/src/index.rs - MCP server
crates/rustiphy-cli/src/mcp.rs - Agent setup
crates/rustiphy-cli/src/setup.rs - Graph viewer
crates/rustiphy-cli/src/view.rs - File watcher
crates/rustiphy-cli/src/watch.rs - Enrich command
crates/rustiphy-cli/src/semantic.rs - Token benchmark
crates/rustiphy-cli/src/bench.rs
Code indexing
- Repository scanner
crates/rustiphy-core/src/scan.rs - Language support
crates/rustiphy-core/src/lang.rs - AST extractor
crates/rustiphy-core/src/extract.rs - Code graph
crates/rustiphy-core/src/graph.rs - Community detection
crates/rustiphy-core/src/community.rs - Graph model
crates/rustiphy-core/src/model.rs - Index reconciliation
crates/rustiphy-core/src/sync.rs - Persistent index
crates/rustiphy-core/src/storage.rs
Compact context
- Graph slicer
crates/rustiphy-compact/src/slicer.rs - Compact graph DSL
crates/rustiphy-compact/src/dsl.rs - Token budgeting
crates/rustiphy-compact/src/tokens.rs - File skeletonizer
crates/rustiphy-compact/src/skeleton.rs - Architecture map
crates/rustiphy-compact/src/map.rs
Semantic summaries
- Summary enricher
crates/rustiphy-llm/src/enricher.rs - LLM client
crates/rustiphy-llm/src/client.rs
Other components
- Repository user
- AI coding agent
- OpenAI-compatible LLM
Connections 32
- Repository user → Command dispatcher: runs commands
README.md - AI coding agent → MCP server: sends MCP requests
README.md - Command dispatcher → Agent setup: auto configures
crates/rustiphy-cli/src/main.rs - Command dispatcher → MCP server: starts server
crates/rustiphy-cli/src/main.rs - Command dispatcher → Enrich command: builds or enriches
crates/rustiphy-cli/src/main.rs - Command dispatcher → Index loader: loads query index
crates/rustiphy-cli/src/main.rs - Command dispatcher → Graph slicer: slices graph
crates/rustiphy-cli/src/main.rs - Command dispatcher → File skeletonizer: skeletonizes file
crates/rustiphy-cli/src/main.rs - Repository user → File watcher: keeps index current
README.md - Repository user → Graph viewer: explores graph
README.md - Repository user → Token benchmark: compares token cost
README.md - Index loader → Repository scanner: scans fallback
crates/rustiphy-cli/src/index.rs - Index loader → Index reconciliation: refreshes stored graph
crates/rustiphy-cli/src/index.rs - Repository scanner → AST extractor: extracts files
crates/rustiphy-core/src/scan.rs - Repository scanner → Language support: detects language
crates/rustiphy-core/src/scan.rs - Code graph → AST extractor: uses file facts
crates/rustiphy-core/src/graph.rs - Code graph → Community detection: detects communities
crates/rustiphy-core/src/graph.rs - Code graph → Graph model: models graph entities
crates/rustiphy-core/src/graph.rs - Index reconciliation → Repository scanner: scans changes
crates/rustiphy-core/src/sync.rs - Index reconciliation → Code graph: updates graph
crates/rustiphy-core/src/sync.rs - Index reconciliation → Persistent index: persists updates
crates/rustiphy-core/src/sync.rs - Persistent index → Code graph: stores graph state
crates/rustiphy-core/src/storage.rs - Graph slicer → Compact graph DSL: renders slice
crates/rustiphy-compact/src/slicer.rs - Graph slicer → Token budgeting: budgets output
crates/rustiphy-compact/src/slicer.rs - Architecture map → Compact graph DSL: formats map
crates/rustiphy-compact/src/map.rs - Enrich command → Summary enricher: requests summaries
README.md - Summary enricher → LLM client: requests completions
crates/rustiphy-llm/src/enricher.rs - LLM client → OpenAI-compatible LLM: calls completion API
crates/rustiphy-llm/src/client.rs - Agent setup → AI coding agent: registers server and skill
README.md - MCP server → File watcher: keeps index fresh
README.md - MCP server → Architecture map: serves map
README.md - MCP server → Graph slicer: serves context slices
README.md