Engineering · 2026

PromptNinja

A full-stack SaaS that turns rough ideas into structured prompts. Runs on Cloudflare Workers at near-zero infrastructure cost.

TypeScriptHonoCloudflare WorkersD1Stripe

Context

People type vague requests into AI tools and get vague answers back. The hard part was never the model — it is framing the ask: the context, the constraints, the output format. PromptNinja closes that gap. You give it a rough idea, pick a lens, and it returns a well-structured prompt that works with the major AI assistants — ChatGPT, Claude, Gemini, Copilot.

The core idea is the mode selector. The same input, run through a different mode, produces a radically different result. General sharpens any prompt. Business reframes an idea around goals, audience, and success criteria. Study turns a topic into a progressive learning path. Code specifies language, edge cases, testing, and security. The mode changes how the AI thinks about the input — that is where the value lives.

My role

I designed and directed this one end to end — product, design, and engineering — building it with a small team of AI agents working alongside me. I made the product calls (the four modes, the free-to-pro flow, how limits are communicated), designed the interface, and shaped the backend that runs it all: auth, billing, the AI engine, rate limiting, encrypted history, and internationalization.

Directing a real, paid SaaS from the first sketch to a deployable production app — owning both the experience and the system underneath it while orchestrating the agents that do the building — is the point of this case.

How it is built

The entire app runs on Cloudflare Workers — V8 isolates at the edge, near-zero cold start, served from a global CDN. The backend is TypeScript in strict mode on Hono, with exactly one production dependency. Everything else uses the Workers runtime directly: fetch() for OpenAI, Stripe, and email; crypto.subtle for encryption; template literals for HTML. No SDKs, no build step beyond the TypeScript compile.

Data lives in D1, Cloudflare’s managed SQLite, with every query parameterized. Prompt history is encrypted per user with AES-256-GCM through the Web Crypto API — lose the key, lose the data, by design. Auth is passwordless: a magic link emailed via Resend, then a signed session cookie. Billing is Stripe Checkout and the Customer Portal, with webhooks verified by HMAC signature before anything is trusted.

The AI engine calls OpenAI over plain fetch() with retry and exponential backoff, tracks tokens and cost on every call, and keeps user input out of the system prompt. Rate limiting runs inside the app — anonymous, free, and pro tiers, each with its own daily cap and a short cooldown between requests. The UI ships in two languages, chosen from the incoming request.

Outcome

PromptNinja is a complete, production-grade SaaS: passwordless sign-in, four working modes, Stripe subscriptions, encrypted history, and built-in rate limiting. It deploys to the edge with a single command and runs at near-zero infrastructure cost on Cloudflare’s free tier — the revenue model is designed to outrun the API bill, not subsidize it.

For me it is proof that a designer can direct both the experience and the engineering of a real product — orchestrating AI agents to build it — from the first idea to a system designed to pay for itself.