11# RagSharp
22
3- RagSharp provides a deterministic, offline-capable code graph indexer and skill installer for C#/.NET repositories. It ships a single NuGet package containing:
3+ RagSharp is a deterministic, offline-capable toolkit for indexing and querying C#/.NET repositories.
4+ It ships as a single NuGet package that provides two command-line tools:
45
5- - ` ragsharp ` — installer for Codex skills.
6- - ` ragsharp-codegraph ` — code graph indexer/query CLI .
6+ - ` ragsharp ` — installs/uninstalls Codex skills into a repository .
7+ - ` ragsharp-graph ` — builds and queries a code graph index for fast, structured lookups .
78
89See the Codex skill specification at https://agentskills.io/specification .
910
11+ ## What RagSharp does
12+
13+ RagSharp focuses on repeatable, offline analysis of C# codebases:
14+
15+ - ** Indexes** source code and builds a graph of types, members, usings, and relationships.
16+ - ** Queries** the graph (symbols, inheritance, references) and outputs JSON for automation.
17+ - ** Installs skills** that wrap common workflows such as indexing or querying.
18+
19+ All outputs are stored under ` .ragsharp/graph/ ` by default to keep artifacts organized and
20+ easy to clean up.
21+
1022## Requirements
1123
1224- .NET SDK 10 (only target).
@@ -26,7 +38,7 @@ dotnet --list-sdks
2638``` bash
2739dotnet build
2840
29- dotnet test
41+ dotnet test ragsharp.slnx
3042```
3143
3244## Package
@@ -45,21 +57,53 @@ dotnet add package RagSharp --source /path/to/ragsharp/dist
4557ragsharp install --root . --skill-dir .codex/skills
4658```
4759
48- ## Index and query
60+ ## RagSharp Graph quickstart
61+
62+ Build and query the graph:
4963
5064``` bash
51- ragsharp-codegraph doctor --root .
65+ ragsharp-graph doctor --root .
5266
53- ragsharp-codegraph index --root . --db .codegraph/ index.db --state .codegraph /state.json
67+ ragsharp-graph index --root . --db .ragsharp/graph/ index.db --state .ragsharp/graph /state.json
5468
55- ragsharp-codegraph query symbols --db .codegraph/index.db --format json --limit 50 --symbol " Greeter"
69+ ragsharp-graph query symbols --db .ragsharp/graph/index.db --format json --limit 50 --symbol " Greeter"
70+ ```
71+
72+ Export the graph:
73+
74+ ``` bash
75+ ragsharp-graph export --db .ragsharp/graph/index.db --format dot --out .ragsharp/graph/graph.dot
5676```
5777
78+ ## CLI reference
79+
80+ ### ` ragsharp `
81+
82+ - ` ragsharp install --root <path> --skill-dir <path> ` — install skills.
83+ - ` ragsharp uninstall --root <path> --skill-dir <path> ` — uninstall skills.
84+
85+ ### ` ragsharp-graph `
86+
87+ - ` doctor ` — verify the environment and print the repository root.
88+ - ` index ` — build a fresh index.
89+ - ` update ` — incrementally update the index and remove deleted files.
90+ - ` query <type> ` — query the index (` symbols ` , ` usings ` , etc.) and emit JSON.
91+ - ` export ` — export the graph as ` dot ` or ` gexf ` .
92+
5893## Output locations
5994
6095- ` .codex/skills/ ` contains installed skills.
61- - ` .codegraph/ ` contains the index and state files (not committed).
62- - Ensure ` .codegraph/ ` and ` state.json ` remain in ` .gitignore ` .
96+ - ` .ragsharp/graph/ ` contains the index and state files (not committed).
97+ - Ensure ` .ragsharp/graph/ ` and ` state.json ` remain in ` .gitignore ` .
98+
99+ ## Example prompts
100+
101+ Use these with your assistant after indexing:
102+
103+ - “List the top 20 symbols that inherit from ` BaseType ` in JSON.”
104+ - “Show usages of ` HttpClient ` and include 3 context lines.”
105+ - “Find all public methods in ` src/ ` that return ` Task ` .”
106+ - “Export the graph to DOT and summarize the top 10 node kinds.”
63107
64108## Troubleshooting
65109
0 commit comments