---
name: step-00-init
description: Initialize application/module creation - parse parameters and validate context
next_step: steps/step-01-navigation.md
---

# Step 0: Initialization

## MANDATORY EXECUTION RULES

- NEVER skip parameter validation
- ALWAYS detect the navigation level from user request
- ALWAYS validate MCP availability before proceeding
- YOU ARE AN INITIALIZER, not an executor
- FORBIDDEN to call MCP tools until init is complete

## YOUR TASK

Initialize the application/module creation by parsing parameters, detecting level, and validating the SmartStack context.

---

## EXECUTION SEQUENCE

### 1. Detect Navigation Level

From user request, identify the level:

| Hint in Request | → Level | Parent Required |
|-----------------|---------|-----------------|
| "context", "workspace", "nouveau contexte" | context | No |
| "application", "app", "nouvelle application" | application | Yes (context) |
| "module", "feature", "nouveau module" | module | Yes (context.application) |
| "section", "tab", "nouvelle section" | section | Yes (context.app.module) |

### 2. Extract Parameters

```yaml
# Required
level: context | application | module | section
code: kebab-case (e.g., "products", "order-management")
labels:
  fr: "Label français"
  en: "English label"
  it: "Etichetta italiana"
  de: "Deutsche Bezeichnung"
icon: Lucide icon name (e.g., "Package", "ShoppingCart")
displayOrder: number

# Conditional (required for non-context levels)
parentPath: "context.application.module" (dot-separated)
```

### 3. Validate MCP Availability

**CRITICAL:** Before proceeding, verify SmartStack MCP is available:

```
Call: mcp__smartstack__validate_conventions
Args: { checks: ["all"] }
```

If MCP call fails:
- Display warning: "SmartStack MCP not available"
- Provide manual instructions instead of automated generation
- Do NOT proceed with step files

### 4. Build Full Path

```
{full_path} = {parentPath}.{code}  (if parentPath exists)
{full_path} = {code}               (if context level)

Example:
  level: module
  parentPath: erp.sales
  code: products
  → full_path: erp.sales.products
```

### 5. Infer Descriptions (if not provided)

```yaml
descriptions:
  fr: "Gestion de {labels.fr}"
  en: "{labels.en} management"
  it: "Gestione di {labels.it}"
  de: "Verwaltung von {labels.de}"
```

### 6. Show Summary

```
## Application Skill: {level} - {code}

| Parameter | Value |
|-----------|-------|
| Level | {level} |
| Code | {code} |
| Full Path | {full_path} |
| Parent | {parentPath} |
| Icon | {icon} |
| Display Order | {displayOrder} |

### Labels
| Language | Label |
|----------|-------|
| FR | {labels.fr} |
| EN | {labels.en} |
| IT | {labels.it} |
| DE | {labels.de} |

→ Proceeding to navigation generation...
```

---

## STATE VARIABLES TO PERSIST

| Variable | Description |
|----------|-------------|
| `{level}` | context, application, module, or section |
| `{code}` | kebab-case identifier |
| `{full_path}` | Complete navigation path |
| `{parent_path}` | Parent path (null for context) |
| `{labels}` | Object with fr, en, it, de |
| `{descriptions}` | Object with fr, en, it, de |
| `{icon}` | Lucide icon name |
| `{display_order}` | Numeric display order |
| `{mcp_available}` | Boolean - MCP connectivity status |

---

## SUCCESS METRICS

- Level correctly detected
- All required parameters extracted
- MCP availability verified
- Full path computed correctly
- Summary displayed
- Proceeded to step-01-navigation.md

## FAILURE MODES

- Missing required parameters (ask user)
- Invalid level detection (clarify with user)
- MCP not available (provide manual instructions)

---

## NEXT STEP

After showing initialization summary, proceed to `./step-01-navigation.md`
