---
name: business-analyse-status
description: Display the current state of business analysis cycle, show progress per module, and recommend next steps.
user-invocable: true
---

# /business-analyse-status

Display the current state of the business analysis cycle for the active feature.

## Trigger

- Explicit: `/business-analyse-status` or `/business-analyse-status <feature-id>`
- When the user asks "where are we?", "what's the status?", "what's left to do?"

## Execution

### Step 1 — Locate feature

1. If `<feature-id>` is provided, search for `docs/business/<feature-id>/index.json`
2. If not provided, scan `docs/business/*/index.json` — if exactly 1 feature exists, use it; if multiple, list them and ask which one
3. If no feature found, display:
   ```
   Aucune analyse métier trouvée dans docs/business/.
   → Lancez /business-analyse pour démarrer.
   ```

### Step 2 — Read state

Read the following files (all optional — missing = not done):

| File | What it tells us |
|------|-----------------|
| `index.json` | Feature exists, metadata, status, module list |
| `cadrage.json` | Cadrage done |
| Per module: `entities.json` | Entities specified |
| Per module: `rules.json` | Business rules specified |
| Per module: `usecases.json` | Use cases specified |
| Per module: `permissions.json` | Permissions defined |
| Per module: `screens.json` | UI design done |
| Per module: `navigation.json` | Navigation tree done |
| Per module: `handoff.json` | Handoff/PRD generated |
| `ba-interactive.html` (in project root or feature dir) | HTML document generated |
| `ba-review.json` (in project root) | Client review pending |

### Step 3 — Compute progress

For each module, determine completion of each phase:

| Phase | Required files | Skill |
|-------|---------------|-------|
| Cadrage | status >= `"framed"` AND `cadrage.json` has context/stakeholders/scope | `/business-analyse` |
| Structure | status >= `"decomposed"` AND modules[] non-empty with anticipatedSections | `/business-analyse` |
| Specification | status >= `"specified"` (per module) AND entities/rules/usecases/permissions non-empty | `/business-analyse` |
| Consolidation | status >= `"consolidated"` AND consolidation.json exists | `/business-analyse` |
| Design | status >= `"designed"` AND `screens.json` non-empty per module | `/business-analyse-design` |
| HTML | `ba-interactive.html` exists and > 100KB | `/business-analyse-html` |
| Review | status >= `"reviewed"` OR `ba-review.json` exists (pending) | `/business-analyse-review` |
| Handoff | status >= `"handed-off"` AND `.ralph/prd-*.json` exists | `/business-analyse-handoff` |

### Step 4 — Display

Use this exact format:

```
══════════════════════════════════════════════════
  Business Analyse — {applicationName}
  Version {version} · {lastModified}
══════════════════════════════════════════════════

  {checkmark} Cadrage              {status}
  {checkmark} Spécification        {X}/{Y} modules
  {checkmark} Design UI            {X}/{Y} modules
  {checkmark} Document HTML        {status}
  {checkmark} Review client        {status}
  {checkmark} Handoff              {status}

  Détail par module :
  ┌──────────────────┬──────┬────────┬────────┬──────────┐
  │ Module           │ Spec │ Design │ Review │ Handoff  │
  ├──────────────────┼──────┼────────┼────────┼──────────┤
  │ {moduleName}     │  ✓   │  ✓     │  ○     │  ·       │
  │ {moduleName}     │  ✓   │  ○     │  ·     │  ·       │
  └──────────────────┴──────┴────────┴────────┴──────────┘

  Prochaine étape recommandée :
  → {recommendation}

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

Legend:
- `✓` = done (green if terminal supports it)
- `○` = in progress / partial
- `·` = not started

### Step 5 — Recommend next step

Based on the current state, recommend ONE next action:

| State | Recommendation |
|-------|---------------|
| No cadrage | `Lancez /business-analyse pour démarrer l'analyse.` |
| Cadrage done, spec incomplete | `Continuez /business-analyse pour spécifier les modules restants.` |
| All modules specified, no design | `Lancez /business-analyse-design <feature-id> pour concevoir les interfaces.` |
| Design done, no HTML | `Lancez /business-analyse-html <feature-id> pour générer le document client.` |
| HTML generated, no review | `Envoyez ba-interactive.html au client pour review.` |
| ba-review.json exists | `Lancez /business-analyse-review pour appliquer les corrections client.` |
| Review done / approved | `Lancez /business-analyse-handoff pour générer les PRD.` |
| Handoff done | `Analyse complète ! Lancez /business-analyse-develop pour démarrer le développement.` |

## Rules

- This skill is READ-ONLY — it never modifies any file
- Use the `ba-reader` agent to read JSON files if available
- Keep output concise — the user wants a quick overview, not a full report
- If a module has partial data (e.g., entities but no rules), show it as `○` (in progress)
