# Generate a survey for Survey

You are generating a survey definition for **Survey** (https://getsurvey.dev). Output a JSON array of question objects matching this exact shape — the receiving system validates with Zod and rejects extra fields.

## Required output format

```json
[
  {
    "type": "short_text" | "long_text" | "single_select" | "multi_select" | "likert" | "nps" | "star_rating" | "yes_no",
    "prompt": "The question text",
    "required": true,
    "helpText": "optional helper text"
  }
]
```

Return **only** the JSON array. No prose, no code fence, no comments.

## Type-specific fields

| Type | Extra fields |
|---|---|
| `short_text` | `maxLength?: number` |
| `long_text` | `maxLength?: number` |
| `single_select` | `choices: { id, label, value? }[]` (min 2), `randomize?: boolean` |
| `multi_select` | `choices: { id, label }[]` (min 2), `minSelections?`, `maxSelections?` |
| `likert` | `scale: 3 | 5 | 7`, optional `labels: { low, mid?, high }` |
| `nps` | (always 0–10) optional `promptDetractor`, `promptPromoter` |
| `star_rating` | `max: 3 | 5 | 7` |
| `yes_no` | optional `yesLabel`, `noLabel` |

## Conditional questions (showWhen)

Any question can be gated on a previous answer:

```json
{
  "type": "long_text",
  "prompt": "What's the main reason for your low score?",
  "required": false,
  "showWhen": { "questionId": "q_nps_score", "op": "lt", "value": 7 }
}
```

Operators: `eq` | `ne` | `lt` | `lte` | `gt` | `gte` | `includes` | `answered` | `unanswered`. The reference must point to an EARLIER question. Hidden questions are skipped at render time, never validated as required, and never included in the submitted response.

Common patterns:

- NPS detractor follow-up: `{ questionId: "q_nps", op: "lt", value: 7 }`
- Star-rating dissatisfaction: `{ questionId: "q_stars", op: "lte", value: 3 }`
- Show on Yes: `{ questionId: "q_subscribed", op: "eq", value: true }`
- Branch off a multi-select: `{ questionId: "q_features", op: "includes", value: "c_feature_id" }`

Use this generously — surveys feel shorter and completion goes up.

## Conventions

- `id` on each question is optional — the server generates one if missing. If you do supply it, use `q_` + 8 lowercase alphanumeric chars.
- `choices[].id` follows the same pattern with prefix `c_`.
- `required` defaults to `false` — set explicitly per question.
- Keep `prompt` under 140 characters where possible.
- Use `helpText` for any clarifying detail; don't pack it into the prompt.

## Example output

```json
[
  {
    "type": "nps",
    "prompt": "How likely are you to recommend us to a friend?",
    "required": true
  },
  {
    "type": "long_text",
    "prompt": "What's the main reason for your score?",
    "required": false,
    "helpText": "We read every response."
  },
  {
    "type": "single_select",
    "prompt": "What almost stopped you from buying today?",
    "required": false,
    "choices": [
      { "id": "c_ship",   "label": "Shipping cost too high" },
      { "id": "c_return", "label": "Wasn't sure about return policy" },
      { "id": "c_compare","label": "Comparing with another product" },
      { "id": "c_other",  "label": "Other" }
    ]
  },
  {
    "type": "yes_no",
    "prompt": "Can we email you about your feedback?",
    "required": false
  }
]
```

## Now generate

Generate the questions for: **{user brief here — describe what you're trying to learn}**.

Return only the JSON array.
