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
npx --yes github:byronwade/Design resolve --request "rebuild the hero"

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.