---
name: ba-generate-html
description: "Generate the interactive HTML document from business analysis JSON data"
model: opus
user_invocable: true
---

# /ba-generate-html

Generate the interactive HTML document of the business analysis from the JSON analysis files.

## Triggers

- Explicit invocation: `/ba-generate-html <feature-id>`
- After `/business-analyse` step-04 (consolidation complete)
- Delegation from `/ba-review` (after review corrections applied)

## Parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| `<feature-id>` | Yes | Feature identifier (e.g., FEAT-001) |
| `--force` | No | Regenerate even if HTML already exists |

## Prerequisites

- JSON analysis files must exist (at minimum `index.json` + `cadrage.json`)
- Feature status must be `consolidated`

## Workflow

4 progressive steps:

| Step | File | Role |
|------|------|------|
| 01 | `steps/step-01-collect.md` | Read JSON sources (index, cadrage, modules, consolidation) |
| 02 | `steps/step-02-build-data.md` | Build FEATURE_DATA + EMBEDDED_ARTIFACTS objects |
| 03 | `steps/step-03-render.md` | Inject into ba-interactive.html template, write final file |
| 04 | `steps/step-04-verify.md` | POST-CHECK (size, sections, coherence) |

## Absolute Rules

- **NEVER** deploy an empty template — FEATURE_DATA must be injected
- **moduleSpecs** MUST have ONE entry per module (empty = BROKEN)
- **Scope keys** MUST be converted: `mustHave` → `vital`, `shouldHave` → `important`, `couldHave` → `optional`, `outOfScope` → `excluded`
- **Wireframe fields** MUST be renamed: `mockupFormat` → `format`, `mockup` → `content`
- **Final file** MUST be > 100KB

## References

| File | Content |
|------|---------|
| `references/data-mapping.md` | JSON → FEATURE_DATA field mapping |
| `references/data-build.md` | FEATURE_DATA & EMBEDDED_ARTIFACTS construction |
| `references/output-modes.md` | Standard, micro, delta, multi-app modes |

## Entry Point

**FIRST ACTION:** Load `steps/step-01-collect.md`
