Skip to content

Business-as-Code

A business is a definition plus a loop that keeps the running business true to it, carried by five pillars from the model to composition.

A business is a definition plus a loop that keeps the running business true to it. You write what it sells, to whom and who does the work, and the loop keeps the business matching.

Five pillars

PillarWhat it isReference
The modelOne definition of the business, and one view of where it stands nowNouns, Verbs, Dashboard
The loopEach week, the gap between the view and the Goal sets the next testWeekly test
AuthorityOne chain of Permissions, Limits and Mandates that only narrowsMandates and limits
Rehearsal and changeEvery move is tried first, then merged as a new VersionChange
CompositionThe business is assembled from inherited partsStartup Template

A product is one part of a business. Around it sit a site, a domain, payments, tax, support, contracts, books and the people who run them. Here one definition holds all of it, and an agent can read it whole.

The model: one definition, one view

Your whole business is one definition. Edit it and the Site, the API, the agents' instructions and the books follow.

Nouns are the records a business keeps, and Verbs are what can be done to them. Every Verb leaves an Event, the record that it happened.

Products are what you sell, through Offers. Agents do the work, each in a Role. Workflows move the work, and Systems are the software it moves through.

The root is the Founding Hypothesis: everything the Startup says, sells and measures compiles from it. The definition says what the business should be. The view says what it is now: a Dashboard of any scope, from one Role to the whole Startup, compiled from the same records.

A founder on startups.new says "charge $29 a month". A developer adds offers/pro.mdx. Both write the same Offer, served by one API, SDK, CLI and MCP server.

The loop: close the gap every week

Each turn reads the view, ranks the gap between it and the Minimum Success Criteria, and works the top of the list. The weekly test ranks the five slots of the Founding Hypothesis and runs one Experiment on the weakest.

Inside the week, the view ranks what waits on its reader: Approvals, Actions in a delay window and Tasks, nearest close first. Every run ends in Evidence and a Decision. Experimentation shows the loop each run carries.

Authority: one chain that only narrows

A Permission says what a Role may do, a Limit how much, and a Mandate for whom and until when. Limits inherit, and a Role only tightens what its Startup allows.

Every Action records who acted, for whom and under which Mandate. A call over its Limit never fails: it waits pending for an Approval, a person's answer on that one Action.

Autonomy climbs per Verb on evidence, through three rungs: assist, supervised and full. Autonomy levels shows what each rung lets an agent do.

Rehearsal and change: try it, then merge it

Every edit lands first as a Change, previewed on its own branch. Checks run on the preview, and a merged Change becomes a new Version of the business. The previous Version stays, so a bad edit is one revert away.

A move is rehearsed before it is real. A try call runs and stores nothing, and the test environment runs the whole business with simulated payments, ad spend and filings. Test and live explains the two environments.

An Order keeps the Version of the Offer it bought, so a price Change never rewrites a past sale.

Composition: build from parts

startup.ts names the business and the Startup Template it extends. The template brings Products, Offers, Teams, Roles, Processes and Systems. A file exists only where the business differs from it.

startup.ts
import { Startup } from 'startup-builder'

export default Startup({
  name: 'Leaseline',
  domain: 'leaseline.app',
  extends: 'solo-saas',
  story: 'Leaseline tracks lease renewals for small property managers.',
  signup: 'magicLink',
  trial: 'card-free',
})
  1. 4The Startup: one business, with its own Products, Customers and P&L. →
  2. 5Its Site, app, API and email live at this domain. →
  3. 6The Solo SaaS Template brings Products, Offers, Teams, Roles, Processes and Systems. A file exists only where Leaseline differs. →
  4. 7What it does, in one sentence. The Brand, the Site and every agent start from it. →
  5. 8–9Settings: how customers sign up and try it. Every other Setting is inherited. →
  • leaseline/
  • startup.ts
  • nouns/Lease.mdxa Noun: its fields, Verbs and states
  • nouns/Lease.renew.tsthe Function behind Lease.renew
  • products/offers/ what you sell
  • agents/Teams, Roles and who fills each
  • workflows/Processes and their Workflows
  • systems/edits to the Systems you inherit

Leaseline, built on the Solo SaaS template, runs from seven files and inherits the rest. Parts compose below the template too: a Noun inherits another's properties, and a Thing can be several Nouns at once.

Builders compile the parts into a running business. Each Verb compiles to an API route, an SDK method, a CLI command and an MCP tool, all named Noun.verb. Your agent and your code call the same thing.

Next

Part 1 of six chapters on how the business works. How products work is next: what you sell, and how it is priced. For each pillar in code, read the Startup as code.