Guidelines API¶
REST API endpoints for managing coding guidelines.
Endpoints¶
List Guidelines¶
Query parameters:
| Parameter | Type | Description |
|---|---|---|
source |
string | Filter by source type (claude, cursor, steering, agents) |
file |
string | Filter by file path (returns guidelines that apply to the file) |
q |
string | Search in title and content |
Response:
{
"guidelines": [
{
"id": "abc123def456",
"title": "Python Code Style",
"content": "# Python Code Style\n\nUse type hints...",
"source_type": "claude",
"source_file": "CLAUDE.md",
"file_pattern": "**/*.py",
"tags": ["python", "style"],
"is_sample": false
}
],
"total_count": 8,
"counts_by_source": {
"claude": 5,
"steering": 3
}
}
Convert Guideline¶
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
guideline_id |
string | Yes | ID of the guideline to convert |
format |
string | Yes | Target format: steering, claude, or cursor |
preview |
boolean | No | If true (default), don't write files |
Response:
{
"filename": "python-code-style.md",
"content": "---\ninclusion: fileMatch\nfileMatchPattern: '**/*.py'\n---\n\n# Python Code Style\n\n...",
"frontmatter": {
"inclusion": "fileMatch",
"fileMatchPattern": "**/*.py"
},
"source_id": "abc123def456"
}
Export Guidelines¶
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
format |
string | Yes | Export format: claude or cursor |
Response:
Data Models¶
Guideline¶
interface Guideline {
id: string; // Unique identifier (hash-based)
title: string; // Title or heading
content: string; // Full content
source_type: SourceType; // Source type enum
source_file: string; // Path to source file
file_pattern?: string; // Glob pattern for applicable files
tags: string[]; // Tags for categorization
is_sample: boolean; // Whether this is a sample guideline
}
SourceType¶
ConversionResult¶
interface ConversionResult {
filename: string; // Suggested output filename
content: string; // Converted content
frontmatter: object; // YAML frontmatter (for steering)
source_id: string; // Original guideline ID
}
Examples¶
List all guidelines¶
Filter by source¶
Search guidelines¶
Convert to steering format¶
curl -X POST http://localhost:8765/api/guidelines/convert \
-H "Content-Type: application/json" \
-d '{"guideline_id": "abc123", "format": "steering", "preview": true}'
Convert to CLAUDE.md format¶
curl -X POST http://localhost:8765/api/guidelines/convert \
-H "Content-Type: application/json" \
-d '{"guideline_id": "abc123", "format": "claude", "preview": true}'
Export all to .cursorrules¶
curl -X POST http://localhost:8765/api/guidelines/export \
-H "Content-Type: application/json" \
-d '{"format": "cursor"}'