Skip to main content
Trinity
API Reference

Skills API

Manage the skills library and assign skills to agents. Skills are reusable instruction sets stored as Markdown files that get injected into an agent's .claude/skills/ directory.

Full interactive API docs are available at http://localhost:8000/docs when running locally. This page covers the most important endpoints.

Skills Library

GET

/api/skills/library

List all available skills from the skills library. Returns metadata only (no content) for performance.

curl -H "Authorization: Bearer <token>" \
  http://localhost:8000/api/skills/library

# Response
[
  {
    "name": "code-review",
    "description": "Perform thorough code reviews with security checks",
    "path": "skills/code-review.md"
  },
  {
    "name": "research-web",
    "description": "Research topics using web search and summarize findings",
    "path": "skills/research-web.md"
  }
]
GET

/api/skills/library/:name

Get details for a specific skill including its full Markdown content.

curl -H "Authorization: Bearer <token>" \
  http://localhost:8000/api/skills/library/code-review

# Response
{
  "name": "code-review",
  "description": "Perform thorough code reviews",
  "path": "skills/code-review.md",
  "content": "# Code Review Skill\n\nWhen reviewing code..."
}
GET

/api/skills/library/status

Get configuration status, sync info, and skill count for the library.

POST

/api/skills/library/sync

Sync the skills library from GitHub. Clones or pulls the configured repository.Admin only

curl -X POST -H "Authorization: Bearer <token>" \
  http://localhost:8000/api/skills/library/sync

# Response
{
  "success": true,
  "skills_count": 12,
  "message": "Library synced from GitHub"
}

Agent Skill Assignments

GET

/api/agents/:name/skills

Get skills assigned to an agent with assignment metadata.

curl -H "Authorization: Bearer <token>" \
  http://localhost:8000/api/agents/research-agent/skills

# Response
[
  {
    "skill_name": "code-review",
    "assigned_by": "admin",
    "assigned_at": "2026-03-15T10:00:00Z"
  }
]
PUT

/api/agents/:name/skills

Bulk update skills assigned to an agent. Replaces all existing assignments with the provided list.

NameTypeRequiredDescription
skillsstring[]YesArray of skill names to assign
curl -X PUT -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"skills": ["code-review", "research-web"]}' \
  http://localhost:8000/api/agents/research-agent/skills

# Response
{
  "success": true,
  "agent_name": "research-agent",
  "skills_assigned": 2,
  "skills": ["code-review", "research-web"]
}
POST

/api/agents/:name/skills/:skill_name

Assign a single skill to an agent. Returns 404 if skill not found in library.

DELETE

/api/agents/:name/skills/:skill_name

Remove a skill assignment from an agent.

POST

/api/agents/:name/skills/inject

Push all assigned skills to a running agent. Copies skill files to the agent's .claude/skills/ directory. Agent must be running.

curl -X POST -H "Authorization: Bearer <token>" \
  http://localhost:8000/api/agents/research-agent/skills/inject

# Response
{
  "success": true,
  "skills_injected": 2,
  "skills_failed": 0
}

Error Responses

StatusMeaning
400Sync failed or invalid request
401Invalid or missing JWT token
403Admin access required (for sync)
404Skill not found in library