Skip to content

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Promptwright

A prompt linter. Paste a prompt, get it scored on nine weighted channels, see what's contradictory or missing, and get it rewritten in the shape your target model's own documentation recommends.

The linter runs entirely in the browser. No prompt is ever sent to a server. That is what makes the free tier cost nothing to serve, and it is the thing not to break.


Run it locally

npm install
npm run dev

Then open http://localhost:3000.

Note: hot-reload needs a websocket. If you open the dev server through a proxy or an embedded preview pane that blocks ws://localhost:3000/_next/hmr, React will server-render the page but never hydrate, and nothing will be clickable. That is the proxy, not the code — npm run build && npm run start behaves correctly, and so does a normal browser tab.

Environment variables

Copy .env.example to .env.local and fill it in. Nothing here is required to run the linter; they only affect the waitlist and canonical URLs.

Variable Purpose
NEXT_PUBLIC_SITE_URL Canonical origin, used for Open Graph, robots.txt and the sitemap.
LOOPS_API_KEY Sends signups to Loops. Recommended.
WAITLIST_WEBHOOK_URL Alternative: POSTs signup JSON to any endpoint. Ignored if LOOPS_API_KEY is set.

With neither backend configured, POST /api/waitlist returns 503 and says so. It never pretends to have saved an address it discarded.

Verify the Loops endpoint and field names against their current API docs before launch — the integration in app/api/waitlist/route.js was written against their documented contacts/create shape but has not been run against a live key.

Deploy to Vercel

The domain is promptwright.cloud, registered at IONOS.

  1. In Vercel, Add New → Project and import EuroDev/promptwright. It detects Next.js; the defaults are correct.
  2. Add the environment variables above under Settings → Environment Variables, for Production, Preview and Development.
  3. Settings → Domains → add promptwright.cloud. Accept the prompt to add www too.
  4. Vercel then shows the exact DNS records for this project. Copy them as shown — the apex A record value and, importantly, the www CNAME target, which is now per-project (something like d1d4fc829fe7bc7c.vercel-dns-017.com) rather than the old shared cname.vercel-dns.com.
  5. In IONOS: Domains & SSL → promptwright.cloud → DNS. Add an A record with host @ and the value Vercel showed, and a CNAME with host www pointing at Vercel's per-project target. Delete any pre-existing IONOS parking/forwarding A or CNAME record for @ or www first, or the domain will show an invalid configuration.
  6. Wait for propagation (usually minutes, up to a few hours). Vercel issues the TLS certificate automatically once the records resolve.
  7. Redeploy so the environment variables are picked up.

Alternatively, point IONOS at Vercel's nameservers and let Vercel manage DNS. Only do that if no email or other records live on this domain — changing nameservers moves all DNS, not just the website.

Layout

app/
  layout.js              metadata, fonts, no-flash theme script
  page.js                landing page
  globals.css            design tokens and all styles
  privacy/page.js
  api/waitlist/route.js  signup capture (Loops or a generic webhook)
  opengraph-image.js     generated social card
  robots.js, sitemap.js
components/
  Linter.jsx             the tool — client component
  WaitlistForm.jsx
  ThemeToggle.jsx
lib/
  engine.js              scoring + rewrite logic. Pure, no DOM, no network, no deps.

lib/engine.js is the product. It has no dependencies and no side effects, which is why the same file can later run in a browser extension without changes.

Testing the engine

It is plain ES modules, so it runs under Node directly:

node --input-type=module -e "
import('./lib/engine.js').then(({SAMPLES, analyze}) => {
  SAMPLES.forEach((s,i) => {
    const a = analyze(s.text, s.task);
    console.log(i, 'score', a.total, 'warnings', a.warnings.length);
  });
});"

Expected: 14, 23, 18, 87, 7 with 4 warnings on the last.

What this is not, yet

Phase 1 is the free tool plus a mailing list. Not built:

  • accounts and payments
  • server-side rewrites written by a model, instead of the template
  • A/B against GPT, Gemini and Grok (needs API keys server-side)
  • the browser extension

Before any of those ship, add per-user rate limiting — the moment an endpoint calls a model API with your key, an unthrottled route is an uncapped bill.

And do not log prompt contents. People paste confidential material into prompt tools; the privacy page promises they are never sent anywhere, and that promise is also the product.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages