# Extract

Domain-to-theme extraction: point it at a public site and it writes a DESIGN.md plus deterministic Poetry tokens, ready for the AA-gated importer.

Domain in, theme out: `bin/rails "poetry:design:extract[stripe.com]"` writes `DESIGN.md` (YAML frontmatter tokens over a Markdown body), `theme.tailwind.css` (a complete Tailwind v4 stylesheet), and `tokens.css` (plain `:root`/`.dark` custom properties) under `tmp/poetry/design_extract/<domain>/`, all in Poetry's token vocabulary. Fetch rides context.dev (`CONTEXT_DEV_API_KEY`; without a key it degrades to a homepage-only fetch), one Claude call composes the DESIGN.md (`ANTHROPIC_API_KEY`; `POETRY_EXTRACT_MODEL` overrides the model), and the token stylesheets are derived deterministically from the fetched styleguide and brand - same inputs, same bytes, no model output in them. Nothing touches your theme: the printed `bin/rails "poetry:design:import[...]"` runs Poetry's existing importer, which drops any swatch failing WCAG AA.
