# 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.

**⛔ Compound proper nouns:** Some camelCase words are actually single brand/product names that must NOT be split. Before splitting on camelCase boundaries, check if the full word is a known compound:

| Word | Type | Parsed as |
|------|------|-----------|
| `SmartStack` | Brand name | `["SmartStack"]` (1 word) |
| `JavaScript` | Language | `["JavaScript"]` (1 word) |
| `TypeScript` | Language | `["TypeScript"]` (1 word) |
| `DevOps` | Proper noun | `["DevOps"]` (1 word) |
| `GitHub` | Brand name | `["GitHub"]` (1 word) |
| `InfraAzure` | Normal camelCase | `["Infra", "Azure"]` (2 words) |

**Rule:** If the full word (before splitting) is recognized as a brand, product, or proper noun, treat it as ONE word. Only split unknown camelCase words.

**Example:** `SmartStack.infra-azure` → `["SmartStack", "infra", "azure"]` → kebab: `smartstack-infra-azure`

| Raw input | Parsed words |
|-----------|-------------|
| `mon super projet` | `["mon", "super", "projet"]` |
| `gestion-des-stocks` | `["gestion", "des", "stocks"]` |
| `my_awesome_app` | `["my", "awesome", "app"]` |
| `SmartStack.App` | `["SmartStack", "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 |
|-----------|---------------|------------|------------|
| `SmartStack.App` | `SmartStack.App` | `smartstack-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` |
