Generate Triggers#
POST/v1/repos/{owner}/{repo}/triggers
Generates trigger test YAML for a SKILL.md file using an LLM. The generated tests cover explicit, implicit, contextual, and negative trigger types. Rate limited to 5 requests per minute.
Path Parameters#
| Parameter | Type | Description |
|---|---|---|
| owner | string | GitHub username or organization |
| repo | string | Repository name |
Query Parameters#
| Parameter | Type | Description |
|---|---|---|
| path | string | Path to the skill directory or SKILL.md file |
Request Body#
Optional JSON body:
| Field | Type | Description |
|---|---|---|
| model | string? | LLM model override (default: server-configured) |
Response#
Returns skill_name, triggers_yaml (the generated YAML string), test_count, and usage (token counts).
example response
{
"owner": "owner",
"repo": "repo",
"path": "skills/my-skill/SKILL.md",
"skill_name": "my-skill",
"triggers_yaml": "triggers:\n - type: explicit\n prompt: ...",
"test_count": 12,
"usage": { "model": "claude-haiku-4-5-20251001", "input_tokens": 3200, "output_tokens": 900 }
}
This endpoint calls an LLM and may take 10-30 seconds to respond. Results are cached per commit SHA and model — repeated requests for the same skill on the same commit return the cached response.
Errors#
| Status | Cause |
|---|---|
| 404 | Repository or skill path not found |
| 422 | LLM generation failed |
| 429 | Rate limit exceeded |
| 503 | Service not configured (missing API key) |
| 504 | Operation timed out |
Example#
bash
curl -X POST "https://api.skill-lab.dev/v1/repos/owner/repo/triggers?path=my-skill"javascript
const res = await fetch("https://api.skill-lab.dev/v1/repos/owner/repo/triggers?path=my-skill", { method: "POST" });
const data = await res.json();
// data.triggers_yamlpython
import httpx
res = httpx.post("https://api.skill-lab.dev/v1/repos/owner/repo/triggers?path=my-skill")
data = res.json()
# data['triggers_yaml']