docs: update agent guide and SKILL docs; standardize Web API port 5001
- Update .claude SKILL to use port 5001 in all examples - Add repo-root SKILL.md consolidated API guide - Expand AGENTS.md with rb.ps1 usage and policies
This commit is contained in:
@@ -11,14 +11,14 @@ Use this guide when accessing the Roslyn Bridge for C# code analysis.
|
||||
|
||||
```
|
||||
┌─────────────┐ REST API ┌────────────────────┐ HTTP ┌─────────────────────┐
|
||||
│ Claude │ ◄─────────────────► │ Web API (:5000) │ ◄────────────► │ VS Plugin (:59123) │
|
||||
│ Claude │ ◄─────────────────► │ Web API (:5001) │ ◄────────────► │ VS Plugin (:59123) │
|
||||
│ AI │ │ Middleware │ │ Roslyn Bridge │
|
||||
└─────────────┘ └────────────────────┘ └─────────────────────┘
|
||||
```
|
||||
|
||||
## Recommended: Web API (Port 5000)
|
||||
## Recommended: Web API (Port 5001)
|
||||
|
||||
**Base URL**: `http://localhost:5000`
|
||||
**Base URL**: `http://localhost:5001`
|
||||
|
||||
The Web API provides a modern RESTful interface with:
|
||||
- Clean REST endpoints with query parameters
|
||||
@@ -69,34 +69,34 @@ Direct access to the Visual Studio plugin (use only if Web API is unavailable):
|
||||
|
||||
```bash
|
||||
# Health check
|
||||
curl http://localhost:5000/api/health
|
||||
curl http://localhost:5001/api/health
|
||||
|
||||
# Get all projects (returns full file paths)
|
||||
curl http://localhost:5000/api/roslyn/projects
|
||||
curl http://localhost:5001/api/roslyn/projects
|
||||
|
||||
# Get solution overview
|
||||
curl http://localhost:5000/api/roslyn/solution/overview
|
||||
curl http://localhost:5001/api/roslyn/solution/overview
|
||||
|
||||
# Get diagnostics for entire solution
|
||||
curl http://localhost:5000/api/roslyn/diagnostics
|
||||
curl http://localhost:5001/api/roslyn/diagnostics
|
||||
|
||||
# Get diagnostics for specific file
|
||||
curl "http://localhost:5000/api/roslyn/diagnostics?filePath=C:/path/to/file.cs"
|
||||
curl "http://localhost:5001/api/roslyn/diagnostics?filePath=C:/path/to/file.cs"
|
||||
|
||||
# Get symbol at position (use paths from /projects response)
|
||||
curl "http://localhost:5000/api/roslyn/symbol?filePath=C:/path/to/file.cs&line=10&column=5"
|
||||
curl "http://localhost:5001/api/roslyn/symbol?filePath=C:/path/to/file.cs&line=10&column=5"
|
||||
|
||||
# Find all references
|
||||
curl "http://localhost:5000/api/roslyn/references?filePath=C:/path/to/file.cs&line=18&column=30"
|
||||
curl "http://localhost:5001/api/roslyn/references?filePath=C:/path/to/file.cs&line=18&column=30"
|
||||
|
||||
# Search for symbols
|
||||
curl "http://localhost:5000/api/roslyn/symbol/search?symbolName=MyClass&kind=class"
|
||||
curl "http://localhost:5001/api/roslyn/symbol/search?symbolName=MyClass&kind=class"
|
||||
|
||||
# Get recent history
|
||||
curl http://localhost:5000/api/history/recent?count=10
|
||||
curl http://localhost:5001/api/history/recent?count=10
|
||||
|
||||
# Get history statistics
|
||||
curl http://localhost:5000/api/history/stats
|
||||
curl http://localhost:5001/api/history/stats
|
||||
```
|
||||
|
||||
**IMPORTANT curl syntax rules:**
|
||||
@@ -170,50 +170,50 @@ curl -X POST http://localhost:59123/query -H "Content-Type: application/json" -d
|
||||
|
||||
```bash
|
||||
# Step 1: Check if services are healthy
|
||||
curl http://localhost:5000/api/health
|
||||
curl http://localhost:5001/api/health
|
||||
|
||||
# Step 2: Get all projects and their files
|
||||
curl http://localhost:5000/api/roslyn/projects
|
||||
curl http://localhost:5001/api/roslyn/projects
|
||||
# Response includes: {"data": [{"documents": ["C:/Full/Path/To/File.cs", ...]}]}
|
||||
|
||||
# Step 3: Use the full paths from Step 2 in subsequent queries
|
||||
FILE="C:/Users/AJ/Desktop/MyProject/Program.cs"
|
||||
|
||||
# Get diagnostics (errors/warnings) for a file
|
||||
curl "http://localhost:5000/api/roslyn/diagnostics?filePath=$FILE"
|
||||
curl "http://localhost:5001/api/roslyn/diagnostics?filePath=$FILE"
|
||||
|
||||
# Get symbol information at a specific location
|
||||
curl "http://localhost:5000/api/roslyn/symbol?filePath=$FILE&line=15&column=10"
|
||||
curl "http://localhost:5001/api/roslyn/symbol?filePath=$FILE&line=15&column=10"
|
||||
|
||||
# Find all references to that symbol
|
||||
curl "http://localhost:5000/api/roslyn/references?filePath=$FILE&line=15&column=10"
|
||||
curl "http://localhost:5001/api/roslyn/references?filePath=$FILE&line=15&column=10"
|
||||
|
||||
# Step 4: View your query history
|
||||
curl http://localhost:5000/api/history/recent?count=5
|
||||
curl http://localhost:5001/api/history/recent?count=5
|
||||
|
||||
# Step 5: Get statistics about your queries
|
||||
curl http://localhost:5000/api/history/stats
|
||||
curl http://localhost:5001/api/history/stats
|
||||
```
|
||||
|
||||
### Advanced Query Examples
|
||||
|
||||
```bash
|
||||
# Search for all classes with "Service" in the name
|
||||
curl "http://localhost:5000/api/roslyn/symbol/search?symbolName=Service&kind=class"
|
||||
curl "http://localhost:5001/api/roslyn/symbol/search?symbolName=Service&kind=class"
|
||||
|
||||
# Get solution-wide statistics
|
||||
curl http://localhost:5000/api/roslyn/solution/overview
|
||||
curl http://localhost:5001/api/roslyn/solution/overview
|
||||
|
||||
# For complex queries not available as REST endpoints, use POST /query
|
||||
curl -X POST http://localhost:5000/api/roslyn/query \
|
||||
curl -X POST http://localhost:5001/api/roslyn/query \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"queryType":"searchcode","symbolName":".*Controller","parameters":{"scope":"classes"}}'
|
||||
|
||||
# Build a project
|
||||
curl -X POST "http://localhost:5000/api/roslyn/project/build?projectName=MyProject"
|
||||
curl -X POST "http://localhost:5001/api/roslyn/project/build?projectName=MyProject"
|
||||
|
||||
# Add NuGet package
|
||||
curl -X POST "http://localhost:5000/api/roslyn/project/package/add?projectName=MyProject&packageName=Newtonsoft.Json&version=13.0.3"
|
||||
curl -X POST "http://localhost:5001/api/roslyn/project/package/add?projectName=MyProject&packageName=Newtonsoft.Json&version=13.0.3"
|
||||
```
|
||||
|
||||
## Response Format
|
||||
@@ -253,7 +253,7 @@ All endpoints return JSON in this format:
|
||||
## Troubleshooting
|
||||
|
||||
**"Failed to connect" error:**
|
||||
1. Check if Web API is running: `curl http://localhost:5000/api/health/ping`
|
||||
1. Check if Web API is running: `curl http://localhost:5001/api/health/ping`
|
||||
2. Check if VS Plugin is running: `curl -X POST http://localhost:59123/health -H "Content-Type: application/json" -d "{}"`
|
||||
3. Ensure Visual Studio is open with a solution loaded
|
||||
|
||||
|
||||
Reference in New Issue
Block a user