Skip to main contentSkip to search
designcontracts.sh

Docs

Turn any public website into an installable Design Contract — tokens, layout DNA, a semantic graph, and agent-ready guidance.

Quick start

  1. Open Chat and paste a public URL.
  2. Scan gathers tokens via tools and shows an inline Design Contract — Open loads the saved results (no second scan).
  3. Download the pack and install it with the Design CLI.
npx --yes github:byronwade/Design init --profile web-marketing --app-type marketing-site
npx --yes github:byronwade/Design resolve --request "rebuild the hero"

Enforce with the engine

Installed packs are upheld by the Design engine. Init with a profile plus one of four app types — saas-workbench, admin-console, content-studio, or marketing-site — then run the loop:

npx --yes github:byronwade/Design init --profile web-app --app-type saas-workbench
npx --yes github:byronwade/Design resolve --request "rebuild the hero"
# build the change with the resolved semantic tokens
npx --yes github:byronwade/Design check
npx --yes github:byronwade/Design verify --mode release

verify --mode release emits receipts. Scans also seed .design/receipts/contextds-drift.json — observation-only drift evidence that never rewrites DESIGN.md.

HTTP API

POST /api/scan

Extract tokens, layout DNA, semantic graph, and a Design Contract pack.

{ "url": "https://stripe.com", "mode": "accurate" }

GET /api/contracts/download?domain=stripe.com

Download the installable contract ZIP for the latest scan.

GET /api/scan/export-llm?domain=stripe.com

LLM-friendly JSON (or ?format=markdown) from the serverless store.

Chat agent

Chat uses the Vercel AI SDK + AI Gateway (`ToolLoopAgent`) with tools scan_site, get_tokens, resolve_graph, and get_contract_download.

POST /api/agent/chat
{ "messages": [ /* UIMessage[] from useChat */ ] }

# .env.local
AI_GATEWAY_API_KEY=...
SCANNER_SERVICE_URL=https://designcontracts-scanner.vercel.app

Accurate scans

When SCANNER_SERVICE_URL is set, chat defaults to accurate browser capture via the Vercel Chromium scanner.