# The kit standard · v1 (DRAFT, not a rule yet)

Updated 2026-11-28. Live: https://dna.scottelling.com · Data: /standard.json · Made from Projects/dna/standard/standard.json by scripts/build.mjs. Don't edit this file.

Every app is built only from its kit, the kit follows ten shared laws, and checks catch drift before anything ships.

Draft for Scott's sign-off. Not a rule yet: no project follows it until Scott signs it.

## The idea

Think of building a house. The laws are the building code every house follows. Each project's kit is its own catalogue of approved materials and pieces. Screens are the rooms, built only from that catalogue. Checks are the inspector who won't sign off on anything that isn't from it.

```text
SHARED LAWS     the same 10 laws for every project       changes only on Scott's yes
     |
PROJECT KIT     each project's own look, built under the laws
     |-- rules      the project's own rules, each under a law, each with a check
     |-- values     every colour, size, space and corner, once
     |-- parts      buttons, rows, menus... built only from values, in every state
     '-- patterns   how things act, and how parts make screens
     |
SCREENS         only place parts and call patterns. Nothing of their own.
     ^
CHECKS          look at the code AND the drawn screen on every release,
                and send every gap back up to the kit
```

## The 10 laws (every project)

1. **One source for everything** (`source`). Every value, part, rule and word lives in exactly one place. Copies are made by a script, never typed.
   - Why: Two copies always drift apart. Daylight's kit and app disagree on its Work blue; John keeps its colours in four places.
   - Check: Raw values outside the values file: 0. Anything defined twice: 0.
   - Example: The card padding is written once, as card-padding. Change it there and every card changes.
2. **Screens only assemble** (`assemble`). A screen places parts and calls patterns. It writes no styles, numbers, colours, words or behaviour of its own, including inside code.
   - Why: Every one-off starts on a screen. If screens can't make things, they can't make one-offs.
   - Check: No styles, inline styles or colours in screen files, code included.
   - Example: A screen says button("Save"). It never says padding: 13px.
3. **Fix at the root, never patch** (`root`). Fix the lowest layer that caused the problem (value, then part, then pattern) and delete the special case it replaces. The kit gets simpler as it learns, not bigger.
   - Why: A patch fixes one screen and leaves the cause for the next one.
   - Check: Forced overrides, nudges and one-off rules are counted; the count only goes down.
   - Example: A row is cramped on one screen. Fix the row part's spacing, so every row is right.
4. **Few choices** (`few`). Small fixed scales, named by job: at most 8 text sizes, 3 weights, 4 corner sizes, one spacing scale, one icon line weight. A new value must replace an old one.
   - Why: Near-twins creep in one at a time: Tilt had 20 corner sizes.
   - Check: Each scale is counted on the drawn screen.
   - Example: Want a 15px corner? Use 14 or 16, or replace one of them everywhere.
5. **One part per job, one engine per behaviour** (`one-part`). No look-alikes and no "v2". Improve a part in place, so every screen gets better together.
   - Why: Two menus or two drag codes start the same and slowly behave differently.
   - Check: Parts doing the same job: 0.
   - Example: One menu builder, used by every menu in the app.
6. **Every part, every state** (`states`). Each part shows hover (mouse only), pressed, focus, chosen, off, empty, loading and error, and the Kit page shows them all.
   - Why: Missing states are where an app feels broken. No project has them all yet.
   - Check: Each part lists its states; missing ones are counted and only go down.
   - Example: The button has normal, pointed at, pressed, off and loading, side by side on the Kit page.
7. **Everyone can read and reach it** (`everyone`). Words on any fill are easy to read (4.5:1) in every theme. Colour is never the only signal. Tap areas are at least 44px. Focus is visible. Reduced motion is respected.
   - Why: Contrast breaks quietly when a colour changes.
   - Check: Contrast and tap-size checks run in every theme.
   - Example: A red Late pill also says Late, so it works for colour-blind eyes.
8. **Calm and plain** (`calm`). Buttons say what happens. One main action per area. No pop-ups and no "are you sure?": things change at once, with one Undo.
   - Why: Every extra question or pop-up slows you down and hides the next step.
   - Check: Buttons are checked for plain words; icon buttons must have names.
   - Example: Delete deletes now; Undo brings it back.
9. **No rule without a check** (`checked`). Every rule names the test that proves it. Checks look at the drawn screen, not just the code. A planted mistake proves each check works. If Scott sees a problem a check passed, fix the check first.
   - Why: A rule nobody checks gets quietly broken.
   - Check: A rule whose test is missing fails; a trap page of planted mistakes must fail.
   - Example: Legend: each of its 123 rules points at a real test.
10. **Mess only goes down** (`down`). Every kind of mess is a number that may only fall. Known-problem lists only shrink. All checks run on every release, and a failing check stops it.
   - Why: Cleaning up only sticks if it can't slide back.
   - Check: The counts file is compared on every release.
   - Example: Mavan: patches 3 can go to 2, never back to 4.

## The 10 parts of a complete kit

1. **Foundations**: the why. A short list of big beliefs about how things should look and feel.
   - Role: Every other decision traces back to one of these. When two choices compete, the foundations decide.
   - Example: "Calm and plain: one main button per screen, no pop-ups." That's why the Video Lab has no "Are you sure?" boxes.
   - Done looks like: The 10 laws, plus the project's own principles, each named, each with a check.
   - Copy from: Legend's laws (laws.ts), Mavan's RULES.md
2. **Values**: the raw materials. Every colour, text size, space, corner and speed, each written once with a name.
   - Role: Change one value and everything using it changes together. Nobody types a raw number on a screen.
   - Example: card-padding = 16. Make it 20 and every card in the app gets roomier at once.
   - Done looks like: One values file, named by job, on small scales, loaded first everywhere.
   - Copy from: Mavan's tokens.css, Tilt's tilt-tokens.css, Legend's tokens.css
3. **Parts**: the building blocks. Buttons, fields, rows, cards and menus, built only from values.
   - Role: Screens are made by placing parts, never by drawing their own. Each part knows all its states.
   - Example: One button part. Every Save, Send and Delete is that button, so they all press and light up the same way.
   - Done looks like: One part per job, each with its list of required states.
   - Copy from: Mavan's jobs.json and states.json
4. **Patterns**: how blocks combine and behave. Proven screen layouts and shared behaviours like drag, undo and menus.
   - Role: Nobody reinvents a layout or a behaviour. Drag works the same everywhere because there's only one drag.
   - Example: A list on the left, the chosen item open on the right. Notes, Tasks and Chats all use it.
   - Done looks like: Behaviours as shared modules; named page layouts.
   - Copy from: Legend's patterns folder, Kit2's page layouts
5. **Rules**: written once. The specific do's and don'ts, each in exactly one place.
   - Role: One answer to "how should this work?". Rules written in four places end up saying four different things.
   - Example: "Every word on a coloured fill must be easy to read in light and dark."
   - Done looks like: One rules file; each rule names its law and its check.
   - Copy from: Legend's rules.ts
6. **Checks**: the inspector. Automatic tests that run before anything goes live.
   - Role: They catch drift you'd never spot by eye, and block the release until it's fixed.
   - Example: Someone types a stray grey that isn't in the values. The check fails and names the line.
   - Done looks like: Code checks, drawn-screen checks and planted traps, all inside the release step.
   - Copy from: Mavan's release checks, Kit2's trap page, John's budget check
7. **Kit page**: the showroom. One page that shows every part in every state, live.
   - Role: You see the whole kit in one place, so gaps are obvious. At best, you point at anything in the app and see which part made it.
   - Example: Mavan's Kit page: hold the Option key and point at a button to see its part and values.
   - Done looks like: Every part in every state, live, plus point-and-trace.
   - Copy from: Mavan's Kit page and its trace
8. **The way in**: how new things get added. The path a new idea takes to join the kit.
   - Role: New things are tried, checked and added to the kit first, then used on screens. This is what stops one-offs.
   - Example: Legend needs a date picker. It's built in a playground, checked, added to the kit, then placed on the screen.
   - Done looks like: Need → reuse a part? → try it → check it → kit part → screens use it.
   - Copy from: Mavan's Playground
9. **History**: the kit's diary. What changed in the kit, when and why.
   - Role: You can see how the kit grew, undo a bad change, and know why a value is what it is.
   - Example: "Nov 29: corners cut from 5 sizes to 3. Scott: too many near-twins."
   - Done looks like: A kit changelog: what, when, why, in Scott's words.
   - Copy from: Kit2's upgrade log
10. **Ownership**: who may change the kit. The rule for who can change the kit, and how.
   - Role: Without it, any quick fix can quietly bend the kit, and drift creeps back.
   - Example: Kit changes go only through the way in, in their own save, with a diary line. Values Scott locked change only when he says so.
   - Done looks like: Kit changes only via the way in, own commit, diary line; locked values need Scott's words.
   - Copy from: Mavan's locked feel values (nobody has the full version yet)

## The loop

**Kit → app (automatic)**

1. Change a value or a part once, in the kit.
2. Every screen gets it on its next load. Screens hold no copies.
3. The release runs every check. A failing check stops it.
4. It ships.

**App → kit (one path for everyone)**

1. A need or a flaw shows up: a new feature, Scott's eye, a stress test, a check.
2. Is there a part for this job already? Use it.
3. If not, name the law it falls under and try the new part in a playground.
4. Check it: every state, every theme, phone and desktop, by picture.
5. It becomes a kit part with its rule and check. Then screens use it.
6. One line in the kit diary.
7. Something every project should follow? Add one line to Suggestions. Never edit the shared laws.

## How we work (every chat, every job)

1. **Check the version first.** Read the project's Kit map. If its kit standard version is older than this one, catching up is the first job.
2. **Build only from the kit.** Need something new? It goes into the kit first, then onto the screen.
3. **Leave it cleaner.** Touch a screen and see a patch or a one-off? Fix it at the root in the same job, so the mess count goes down.
4. **Run every check, then ship.** A failing check means you're not done. Passing means ship it: finished work ships.
5. **Suggest, never edit the laws.** A rule every project should follow goes in Suggestions. Scott decides on Sunday.

## Staying alive

- **Suggestions:** Projects add one line each: the rule, why, and its check. They never edit the laws.
- **Sunday review:** Scott accepts or rejects each suggestion. Accepted ones become the next version, with a dated line in the History.
- **Version stamp:** Each project's rules say which version it follows. Behind means catching up is the first job.
- **Scoreboard:** Every project's score on the 10 parts and its mess counts, each with when it was measured.

## The Kit map every project adds to its AGENTS.md

```text
## Kit map: Kit standard v1
Rules: kit/RULES.md   Values: kit/values.css   Parts: kit/parts/
Patterns: kit/patterns/   Checks: kit/checks/ (every release)
Kit page: /kit   Try new parts: kit/playground/   Diary: kit/CHANGELOG.md
Who changes the kit: any AI, only through the playground,
  in its own save, with a diary line.
Locked (only Scott changes): the accent colour.
```
