DEV Community

I built a minimalist protocol to communicate with AI without ambiguity

The problem

Every developer who works with AI knows this frustration:
you write a long, detailed prompt, and the AI generates
something that's almost right but inconsistent,
over-engineered, or missing critical details.

The problem isn't the model. It's the language.

Natural language is ambiguous by design. What's obvious
to you has ten possible interpretations for an AI.

The solution: NEXUS

NEXUS is a tachygraphic protocol — structured shorthand
that compresses complex software architecture into
precise, unambiguous intent.

Instead of writing:

"Create a modern dashboard with authentication,
analytics charts, user management, real-time
notifications, dark mode, responsive design..."

You write:

@React @Tailwind
Page Dashboard
  @Auth[mode:jwt]
  Layout SplitView
  Section Analytics #glass
    Chart < MetricsData [paginate:10]
  Section Users
    Table < User !bold
      !error:404 -> /not-found
Enter fullscreen mode Exit fullscreen mode

8 lines. Zero ambiguity. The AI knows exactly what
to build.

What NEXUS is (and isn't)

NEXUS is not a programming language. It doesn't
replace JavaScript, Python, or any other language.

It's the communication layer between human intent
and AI generation. You write NEXUS, the AI generates
the real code.

How it works

// Frontend
Page ProductDetail
  Layout Stack #gap-2
  Section Hero
    Image < product.thumbnail [ratio:16/9]
    Text < product.name !bold !xl
  Section Actions
    ( product.inStock ) ->
      Button "Add to Cart" => CartStore.add(product)
    :
      Badge "Out of Stock" #muted

// Backend
Model Order
  Entity id !pk
  Entity status default:pending
  Entity user -> Model.User
  Entity items -> Model.Product [many]

Controller OrderController
  Router ApiV1
    Endpoint POST /orders => OrderService.create()
      !error:400 -> /error/bad-request
      !error:500 -> /error/server
Enter fullscreen mode Exit fullscreen mode

The library

nxlang is the open source TypeScript library that
implements the protocol:

  • validateNexus() — validates syntax in real time
  • buildSystemPrompt() — generates the AI context
  • createDefaultConfig() — project DNA configuration
npm install nxlang
Enter fullscreen mode Exit fullscreen mode

135 tests passing. Library-first architecture so you
can embed it in your own tools and editors.

Beyond code

The three primitives of NEXUS are universal:

  • @ Directives — define context (@React, @Legal, @Scientific)
  • # Tokens — define labels (#urgent, #primary, #confidential)
  • -> => Relations — define flows and actions

The protocol was designed for code but the problem it
solves exists in every industry that uses AI.

Links

Would love to hear what the Dev.to community thinks —
especially if you've felt this same frustration with
long prompts to AI.

Top comments (0)