prongs
GitHub

Start here

Introduction

Prongs is the intent layer between your agents and your codebase: an open spec, a framework that implements it, and presets for UI, errors and logs that you and your agents extend. Code says what something is for; your registry decides what that resolves to; a checker keeps the two honest.

Read https://www.prongs.dev/docs/introduction.md and help me apply it to my app.

What Prongs does

Prongs is how your codebase says what things are for. Its components, helpers and registry are copied into your repo, so you can change any of them, and every place that uses an intent follows the change.

You own the code. prongs add writes the components, helpers and registry into your project. The framework packages do the checking and the tooling; everything you change lives in your repo.

Every call site names its purpose. A button says action.delete, an error says conflict.duplicate. The registry decides how it looks and what it returns.

Mistakes are caught. prongs check flags code that goes around the registry, and prongs validate checks the registry itself, in CI.

Agents read the vocabulary first. prongs spec --agents --skill writes PRONGS.md, an agent block and a Claude Code skill from your registry. prongs info reports the setup in one answer.

The problem

Every codebase is full of small decisions that should be made once: how a destructive button looks, which status a taken username gets, what an audit log line holds. Written by hand, each call site makes them again, and they drift. The same caption ends up styled sixteen ways, a database error reaches the browser as a 400, and a failure is caught and never recorded.

Coding agents make this worse. They are not careless; they are guessing. Given a blank JSX tag or a failed query, an agent has to work out the convention from whatever code it can find. A style guide or a long AGENTS.md is advice the agent may follow, and nothing tells it when it has missed.

Intents name what things are for

Intents are to your codebase what status codes are to HTTP. A 404 means the same thing in every API, so nobody decides it again for each endpoint. An intent is that kind of agreed word for the rest of your code. The call site says what something is for and nothing more.

TSX
<Action intent="action.delete" onClick={removeProject}>Delete project</Action>

return fail('conflict.duplicate', 'That handle is already taken.');

log('audit.created', 'Account created', { userId: user.id });

Each intent is defined once, in a registry in your repo, which decides what it resolves to. action.delete becomes a <button> with the destructive look; conflict.duplicate becomes a 409 with that message and code; audit.created becomes a log line at the right level in one known shape. The agent answers one question it can answer from the code, “what is this for?”, and the registry handles the rest.

The spec, the framework and the presets

The spec. The Prongs Intent Spec is an open format. It defines what an intent is, how a registry resolves one, and how it is exported and checked. Any tool or language can read a registry, and anyone can write a profile for one.

The framework. @prongsjs/core implements the spec for TypeScript. Intent ids are literal types, so a typo fails tsc. The check engine ships with it, and the prongs CLI writes PRONGS.md, installs agent hooks and runs prongs check.

The presets. Three profiles ship with starter intents: UI says what an element is for, errors says what went wrong and what the caller is told, and logs says what happened and who needs to know. They are a starting point, copied into your repo. You extend them.

Your registry decides what each intent means

The registry is your code. Change what an intent maps to, and every call site follows. Restyle control.primary and every action built on it changes. Point status.internal somewhere else and every 500 does too. When no intent fits, you or your agent add one, with a description and “not for… use instead” links to its neighbours:

Terminal
npx prongs add-intent action.archive --refs control.secondary \
--description "Moves something out of view without deleting it"

prongs check --suggest finds the intents your code is missing. It groups the overrides and styled elements that repeat across files, ranks them, and gives the command to add each one. The vocabulary grows from the code you have, not from a style guide nobody reads.

Each intent is named, typed and checked

Named. Every intent has a description, the words code uses for it, and its neighbours. prongs spec compiles them into PRONGS.md, the index an agent reads before it writes code. Running prongs spec --check in CI fails the build when PRONGS.md falls out of step with the registry.

Typed. An unknown intent, an intent from the wrong domain, or a look intent used at a call site fails tsc.

Checked. prongs check finds code that goes around the registry: styled raw elements, hand-written error responses, a database error sent to the caller, and stray console calls. Installed as an agent hook, it runs after every edit and names the intent to use while the code is still in front of the agent.

What Prongs is not

Prongs is not a component library with a fixed look, a CSS framework, or a logging library. Tailwind still does the styling, and your logger still writes the lines. Prongs decides where those choices are made: once, by name, in the registry.