# User prompts by persona → Impact Nova actions

## MANDATORY — all personas

**Impact Nova components only. No custom UI components.**

| User mentions | You MUST use |
|---------------|--------------|
| table, grid, spreadsheet, Excel-like, rows & columns | **DataTable** from `impact-nova/data-table` |
| modal, dialog | `impact-nova/dialog` or `alert-dialog` |
| sidebar, app shell | `impact-nova/layout` + `sidebar` + `header` |
| filters, chips | `impact-nova/filter-strip` |
| toast | `impact-nova/toast` + `toaster` |
| chart | `impact-nova/chart` |

Full rules: **`impact-nova://design-system-mandate`**. Call **`validate_snippet`** before finishing.

---

The MCP agent must detect **who is prompting** and route accordingly. Users rarely say "use Impact Nova" or "scaffold Vite."

---

## Personas (auto-detect)

| Persona | Typical user | How they prompt | Agent reply style |
|---------|--------------|-----------------|-------------------|
| **product** | PM, planner, BA (e.g. retail planning) | Workflows, KPIs, user stories, acceptance criteria | Business outcomes; hide stack unless asked |
| **designer** | UX/UI, visual design | Screenshot, Figma, "make it match", spacing, mockup | Visual/layout language; tokens + Layout chrome |
| **manager** | EM, director, client-facing | Executive demo, overview, stakeholder walkthrough | Short, non-technical; KPI + Chart dashboards |
| **backend** | API engineer, full-stack backend | CRUD, REST/GraphQL, wire API, admin UI for data | Typed API interfaces; show integration points |
| **frontend** | React/TS developer | impact-nova, subpath imports, ColDef, scaffold, component names | Technical; strict TS, ag-grid-rules, validate_snippet |
| **unknown** | Mixed / unclear | Vague "build a dashboard" | `interpret_user_request` + `suggest_components_for_ui` |

**First step for any non-trivial request:** call **`interpret_user_request`** with the user's message verbatim.

---

## Product (planning / workflow) — Anagha-style

**Says:** *"Create a workflow where users edit sales KPIs…"*, *"user story with Generate Receipts / Save Changes"*, *"grid with SKUs and months"*

**Agent does:**
1. `interpret_user_request` → persona `product`
2. `scaffold_impact_nova_app` if greenfield — pass `modules[]` from prompt
3. DataTable + Tabs + FilterStrip + toast
4. **NOT** a standalone `.html` file

---

## Designer

**Says:** *"Make it look like our product"* (+ screenshot), *"match Figma spacing"*, *"sidebar and filter chips like Item Smart"*

**Agent does:**
1. `interpret_user_request` → persona `designer`
2. `suggest_components_for_ui` (enrich from image if attached)
3. `get_design_tokens`
4. `resource:impact-nova://layout` + layout patterns
5. Scaffold if full-screen tool; otherwise match chrome in existing app
6. Reply describes **visual structure**, not file names

---

## Manager / stakeholder

**Says:** *"Demo for leadership"*, *"executive overview of planning metrics"*, *"walkthrough for client"*

**Agent does:**
1. `interpret_user_request` → persona `manager`
2. Scaffold or Dashboard route with **KPI cards + Chart** (simple path first)
3. Avoid deep grid/workflow unless they asked
4. Reply: 2–3 bullets on what the demo shows; offer to add detail

---

## Backend

**Says:** *"Admin UI for my REST API"*, *"CRUD screen for orders endpoint"*, *"show data from GraphQL"*

**Agent does:**
1. `interpret_user_request` → persona `backend`
2. Define `interface` types for API payloads in code
3. DataTable (read) or Form + Dialog (write); mock fetch with clear `// TODO: replace with your API`
4. Scaffold if no frontend project exists
5. Reply explains **where to plug in** fetch/mutations without React lecture

---

## Frontend developer

**Says:** *"Add DataTable with ColDef for items"*, *"scaffold impact nova app"*, *"import Layout from impact-nova/layout"*, *"wire FilterStrip to zustand"*

**Agent does:**
1. `interpret_user_request` → persona `frontend`
2. If existing repo: `analyze_project_for_impact_nova` first
3. `get_component` / `list_components` for named components
4. `get_real_world_patterns` + `impact-nova://ag-grid-rules` for grids
5. `validate_snippet` on generated snippets
6. Scaffold only when they say new app / greenfield
7. Reply: technical, subpath imports, strict TypeScript

---

## Decision tree (all personas)

```
User message
    │
    ├─ interpret_user_request (always for greenfield / prototype / ambiguous)
    │
    ├─ persona = frontend + existing impact-nova in package.json
    │     └─ extend project; analyze_project_for_impact_nova; no re-scaffold
    │
    ├─ persona = product | designer | manager + full-screen tool + empty workspace
    │     └─ scaffold_impact_nova_app (modules[] from prompt)
    │
    ├─ persona = backend + no UI project
    │     └─ scaffold → API-shaped page with typed interfaces
    │
    ├─ grid / KPI / Excel-like (any persona)
    │     └─ DataTable + impact-nova://ag-grid-rules
    │
    ├─ screenshot / Figma (designer + product)
    │     └─ suggest_components_for_ui + tokens + Layout
    │
    └─ "HTML artifact" only
          └─ raw HTML allowed (explicit exception)
```

---

## Anti-patterns by persona

| Persona | Wrong | Right |
|---------|-------|-------|
| Product | `planning_prototype.html` | Scaffolded React + Layout + DataTable |
| Designer | Generic MUI/Bootstrap | Impact Nova Layout + tokens |
| Manager | 14-step technical README | "Open localhost — you'll see KPIs and trend chart" |
| Backend | Untyped `any` fetch data | `interface OrderRow` + typed state |
| Frontend | `import from 'impact-nova'` barrel in features | `import { X } from 'impact-nova/x'` |
| Frontend | Plain AG Grid | impact-nova DataTable + ag-grid-rules |

---

## MCP prompts

| Prompt | When |
|--------|------|
| **route-user-request** | Any ambiguous or persona-unknown message (paste verbatim) |
| **build-product-prototype** | Product workflow / grid / user story |
| **scaffold-impact-nova-app** | Frontend explicitly wants new Vite app |

---

## Local dev (monorepo)

When developing inside the impact-nova repo, scaffold auto-links `impact-nova` via `file:`. Rebuild DS after changes (`npm run build` at repo root). Override: `--from-npm` or MCP `usePublishedPackages: true`.

To test unreleased `create-impact-nova` in MCP: `cd packages/mcp && npm install file:../create-impact-nova`.
