Skip to content
Habitus Design

https://github.com/ui8kit/saas-design

Instructions

Guides for building a new app or brand with this repo: setup, tokens, blocks and codegen, the Figma parser, checks and deploy. Each link opens the document on GitHub.

Getting started

  • README

    What the repo builds, the pipeline diagram, prerequisites, quickstart and how to run the three apps.

    README.md

  • Learn, in order

    Ten short lessons from tokens to deploy, each linking the real files.

    docs/learn/README.md

  • New brand

    Clone → rename and recolour in fixtures/site.config.json and mapping.json → bun run regen → green check.

    docs/new-brand.md

  • Agent guide

    Golden rules, pipeline order, how to read common requests and the definition of done.

    AGENTS.md

  • Architecture

    Layers, data flow and why the adapter layer exists.

    docs/architecture.md

  • Command manual

    Short command-by-command manual, setup to deploy.

    .manual/README.md

  • Contributing

    Commit rules and how to propose a change.

    CONTRIBUTING.md

Tokens & theming

  • Tokens

    Where colors, radius and type come from; package tokens vs app brand tokens.

    docs/learn/01-tokens.md

  • Design settings

    Corners, spacing rhythm, media and control sizes, with the Figma measurements.

    docs/design-settings.md

  • Tokens and brand-os

    Commands: mapping.json → theme.css, brand.css and the brand-os bundle.

    .manual/03-tokens-brand-os.md

  • Token rule

    Token colors only in packages; brand colors only at app level.

    .cursor/rules/tokens.mdc

  • Radius rule

    Outer 40px brand radius, one fixed md token inside, 8px preview frame.

    .cursor/rules/radius.mdc

  • Dark mode rule

    How the dark theme is defined and switched.

    .cursor/rules/dark-mode.mdc

Blocks & codegen

  • Primitives

    codegen 2.0 bricks, recipe overrides and the generated templ, Svelte and React components.

    docs/learn/03-primitives.md

  • Retag

    Why apps and blocks never write raw HTML tags, and the lint that checks it.

    docs/learn/04-retag.md

  • Blocks

    The block DSL and how one def becomes three runtimes.

    docs/learn/05-blocks.md

  • Adapter

    Semantic ui-* classes and @apply.

    docs/learn/07-adapter.md

  • Runtimes

    The three apps and DOM parity between them.

    docs/learn/08-runtimes.md

  • Add a runtime

    Adding Vue, Solid or a server template language, following how React was added.

    docs/add-a-runtime.md

  • Blocks and retag rule

    Block as the only landmark unit, retagged by meaning; no raw tags.

    .cursor/rules/blocks-retag.mdc

Figma parser

  • Figma parser

    fig2design: the dump schema (frames, images, variables) and which scripts read it.

    docs/figma-parser.md

  • Replicate with a new Figma file

    Extract another .fig with fig2design, map its palette, frames and texts, then measure drift.

    docs/replicate-with-new-figma.md

  • Contract and fixtures

    Figma dump → contract records → view models; why copy never lives in components.

    docs/learn/06-contract-fixtures.md

  • Extract a Figma file

    Commands to run the fig2design parser on a .fig kept outside the repo.

    .manual/01-extract-figma.md

  • Figma-to-site skill

    The agent workflow from .fig to deployed apps.

    .cursor/skills/figma-to-site/SKILL.md

  • Figma blocks source

    The ten blocks rebuilt from the Figma frame, as block DSL.

    packages/blocks/defs/figma.ts

  • Figma content mapping

    Reads the parsed frame by node id and image hash and writes the contract records.

    tools/content.ts

Checks & policy

  • Checks lesson

    What bun run check runs and how to read a failure.

    docs/learn/09-checks.md

  • All checks

    Every check, what it verifies and how to fix it.

    docs/checks.md

  • The 8+4 grid

    Layout and control rhythm, and how ui8px enforces both.

    docs/learn/02-grid-8-4.md

  • Grid rule

    Allowed spacing steps per scope and how new utilities are reviewed.

    .cursor/rules/grid-8-4.mdc

  • Troubleshooting

    Known gaps and their fixes, linked to the backlog.

    docs/troubleshooting.md

  • Backlog format

    How tool problems and deliberate deviations are logged.

    .project/backlog/README.md

Deploy

  • Deploy lesson

    The three Vercel projects in short.

    docs/learn/10-deploy.md

  • Deploy to Vercel

    Three Vercel projects from one repo: root directories, install and build commands.

    docs/deploy-vercel.md

  • Deploy commands

    Terse deploy manual.

    .manual/08-deploy-vercel.md

  • Git workflow rule

    Small verified commits, normal push, no force or amend.

    .cursor/rules/git-workflow.mdc