State modeling
Ask for discriminated unions, exact optional fields, exhaustive switch handling, and impossible-state prevention.
Use this existing Omellody prompt utility to turn messy API responses, UI states, validation needs, and edge cases into a type design prompt with discriminated unions, runtime validation notes, tests, and migration steps. The builder runs locally in your browser and does not send project details to Omellody.
Replace the examples with sanitized project details. The generated prompt updates locally in your browser.
Formula: Domain states + source data + consumer code + impossible states + runtime validation + migration constraints + test matrix.
| Variable | What to enter |
|---|---|
{context} | Add specific, sanitized context details. If unknown, write the assumption explicitly. |
{stack} | Add specific, sanitized stack details. If unknown, write the assumption explicitly. |
{goal} | Add specific, sanitized goal details. If unknown, write the assumption explicitly. |
{constraints} | Add specific, sanitized constraints details. If unknown, write the assumption explicitly. |
Ask for discriminated unions, exact optional fields, exhaustive switch handling, and impossible-state prevention.
Separate trusted internal types from parsed external data and require validation at API boundaries.
Include compatibility shims, fixture examples, type tests, unit tests, and rollout notes for existing components.
| Check | Pass condition | Fix if weak |
|---|---|---|
| Grounding | The answer distinguishes facts, assumptions, and unknowns. | Add source snippets, example inputs, or explicit non-goals. |
| Safety | No secrets, customer data, account identifiers, or destructive commands are requested. | Sanitize examples and ask for read-only checks first. |
| Actionability | The plan includes concrete steps, owners, tests, and rollback or review criteria. | Request a checklist with evidence and stop conditions. |
| Verification | The output can be tested with unit cases, logs, traces, fixtures, or source-of-truth docs. | Add expected results and failure examples before using it. |
| Item | Snapshot |
|---|---|
| Page type | Existing Omellody coding prompt utility refreshed in Red Mode for depth and internal discovery. |
| Demand signal | URL inventory on 2026-05-22 flagged this prompt-family page as thin with limited internal-link depth while traffic radar continued to show AI prompt generator demand. |
| Originality | Omellody-created formula, builder, review criteria, FAQ, source snapshot, and safety guidance. No external repository content copied. |
| Last reviewed | 2026-05-22 |