-
Notifications
You must be signed in to change notification settings - Fork 1
Add ragsharp scaffold: codegraph indexer, SQLite store, CLI, installer, templates, docs and tests #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
KSemenenko
merged 1 commit into
main
from
codex/create-ragsharp-project-as-nuget-package
Jan 3, 2026
Merged
Add ragsharp scaffold: codegraph indexer, SQLite store, CLI, installer, templates, docs and tests #1
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,66 @@ | ||
| # RagSharp | ||
| # RagSharp | ||
|
|
||
| RagSharp provides a deterministic, offline-capable code graph indexer and skill installer for C#/.NET repositories. It ships a single NuGet package containing: | ||
|
|
||
| - `ragsharp` — installer for Codex skills. | ||
| - `ragsharp-codegraph` — code graph indexer/query CLI. | ||
|
|
||
| See the Codex skill specification at https://agentskills.io/specification. | ||
|
|
||
| ## Requirements | ||
|
|
||
| - .NET SDK 10 (primary) with multi-targeting to net8.0 for fallback. | ||
| - Cross-platform (Windows/macOS/Linux). | ||
|
|
||
| ## Install .NET 10 | ||
|
|
||
| Follow the OS-specific steps in [docs/Development/SetupDotNet.md](docs/Development/SetupDotNet.md) and verify: | ||
|
|
||
| ```bash | ||
| dotnet --info | ||
| dotnet --list-sdks | ||
| ``` | ||
|
|
||
| ## Build and test RagSharp | ||
|
|
||
| ```bash | ||
| dotnet build | ||
|
|
||
| dotnet test | ||
| ``` | ||
|
|
||
| ## Package | ||
|
|
||
| ```bash | ||
| dotnet pack src/RagSharp.Packaging/RagSharp.Packaging.csproj -c Release -o dist | ||
| ``` | ||
|
|
||
| ## Install in another repository | ||
|
|
||
| From the target repository root: | ||
|
|
||
| ```bash | ||
| dotnet add package RagSharp --source /path/to/ragsharp/dist | ||
|
|
||
| ragsharp install --root . --skill-dir .codex/skills | ||
| ``` | ||
|
|
||
| ## Index and query | ||
|
|
||
| ```bash | ||
| ragsharp-codegraph doctor --root . | ||
|
|
||
| ragsharp-codegraph index --root . --db .codegraph/index.db --state .codegraph/state.json | ||
|
|
||
| ragsharp-codegraph query symbols --db .codegraph/index.db --format json --limit 50 --symbol "Greeter" | ||
| ``` | ||
|
|
||
| ## Output locations | ||
|
|
||
| - `.codex/skills/` contains installed skills. | ||
| - `.codegraph/` contains the index and state files (not committed). | ||
| - Ensure `.codegraph/` and `state.json` remain in `.gitignore`. | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| See [docs/Development/Troubleshooting.md](docs/Development/Troubleshooting.md). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| name: ragsharp-build-code-graph | ||
| description: | | ||
| Build or update a code graph index for C#/.NET repositories using ragsharp-codegraph. | ||
| Triggers: build index, update index, refresh index, code graph, dependency graph, static analysis, Roslyn, line numbers. | ||
| --- | ||
| ## Steps | ||
| 1. Run `ragsharp-codegraph doctor --root .`. | ||
| 2. Run `ragsharp-codegraph index --root . --db .codegraph/index.db --state .codegraph/state.json`. | ||
| 3. For incremental updates, run `ragsharp-codegraph update --root . --db .codegraph/index.db --state .codegraph/state.json`. | ||
|
|
||
| ## Expected Results | ||
| - `.codegraph/index.db` exists. | ||
| - `.codegraph/state.json` is updated. | ||
| - Output goes to stderr, JSON is emitted only for query commands. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Build Code Graph Skill | ||
|
|
||
| Use this skill to initialize or refresh the code graph index. | ||
| - `ragsharp-codegraph doctor` validates tooling. | ||
| - `ragsharp-codegraph index` builds the graph. | ||
| - `ragsharp-codegraph update` applies incremental changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| param([string]$Root = ".") | ||
| ragsharp-codegraph index --root $Root --db .codegraph/index.db --state .codegraph/state.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
| ragsharp-codegraph index --root "${1:-.}" --db .codegraph/index.db --state .codegraph/state.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| name: ragsharp-query-code-graph | ||
| description: | | ||
| Query the ragsharp code graph for declarations, references, callers, callees, dependencies, and line-number evidence. | ||
| Triggers: find usages, where defined, callers, callees, dependency path, project deps, type hierarchy, line numbers, evidence. | ||
| --- | ||
| ## Steps | ||
| 1. Run `ragsharp-codegraph query symbols --db .codegraph/index.db --format json --limit 50 --symbol "SymbolName"`. | ||
| 2. Use the JSON output to answer questions with file:line-range evidence. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Query Code Graph Skill | ||
|
|
||
| Use query contracts defined in docs/Development/QueryContract.md and OutputSchema.md. | ||
| Each answer should cite file:line-range evidence from query results. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| param([string]$Symbol = "") | ||
| ragsharp-codegraph query symbols --db .codegraph/index.db --format json --limit 50 --symbol $Symbol |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
| ragsharp-codegraph query symbols --db .codegraph/index.db --format json --limit 50 --symbol "${1:-}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Code Graph CLI | ||
|
|
||
| ## Commands | ||
|
|
||
| - `ragsharp-codegraph doctor --root <path>` | ||
| - `ragsharp-codegraph index --root <path> --db .codegraph/index.db --state .codegraph/state.json` | ||
| - `ragsharp-codegraph update --root <path> --db .codegraph/index.db --state .codegraph/state.json` | ||
| - `ragsharp-codegraph query <queryType> --db .codegraph/index.db --format json --limit N --context-lines M` | ||
| - `ragsharp-codegraph export --db .codegraph/index.db --format dot|gexf --out .codegraph/graph.dot` | ||
|
|
||
| ## Files\n\n- `.codegraph/index.db` — SQLite graph database.\n- `.codegraph/state.json` — incremental index state.\n- `.codegraph/schema_version` — schema version guard.\n+ | ||
| ## Exit codes | ||
|
|
||
| - 0: success | ||
| - 2: invalid arguments | ||
| - 3: environment error | ||
| - 4: index missing | ||
| - 5: schema mismatch | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Output Schema | ||
|
|
||
| ```json | ||
| { | ||
| "schemaVersion": "1", | ||
| "nodes": [ | ||
| { | ||
| "id": 1, | ||
| "kind": "Type", | ||
| "name": "Greeter", | ||
| "fullyQualifiedName": "SampleApp.Greeter", | ||
| "documentPath": "Program.cs", | ||
| "location": { | ||
| "filePathRelative": "Program.cs", | ||
| "startLine": 5, | ||
| "startColumn": 1, | ||
| "endLine": 9, | ||
| "endColumn": 2 | ||
| } | ||
| } | ||
| ], | ||
| "edges": [ | ||
| { | ||
| "id": 10, | ||
| "kind": "DeclaredAt", | ||
| "sourceId": 2, | ||
| "targetId": 1, | ||
| "location": { | ||
| "filePathRelative": "Program.cs", | ||
| "startLine": 5, | ||
| "startColumn": 1, | ||
| "endLine": 9, | ||
| "endColumn": 2 | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Performance | ||
|
|
||
| - Use `ragsharp-codegraph update` for incremental indexing. | ||
| - Store the database on fast local storage. | ||
| - Increase `--limit` cautiously for large repositories. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Query Contract | ||
|
|
||
| All `ragsharp-codegraph query` commands emit JSON to stdout. Logs go to stderr. The JSON schema is defined in [OutputSchema.md](OutputSchema.md). | ||
|
|
||
| Query requests support: | ||
| - `--symbol` to filter by name or fully-qualified name. | ||
| - `--kind` to filter by node kind. | ||
| - `--document` to filter by file path. | ||
| - `--limit` to cap results. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Setup .NET 10 | ||
|
|
||
| ## macOS | ||
|
|
||
| ```bash | ||
| brew install --cask dotnet-sdk-preview | ||
|
|
||
| dotnet --info | ||
| dotnet --list-sdks | ||
| ``` | ||
|
|
||
| ## Ubuntu/Debian | ||
|
|
||
| ```bash | ||
| sudo apt-get update | ||
| sudo apt-get install -y dotnet-sdk-10.0 | ||
|
|
||
| dotnet --info | ||
| dotnet --list-sdks | ||
| ``` | ||
|
|
||
| ## Windows (PowerShell) | ||
|
|
||
| ```powershell | ||
| winget install Microsoft.DotNet.SDK.Preview | ||
| dotnet --info | ||
| dotnet --list-sdks | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Troubleshooting | ||
|
|
||
| - Ensure .NET SDK 10 is installed and on PATH. | ||
| - Run `ragsharp-codegraph doctor` for environment checks. | ||
| - Delete `.codegraph/` to rebuild the index from scratch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "sdk": { | ||
| "version": "10.0.100", | ||
| "rollForward": "latestFeature", | ||
| "allowPrerelease": true | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
|
|
||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 17 | ||
| VisualStudioVersion = 17.0.31903.59 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RagSharp.CodeGraph.Core", "src/RagSharp.CodeGraph.Core/RagSharp.CodeGraph.Core.csproj", "{9842C0C2-C914-4AE9-B695-C31285B4FA10}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RagSharp.CodeGraph.Store.LiteGraph", "src/RagSharp.CodeGraph.Store.LiteGraph/RagSharp.CodeGraph.Store.LiteGraph.csproj", "{DB688194-9C0A-40CC-8977-C49F0EF97F7E}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RagSharp.CodeGraph.Cli", "src/RagSharp.CodeGraph.Cli/RagSharp.CodeGraph.Cli.csproj", "{E9442C38-3561-489A-A048-9C39E3989204}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RagSharp.SkillInstaller", "src/RagSharp.SkillInstaller/RagSharp.SkillInstaller.csproj", "{F88A2153-7673-4CC3-BEB7-93990D10D8E0}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RagSharp.Packaging", "src/RagSharp.Packaging/RagSharp.Packaging.csproj", "{329B88F1-A1C4-444F-9BD4-3E5333E587DA}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RagSharp.CodeGraph.Tests", "tests/RagSharp.CodeGraph.Tests/RagSharp.CodeGraph.Tests.csproj", "{0EB45C08-B646-40B0-8766-A4790C70FB7C}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RagSharp.SkillInstaller.Tests", "tests/RagSharp.SkillInstaller.Tests/RagSharp.SkillInstaller.Tests.csproj", "{763BFEF6-0BD4-423D-9784-CE707EBC3719}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {9842C0C2-C914-4AE9-B695-C31285B4FA10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {9842C0C2-C914-4AE9-B695-C31285B4FA10}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {9842C0C2-C914-4AE9-B695-C31285B4FA10}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {9842C0C2-C914-4AE9-B695-C31285B4FA10}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {DB688194-9C0A-40CC-8977-C49F0EF97F7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {DB688194-9C0A-40CC-8977-C49F0EF97F7E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {DB688194-9C0A-40CC-8977-C49F0EF97F7E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {DB688194-9C0A-40CC-8977-C49F0EF97F7E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {E9442C38-3561-489A-A048-9C39E3989204}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {E9442C38-3561-489A-A048-9C39E3989204}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {E9442C38-3561-489A-A048-9C39E3989204}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {E9442C38-3561-489A-A048-9C39E3989204}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {F88A2153-7673-4CC3-BEB7-93990D10D8E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {F88A2153-7673-4CC3-BEB7-93990D10D8E0}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {F88A2153-7673-4CC3-BEB7-93990D10D8E0}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {F88A2153-7673-4CC3-BEB7-93990D10D8E0}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {329B88F1-A1C4-444F-9BD4-3E5333E587DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {329B88F1-A1C4-444F-9BD4-3E5333E587DA}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {329B88F1-A1C4-444F-9BD4-3E5333E587DA}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {329B88F1-A1C4-444F-9BD4-3E5333E587DA}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {0EB45C08-B646-40B0-8766-A4790C70FB7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {0EB45C08-B646-40B0-8766-A4790C70FB7C}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {0EB45C08-B646-40B0-8766-A4790C70FB7C}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {0EB45C08-B646-40B0-8766-A4790C70FB7C}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {763BFEF6-0BD4-423D-9784-CE707EBC3719}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {763BFEF6-0BD4-423D-9784-CE707EBC3719}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {763BFEF6-0BD4-423D-9784-CE707EBC3719}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {763BFEF6-0BD4-423D-9784-CE707EBC3719}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| EndGlobal |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an extra newline escape sequence in the middle of the line. The text "## Files\n\n- " should be "## Files" followed by a proper newline and bullet list.