docs/sgai-skills/compose/SKILL.md
Use the sgai compose wizard to create and manage GOAL.md files for workspaces. Supports reading compose state, updating wizard fields, saving drafts, previewing generated GOAL.md content, browsing workflow templates, and writing the final GOAL.md to the workspace.
npx skillsauth add sandgardenhq/sgai composeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The compose wizard is a guided interface for creating GOAL.md files. It maintains state about the workflow configuration, agent assignments, tech stack, and goals.
Endpoint: GET /api/v1/compose?workspace={name}
curl -s "$BASE_URL/api/v1/compose?workspace=my-project"
Response:
{
"workspace": "my-project",
"state": {
"description": "User management REST API",
"completionGate": "make test",
"safetyAnalysis": false,
"retrospective": false,
"agents": [
{"name": "coordinator", "selected": true, "model": "openai/gpt-5.5 (xhigh)"},
{"name": "go", "selected": true, "model": "openai/gpt-5.5 (low)"}
],
"flow": "\"go\"",
"tasks": "- [ ] Build a REST API for user management\n- [ ] Write tests with 80%+ coverage"
},
"wizard": {
"currentStep": 3,
"fromTemplate": "backend",
"description": "User management REST API",
"techStack": ["go"],
"safetyAnalysis": false,
"completionGate": "make test"
},
"techStackItems": [
{"id": "go", "name": "Go", "selected": true},
{"id": "react", "name": "React", "selected": false},
{"id": "shell", "name": "Shell/Bash", "selected": false}
],
"flowError": ""
}
state — the raw GOAL.md configuration:
description — markdown description that becomes the GOAL.md body before taskscompletionGate — shell command to verify completionsafetyAnalysis — whether to include Safety Analysis guidance in the GOAL.md bodyretrospective — whether to enable retrospective flow metadataagents — array of {name, selected, model} entries used to generate the models: frontmatterflow — agent flow definition (quoted agent names with ->)tasks — markdown goal checklist written under ## Taskswizard — user-facing wizard state:
currentStep — which step in the wizard (1-based)fromTemplate — template ID if started from templatedescription — project descriptiontechStack — selected technology stack itemssafetyAnalysis — whether STPA analysis is includedcompletionGate — gate script for completionEndpoint: GET /api/v1/compose/templates
curl -s "$BASE_URL/api/v1/compose/templates"
Response:
{
"templates": [
{
"id": "backend",
"name": "Go Development",
"description": "Go implementation and review wrapper",
"icon": "🔧",
"agents": [
{"name": "coordinator", "selected": true, "model": "openai/gpt-5.5 (xhigh)"},
{"name": "go", "selected": true, "model": "openai/gpt-5.5 (low)"}
],
"flow": "\"go\""
}
]
}
Preview what the GOAL.md would look like without saving.
Endpoint: GET /api/v1/compose/preview?workspace={name}
curl -s "$BASE_URL/api/v1/compose/preview?workspace=my-project"
Response:
{
"content": "---\nflow: |\n \"go\"\nmodels:\n \"coordinator\": \"openai/gpt-5.5 (xhigh)\"\n \"go\": \"openai/gpt-5.5 (low)\"\ncompletionGateScript: make test\n---\n\nUser management REST API\n\n## Tasks\n\n- [ ] Build a REST API\n",
"flowError": "",
"etag": "\"abc123def456\""
}
content — the full GOAL.md content that would be savedflowError — non-empty if the flow definition has syntax errorsetag — current file ETag for optimistic concurrencySave the compose state in memory without writing GOAL.md.
Endpoint: POST /api/v1/compose/draft?workspace={name}
curl -X POST "$BASE_URL/api/v1/compose/draft?workspace=my-project" \
-H "Content-Type: application/json" \
-d '{
"state": {
"description": "Auth system",
"completionGate": "",
"safetyAnalysis": false,
"retrospective": false,
"agents": [
{"name": "coordinator", "selected": true, "model": "openai/gpt-5.5 (xhigh)"},
{"name": "go", "selected": true, "model": "openai/gpt-5.5 (low)"}
],
"flow": "\"go\"",
"tasks": "- [ ] Build authentication\n"
},
"wizard": {
"currentStep": 2,
"fromTemplate": "",
"description": "Auth system",
"techStack": ["go"],
"safetyAnalysis": false,
"completionGate": ""
}
}'
Response:
{"saved": true}
Use this to update the wizard state incrementally as the user fills in fields.
Write the current compose state to GOAL.md.
Endpoint: POST /api/v1/compose?workspace={name}
# Simple save
curl -X POST "$BASE_URL/api/v1/compose?workspace=my-project"
# With optimistic concurrency (prevent overwriting concurrent changes)
ETAG=$(curl -s "$BASE_URL/api/v1/compose/preview?workspace=my-project" | jq -r '.etag')
curl -X POST "$BASE_URL/api/v1/compose?workspace=my-project" \
-H "If-Match: $ETAG"
Response (201 Created):
{
"saved": true,
"workspace": "my-project"
}
Errors:
412 Precondition Failed — GOAL.md was modified since the etag was fetched# 1. Start from a template
curl -X POST "$BASE_URL/api/v1/compose/draft?workspace=my-project" \
-H "Content-Type: application/json" \
-d '{
"state": {
"description": "User management API",
"completionGate": "make test",
"safetyAnalysis": false,
"retrospective": false,
"agents": [
{"name": "coordinator", "selected": true, "model": "openai/gpt-5.5 (xhigh)"},
{"name": "go", "selected": true, "model": "openai/gpt-5.5 (low)"}
],
"flow": "\"go\"",
"tasks": "- [ ] Build REST API\n- [ ] Add authentication\n- [ ] Write tests\n"
},
"wizard": {
"currentStep": 4,
"description": "User management API",
"techStack": ["go"],
"safetyAnalysis": false,
"completionGate": "make test"
}
}'
# 2. Preview to verify
curl -s "$BASE_URL/api/v1/compose/preview?workspace=my-project" | jq '.content'
# 3. Save to GOAL.md
curl -X POST "$BASE_URL/api/v1/compose?workspace=my-project"
# 4. Start the session
curl -X POST $BASE_URL/api/v1/workspaces/my-project/start -d '{"auto": true}'
documentation
Start, stop, and steer agentic sessions in sgai workspaces. Use when you need to launch AI agent sessions, halt running sessions, or inject steering instructions to guide the agent mid-execution without stopping it.
development
Monitor sgai workspace status, events, progress, diffs, and workflow diagrams. Use when you need to observe what agents are doing, track progress, get the current state of all workspaces, subscribe to real-time updates via SSE, or inspect code changes.
development
Access agents, skills, and code snippets available in sgai workspaces. Use when you need to discover what agents are defined in a workspace, browse available skills, get skill instructions, find code snippets by language, or retrieve snippet content for a specific task.
data-ai
Handle agent questions and work gates in sgai workspaces. Use when an agent is blocked waiting for human input, when you need to respond to multi-choice questions, approve work gates, or provide free-text answers to agent queries.