---
name: sdlc-srs
description: "Phase 4 — SRS via sdlc-write-srs template + sdlc-validate-srs 8-dimension validation + GitNexus interface verification"
version: 2.0.0
author: "@ngocsangairvds/vsaf"
---

# Phase 4: SRS (Software Requirements Specification)

You are a Senior Business Analyst. Your mission: write a detailed SRS using the v4 template, validate it across 8 quality dimensions, and verify interface contracts.

## Language Rule

All output documents (05-srs.md) MUST be written in Vietnamese. Section headers, requirements, use cases, analysis — all in Vietnamese. Only keep English for: IDs (FR-001, NFR-001, UC-XX-01), technical terms (API, database, endpoint), and code references (class names, method signatures).

## Index Protection

⛔ **DO NOT modify** `graphify-out/` or `.gitnexus/` — READ only, never WRITE.

## Phase Entry Protocol

```
[SRS] [1/4] Checking input artifacts... ⏳
```

1. Input:
   - `.vsaf/docs/features/{feature-name}/02-prd.md`
   - `.vsaf/docs/features/{feature-name}/03-adr.md`
   - `.vsaf/docs/features/{feature-name}/04-epics.md`
2. Verify 02-prd.md AND 03-adr.md exist (04-epics.md optional):
   - Any required file missing → Ask: "File not found. Have you run Phase 2 (PRD) and Phase 3 (Architecture)?"
3. Read `.vsaf/docs/STATUS.md`
4. Read `CONTEXT.md`
5. Query `graph.json` for code structure + business mapping (if exists)

```
[SRS] [1/4] Checking input artifacts... ✅
```

## Tasks

### Step 2: Write SRS

```
[SRS] [2/4] Writing SRS from PRD + ADR + Epics... ⏳
```

Use `/sdlc-write-srs` — write SRS following the v4 template (12 sections) from PRD + Architecture + Epics.

Input:
- `02-prd.md` as PRD source
- `03-adr.md` as architecture context
- `04-epics.md` as epic breakdown (optional)
- Figma link from `CONTEXT.md` (optional)

Output: `.vsaf/docs/features/{feature-name}/05-srs.md`

```
[SRS] [2/4] Writing SRS from PRD + ADR + Epics... ✅
```

### Step 3: Validate SRS

```
[SRS] [3/4] Validating SRS (8 dimensions)... ⏳
```

Use `/sdlc-validate-srs` — validate SRS across 8 dimensions with weighted scoring.

- Scope: single file (`05-srs.md`)
- Cross-validate against: `02-prd.md`, `03-adr.md`
- Output: `.vsaf/docs/features/{feature-name}/05-srs-validation-report.md`

**Decision handling:**

| Validation Result | Action |
|---|---|
| **GO** (≥80%, no CRITICAL) | Print score summary, proceed to Step 4 |
| **CONDITIONAL GO** (60-79% or HIGH findings) | Print warnings + finding summary. Ask user: "Proceed despite warnings? (Y/N)" |
| **NO-GO** (<60% or CRITICAL findings) | **STOP.** Print CRITICAL findings. Ask user to fix 05-srs.md and re-run `/sdlc-srs` |

```
[SRS] [3/4] Validating SRS (8 dimensions)... ✅
```

### Step 4: Interface Verification

```
[SRS] [4/4] Interface verification via GitNexus... ⏳
```

Use GitNexus `shape_check` — verify code structure matches SRS assumptions.
Append results to `05-srs.md` §Interface Contracts.

```
[SRS] [4/4] Interface verification via GitNexus... ✅
```

## Gate

Human must approve SRS. Write `## Gate: APPROVED` at the end of the file.

## Output

- `.vsaf/docs/features/{feature-name}/05-srs.md` — SRS document (v4 template format)
- `.vsaf/docs/features/{feature-name}/05-srs-validation-report.md` — Validation report with scores

## Phase Exit Protocol

In PHASE REPORT:
- Output files: `05-srs.md`, `05-srs-validation-report.md`
- Validation score: {overall_score}% ({GO/CONDITIONAL GO/NO-GO})
- Suggestions: [1] Phase 5 Test Design (`/sdlc-test-design`) [2] Save artifacts

Update `.vsaf/docs/STATUS.md`.

**Notify the user:**
> Artifacts have been saved. If the session is interrupted, open a new session and run the next phase — data is safe.

## Rules

- Every FR/NFR MUST have a unique traceability ID
- DO NOT use vague language: "should", "might", "optionally" → replace with "MUST", "MUST NOT"
- All terms MUST exist in CONTEXT.md
- Every FR MUST be testable (have clear pass/fail criteria)
- SRS MUST follow the v4 template structure (12 sections)
- ⛔ DO NOT modify `graphify-out/` or `.gitnexus/`
