prongs
GitHub

Concepts

Naming intents

The names are the product. A good intent can be chosen from facts in the code, without judging how anything should look.

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

The test

Ask: could someone pick this intent by reading the code and the content alone? “This handler shares the article” points to action.share. “This should be a secondary pill” is a visual judgement, and visual judgements are exactly what drift. Name meaning intents for what the element is or does. Put every look decision in the look layer.

Look words are rejected

The UI profile refuses meaning intents whose names describe a look or a widget: words like primary, ghost, muted, bold, small, compact, hero, card, chip, pill, tab, button, row, stack, grid, centered and colour names. Look intents (control.pill, arrange.grid) may use any words. The list is configurable.

Instead of action.primaryaction.submit, action.start, action.delete
Instead of layout.showcaselayout.collection (equal items in a grid)
Instead of layout.stack, layout.rowlayout.group, layout.actions
Instead of nav.tabnav.view (switches which view you see)
Instead of choice.chipchoice.option, choice.filter
Instead of heading.heroheading.pitch (the persuasive headline)

Neighbours must contrast

In any domain with more than two intents, each one needs a “not for… use instead” link to or from a sibling. Otherwise the registry warns. text.caption says it is not for a few words that name a value (text.label), nor for dates and counts (text.meta). Those links are what an agent reads when two intents look close, and they are what each intent’s page shows.

Split an intent only when it looks or behaves differently

Edit, duplicate, move and archive look and behave the same, so the starter has one action.command for them and the verb goes in the verb prop, which analytics reports. Fewer intents means fewer close calls for an agent: in our tests, a starter of about 90 intents covered as much real UI as one of 170, and agents agreed on the same intent just as often.

Give a verb its own intent when you want to restyle or measure every use of it on its own. Feedspace’s registry adds action.follow, action.subscribe, action.bookmark and action.clap (they are not among the starter intents): each has its own look and its own number on the dashboard, and the names match the handlers (toggleFollow, toggleSave).

Keywords make the match checkable. When an action’s handler, label or text points to another intent, check says so:

app/projects.tsx:42:9  warning  name-mismatch  The code says "archive project", which points to
  action.command, not action.delete.
    → <Action intent="action.command">: Does something and stays on the page: edit, add, remove, retry, share…

Variants are structural

A third part is for a structural difference, never a restyle or a state: names you might add like nav.step.done (a completed step) and action.open.item (the whole row is the link). If you want a variant only because something should look different, the intent is missing a meaning. Name that instead.