Skip to content

The Startup as code

A Startup is a definition plus a loop that keeps it true, built on five pillars from the model to composition, each a set of files and calls.

Read as
GuideSpec

A Startup is a definition plus a loop that keeps the running business true to it. Each of the five pillars below is a set of files, records and calls.

The model: Nouns, Verbs and Events

A Noun is a type of record: its properties, its Relationships, and the Verbs that act on it. A Thing is one instance, with a stable id, a current state, and the properties of its Nouns.

Take a Startup that sells lesson booking to independent music teachers. It declares a Lesson Noun in nouns/Lesson.mdx, with a student, a startsAt and a status. Every lesson a teacher books is a Thing at an address such as https://api.sb/lessons.example/lessons/lsn_42.

A Verb is what can be done to a Noun. Each Verb has six forms, and every Interface uses the same six:

NameExampleWhere it appears
verbbooksProse: a parent books a Lesson.
actionbookThe call: Lesson.book.
activitybookingThe state while the Action runs.
eventbookedThe Event: Lesson.booked.
reversebookedByThe record read backward: who booked it.
inversecancelThe Verb that undoes it.

An Action is one Verb performed by a Worker on a Thing. An Event is the immutable record of what happened, such as Lesson.booked. Actions change; Events never do.

State is computed from Events, never set by hand. The view of any scope reads the same records, addressed by a view address and rendered by a Dashboard as Markdown, screens or JSON.

The loop: Goals, Experiments and Decisions

A Goal holds Key Results read live from Metrics, and every Startup holds one: its Minimum Success Criteria. The weekly test ranks the gap and runs one Experiment on the weakest slot of the Founding Hypothesis.

A file in experiments/ is one Experiment: the Hypothesis, the value it varies, and the Metrics that pick the winner. Each measured Process names the Setting, budget or Limit its reading moves, as actuating loops shows.

Every run ends in Evidence and a Decision. The experiment guide takes one from a file to a Decision.

Authority: Permissions, Limits and Mandates

Every Action records who acted (by), for whom (for), and under which Mandate. A Role file declares its contract in agents/: its limits, its mandates, and its autonomy rung, assist, supervised or full, per decision class.

Every Limit is checked before the call runs. A call over its Limit does not fail: it returns a pending Action with reason awaitingAction, held by an Approval. Approved, it runs; refused, it ends refused; unanswered by its deadline, it ends canceled.

Limits inherit, and a child only tightens. Mandates and limits lists where each one lives.

Rehearsal and change: Modes, Changes and Versions

A call picks its Mode. try runs and stores nothing, send returns a pending Action at once, and do waits for the result, as Modes shows. The test environment runs the same definition with simulated payments, ad spend and filings, as test and live explains.

Nobody edits a live definition in place. Every edit is a Change: writes previewed on a branch, checked, approved where a Limit requires it, and merged as one unit. No author approves their own Change.

Each merge produces a new Version at a fingerprint. An Order keeps the Version of the Offer it bought, so a price Change never rewrites a past sale. Ship my changes takes a Change from review to the live address.

Composition: inheritance and projection

A Startup Template is a definition other Startups extend, overriding only what differs. The root of the catalog carries Teams, Systems, Processes and Offers. The lesson-booking Startup declares its Lesson Noun and its Offers, and inherits the rest.

A Startup pins the Version it extends. When the Startup Template improves, the upgrade arrives as a Change the Startup reviews, never as a silent rewrite.

Below the template, a Noun inherits another's properties, and a Thing can be several Nouns at once. A Dataset served through an API is also Software, with the properties of both. Each Verb projects to an API route, an SDK method, a CLI command, an MCP call and an Event, all named Noun.verb:

Order.placeMode do
You, to your agent

Place the latest order with an offer.

curl -X POST https://api.sb/ledgerlark.com/orders/place \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"offer":"offer_1"}'
import { $ } from 'startup-builder'

const order = await $.Order.place({ offer: 'offer_1' })
npx startup-builder do Order.place --json '{"offer":"offer_1"}'
{
  "name": "do",
  "arguments": {
    "code": "return await $.Order.place({ offer: 'offer_1' })"
  }
}

One write adds a Verb's endpoint, SDK method, agent tool, App button and reference row.

Next

What happens on every call follows one Action from the call to its last Event. Business-as-Code states the five pillars for founders.