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#

ParameterTypeDescription
ownerstringGitHub username or organization
repostringRepository name

Query Parameters#

ParameterTypeDescription
pathstringPath to the skill directory or SKILL.md file

Request Body#

Optional JSON body:

FieldTypeDescription
modelstring?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#

StatusCause
404Repository or skill path not found
422LLM generation failed
429Rate limit exceeded
503Service not configured (missing API key)
504Operation 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_yaml
python
import httpx

res = httpx.post("https://api.skill-lab.dev/v1/repos/owner/repo/triggers?path=my-skill")
data = res.json()
# data['triggers_yaml']