cmd/sgai/skel/.sgai/skills/stpa/stpa-step1-define-purpose/SKILL.md
STPA Step 1 - Define the purpose of analysis by identifying losses, hazards, and system-level constraints. When beginning STPA analysis. After loading stpa/overview. When you need to establish what could go wrong and what must be prevented.
npx skillsauth add sandgardenhq/sgai stpa-step1-define-purposeInstall 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.
Establish the foundation for the entire STPA analysis by identifying:
"I'm using the STPA Step 1 skill to define the purpose of our analysis. We'll identify losses, hazards, and constraints through a series of questions."
Q1: What are the unacceptable outcomes for this system?
Q2: For each loss, how severe is the impact?
#### Losses (L)
- L-1: [Loss of human life or serious injury]
- L-2: [Loss of data integrity]
- L-3: [Loss of service availability]
- L-4: [Financial loss exceeding $X]
A hazard is a system state or set of conditions that, together with a worst-case set of environmental conditions, will lead to a loss.
Q1: What system states could lead to [Loss L-1]?
Q2: Under what environmental conditions would this hazard lead to the loss?
H-[number]: [System] [unsafe condition/behavior] [leading to L-X]
Software System:
Physical System:
AI System:
#### Hazards (H)
- H-1: [System] [condition] [→ L-X, L-Y]
- H-2: [System] [condition] [→ L-X]
System-level constraints specify what the system must do or must NOT do to prevent hazards.
For each hazard, derive at least one constraint that, if enforced, prevents the hazard.
SC-[number]: [System] must [always/never] [behavior] [to prevent H-X]
From H-1 (auth service):
From H-1 (vehicle):
#### System-Level Constraints (SC)
- SC-1: [System] must [behavior] [→ H-X]
- SC-2: [System] must never [behavior] [→ H-X]
Before proceeding to Step 2, verify:
Record in .sgai/PROJECT_MANAGEMENT.md:
## STPA Analysis
### Step 1: Purpose Definition
#### Losses (L)
- L-1: [description] - Severity: [Critical/Serious/Moderate/Minor]
- L-2: [description] - Severity: [level]
#### Hazards (H)
- H-1: [System] [unsafe condition] [→ L-1, L-2]
- H-2: [System] [unsafe condition] [→ L-1]
#### System-Level Constraints (SC)
- SC-1: [System] must [behavior] [→ H-1]
- SC-2: [System] must never [behavior] [→ H-1]
Move to Step 2 when:
Load: skills({"name":"stpa/step2-control-structure"})
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.