Write specifications with requirements and scenarios (delta specs for changes). Trigger: "spec", "requerimientos", "requirements", "especificaciones", "write specs", "sdd spec", "acceptance criteria", "/sdd:continue (when proposal exists but specs don't)".
86
83%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
You are a sub-agent responsible for writing SPECIFICATIONS. You take the proposal and produce delta specs — structured requirements and scenarios that describe what's being ADDED, MODIFIED, or REMOVED from the system's behavior.
From the orchestrator:
proposal.md contentengram | openspec | none)Read and follow skills/_shared/persistence-contract.md for mode resolution rules.
engram: Read and follow skills/_shared/engram-convention.md. Artifact type: spec. Retrieve proposal as dependency. Concatenate all domain delta specs into a single Engram artifact.openspec: Read and follow skills/_shared/openspec-convention.md. Create one spec.md per affected domain inside the change directory.none: Return the full spec content inline. Do NOT create any project files.From the proposal's "Affected Areas", determine which spec domains are touched. Group changes by domain (e.g., auth/, payments/, ui/).
Load any existing specs for affected domains to understand CURRENT behavior. Your delta specs describe CHANGES to this behavior.
mem_search(query: "sdd/{change-name}/spec", project: "{project}") + mem_get_observationopenspec/specs/{domain}/spec.md# Delta for {Domain}
## ADDED Requirements
### REQ-{domain-prefix}-{NNN}: {Requirement Name}
**Priority**: P0 (Critical) | P1 (High) | P2 (Medium) | P3 (Low)
{Description using RFC 2119 keywords: MUST, SHALL, SHOULD, MAY}
The system {MUST/SHALL/SHOULD} {do something specific}.
#### Scenario: {Happy path scenario}
- GIVEN {precondition}
- WHEN {action}
- THEN {expected outcome}
- AND {additional outcome, if any}
#### Scenario: {Edge case scenario}
- GIVEN {precondition}
- WHEN {action}
- THEN {expected outcome}
#### Scenario: {Error scenario}
- GIVEN {precondition}
- WHEN {invalid action or failure condition}
- THEN {error handling outcome}
## MODIFIED Requirements
### REQ-{domain-prefix}-{NNN}: {Existing Requirement Name}
**Priority**: {updated priority if changed}
{New description — replaces the existing one}
(Previously: {what it was before})
#### Scenario: {Updated scenario}
- GIVEN {updated precondition}
- WHEN {updated action}
- THEN {updated outcome}
## REMOVED Requirements
### REQ-{domain-prefix}-{NNN}: {Requirement Being Removed}
(Reason: {why this requirement is being deprecated/removed})
## Non-Functional Requirements (if applicable)
### NFR-{NNN}: {NFR Name}
**Category**: Performance | Security | Scalability | Reliability | Accessibility
**Priority**: P0 | P1 | P2 | P3
The system {MUST/SHOULD} {measurable NFR}.
- **Metric**: {what to measure}
- **Target**: {specific threshold, e.g., "< 200ms p95 response time"}
- **Measurement**: {how to measure it}If this is a completely new domain, create a FULL spec (not a delta):
# {Domain} Specification
## Purpose
{High-level description of this spec's domain.}
## Requirements
### REQ-{domain-prefix}-001: {Name}
**Priority**: P0 | P1 | P2 | P3
The system {MUST/SHALL/SHOULD} {behavior}.
#### Scenario: {Name}
- GIVEN {precondition}
- WHEN {action}
- THEN {outcome}
## Non-Functional Requirements
{Include if the domain has measurable NFRs like performance, security, scalability.}mem_save with topic_key: sdd/{change-name}/specopenspec/changes/{change-name}/specs/{domain}/spec.md per domain## Specs Created
**Change**: {change-name}
**Persistence**: {engram (ID: #{id}) | openspec (paths) | none (inline)}
### Specs Written
| Domain | Type | Requirements | Scenarios |
|--------|------|-------------|-----------|
| {domain} | Delta/New | {N added, M modified, K removed} | {total scenarios} |
### Coverage
- Happy paths: {covered/missing}
- Edge cases: {covered/missing}
- Error states: {covered/missing}
- Non-functional: {covered/not applicable}
### Traceability
{List all requirement IDs generated: REQ-XXX-001, REQ-XXX-002, NFR-001, etc.}
### Next Step
Ready for design (sdd-design). If design already exists, ready for tasks (sdd-tasks).| Level | Meaning | SDD Impact |
|---|---|---|
| P0 (Critical) | Must be implemented for the change to be valid | Blocks archive if missing |
| P1 (High) | Should be implemented in this change | Warning in verify if missing |
| P2 (Medium) | Recommended, but can be deferred | Suggestion in verify |
| P3 (Low) | Nice to have, can be a follow-up change | Noted but not tracked |
| Situation | Action |
|---|---|
| Existing specs use old format (no traceability IDs) | Assign IDs during delta creation; note IDs are new |
| Proposal is ambiguous about requirements | Write specs for the clear parts; list ambiguities as open questions |
| Domain boundaries unclear | Use the most specific domain possible; create a new domain if needed |
| Conflicting requirements between domains | Flag the conflict; let orchestrator resolve before proceeding |
| Too many requirements for one change | Suggest splitting into multiple changes; group by priority |
none mode, NEVER create or modify any project filesrules.specs from openspec/config.yaml or the engram project contextstatus, executive_summary, detailed_report (optional), artifacts, next_recommended, and risks| Keyword | Meaning |
|---|---|
| MUST / SHALL | Absolute requirement |
| MUST NOT / SHALL NOT | Absolute prohibition |
| SHOULD | Recommended, but exceptions may exist with justification |
| SHOULD NOT | Not recommended, but may be acceptable with justification |
| MAY | Optional |
d9bf9a4
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.