---
name: business-analyse-handoff
description: "Transform consolidated business analysis into handoff data (8 categories) and PRD files for /business-analyse-develop consumption."
user_invocable: true
---

# /business-analyse-handoff — v1

## Purpose

Bridge between `/business-analyse` (understand) and `/business-analyse-develop` (execute).
Transforms consolidated BA data into structured handoff and PRD files.

```
/business-analyse  →  /business-analyse-handoff  →  /business-analyse-develop
   (comprendre)            (planifier)               (executer)
```

## Architecture

**3 steps** — "Validate, Transform, Export"

| Step | File | Model | Role |
|------|------|-------|------|
| 00 | `step-00-validate.md` | Sonnet | Detect input, validate BA readiness, AC gate |
| 01 | `step-01-transform.md` | Sonnet | Build handoff data per module (8 categories) |
| 02 | `step-02-export.md` | Sonnet | Generate PRD files, verify, output progress |

## Input

- Consolidated BA feature (`status = "consolidated"` or `"specified"`)
- Source: `docs/{app}/business-analyse/v{X.Y}/index.json` (app-level) + `docs/{app}/{module}/business-analyse/v{X.Y}/` (flat files per module)
- Usage: `--feature <path>` or auto-detection from `docs/`

## Output

| Artifact | Path | Description |
|----------|------|-------------|
| Handoff data | Written to module `handoff.json` via ba-writer | 8-category file mapping + BR-to-code + API summary |
| PRD files | `.ralph/prd-{moduleCode}.json` | Deterministic extraction via `ss business-analyse-handoff` |
| Progress tracker | `.ralph/progress.txt` | Task breakdown per module |
| Module queue | `.ralph/modules-queue.json` | Topological order (if 2+ modules) |
| BA manifest | `docs/index.json` | Updated with "handed-off" status |

## Handoff Categories (8)

| Category | Source (flat files) | Key rules |
|----------|--------|-----------|
| **domain** | `entities.json > entities[]` | Entities, ValueObjects, Enums |
| **application** | `usecases.json > useCases[]` | Services, DTOs, Validators |
| **infrastructure** | `entities.json > entities[]` | EF Configurations, DbSet |
| **api** | Generated from useCases + entities | Controllers |
| **frontend** | `screens.json > screens[]` | Pages, Components, Hooks |
| **seedData** | Generated from entities + permissions | CORE + business |
| **tests** | All layers | Unit, Integration, Security tests |
| **documentation** | All layers | Technical docs, user guides, API specs |

## Agents

| Agent | Role | Operations |
|-------|------|------------|
| `ba-writer` | Write handoff data | enrichModuleHandoff() |
| `ba-reader` | Read feature data | findFeature, readSection, getModuleStatus |

## References

| File | Content |
|------|---------|
| `references/prd-generation.md` | PRD v3.0 structure & validation rules |
| `references/handoff-mappings.md` | BR-to-code & API summary mapping |
| `references/handoff-seeddata-generation.md` | SeedData core generation reference |
| `references/handoff-file-templates.md` | Handoff file structure (8 categories) |
| `references/acceptance-criteria.md` | Module acceptance criteria (AC-01 to AC-17) |
| `references/entity-domain-mapping.md` | Entity BA to Domain file mapping |
| `references/readiness-scoring.md` | Readiness scoring algorithm |

## Schema

| File | Content |
|------|---------|
| `schemas/handoff-schema.json` | Handoff data schema (8 categories) |

## Templates

| File | Content |
|------|---------|
| `templates/tpl-progress.md` | Progress tracker template |

## Entry Point

**FIRST ACTION:** Load `steps/step-00-validate.md`
