pages/drafts/, folder rules for Claude

You are inside the Studio (the playground for marketing drafts). The rules here are deliberately looser than production. Read this file alongside the repo-root website/CLAUDE.md.

Studio is where new patterns are born

The system explicitly wants drafts to invent. Production pages stay coherent; drafts are the R&D lab. Lean into creative remixing here.

Before scaffolding a new draft:

  1. Read the existing production pages for inspiration:

  2. Identify which patterns fit the briefing and which don’t. Then:

  3. Inventing is encouraged, not tolerated. A draft that uses 4 off-the-shelf components in a sensible way is fine; a draft that invents a fresh visual treatment which feels brand-aligned is better. That’s how the design system grows. Surface the new pattern at the end so the designer can decide whether to harvest it into a shared component.

  4. Atoms locked, compositions free. The mental model: brand atoms (fonts, palette, type scale, button geometry, gradient recipes) are the basic ingredients. Use them — always. Drafts never invent a new ingredient. Compositions (layouts, motion, interactions, scroll effects, novel visual treatments, never- built-before interactive graphics) are the recipes. Cook anything you want, as long as you only use brand ingredients.

    npm run check:brand-usage will catch hardcoded brand-palette hex, Boldonse rules without locked line-height, and gradients that bypass tokens — anywhere in the codebase, drafts included.

  5. The harvest loop applies to tokens too. A one-off value in a draft that proves useful across multiple campaigns gets harvested into tokens.css as new canonical token. That’s how the palette grows: bottom-up from real campaign needs, not top-down speculation. Surface harvest candidates explicitly.

  6. Aim for world-class. The bar isn’t “on-brand and acceptable.” It’s the calibre of Linear, Stripe, Apple, Vercel, Phantom, Arc. Drafts in Studio should aspire to that standard. World-class design routinely breaks rules to make a point. The rules just come back stronger after the experiment. Default to permissive in drafts; default to strict in production.

  7. The system invariants are NOT permissive. A.4’s wide latitude covers colours, effects, layouts, custom spacing. It does NOT cover the things that make the brand recognizable across pages:

What’s different in here

TopicProduction rule (default)Studio rule (this folder)
Layout wrapperCampaignLayout / BaseLayout directlyDraftPage preferred (auto-draft={true} + metadata banner)
New componentsForbidden, surface to designerPermitted inline within the draft file
Hardcoded URLsBanned, use @lib/linksTolerated, but still prefer registry when convenient
Hardcoded hex / pxBanned, use tokensTolerated for one-off campaign visuals; prefer tokens
npm run checkMust passMust pass (drafts are still linted; the lints just exclude some drift checks for drafts (see scripts))
Indexable by GoogleYesNo, noindex enforced by <DraftPage>
Linked from Nav / Footer / sitemapYesNo, drafts live at /drafts/<slug> only

Defaults when a user asks you to “build a campaign page”

  1. Copy _starter-template.astro as your scaffold.

    cp src/pages/drafts/_starter-template.astro src/pages/drafts/<slug>.astro

    The starter is the canonical pattern. Edit the copy + structure from there.

  2. Use <DraftPage> as the layout wrapper with metadata:

    <DraftPage
      title="Campaign name"
      briefingUrl="https://notion.so/..."
      owner="Maya"
      status="sketch"
    >
      {/* page content */}
    </DraftPage>
  3. Pull copy from src/copy/drafts/<lang>/<slug>.md if structured YAML makes sense. For very short drafts, inline copy in the .astro file is fine.

  4. Use existing canonical components when they fit: <PlanetHero>, <FeatureBlock>, <FeatureCard>, <AccordionItem>, <TierLadder>, <Button>, <Disclaimer>, <SocialProof>, etc. List in _docs/COMPONENTS.md.

  5. Invent inline if no canonical component fits. Custom CSS inside the .astro file is fine. Do NOT add new files to src/components/ from a draft session. That’s a designer decision (see “Component promotion” below).

What you can NOT do here

Where to put files (assets, images, copy, CSS)

When a draft needs new assets, follow these conventions. Don’t invent new directories; use the existing structure.

Images

TypeLocationWhy
Illustrations (PNG, SVG)src/assets/illustrations/Astro will optimise (resize, WebP/AVIF, srcset) at build time
Photossrc/assets/photos/Same, Astro optimises
Iconssrc/assets/icons/Same, Astro optimises
Logos / brand markssrc/assets/ (top-level)Same
Static assets that don’t need processingpublic/Served as-is, no Astro optimisation. Use for OG images that need exact dimensions, video files, robots.txt, etc.

Always import images via @assets/<path> and pass them to Astro’s <Image> or to a component prop, not hardcoded <img src>. That’s how you get automatic optimisation.

Naming

File size

Copy

CSS

Don’t put in drafts

When marketing asks you to “add this image”, confirm the source file exists locally, drop it into the right src/assets/ folder with a sensible slug-cased name, import it in the draft, and tell the user where you put it (so they know for next time).

Component promotion (the upgrade path)

When the same pattern appears in two or more drafts, it’s a candidate for promotion to a shared component. The signal usually looks like: marketing asks “make me one of those split-testimonial things again” and you find yourself copy-pasting from another draft.

When that happens:

  1. Tell the user the pattern is repeating.
  2. Recommend extracting to src/components/<Name>.astro.
  3. Wait for designer / explicit approval.
  4. Once approved: extract, tokenize the colours/spacings/radii, add an example to _docs/COMPONENTS.md, replace inline copies in both drafts.

This is how the design system grows organically. New patterns are born in drafts, harvested by the designer when reuse proves their value.

Promotion (drafts → production)

The promotion process lives in _docs/DRAFT-WORKFLOW.md. Quick summary:

  1. Move pages/drafts/<slug>.astropages/<slug>.astro.
  2. Replace <DraftPage> with the appropriate production layout (<CampaignLayout> or <BaseLayout>), drop draft props.
  3. Move copy/drafts/<lang>/<slug>.mdcopy/<lang>/<slug>.md.
  4. Update internal references (Nav, sitemap rules, etc. if applicable).
  5. Run npm run check. Production-strict lints now apply.
  6. Open the promotion PR. Designer + brand-checks gate the merge.

When you finish

  1. Run npm run check (drafts pass loosened lints, but copy / brand checks still apply).

  2. Summarize what you built in plain language so the user can share with their team.

  3. ALWAYS finish your final reply with a “Where to see it” block. Non-technical users don’t automatically know about localhost, dev servers, or preview URLs. Include this every time you create or modify a draft, even if you’ve explained before in this session. Format:

    Where to see it:
    • Locally (right now): http://localhost:4321/drafts/<slug>
      If that page doesn't load, open a terminal in this folder
      and run `npm run dev`, then refresh.
    • Shareable preview (after you push):
      1. Say "open a PR" and I'll create one.
      2. Wait ~60 seconds for Vercel to finish building.
      3. The preview URL will appear as a comment on the PR.
         Click through to share with the team.

    Localhost = fastest path to seeing it. PR-preview = shareable path. Both in that order. Adapt the slug for the actual draft.