# MANDATORY User Questions for Init

╔══════════════════════════════════════════════════════════════════════════╗
║  Every question below REQUIRES a call to the AskUserQuestion tool.      ║
║  The YAML blocks are the EXACT parameters to pass to the tool.         ║
║  NEVER substitute a tool call with auto-derived values.                ║
║  NEVER combine questions — one AskUserQuestion call per question.      ║
╚══════════════════════════════════════════════════════════════════════════╝

## Question 1: Repository URL

**CALL AskUserQuestion with these parameters (skip only if URL provided in command args):**

```yaml
AskUserQuestion:
  - header: "Repository"
    question: "Repository URL? (detected: {DETECTED_URL})"
    options:
      - label: "Use detected URL (Recommended)"
        description: "{DETECTED_URL}"
      - label: "Enter GitHub URL"
        description: "https://github.com/org/repo.git"
      - label: "Enter Azure DevOps URL"
        description: "https://dev.azure.com/org/project/_git/repo"
      - label: "Local only (no remote)"
        description: "Initialize without remote (limited features)"
    multiSelect: false
```

**⛔ FOLLOW-UP: If user selects "Enter GitHub URL" or "Enter Azure DevOps URL":**

The selected option is just a choice, NOT the actual URL. You MUST ask a follow-up question:

```yaml
AskUserQuestion:
  - header: "URL"
    question: "Enter the repository URL:"
    options:
      - label: "https://github.com/org/repo.git"
        description: "Example GitHub format"
      - label: "https://dev.azure.com/org/project/_git/repo"
        description: "Example Azure DevOps format"
    multiSelect: false
```

The user will type the actual URL via "Other". Then:
- Validate format
- Update `{REPO_URL}` and `{GIT_PROVIDER}`

## Question 2: Root Folder

**CALL AskUserQuestion NOW — do NOT auto-derive from URL:**

**If sibling projects exist, show where it fits:**

```
{WORKSPACE_DIR}/
├── SmartStack.app/    ✅ (gitflow)
├── SmartStack.mcp/    ✅ (gitflow)
├── SmartStack.cli/    ✅ (gitflow)
└── NewProject/        ← THIS PROJECT
    ├── .bare/
    ├── 01-Main/
    ├── 02-Develop/
    ├── features/
    ├── releases/
    └── hotfixes/
```

```yaml
AskUserQuestion:
  - header: "Location"
    question: "Root folder for THIS project? (worktrees will be created here)"
    options:
      - label: "Use parent folder (Recommended)"
        description: "{DETECTED_FOLDER}/ - consistent with {#SIBLING_PROJECTS} sibling project(s)"
      - label: "Use current folder"
        description: "$(pwd)/ - Will create subfolders here"
      - label: "Custom path"
        description: "Specify a different location"
    multiSelect: false
```

**⛔ FOLLOW-UP: If user selects "Custom path":**

You MUST ask a follow-up question to get the actual path:

```yaml
AskUserQuestion:
  - header: "Path"
    question: "Enter the full path for the project root folder:"
    options:
      - label: "{DETECTED_FOLDER}/"
        description: "Parent of current directory"
      - label: "{WORKSPACE_DIR}/"
        description: "Workspace root"
    multiSelect: false
```

The user will type the actual path via "Other". Validate the path exists or can be created.

**Explain the structure that will be created for this project:**

```
{ROOT_FOLDER}/
├── .bare/                 # Git bare repository (this repo only)
├── 01-Main/               # Worktree: main branch
├── 02-Develop/            # Worktree: develop branch
├── features/              # Feature branch worktrees
├── releases/              # Release branch worktrees
└── hotfixes/              # Hotfix branch worktrees
```

## Question 3: Project Name

**CALL AskUserQuestion NOW — do NOT auto-derive from URL:**

```yaml
AskUserQuestion:
  - header: "Project"
    question: "Project name? (detected: {DETECTED_NAME})"
    options:
      - label: "Use detected name (Recommended)"
        description: "Project: {DETECTED_NAME}"
      - label: "Custom name"
        description: "Specify a different project name"
    multiSelect: false
```

**⛔ FOLLOW-UP: If user selects "Custom name":**

You MUST ask a follow-up question to get the actual name:

```yaml
AskUserQuestion:
  - header: "Name"
    question: "Enter the project name:"
    options:
      - label: "{DETECTED_NAME}"
        description: "Detected from repository"
      - label: "{DETECTED_NAME}-v2"
        description: "Variant of detected name"
    multiSelect: false
```

The user will type the actual name via "Other". Use this raw input for step 6b (normalization).

## Question 4: Existing Configuration

**If `ALREADY_INITIALIZED` = true:**

Display current configuration and ask what to do:

```yaml
AskUserQuestion:
  - header: "Existing"
    question: "GitFlow is already initialized. Current config will be shown. What do you want to do?"
    options:
      - label: "Reconfigure (Recommended)"
        description: "Review and update all settings"
      - label: "Repair"
        description: "Fix missing directories only"
      - label: "View only"
        description: "Display current config and exit"
      - label: "Cancel"
        description: "Exit without changes"
    multiSelect: false
```

**Handle choices:**
- **Reconfigure**: Continue to step 4 (will ask all questions again)
- **Repair**: Check directories, fix missing ones, exit
- **View only**: Display config, exit
- **Cancel**: Exit immediately

## Question 5: Worktree Mode

CALL AskUserQuestion NOW. This is the MOST FREQUENTLY SKIPPED question.
Do NOT default to "organized". The user MUST explicitly choose.

```yaml
AskUserQuestion:
  - header: "Worktrees"
    question: "How should worktrees be organized?"
    options:
      - label: "Organized (Recommended)"
        description: "01-Main, 02-Develop, features/, releases/, hotfixes/"
      - label: "Simple"
        description: "main/, develop/, features/, releases/, hotfixes/"
      - label: "Disabled"
        description: "No worktrees, use git checkout (not recommended)"
    multiSelect: false
```
