---
description: Plan mode, unified build command, env wizard for volt-fein
alwaysApply: true
---

# Volt build workflow

## Primary command: `build`

When the user types **`build`**, **`build all`**, or **`build project`** (recommended):

1. **AskQuestion — Plan mode gate:** "Switch to Plan mode (Shift+Tab), then continue." Options: `I'm in Plan mode — continue`, `Cancel`. Block until confirmed.
2. **Environment setup wizard (Q1–Q5)** — see SETUP_GUARD.md. Q1 Travclan credentials always first.
3. **AskQuestion — build scope (Q6):** "What do you want to build?" Options: `Backend and frontend`, `Backend only`.
4. **One plan** (scope matches Q6) → user clicks **Build**
5. Scaffold **backend** autonomously
6. **Scaffold frontend only if Q6 = Backend and frontend** — do NOT ask user to type `build frontend` when full stack was chosen
7. Start stack via `./run.sh` and report success (`run.sh` runs backend only when `frontend/` is missing)

Also applies to **`build backend`** and **`build frontend`** for Plan mode gate + wizard (frontend skips wizard if env already collected).

## Plan mode

Prompts cannot switch Cursor modes programmatically. Always use **AskQuestion** as the first step to confirm Plan mode before wizard or plan.

## Wizard order (strict)

1. Q1 AskQuestion: Travclan credentials now or skip?
2. Chat (if Yes): wait for TRAVCLAN_API_KEY, TRAVCLAN_USER_ID, TRAVCLAN_MERCHANT_ID
3. Q2 AskQuestion (if needed): confirm keys received
4. Q3 AskQuestion: file logging?
5. Q4 AskQuestion: Elasticsearch? (if logging yes)
6. Q5 AskQuestion: MongoDB? (+ chat for URI/DB if yes)
7. Q6 AskQuestion: Backend only or backend + frontend?
8. Write plan → Build click → execute

Do not create files until Build click.

## Terminal commands

During build, run shell commands without asking "should I run X?". Assume permission for `./run.sh`, `docker-compose`, `npm`, `curl`, `mkdir`, `cd`, etc.

## configure env

Re-run the full Environment setup wizard from SETUP_GUARD.md (Q1 always first).
