Wardrobe Pull Router
Stylists paste a client brief and wardrobe inventory notes, and Jev routes each item to a styling role while checking suitability and scoring brief alignment.
Choice Router· pick one of a set
Section · Jev
full primer →The kernel.
Fashion designers paste in what arrives for Styling and wardrobe and Jev picks exactly one option from a fixed list, with the odds for every option shown — unclear cases get a "needs review" badge.
Why this primitiveA discrete role and fit score make wardrobe pulls easy to shortlist and hand off consistently.
Kernel
a Jev `choice` question that routes each incoming item to one handler/category from a fixed option map, plus branch-specific questions asked in the same request
Drives the UI as
a paste box that shows the chosen option, the full probability bar chart, and a 'needs review' badge when confidence is low
Required key.
TYPESAFE_API_KEY
Your TypeSafe key. The mega-prompt asks for it with a secure form and keeps it on the server. Jev returns typed decisions: choice, noul (yes/no probability) and score.
open ↗Add this in your Lovable project under Settings → Secrets before pasting the prompt below.
Appendix · Mega-prompt
The build prompt.
budget · 1 message
Paste into a fresh Lovable project. Make sure the key above is set first. read the build strategy →
Build "Wardrobe Pull Router" as a ONE-SHOT Lovable build (~5 credits, no follow-ups).
Single-page TanStack Start app, one route, cut scope ruthlessly.
THIS PROMPT IS SELF-CONTAINED
Do not assume the participant knows Jev or has read any other page. TypeSafe Jev is a decision model,
not a text generator. It receives `state` plus a map of typed `questions` and returns JSON that code can
use directly. Use Choice to select exactly one defined option, Noul for a yes/no probability from 0 to 1,
and Score for a probability-weighted position across ordered levels. Keep rules, thresholds, arithmetic,
and actions in code. Use a generative model only if the product separately needs prose.
CONCEPT
Stylists paste a client brief and wardrobe inventory notes, and Jev routes each item to a styling role while checking suitability and scoring brief alignment.
Discipline: Fashion & Textile Design (Styling and wardrobe).
Jev pattern: Choice Router (pick one of a set) — a Jev `choice` question that routes each incoming item to one handler/category from a fixed option map, plus branch-specific questions asked in the same request.
Why typed decisions: A discrete role and fit score make wardrobe pulls easy to shortlist and hand off consistently.
ENGINE: TypeSafe Jev (typed decisions, not text)
- Before writing code, ask the participant for `TYPESAFE_API_KEY` with Lovable's secure secret form. Never
ask them to paste it into chat, never prefix it with `VITE_`, and never expose it to browser code.
- Put the callable server function in `src/lib/jev.functions.ts`; do not import a server-only module from UI code.
- Validate the user's input before the handler and read `process.env['TYPESAFE_API_KEY']` inside the handler.
- From the server, call:
POST https://api.typesafe.ai/v1/systemone
Authorization: Bearer <TYPESAFE_API_KEY>, Content-Type: application/json
body: { "model": "jev-latest", "state": <Client brief, event context, inventory descriptions, and constraints>, "questions": QUESTIONS }
- Ask all questions in ONE request (they run in parallel and cannot see each other).
- Read Choice from `answers[id].choice`, `.probabilities`, and `.confidence`; Score from `.score`,
`.probabilities`, `.legend`, and `.confidence`; Noul from `.noul` only (it has no separate confidence).
SERVER IMPLEMENTATION (adapt the input name and result mapping to this concept)
```ts
import { createServerFn } from "@tanstack/react-start";
import { z } from "zod";
const Input = z.object({ text: z.string().trim().min(1).max(20000) });
export const decide = createServerFn({ method: "POST" })
.inputValidator((input: unknown) => Input.parse(input))
.handler(async ({ data }) => {
const apiKey = process.env['TYPESAFE_API_KEY'];
if (!apiKey) return { ok: false as const, status: 500, message: "TYPESAFE_API_KEY is not configured." };
const requestBody = {
model: "jev-latest",
state: { text: data.text },
questions: QUESTIONS,
};
let response: Response | undefined;
for (let attempt = 0; attempt < 3; attempt += 1) {
response = await fetch("https://api.typesafe.ai/v1/systemone", {
method: "POST",
headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
body: JSON.stringify(requestBody),
});
if (response.ok || (response.status !== 429 && response.status < 500)) break;
if (attempt < 2) await new Promise((resolve) => setTimeout(resolve, 750 * 2 ** attempt));
}
if (!response) return { ok: false as const, status: 503, message: "Jev did not respond." };
if (!response.ok) {
const message = (await response.text()).slice(0, 500) || `Jev request failed (${response.status}).`;
return { ok: false as const, status: response.status, message };
}
const result = await response.json();
return { ok: true as const, answers: result.answers };
});
```
In the page component, call `decide` with `useServerFn`, preserve the participant's input while loading or
on error, disable duplicate submissions, and render the returned typed values rather than parsing prose.
QUESTIONS (start here, refine wording if needed)
{
"styling_role": {
"type": "choice",
"instructions": "What role should this item play in the requested look?",
"criteria": {
"anchor": "Defines the main silhouette or visual direction",
"layer": "Adds depth, warmth, or structure over another item",
"accent": "Provides a focused color, texture, or detail",
"practical": "Primarily serves comfort, weather, or movement needs"
}
},
"client_suitable": {
"type": "noul",
"instructions": "For the routed role, is the item suitable for the client and event constraints?",
"criteria": {
"true": "It fits the stated comfort, occasion, and preference needs",
"false": "It conflicts with a stated constraint or preference"
}
},
"brief_alignment": {
"type": "score",
"instructions": "How closely does the item support the styling brief?",
"criteria": [
"Low: little connection to the requested look",
"Moderate: usable with significant styling support",
"High: strong fit with minor tradeoffs",
"Very high: directly fulfills the brief"
]
}
}
DECISION RULES (in code, not in the model)
- choice/score: if confidence < 0.6 show a "needs review" badge instead of acting.
- noul: >= 0.75 = yes, <= 0.25 = no, otherwise "review".
- score: normalise with score / (levels - 1) before combining with weights.
- Missing or malformed answers go to review. Show safe HTTP status and message in the UI. Retry only 429/5xx,
at most twice with increasing delay; never retry 400/401/402/403/404 and never invent results.
- If the product needs prose (a summary, a message), use Lovable AI for that text only; Jev makes the decisions.
UI
a paste box that shows the chosen option, the full probability bar chart, and a 'needs review' badge when confidence is low. Include 2 sample inputs as one-click chips so the demo works instantly.
Tailwind + shadcn, editorial look, footer: "Built during the Creative AI & Quantum Hackathon organised by StreetKode Fam during Indian Krump Festival 14".
NO database, NO auth, NO extra pages, NO tests.
BEFORE YOU FINISH
- Run the app and test both sample inputs through the real server function.
- Confirm the browser receives no API key and no fabricated fallback result.
- Confirm Choice/Score confidence and Noul probability drive the stated review rules.
- Confirm loading, success, review, empty-input, and service-error states are readable on mobile.
Reference only if needed: https://docs.typesafe.ai/api and https://docs.typesafe.ai/primitives
Market sizing.
TAM
Global fashion retail: ~$1.7T
SAM
Styling services and tools: ~$15B
SOM
Independent stylists: ~$4M
Indicative figures for hackathon pitches — refine with your own research before raising.
Adjacent entries.
Material sourcing
Fabric Match Desk
Designers paste a garment brief and fabric swatch notes, and Jev routes the request to a material family while assessing suitability and match strength.
Pattern engineeringPattern Risk Sorter
Patternmakers paste pattern-piece notes and garment specifications, and Jev routes each piece to a construction risk while checking whether it needs review and scoring severity.
Draping and silhouetteDrape Study Sorter
Designers paste drape observations and silhouette goals, and Jev routes each study to a shape behavior while judging goal alignment and confidence of the match.
Surface pattern designPrint Placement Gate
Textile artists paste print concepts, repeat specifications, and placement notes, and Jev routes each design to a repeat type while checking placement readiness and scoring repeat coherence.