{
  "name": "The kit standard",
  "version": 1,
  "status": "draft",
  "statusSays": "Draft for Scott's sign-off. Not a rule yet: no project follows it until Scott signs it.",
  "updated": "2026-11-28",
  "oneLine": "Every app is built only from its kit, the kit follows ten shared laws, and checks catch drift before anything ships.",
  "idea": {
    "says": "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.",
    "picture": "SHARED LAWS     the same 10 laws for every project       changes only on Scott's yes\n     |\nPROJECT KIT     each project's own look, built under the laws\n     |-- rules      the project's own rules, each under a law, each with a check\n     |-- values     every colour, size, space and corner, once\n     |-- parts      buttons, rows, menus... built only from values, in every state\n     '-- patterns   how things act, and how parts make screens\n     |\nSCREENS         only place parts and call patterns. Nothing of their own.\n     ^\nCHECKS          look at the code AND the drawn screen on every release,\n                and send every gap back up to the kit"
  },
  "laws": [
    { "id": "source", "name": "One source for everything", "says": "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." },
    { "id": "assemble", "name": "Screens only assemble", "says": "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." },
    { "id": "root", "name": "Fix at the root, never patch", "says": "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." },
    { "id": "few", "name": "Few choices", "says": "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." },
    { "id": "one-part", "name": "One part per job, one engine per behaviour", "says": "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." },
    { "id": "states", "name": "Every part, every state", "says": "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." },
    { "id": "everyone", "name": "Everyone can read and reach it", "says": "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." },
    { "id": "calm", "name": "Calm and plain", "says": "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." },
    { "id": "checked", "name": "No rule without a check", "says": "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." },
    { "id": "down", "name": "Mess only goes down", "says": "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." }
  ],
  "parts": [
    { "id": "foundations", "name": "Foundations", "short": "the why", "what": "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.", "house": "The design ideas", "apple": "Human Interface Guidelines: clarity, focus on the content, a clear sense of depth.", "done": "The 10 laws, plus the project's own principles, each named, each with a check.", "copyFrom": "Legend's laws (laws.ts), Mavan's RULES.md" },
    { "id": "values", "name": "Values", "short": "the raw materials", "what": "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.", "house": "Approved paint colours and plank sizes", "apple": "Colours named by job (label, background) that switch for dark mode, and text styles (Body, Headline) that grow with bigger text.", "done": "One values file, named by job, on small scales, loaded first everywhere.", "copyFrom": "Mavan's tokens.css, Tilt's tilt-tokens.css, Legend's tokens.css" },
    { "id": "parts", "name": "Parts", "short": "the building blocks", "what": "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.", "house": "Standard doors and windows", "apple": "SwiftUI and UIKit controls with every state and accessibility built in; SF Symbols icons that match the text.", "done": "One part per job, each with its list of required states.", "copyFrom": "Mavan's jobs.json and states.json" },
    { "id": "patterns", "name": "Patterns", "short": "how blocks combine and behave", "what": "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.", "house": "Floor plans", "apple": "Navigation, sheets, lists and split views that every app shares.", "done": "Behaviours as shared modules; named page layouts.", "copyFrom": "Legend's patterns folder, Kit2's page layouts" },
    { "id": "rules", "name": "Rules", "short": "written once", "what": "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.\"", "house": "The building code", "apple": "The guidelines' rules for every kind of control and screen.", "done": "One rules file; each rule names its law and its check.", "copyFrom": "Legend's rules.ts" },
    { "id": "checks", "name": "Checks", "short": "the inspector", "what": "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.", "house": "A building inspector who won't sign off", "apple": "Mostly built into the system itself: use their parts and many mistakes simply can't happen.", "done": "Code checks, drawn-screen checks and planted traps, all inside the release step.", "copyFrom": "Mavan's release checks, Kit2's trap page, John's budget check" },
    { "id": "kit-page", "name": "Kit page", "short": "the showroom", "what": "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.", "house": "A showroom of every door and window", "apple": "Official design files, so designers draw with exactly what developers build.", "done": "Every part in every state, live, plus point-and-trace.", "copyFrom": "Mavan's Kit page and its trace" },
    { "id": "way-in", "name": "The way in", "short": "how new things get added", "what": "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.", "house": "How a new kind of window is approved before it's installed", "apple": "New controls ship in the system first, then every app gets them.", "done": "Need → reuse a part? → try it → check it → kit part → screens use it.", "copyFrom": "Mavan's Playground" },
    { "id": "history", "name": "History", "short": "the kit's diary", "what": "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.\"", "house": "The record of every change to the plans", "apple": "Release notes for every design and system update.", "done": "A kit changelog: what, when, why, in Scott's words.", "copyFrom": "Kit2's upgrade log" },
    { "id": "ownership", "name": "Ownership", "short": "who may change the kit", "what": "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.", "house": "Only the architect changes the plans", "apple": "Apple alone changes the system parts; apps use them.", "done": "Kit changes only via the way in, own commit, diary line; locked values need Scott's words.", "copyFrom": "Mavan's locked feel values (nobody has the full version yet)" }
  ],
  "loop": {
    "kitToApp": [
      "Change a value or a part once, in the kit.",
      "Every screen gets it on its next load. Screens hold no copies.",
      "The release runs every check. A failing check stops it.",
      "It ships."
    ],
    "appToKit": [
      "A need or a flaw shows up: a new feature, Scott's eye, a stress test, a check.",
      "Is there a part for this job already? Use it.",
      "If not, name the law it falls under and try the new part in a playground.",
      "Check it: every state, every theme, phone and desktop, by picture.",
      "It becomes a kit part with its rule and check. Then screens use it.",
      "One line in the kit diary.",
      "Something every project should follow? Add one line to Suggestions. Never edit the shared laws."
    ]
  },
  "howWeWork": [
    { "step": "Check the version first", "says": "Read the project's Kit map. If its kit standard version is older than this one, catching up is the first job." },
    { "step": "Build only from the kit", "says": "Need something new? It goes into the kit first, then onto the screen." },
    { "step": "Leave it cleaner", "says": "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." },
    { "step": "Run every check, then ship", "says": "A failing check means you're not done. Passing means ship it: finished work ships." },
    { "step": "Suggest, never edit the laws", "says": "A rule every project should follow goes in Suggestions. Scott decides on Sunday." }
  ],
  "alive": [
    { "name": "Suggestions", "says": "Projects add one line each: the rule, why, and its check. They never edit the laws." },
    { "name": "Sunday review", "says": "Scott accepts or rejects each suggestion. Accepted ones become the next version, with a dated line in the History." },
    { "name": "Version stamp", "says": "Each project's rules say which version it follows. Behind means catching up is the first job." },
    { "name": "Scoreboard", "says": "Every project's score on the 10 parts and its mess counts, each with when it was measured." }
  ],
  "decisions": [
    { "ask": "Where should the signed standard live?", "pick": "Here, in this app (Projects/dna), with one line in the shared rules pointing to it.", "why": "One home that people and agents both read." },
    { "ask": "How many text sizes, at most?", "pick": "8", "why": "Legend uses 5, Kit2 7, John 8. Eight lets every project fit without losing the limit." },
    { "ask": "What is Kit2 for?", "pick": "The shared showroom and playground where new parts are tried, not a kit every project must load.", "why": "Each project keeps its own look; Kit2 proves ideas first." }
  ],
  "apple": [
    { "name": "Human Interface Guidelines", "part": "foundations", "says": "The big principles and the do's and don'ts for every kind of screen." },
    { "name": "San Francisco text styles", "part": "values", "says": "You pick Body or Headline, not 17 points, and the size grows when someone turns on bigger text." },
    { "name": "Colours named by job", "part": "values", "says": "\"label\" and \"background\", not black and white, and they switch for dark mode and high contrast on their own." },
    { "name": "SF Symbols", "part": "parts", "says": "Thousands of icons drawn to sit beside text and match its weight." },
    { "name": "SwiftUI and UIKit", "part": "parts", "says": "Ready-made buttons, lists, menus and sheets, with every state and accessibility built in." },
    { "name": "Materials and Liquid Glass", "part": "values", "says": "The layered glass look, made into one shared material in 2025." },
    { "name": "Built-in accessibility", "part": "checks", "says": "VoiceOver, bigger text, reduced motion and contrast come with every part." },
    { "name": "Design files", "part": "kit-page", "says": "Official templates, so designers draw with exactly what developers build." }
  ],
  "frontier": {
    "now": [
      { "name": "Values in one shared format", "says": "Big systems like Google's Material, Shopify's Polaris, GitHub's Primer and IBM's Carbon keep values in one file and generate the copies for web, iPhone and Android." },
      { "name": "Design and code linked", "says": "A designer's file connects to the real code part, so the two can't drift." },
      { "name": "Picture checks on every change", "says": "Every part is photographed in every state, and any pixel that moved is flagged before release." },
      { "name": "Rules enforced by code", "says": "A check fails any save that uses a raw colour or size." },
      { "name": "Kits AI can read", "says": "AI tools plug straight into the kit, so they build from real parts instead of inventing new ones." }
    ],
    "next": [
      { "name": "The kit is what AI builds from", "says": "Describe a screen; AI assembles it only from kit parts, checks it against the laws and shows you a picture." },
      { "name": "The kit heals itself", "says": "It spots near-twins, like two almost-identical greys, and suggests merging them. Say yes and every screen updates." },
      { "name": "Screens built on the fly", "says": "Apps assemble screens for each person from the kit. Only a strict kit makes that safe." },
      { "name": "One kit everywhere", "says": "The same values and parts drive the website, the Mac app and the phone app." }
    ]
  },
  "example": {
    "name": "Tiny Notes",
    "says": "A pretend app, to show the whole shape. Each file has one job, matching one of the 10 parts.",
    "tree": "ScottAI/Projects/dna/                 the shared laws live here (this app)\n\nProjects/tiny-notes/\n|-- AGENTS.md         Kit map + \"Kit standard: v1\"   (ownership)\n|-- kit/\n|   |-- RULES.md      principles and rules            (foundations, rules)\n|   |-- values.css    every colour, size, space        (values)\n|   |-- parts/        button.js, row.js               (parts)\n|   |-- patterns/     list-and-detail.js, undo.js      (patterns)\n|   |-- checks/       check.mjs, counts.json           (checks)\n|   |-- kit-page.html the showroom                     (kit page)\n|   |-- playground/   new parts are tried here         (the way in)\n|   '-- CHANGELOG.md  the kit's diary                  (history)\n'-- screens/\n    '-- notes.js      only places parts",
    "files": [
      { "path": "AGENTS.md (top)", "part": "ownership", "says": "A chat opening the project knows where everything is, and who may change the kit.", "code": "## Kit map: Kit standard v1\nRules: kit/RULES.md   Values: kit/values.css   Parts: kit/parts/\nPatterns: kit/patterns/   Checks: kit/checks/ (every release)\nKit page: /kit   Try new parts: kit/playground/   Diary: kit/CHANGELOG.md\nWho changes the kit: any AI, only through the playground,\n  in its own save, with a diary line.\nLocked (only Scott changes): the accent colour." },
      { "path": "kit/RULES.md", "part": "rules", "says": "This app's own rules, each under a law, each with its check.", "code": "- Note titles never wrap past two lines.   law: few        check: title-lines\n- Delete happens at once, with Undo.       law: calm       check: no-confirm\n- Words on the accent are readable.        law: everyone   check: contrast" },
      { "path": "kit/values.css", "part": "values", "says": "Every number, once, named by its job.", "code": ":root {\n  --text-main: #1d1d1f;     --text-quiet: #6e6e73;\n  --fill-accent: #2f7cf6;   --on-accent: #ffffff;\n  --size-body: 16px;        --size-title: 22px;\n  --space-row: 12px;        --space-card: 16px;\n  --corner-control: 8px;    --speed-press: 120ms;\n}" },
      { "path": "kit/parts/button.js", "part": "parts", "says": "The one button. Built only from values, with every state.", "code": "// The one button. Every button in the app is this.\n// States: hover (mouse only), pressed, focus, off, loading.\nexport function button({ label, onPress, main = false, off = false }) { ... }" },
      { "path": "kit/patterns/undo.js", "part": "patterns", "says": "One behaviour, written once.", "code": "// The one Undo. Every change in the app goes through it.\nexport function undoable(change) { ... }" },
      { "path": "screens/notes.js", "part": "screens", "says": "Only places parts and calls patterns.", "code": "list(notes, note => row({ title: note.title }))\nbutton({ label: \"New note\", main: true, onPress: () => undoable(addNote) })\n\n// Not allowed here: style=\"color:#333\", padding: 13px, a second home-made button." },
      { "path": "kit/checks/", "part": "checks", "says": "Run before every release. Mess counts may only go down.", "code": "check.mjs looks for:\n  raw colours or sizes outside values.css   must be 0\n  styles written inside screens              must be 0\n  two parts doing the same job               must be 0\n  words on colours that are hard to read     must be 0\n  every rule has a real check                must be true\n\ncounts.json  { \"patches\": 3, \"missing-states\": 12 }   (3 can go to 2, never back to 4)" },
      { "path": "/kit (in the app)", "part": "kit-page", "says": "The showroom.", "code": "Button:  [normal] [pointed at] [pressed] [off] [loading]\nRow:     [normal] [selected] [empty list] [error]\nValues:  every colour and size, with its name\nHold Option and point at anything: \"button · --fill-accent · law: everyone\"" },
      { "path": "kit/CHANGELOG.md", "part": "history", "says": "The kit's diary.", "code": "Nov 30  Added \"danger button\" (red, for Delete). Tried in the playground,\n        approved by picture. law: one-part\nNov 29  Corners cut from 5 sizes to 3. Scott: \"too many near-twins.\"" }
    ],
    "walkthrough": [
      "Tiny Notes needs a red Delete button. The chat checks the kit: is there a danger button? No.",
      "It adds a fill-danger value, then builds the button in the playground, using only values.",
      "It checks every state in light and dark, phone and desktop, by picture.",
      "The button joins the kit's parts with a rule and a check, and shows up on the Kit page.",
      "The screen uses it: button({ label: \"Delete\", danger: true }).",
      "One line goes in the diary. The checks pass, and it ships.",
      "Had the chat typed color: red on the screen instead, the check would have failed and stopped the release."
    ]
  }
}
