---
name: business-analyse-design
description: "Design user interfaces for each module: screens, wireframes, and navigation tree from Phase 1 analysis data."
model: opus
user_invocable: true
---

# /business-analyse-design

Design user interfaces for each module based on the business analysis data (entities, use cases, permissions) produced by `/business-analyse`.

## Triggers

- Explicit invocation: `/business-analyse-design <feature-id>`
- After `/business-analyse` step-04 (consolidation complete)
- After `/business-analyse-review` when corrections target UI/screens

## Parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| `<feature-id>` | Yes | Feature identifier (e.g., FEAT-001) |
| `--module` | No | Restrict to a single module (e.g., HumanResources) |

## Prerequisites

- `/business-analyse` must be completed (step-04 consolidated)
- JSON files must exist: `index.json`, `entities.json`, `usecases.json`, `permissions.json` per module
- Feature status must be `consolidated` or `reviewed`

## Workflow

3 progressive steps:

| Step | File | Role |
|------|------|------|
| 01 | `steps/step-01-screens.md` | Define sections/resources with detailed specs per module |
| 02 | `steps/step-02-wireframes.md` | Generate wireframes (ASCII/HTML) for each screen |
| 03 | `steps/step-03-navigation.md` | Define the complete navigation tree (seedDataCore) |

## Input

For each module, load via ba-reader:
- `index.json` (module metadata, anticipatedSections)
- `entities.json` (attributes with types, relationships)
- `usecases.json` (actor actions, scenarios)
- `permissions.json` (role matrix, permission paths)

## Output

Per module:
- `screens.json` — Detailed interface specifications (SmartTable columns, SmartForm fields, SmartDashboard KPIs)
- Wireframes embedded in screens.json (mockupFormat, elements[], layout, componentMapping)

Project-level:
- `navigation.json` — Complete navigation tree (routes, menus, breadcrumbs)

## Absolute Rules

- **NEVER** invent entities or permissions not defined in Phase 1 — UI specs MUST reference existing analysis data
- **Every screen** MUST have a `permission` field referencing a valid permission path from permissions.json
- **Every SmartTable column** MUST reference a valid entity attribute or relationship
- **Every SmartForm field** MUST reference a valid entity attribute
- **screens.json** MUST have at least one section per module

## Post-Design Workflow

```
/business-analyse-design completes
    |
    v
/business-analyse-html (generates interactive HTML with mockups, ERD, permission matrix)
    |
    v
Client reviews HTML
    |
    v
/business-analyse-review (apply corrections, route back to /business-analyse or /business-analyse-design)
```

## References

| File | Content |
|------|---------|
| `/business-analyse` skill | Source analysis data (entities, UCs, permissions) |
| `/business-analyse-html` skill | HTML generation consuming screens.json |
| `business-analyse-html/references/data-mapping.md` | JSON to FEATURE_DATA field mapping |

## Entry Point

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

<success_criteria>
- screens.json genere par module avec specifications section/resource
- Toutes les colonnes SmartTable referencent des attributs d'entite valides
- Tous les champs SmartForm referencent des attributs d'entite valides
- Tous les ecrans ont un champ permission valide depuis permissions.json
- navigation.json genere avec arbre de navigation complet
- Wireframes inclus dans screens.json avec mockupFormat et elements[]
- Aucune entite ou permission inventee (toutes referencent Phase 1)
</success_criteria>
