---
name: step-04-verify
description: Post-check verification of generated HTML
model: opus
---

# Step 4: Verify Generated HTML

## YOUR TASK

Run 5 blocking validations on the generated HTML file and display the completion summary.

---

## EXECUTION SEQUENCE

### 1. Blocking Validations

**Check 1 — File size > 100KB:**
```
if [ $(stat --format=%s ba-interactive.html) -lt 100000 ]; then
  BLOCKING_ERROR("ba-interactive.html not pre-populated — file too small")
fi
```

**Check 2 — moduleSpecs present in HTML:**
```
if ! grep -q '"moduleSpecs"' ba-interactive.html; then
  BLOCKING_ERROR("moduleSpecs not found — FEATURE_DATA not serialized")
fi
```

**Check 3 — cadrage.scope uses HTML keys (inscope/outofscope, NOT inScope):**
```
if grep -q '"inScope"' ba-interactive.html; then
  BLOCKING_ERROR("cadrage.scope still has JSON keys — conversion failed")
fi
```

**Check 4 — Wireframe field names correct (format/content, NOT mockupFormat/mockup):**
```
if grep -q '"mockupFormat"' ba-interactive.html; then
  BLOCKING_ERROR("Wireframes use 'mockupFormat' — must be 'format'")
fi
```

**Check 5 — All modules have specs AND wireframes:**
```
FOR each module in FEATURE_DATA.modules:
  IF FEATURE_DATA.moduleSpecs[module.code] undefined:
    BLOCKING_ERROR("Module {module.code} not in moduleSpecs")
  IF EMBEDDED_ARTIFACTS.wireframes[module.code] undefined:
    BLOCKING_ERROR("Module {module.code} not in wireframes")
```

> **IF any check fails:** fix the issue and re-run the failing step before completing.

---

### 2. Display Completion Summary

```
══════════════════════════════════════════════════════════════
  [OK] HTML DEPLOY COMPLETE — {application_name}
══════════════════════════════════════════════════════════════

Modules: {count} ({names})

[DIR] Artifact generated:
  ba-interactive.html — Interactive document
     Path: {output_path}
     Pre-populated: {module_count} modules, {total_uc} use cases,
       {total_br} business rules, {total_wireframes} wireframes

[NEXT] Review & Validation:
  1. Open ba-interactive.html in browser
  2. Review all modules, use cases, business rules
  3. Validate wireframes and permissions
  4. If OK: /derive-prd then /ralph-loop to begin development
  5. If changes needed: /business-analyse to iterate

══════════════════════════════════════════════════════════════
```
