DEV Community

edwin  realpe preciado
edwin realpe preciado

Posted on

I built a protocol that reduces AI prompts by 70% — here's the proof

The claim

Most developers know that AI prompts are
inconsistent. You write 80 words describing
a component, the AI generates something
close but not quite right, you iterate,
you waste time.

I've been working on a different approach:
instead of writing better prompts, what if
you had a structured protocol that eliminates
the ambiguity entirely?

That's NEXUS — a minimalist Human-AI
communication protocol. And instead of
just claiming it works, I built a library
of 25 real examples showing the before
and after.

The comparison

Here's a real example — a webhook handler:

Without NEXUS (87 words of natural language):

"Create a POST endpoint in Express to receive
Stripe webhooks. It should read the body as
raw buffer, verify the webhook signature using
stripe.webhooks.constructEvent() with the secret
from environment variables, return 400 if the
signature is invalid, and call
WebhookService.handleStripe() with the event.
Respond with received: true if everything works."

Result: variable. Depends on the model,
the day, the context.

With NEXUS (8 lines):

@Express
Controller WebhookController
  Router ApiV1
    Endpoint POST /webhooks/stripe
      !! "La firma del webhook debe ser válida"
      => WebhookService.handleStripe()
      !error:400 -> /error/invalid-signature
Enter fullscreen mode Exit fullscreen mode

Result: deterministic. Every time.

The numbers across 25 examples:

  • Average reduction: ~70% less text
  • Ambiguity: zero
  • The AI knows exactly what to build

Why it works

Natural language compresses intent into
sentences that humans parse easily but
AI models resolve inconsistently.

NEXUS makes intent explicit:

  • !! preconditions fire before the action
  • !error:code handles failures after
  • => is the action — nothing implied

The model doesn't decide what to do.
The protocol tells it.

See the 25 examples

I built a full library showing the
three-panel comparison for every example:

  1. Natural language prompt (what you'd write today)
  2. NEXUS blueprint (8-16 lines)
  3. Generated code (the output)

Cards, navbars, forms, REST APIs,
authentication flows — all with the
before/after numbers.

👉 nexuslang.dev/examples

The library is open source:
💻 github.com/open-souse/Nexus
📦 npm install nxlang


Curious what examples you'd want to see
next — what's the most painful component
to describe to an AI in natural language?

Top comments (0)