---
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-4. Parameter Detection & Project Analysis

See [references/init-parameter-detection.md](../references/init-parameter-detection.md) for:
- Navigation level detection (application/module/section/resource)
- Parameter extraction (code, labels, icon, displayOrder)
- Project type & seeding strategy detection
- Feature.json context enrichment (optional)
- MCP prerequisite validation (BLOCKING)

### 5. Build Full Path

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

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

### 6. 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}"
```

### 7. Show Summary

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

| Parameter | Value |
|-----------|-------|
| Level | {level} |
| Code | {code} |
| Full Path | {full_path} |
| Parent | {parentPath} |
| Icon | {icon} |
| Display Order | {displayOrder} |
| Project Type | {project_type} |
| Seeding Strategy | {seeding_strategy} |
| Feature.json | {has_feature_context ? feature_json_path : "Not found (standard generation)"} |

### 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}` | application, module, section, or resource |
| `{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 |
| `{project_type}` | "core" or "client" (from .smartstack/config.json) |
| `{db_context}` | "core" or "extensions" (from .smartstack/config.json) |
| `{seeding_strategy}` | "hasdata" (core) or "provider" (client) |
| `{feature_json_path}` | Path to feature.json (null if not found) |
| `{has_feature_context}` | Boolean - whether BA context is available |
| `{feature_data}` | Parsed feature.json object (null if not found) |

---

## SUCCESS METRICS

- Level correctly detected
- All required parameters extracted
- MCP availability verified
- Project type and seeding strategy detected
- Feature.json detected if available (enrichment context loaded)
- 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 (STOP - display install instructions)

---

## NEXT STEP

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