sgai-goal
Skill11 starsChanged 8 days agoMITView on GitHub
Use when starting a new feature, project, or bug fix in a repository that uses SGAI - interactively composes a GOAL.md with agent flow graph, model preferences, completion gate, and outcome-based success criteria
In this repository31 other files it gives its agents.
- architecture-diagrammingSkill
- at-risk-detectionSkill
- build-faq-from-issuesSkill
- context-aware-questionsSkill
- daily-planning-ritualSkill
- dependency-mappingSkill
- estimating-change-footprintSkill
- estimating-work-itemsSkill
- idea-to-designSkill
- issue-decompositionSkill
- markdown-formattingSkill
- mermaid-diagramsSkill
- prepare-meeting-agendaSkill
- project-analysisSkill
- project-planningSkill
- repairing-project-setupSkill
- requirement-elicitationSkill
- research-topic-summarizeSkill
- setting-up-a-projectSkill
- stakeholder-trackingSkill
- stakeholder-updatesSkill
- summarize-conversation-threadSkill
- supervising-conductor-workspacesSkill
- supervising-paradev-workspacesSkill
- timeline-planningSkill
- triage-new-issuesSkill
- working-on-an-epicSkill
- working-on-an-issueSkill
- writing-product-specsSkill
- writing-user-storiesSkill
- writing-verification-plansSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
Check for an .sgai/ directory or other SGAI configuration in the repository.
- Very specific: line 44
Check .sgai/preferences.json for saved preferences:
- Distinctive: line 55
If no preferences exist, ask:
- Distinctive: line 88
Ask: "Does this capture what success looks like?"
- Very specific: line 105
Always include stpa-analyst as terminal node for safety analysis (except pure documentation flows).
- Very specific: line 127
Write new GOAL.md to repository root.
- Very specific: line 171
Interactive mode: Always yes (agents ask clarifying questions)
- Distinctive: line 172
stpa-analyst: Always included as terminal reviewer
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SGAI Goal Authoring
Compose GOAL.md files for SGAI workspaces through interactive conversation.
When to Use
- User says "start a new feature/project/fix"
- User describes work to be done in an SGAI-managed repo
- User asks to "create a goal" or "set up SGAI"
Process
0. Verify SGAI Is in Use
Check for an .sgai/ directory or other SGAI configuration in the repository. If absent, stop and ask the user whether this repo actually uses SGAI before proceeding.
1. Detect Tech Stack
Scan the repository for files and choose appropriate agents:
| Detection | Stack | Developer Agent | Reviewer Agent |
go.mod | Go backend | backend-go-developer | go-readability-reviewer |
package.json + react deps | React | react-developer | react-reviewer |
package.json + htmx deps | HTMX | htmx-picocss-frontend-developer | htmx-picocss-frontend-reviewer |
*.sh, Makefile, or CLI tool | Shell | shell-script-coder | shell-script-reviewer |
wrangler.toml | Cloudflare Worker | general-purpose | cloudflare-worker-deployer |
vercel.json or Next.js | Vercel | react-developer | vercel-deployer |
| Python + Claude SDK | Agent SDK | general-purpose | agent-sdk-verifier-py |
| TypeScript + Claude SDK | Agent SDK | general-purpose | agent-sdk-verifier-ts |
| Python + OpenAI SDK | OpenAI Agent | general-purpose | openai-sdk-verifier-py |
| TypeScript + OpenAI SDK | OpenAI Agent | general-purpose | openai-sdk-verifier-ts |
| None detected | General | general-purpose | — |
Multiple stacks combine (e.g., Go + React = both agent chains). See agents-reference.md for the full agent catalog and additional flow-graph variants.
2. Load or Ask Model Preferences
Check .sgai/preferences.json for saved preferences:
{
"models": {
"coordinator": "anthropic/claude-opus-4-6 (max)",
"default": "anthropic/claude-opus-4-6"
}
}If no preferences exist, ask:
"What model should I use for SGAI agents? (e.g., anthropic/claude-opus-4-6)"
Save response to .sgai/preferences.json for future use.
3. Ask for Goal Description
Ask conversationally:
"What do you want to accomplish?"
Listen for:
- Feature: "add", "build", "create", "implement"
- Fix: "bug", "fix", "broken", "error", "issue"
- Project: "new project", "set up", "initialize"
If unclear, ask:
"Is this a new feature, a bug fix, or a new project?"
4. Draft Success Criteria
Transform the description into outcome-based success criteria:
User says: "Add user authentication with OAuth"
Draft as:
- [ ] Users can sign in with OAuth providers
- [ ] Authenticated sessions persist across browser restarts
- [ ] Unauthenticated users are redirected to loginDo NOT write implementation steps like Install passport.js, Create auth middleware, Add login route.
Ask: "Does this capture what success looks like?"
5. Build Flow Graph
Compose flow based on detected stack. Core pattern: developer -> reviewer -> stpa-analyst
Go + React (full stack) example:
flow: |
"backend-go-developer" -> "go-readability-reviewer"
"go-readability-reviewer" -> "stpa-analyst"
"react-developer" -> "react-reviewer"
"react-reviewer" -> "stpa-analyst"More flow variants (single-stack, shell/CLI, architecture documentation, general) are in agents-reference.md.
Always include stpa-analyst as terminal node for safety analysis (except pure documentation flows).
6. Detect Completion Gate
| File | Gate Script |
go.mod | go test ./... |
package.json with test script | npm test |
Makefile with test target | make test |
| None | Omit completionGateScript |
7. Show Preview
Display the complete GOAL.md and ask:
"Here's the goal file. Ready to write it?"
8. Backup and Write
If GOAL.md exists:
- Rename to
GOAL.md.YYYY-MM-DD-HHMMSS.bak - Inform user of backup
Write new GOAL.md to repository root.
GOAL.md Format
---
flow: |
"agent-a" -> "agent-b"
"agent-b" -> "stpa-analyst"
models:
"coordinator": "anthropic/claude-opus-4-6 (max)"
"agent-a": "anthropic/claude-opus-4-6"
"agent-b": "anthropic/claude-opus-4-6"
"stpa-analyst": "anthropic/claude-opus-4-6"
interactive: yes
completionGateScript: go test ./...
---
Brief description of the goal in 1-2 sentences.
## Success Criteria
- [ ] Outcome-based criterion 1
- [ ] Outcome-based criterion 2
- [ ] Outcome-based criterion 3File References
To include context like screenshots or specs, add files to the repo and reference them:
See `docs/mockup.png` for the desired layout.
Refer to `specs/api.md` for endpoint requirements.Common Mistakes
- Implementation steps as success criteria — criteria must describe outcomes ("users can sign in"), not tasks ("add login route")
- Omitting stpa-analyst — always include it as the terminal reviewer, except in pure documentation flows
- Overwriting an existing GOAL.md without backup — always rename the old file to
GOAL.md.YYYY-MM-DD-HHMMSS.bakfirst
Decisions Made by This Skill
- Interactive mode: Always
yes(agents ask clarifying questions) - stpa-analyst: Always included as terminal reviewer
- Preferences location:
.sgai/preferences.jsonin project - Backup naming:
GOAL.md.YYYY-MM-DD-HHMMSS.bak - Success criteria style: Outcome-based, not implementation steps
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

