# Project Name Normalization (INTELLIGENT)

**ALWAYS normalize, even if user chose the detected name.**

## Step 1: Parse input into words

Split the raw input on any separator: spaces, hyphens, underscores, dots, camelCase boundaries.

| Raw input | Parsed words |
|-----------|-------------|
| `mon super projet` | `["mon", "super", "projet"]` |
| `gestion-des-stocks` | `["gestion", "des", "stocks"]` |
| `my_awesome_app` | `["my", "awesome", "app"]` |
| `SmartStack.App` | `["Smart", "Stack", "App"]` |
| `userManagement` | `["user", "Management"]` |

## Step 2: Language detection and spell check

For EACH word, you MUST:
1. **Detect the language** (French, English, or technical/proper noun)
2. **Check spelling** - flag obvious typos
3. **Suggest corrections** if misspelled

| Word | Language | Spelling | Suggestion |
|------|----------|----------|------------|
| `gestion` | FR | OK | - |
| `gestoin` | FR | typo | -> `gestion` |
| `managment` | EN | typo | -> `management` |
| `SmartStack` | Proper noun | OK | - |
| `auth` | EN (abbreviation) | OK | - |

**If typos detected**, ask the user BEFORE generating variants:

```yaml
AskUserQuestion:
  - header: "Spelling"
    question: "Corrections detected. Accept?"
    options:
      - label: "Accept corrections (Recommended)"
        description: "'gestoin' -> 'gestion', 'managment' -> 'management'"
      - label: "Keep original"
        description: "Use the name as typed"
    multiSelect: false
```

## Step 3: Generate all name variants

From the cleaned words, generate ALL variants:

| Variant | Format | Best for |
|---------|--------|----------|
| PascalCase.Dot | `Gestion.Des.Stocks` | .NET namespace, C# project, folder name |
| PascalCase | `GestionDesStocks` | Class name, assembly name |
| kebab-case | `gestion-des-stocks` | Git repo, npm package, URL slug |
| snake_case | `gestion_des_stocks` | Database, Python, file system |

## Step 4: Ask user to choose the PRIMARY format

```yaml
AskUserQuestion:
  - header: "Format"
    question: "Which format for the project name?"
    options:
      - label: "PascalCase.Dot (Recommended)"
        description: "{PascalCase.Dot variant} - .NET convention"
      - label: "PascalCase"
        description: "{PascalCase variant} - single word"
      - label: "kebab-case"
        description: "{kebab-case variant} - git/npm convention"
      - label: "snake_case"
        description: "{snake_case variant} - database/python convention"
    multiSelect: false
```

## Step 5: Store all derived names

Regardless of the chosen primary format, ALL variants are generated and stored:

```json
{
  "PROJECT_NAME": "{chosen format}",
  "PROJECT_VARIANTS": {
    "pascalCaseDot": "Gestion.Des.Stocks",
    "pascalCase": "GestionDesStocks",
    "kebabCase": "gestion-des-stocks",
    "snakeCase": "gestion_des_stocks",
    "displayName": "Gestion Des Stocks",
    "words": ["gestion", "des", "stocks"],
    "language": "fr"
  }
}
```

## Real-world examples

| User types | PascalCase.Dot | kebab-case | PascalCase |
|-----------|---------------|------------|------------|
| `smart stack app` | `SmartStack.App` | `smart-stack-app` | `SmartStackApp` |
| `gestion-des-stocks` | `Gestion.Des.Stocks` | `gestion-des-stocks` | `GestionDesStocks` |
| `Mon Projet V2` | `Mon.Projet.V2` | `mon-projet-v2` | `MonProjetV2` |
| `user auth module` | `User.Auth.Module` | `user-auth-module` | `UserAuthModule` |
| `PROJET TEST` | `Projet.Test` | `projet-test` | `ProjetTest` |
| `e-commerce platform` | `ECommerce.Platform` | `e-commerce-platform` | `ECommercePlatform` |
