Pre-release

Type-safe prompt engineering for production AI

Define prompts with a fluent builder. Let AI generate optimized system prompts. Ship with confidence.

$ npm i @nudge/core @nudge/cli
Your code
import { prompt } from "@nudge/core";export const summarizer = prompt("summarizer", (p) =>  p    .persona("expert summarizer")    .input("text to summarize")    .output("concise summary")    .do("preserve key facts")    .dont("add opinions")    .constraint("max 3 paragraphs"));
Generated prompt
You are an expert summarizer. Your task is to condense information while maintaining accuracy and clarity.**Input:** You will receive text to summarize.**Output:** Provide a concise summary.**Guidelines:**- Preserve key facts and important details- Avoid adding personal opinions or interpretations- Keep your response to a maximum of 3 paragraphs

How it works

1

Define

Write prompts in TypeScript with full autocomplete

2

Generate

AI synthesizes optimized system prompts

3

Ship

Import and use anywhere in your app

Features

Type-Safe

Full TypeScript support with autocomplete

AI-Powered

Generates optimized system prompts

Cached

Only regenerates changed prompts

Composable

Share logic across prompts

Variables

Dynamic prompts with typed placeholders

Optional Blocks

Toggle sections at runtime