cmd/sgai/skel/.sgai/skills/stpa/stpa-step2-control-structure/SKILL.md
STPA Step 2 - Model the control structure using hierarchical control-feedback diagrams in Graphviz/DOT format; After completing STPA Step 1. When you need to understand how control flows through a system. When identifying controllers, control actions, and feedback paths.
npx skillsauth add sandgardenhq/sgai stpa-step2-control-structureInstall 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.
Create a hierarchical model showing:
"I'm using the STPA Step 2 skill to model the control structure. We'll identify controllers, control actions, and feedback paths."
A control structure shows the hierarchical relationships between:
Q1: Who or what makes control decisions in this system?
Q2: What is the hierarchy of control?
Software System:
Physical System:
AI System:
Q1: What commands does [Controller] send to [Controlled Process]?
Q2: When are these control actions sent?
| Controller | Control Action | Controlled Process | |------------|---------------|-------------------| | User | Submit Login | Auth Service | | Auth Service | Issue Token | Session Manager | | Orchestrator | Execute Task | ML Model | | PLC | Open Valve | Pressure Vessel |
Q1: What information does [Controlled Process] send back to [Controller]?
Q2: How does the controller use this feedback?
digraph ControlStructure {
rankdir=TB;
node [shape=box];
// Controllers (top to bottom = higher to lower authority)
User [label="User"];
AuthService [label="Auth Service"];
SessionManager [label="Session Manager"];
Database [label="Database"];
// Control Actions (solid arrows pointing down)
User -> AuthService [label="Login Request"];
AuthService -> SessionManager [label="Create Session"];
SessionManager -> Database [label="Store Session"];
// Feedback (dashed arrows pointing up)
AuthService -> User [label="Auth Result", style=dashed];
SessionManager -> AuthService [label="Session ID", style=dashed];
Database -> SessionManager [label="Write Confirmation", style=dashed];
}
rankdir=TB - Top to bottom flownode [shape=box] - All nodes are rectangular boxesBefore proceeding to Step 3:
Q1: Is every controller-controlled relationship shown? Q2: Does every control action have corresponding feedback? Q3: Are there any hidden controllers we haven't identified? Q4: Are there any feedback paths that are missing or delayed?
Record in .sgai/PROJECT_MANAGEMENT.md:
### Step 2: Control Structure
#### Controllers Identified
1. [Controller 1] - [Role/Description]
2. [Controller 2] - [Role/Description]
#### Control Structure Diagram
```dot
digraph ControlStructure {
rankdir=TB;
node [shape=box];
// [Insert diagram here]
}
| Controller | Control Action | Controlled Process | Feedback | |------------|---------------|-------------------|----------| | [C1] | [Action] | [C2] | [Feedback] |
## When to Proceed to Step 3
Move to Step 3 when:
- [ ] All controllers are identified and placed in hierarchy
- [ ] All control actions are documented
- [ ] All feedback paths are identified (or gaps noted)
- [ ] Human partner confirms the structure looks accurate
Load: `skills({"name":"stpa/step3-unsafe-control-actions"})`
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.