## Introduction

Le workflow Business Analyse v2 est un systeme complet en 8 phases pour transformer une demande utilisateur vague en une implementation precise et documentee. Il separe clairement l'analyse du besoin (WHAT) de la specification technique (HOW).

The Business Analyse v2 workflow is a complete 8-phase system to transform a vague user request into a precise documented implementation. It clearly separates need analysis (WHAT) from technical specification (HOW).

⚠

##### Principe fondamental

##### Core Principle

Comprendre avant de specifier. Les phases 1-3 se concentrent sur le BESOIN (langage utilisateur), les phases 4-6 sur la SOLUTION (langage technique).

Understand before specifying. Phases 1-3 focus on the NEED (user language), phases 4-6 on the SOLUTION (technical language).

🧠

##### ULTRATHINK

Les phases critiques (0, 2, 3, 4, 6) utilisent ULTRATHINK pour une reflexion approfondie. Les phases simples (1, 5, 7) utilisent des modeles plus legers. La phase 7 genere la documentation HTML.

Critical phases (0, 2, 3, 4, 6) use ULTRATHINK for deep reasoning. Simple phases (1, 5, 7) use lighter models. Phase 7 generates HTML documentation.

## Mode Automatique Automatic Mode

`/business-analyse` ORCHESTRATE

Lancez le workflow complet automatique de l'analyse metier a la documentation. La phase 0 orchestre l'execution de toutes les phases successives avec une granularite configurable.

Launch the complete automatic workflow from business analysis to documentation. Phase 0 orchestrates execution of all successive phases with configurable granularity.

    /business-analyse [feature-name] [options]

#### Niveaux de granularite Granularity Levels

Niveau Level | Couverture Coverage | Description
--- | --- | ---
Muscles | Phases principales Main phases | Phases 0-6, haute vue d'ensemble Phases 0-6, high overview
Section | Toutes phases All phases | Phases 0-7 avec details complets Phases 0-7 with full details
Resources | Etendu Extended | Phases 0-7 + agents, hooks, ressources Phases 0-7 + agents, hooks, resources

#### Workflow Complet

## Workflow

## Les 8 Phases The 8 Phases

# | Phase | Commande Command | Modele Model | Mission | Fichier de sortie Output File
--- | --- | --- | --- | --- | ---
0 | ORCHESTRATE | `:0-orchestrate` | OPUS/ULTRATHINK | Orchestration automatique complete Complete automatic orchestration | —
1 | INIT | `:1-init` | Haiku | Initialiser la structure BA Initialize BA structure | —
2 | DISCOVER | `:2-discover` | OPUS/ULTRATHINK | Elicitation + detection similarite Elicitation + similarity detection | `01-business-requirements.md`
3 | ANALYSE | `:3-analyse` | Sonnet/ULTRATHINK | Synthese besoin + technique Merge need + technical context | `02-enriched-requirements.md`
4 | SPECIFY | `:4-specify` | Sonnet/ULTRATHINK | Specification fonctionnelle (FRD) Functional specification (FRD) | `03-functional-spec.md`
5 | VALIDATE | `:5-validate` | Haiku | Validation utilisateur (loop → 3) User validation (loop → 3) | `04-feedback-v[N].md`
6 | HANDOFF | `:6-handoff` | OPUS/ULTRATHINK | Brief d'implementation (anglais) Implementation brief (English) | `05-implementation-brief.md`
7 | DOC-HTML | `:7-doc-html` | Sonnet | Documentation HTML auto-generee Auto-generated HTML documentation | `06-documentation.html`

## Phase 0: ORCHESTRATE

`/business-analyse 0-orchestrate` OPUS/ULTRATHINK

Mission : Orchestrer automatiquement l'execution de toutes les phases successives du workflow Business Analyse, de la decouverte a la documentation.

Mission: Automatically orchestrate execution of all successive phases from discovery to documentation.

    # Full orchestration
    /business-analyse 0-orchestrate [feature-name]

    # With granularity level
    /business-analyse 0-orchestrate [feature-name] --granularity=muscles
    /business-analyse 0-orchestrate [feature-name] --granularity=section
    /business-analyse 0-orchestrate [feature-name] --granularity=resources

#### Orchestration automatique

#### Automatic Orchestration

- Lance Phase 1 (INIT) pour preparer la structure
- Launches Phase 1 (INIT) to prepare structure
- Lance Phase 2 (DISCOVER) avec elicitation et similarite
- Launches Phase 2 (DISCOVER) with elicitation and similarity
- Lance Phase 3 (ANALYSE) pour analyser le besoin
- Launches Phase 3 (ANALYSE) to analyze need
- Lance Phase 4 (SPECIFY) pour generer le FRD
- Launches Phase 4 (SPECIFY) to generate FRD
- Lance Phase 5 (VALIDATE) pour validation utilisateur
- Launches Phase 5 (VALIDATE) for user validation
- Lance Phase 6 (HANDOFF) pour le brief d'implementation
- Launches Phase 6 (HANDOFF) for implementation brief
- Lance Phase 7 (DOC-HTML) pour generer la documentation
- Launches Phase 7 (DOC-HTML) to generate documentation

💡

Phase 0 facilite l'orchestration complete du workflow. Pour un controle granulaire, utilisez les phases individuelles (1-7).

Phase 0 facilitates complete workflow orchestration. For granular control, use individual phases (1-7).

## Phase 1: INIT

`/business-analyse 1-init` Haiku

Mission : Initialiser la structure du dossier Business Analyse avec les fichiers de base et la configuration.

Mission: Initialize Business Analyse folder structure with base files and configuration.

    /business-analyse 1-init [feature-name]

#### Structure creee

#### Created Structure

- Dossier `.claude/ba/[feature-name]/`
- Folder `.claude/ba/[feature-name]/`
- Fichiers de template pour chaque phase
- Template files for each phase
- Configuration et metadata
- Configuration and metadata

## Phase 2: DISCOVER

`/business-analyse 2-discover` OPUS/ULTRATHINK

Mission : Comprendre le vrai besoin utilisateur avant toute exploration technique.

Mission: Understand the real user need before any technical exploration.

#### Etapes

#### Steps

1. Similarity Check : Lance l'agent `ba-similarity` pour detecter les doublons
2. Similarity Check: Launches `ba-similarity` agent to detect duplicates
3. Elicitation : Pose des questions ciblees (max 5)
4. Elicitation: Asks targeted questions (max 5)
5. Business Requirements : Formalise le besoin en langage utilisateur
6. Business Requirements: Formalizes need in user language

    /business-analyse 2-discover Je veux pouvoir exporter mes donnees clients

#### Resultats de similarite Similarity Results

Resultat Result | Action
--- | ---
DUPLICATE | STOP - Reference spec existante STOP - Reference existing spec
EXTEND | Note feature existante a etendre Note existing feature to extend
NEW | Proceder normalement Proceed normally

## Phase 3: ANALYSE

`/business-analyse 3-analyse` Sonnet/ULTRATHINK

Mission : Fusionner le besoin utilisateur avec le contexte technique. Identifier les gaps et conflits.

Mission: Merge user need with technical context. Identify gaps and conflicts.

    /business-analyse 3-analyse [feature-name]

#### Analyse des gaps

#### Gap Analysis

- Feasibility Check : Ce que l'utilisateur veut vs ce que le systeme peut faire
- Feasibility Check: What user wants vs what system can do
- Conflicts : Contradictions entre besoin et contraintes techniques
- Conflicts: Contradictions between need and technical constraints
- Opportunities : Features existantes qui peuvent aider
- Opportunities: Existing features that can help

⚠

Si des gaps ou conflits existent, des questions ciblees sont posees a l'utilisateur avant de continuer.

If gaps or conflicts exist, targeted questions are asked to the user before continuing.

## Phase 4: SPECIFY

`/business-analyse 4-specify` Sonnet/ULTRATHINK

Mission : Produire le FRD (Functional Requirements Document) detaille pour validation humaine.

Mission: Produce detailed FRD (Functional Requirements Document) for human validation.

    # Generate specification
    /business-analyse 4-specify [feature-name]

    # With HTML mockup
    /business-analyse 4-specify [feature-name] --mockup

    # With PlantUML diagrams
    /business-analyse 4-specify [feature-name] --plantuml

#### Sections dynamiques Dynamic sections

Section | Incluse quand Included when
--- | ---
Context | Toujours Always
Functional Requirements | Toujours Always
Data Model | Changements DB DB changes
UI Specification | Changements UI UI changes
Navigation | Nouvelle page New page
Permissions | Nouvelles permissions New permissions
User Flow | Workflow complexe Complex workflow
API Specification | Changements backend Backend changes
Acceptance Criteria | Toujours Always

#### Options

Option | Effet Effect | Tokens
--- | --- | ---
`--mockup` | Maquette HTML avec CSS projet HTML mockup with project CSS | +2,000
`--plantuml` | Diagrammes ER/sequence ER/sequence diagrams | +800

## Phase 5: VALIDATE

`/business-analyse 5-validate` Haiku

Mission : Presenter le FRD a l'utilisateur et collecter son feedback.

Mission: Present FRD to user and collect feedback.

    /business-analyse 5-validate [feature-name]

#### Options de validation Validation Options

Option | Action
--- | ---
APPROVED | Passer a Phase 6 (Handoff) Proceed to Phase 6 (Handoff)
MINOR CHANGES | Modifications directes dans le FRD Direct modifications in FRD
MAJOR CHANGES | Retour a Phase 3 (Analyse) Return to Phase 3 (Analyse)
REJECTED | Archiver et recommencer Archive and start over

🔄

##### Boucle de validation

##### Validation Loop

En cas de MAJOR CHANGES, le workflow retourne a la Phase 3 pour re-analyser avec les nouvelles informations.

On MAJOR CHANGES, the workflow returns to Phase 3 to re-analyze with new information.

## Phase 6: HANDOFF

`/business-analyse 6-handoff` OPUS/ULTRATHINK

Mission : Transformer le FRD valide en brief d'implementation pour Claude Code. Le brief est genere en anglais pour optimiser les tokens et la comprehension du modele.

Mission: Transform validated FRD into implementation brief for Claude Code. The brief is generated in English to optimize tokens and model comprehension.

    /business-analyse 6-handoff [feature-name]

#### Format de sortie (diff-like)

#### Output format (diff-like)

    # IMPLEMENTATION BRIEF: [Feature Name]

    ## Files

    ### Backend

    CREATE `src/Domain/Entities/Feature.cs`
      COPY: `src/Domain/Entities/User.cs`
      CHANGE: class name, properties per spec

    MODIFY `src/Infrastructure/Data/AppDbContext.cs`
      AT: line 45
      ADD: `public DbSet<Feature> Features => Set<Feature>();`

    ### Frontend

    CREATE `src/app/module/feature/feature.component.ts`
      RUN FIRST: `ng generate component module/feature`
      COPY PATTERN: `src/app/existing/existing.component.ts`

    ## Commands

    ```bash
    dotnet build src/Api
    dotnet ef migrations add AddFeatureTable
    npm run build
    npm run lint
    ```

    ## Verify

    - [ ] Build passes
    - [ ] Navigate to /feature works
    - [ ] CRUD operations work

🚀

##### Pret pour implementation

##### Ready for implementation

Le brief peut etre passe directement a `/implement` pour une execution oneshot.

The brief can be passed directly to `/implement` for oneshot execution.

    /implement .claude/ba/[feature]/06-implementation-brief.md

## Phase 7: DOC-HTML

`/business-analyse 7-doc-html` Sonnet

Mission : Generer une documentation HTML auto-generee et polishe a partir de tous les fichiers du workflow Business Analyse.

Mission: Generate polished auto-generated HTML documentation from all Business Analyse workflow files.

    # Generate documentation
    /business-analyse 7-doc-html [feature-name]

    # With specific template
    /business-analyse 7-doc-html [feature-name] --template=standard
    /business-analyse 7-doc-html [feature-name] --template=detailed
    /business-analyse 7-doc-html [feature-name] --template=minimal

#### Documentation generee

#### Generated Documentation

- Resume executif de la feature
- Feature executive summary
- Specifications fonctionnelles validees
- Validated functional specifications
- Architecture et design decisions
- Architecture and design decisions
- Guide d'implementation
- Implementation guide
- Historique complet du workflow
- Complete workflow history

📄

##### Documentation persistante

##### Persistent Documentation

Le fichier HTML est stocke dans `.claude/ba/[feature]/06-documentation.html` pour reference et partage futur.

The HTML file is stored in `.claude/ba/[feature]/06-documentation.html` for future reference and sharing.

## Commandes Utilitaires Utility Commands

`/business-analyse bug` Bug Fix

Documenter et specifier une correction de bug de maniere formelle.

Document and formally specify a bug fix.

    /business-analyse bug [bug-description]

`/business-analyse hotfix` Hotfix

Documenter une correction urgente de maniere legere et rapide.

Document an urgent fix in a lightweight and fast way.

    /business-analyse hotfix [fix-description]

`/business-analyse change-request` Change

Documenter une demande de changement formal pendant le developpement.

Document a formal change request during development.

    /business-analyse change-request [change-description]

## Agents specialises Specialized Agents

Agent | Mission | Utilise en Used in
--- | --- | ---
`ba-similarity` | Detecte les features similaires ou doublons Detects similar features or duplicates | Phase 2
`explore-api` | Endpoints, controllers, DTOs, patterns API Endpoints, controllers, DTOs, API patterns | Phase 3
`explore-schema` | Schema DB, entites, configurations DB schema, entities, configurations | Phase 3
`explore-permissions` | RBAC, roles, autorisations RBAC, roles, authorizations | Phase 3
`explore-navigation` | Menus, routes, pages Menus, routes, pages | Phase 3
`explore-theme` | UI patterns, composants, design system UI patterns, components, design system | Phase 3

## Structure des fichiers File Structure

    .claude/ba/
    └── [feature-name]/
        ├── 01-business-requirements.md    # Phase 2: DISCOVER
        ├── 02-enriched-requirements.md    # Phase 3: ANALYSE
        ├── 03-functional-spec.md          # Phase 4: SPECIFY
        ├── 04-feedback-v1.md              # Phase 5: VALIDATE (si changes)
        ├── 04-feedback-v2.md              # (iterations)
        ├── 05-implementation-brief.md     # Phase 6: HANDOFF
        └── 06-documentation.html          # Phase 7: DOC-HTML

Fichier File | Genere par Generated by | Lu par Read by
--- | --- | ---
`01-business-requirements.md` | Phase 2 | Phase 3, 4
`02-enriched-requirements.md` | Phase 3 | Phase 4
`03-functional-spec.md` | Phase 4 | Humain (validation), Phase 6 Human (validation), Phase 6
`04-feedback-v[N].md` | Phase 5 | Phase 4 (iterations)
`05-implementation-brief.md` | Phase 6 | `/implement`
`06-documentation.html` | Phase 7 | Reference et partage Reference & sharing

## Exemple complet Complete Example

    # Option 1: Mode automatique complet
    /business-analyse Je veux gerer les utilisateurs avec des roles

    # → Phase 0 orchestre tout automatiquement
    # → Phases 1-7 s'executent en sequence
    # → Cree tous les fichiers et la documentation

    ---

    # Option 2: Phases individuelles pour plus de controle

    # Phase 1: Initialiser la structure
    /business-analyse 1-init user-management

    # Phase 2: Decouvrir le besoin
    /business-analyse 2-discover Je veux gerer les utilisateurs avec des roles

    # → Questions d'elicitation posees
    # → Agent ba-similarity verifie les doublons
    # → Cree: .claude/ba/user-management/01-business-requirements.md

    # Phase 3: Analyser et enrichir
    /business-analyse 3-analyse user-management

    # → Fusionne besoin + contexte technique
    # → Identifie gaps et conflits
    # → Cree: .claude/ba/user-management/02-enriched-requirements.md

    # Phase 4: Specifier (FRD)
    /business-analyse 4-specify user-management --plantuml

    # → Genere le FRD complet avec diagrammes
    # → Cree: .claude/ba/user-management/03-functional-spec.md

    # Phase 5: Valider avec l'utilisateur
    /business-analyse 5-validate user-management

    # → Presente resume pour validation
    # → Si APPROVED → Phase 6
    # → Si MAJOR CHANGES → Retour Phase 3

    # Phase 6: Generer le brief d'implementation
    /business-analyse 6-handoff user-management

    # → Transforme FRD en brief diff-like (anglais)
    # → Cree: .claude/ba/user-management/04-implementation-brief.md

    # Phase 7: Generer la documentation
    /business-analyse 7-doc-html user-management

    # → Genere documentation HTML polishe
    # → Cree: .claude/ba/user-management/05-documentation.html

    # Implementation
    /implement .claude/ba/user-management/04-implementation-brief.md

    # → Claude Code execute le brief en oneshot

🎯

##### Conseil

##### Pro Tip

Les fichiers dans `.claude/ba/` constituent un historique precieux. Conservez-les pour documenter les evolutions futures et faciliter la maintenance.

Files in `.claude/ba/` are valuable history. Keep them to document future evolutions and facilitate maintenance.