Skip to content

Commit e0d10d9

Browse files
authored
Merge pull request #1 from managedcode/codex/create-ragsharp-project-as-nuget-package
Add ragsharp scaffold: codegraph indexer, SQLite store, CLI, installer, templates, docs and tests
2 parents a32aa6a + 2e825d2 commit e0d10d9

File tree

37 files changed

+1650
-405
lines changed

37 files changed

+1650
-405
lines changed

.gitignore

Lines changed: 8 additions & 404 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,66 @@
1-
# RagSharp
1+
# RagSharp
2+
3+
RagSharp provides a deterministic, offline-capable code graph indexer and skill installer for C#/.NET repositories. It ships a single NuGet package containing:
4+
5+
- `ragsharp` — installer for Codex skills.
6+
- `ragsharp-codegraph` — code graph indexer/query CLI.
7+
8+
See the Codex skill specification at https://agentskills.io/specification.
9+
10+
## Requirements
11+
12+
- .NET SDK 10 (primary) with multi-targeting to net8.0 for fallback.
13+
- Cross-platform (Windows/macOS/Linux).
14+
15+
## Install .NET 10
16+
17+
Follow the OS-specific steps in [docs/Development/SetupDotNet.md](docs/Development/SetupDotNet.md) and verify:
18+
19+
```bash
20+
dotnet --info
21+
dotnet --list-sdks
22+
```
23+
24+
## Build and test RagSharp
25+
26+
```bash
27+
dotnet build
28+
29+
dotnet test
30+
```
31+
32+
## Package
33+
34+
```bash
35+
dotnet pack src/RagSharp.Packaging/RagSharp.Packaging.csproj -c Release -o dist
36+
```
37+
38+
## Install in another repository
39+
40+
From the target repository root:
41+
42+
```bash
43+
dotnet add package RagSharp --source /path/to/ragsharp/dist
44+
45+
ragsharp install --root . --skill-dir .codex/skills
46+
```
47+
48+
## Index and query
49+
50+
```bash
51+
ragsharp-codegraph doctor --root .
52+
53+
ragsharp-codegraph index --root . --db .codegraph/index.db --state .codegraph/state.json
54+
55+
ragsharp-codegraph query symbols --db .codegraph/index.db --format json --limit 50 --symbol "Greeter"
56+
```
57+
58+
## Output locations
59+
60+
- `.codex/skills/` contains installed skills.
61+
- `.codegraph/` contains the index and state files (not committed).
62+
- Ensure `.codegraph/` and `state.json` remain in `.gitignore`.
63+
64+
## Troubleshooting
65+
66+
See [docs/Development/Troubleshooting.md](docs/Development/Troubleshooting.md).
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: ragsharp-build-code-graph
3+
description: |
4+
Build or update a code graph index for C#/.NET repositories using ragsharp-codegraph.
5+
Triggers: build index, update index, refresh index, code graph, dependency graph, static analysis, Roslyn, line numbers.
6+
---
7+
## Steps
8+
1. Run `ragsharp-codegraph doctor --root .`.
9+
2. Run `ragsharp-codegraph index --root . --db .codegraph/index.db --state .codegraph/state.json`.
10+
3. For incremental updates, run `ragsharp-codegraph update --root . --db .codegraph/index.db --state .codegraph/state.json`.
11+
12+
## Expected Results
13+
- `.codegraph/index.db` exists.
14+
- `.codegraph/state.json` is updated.
15+
- Output goes to stderr, JSON is emitted only for query commands.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Build Code Graph Skill
2+
3+
Use this skill to initialize or refresh the code graph index.
4+
- `ragsharp-codegraph doctor` validates tooling.
5+
- `ragsharp-codegraph index` builds the graph.
6+
- `ragsharp-codegraph update` applies incremental changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
param([string]$Root = ".")
2+
ragsharp-codegraph index --root $Root --db .codegraph/index.db --state .codegraph/state.json
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
ragsharp-codegraph index --root "${1:-.}" --db .codegraph/index.db --state .codegraph/state.json
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: ragsharp-query-code-graph
3+
description: |
4+
Query the ragsharp code graph for declarations, references, callers, callees, dependencies, and line-number evidence.
5+
Triggers: find usages, where defined, callers, callees, dependency path, project deps, type hierarchy, line numbers, evidence.
6+
---
7+
## Steps
8+
1. Run `ragsharp-codegraph query symbols --db .codegraph/index.db --format json --limit 50 --symbol "SymbolName"`.
9+
2. Use the JSON output to answer questions with file:line-range evidence.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Query Code Graph Skill
2+
3+
Use query contracts defined in docs/Development/QueryContract.md and OutputSchema.md.
4+
Each answer should cite file:line-range evidence from query results.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
param([string]$Symbol = "")
2+
ragsharp-codegraph query symbols --db .codegraph/index.db --format json --limit 50 --symbol $Symbol
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
ragsharp-codegraph query symbols --db .codegraph/index.db --format json --limit 50 --symbol "${1:-}"

0 commit comments

Comments
 (0)