agentleFS
BlockKnown publisherblock/berd/src/features/design-system/AGENTS.md

berd / design-system

AGENTS.md1k starsChanged 3 months agoApache-2.0View on GitHub

This folder contains the in-app Goose Design System Explorer. Treat it as a real product surface, not a docs dump. Every component page should use the same structure unless Morgan explicitly asks for a different treatment: 1. PageIntro with a short human-readable purpose. 2. ComponentSpec using the component name. This pulls source, variants, and slots from the generated manifest. Do not hand-write those facts. 3. ComponentPlayground for the live component preview and controls. 4. ComponentTokenDetails for the current preview's color…

We split this AGENTS.md into the rules it gives an agent

16 rules. About 0 are common, 11 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every component page should use the same structure unless Morgan explicitly asks for a different treatment:

    line 8
  2. Distinctive:

    When populating a component page:

    line 30
  3. Very specific:

    Always use ComponentSpec for manifest-owned facts.

    line 32
  4. Distinctive:

    Keep the token details aligned to the current preview state.

    line 45
  5. Distinctive:

    Prefer controls for props, modes, composition choices, and states that cannot be easily inspected by directly interacting with the preview.

    line 54
  6. Distinctive:

    Do not add a control for state the user can naturally change in the preview, such as an accordion's open section, unless the state is …

    line 56
  7. Distinctive:

    Keep controls scoped to real component API or real product states.

    line 59
  8. Distinctive:

    Do not add scenario/content presets when they only swap demo copy.

    line 61
  9. Very specific:

    Remove impossible options when another control changes the valid state space.

    line 66
  10. Distinctive:

    Use the smallest set of controls that explains the component.

    line 69
  11. Distinctive:

    Do not show visible label text as token metadata.

    line 78
  12. Distinctive:

    Do not show raw Tailwind utility pills in the Tokens section.

    line 79
  13. Very specific:

    Prefer explicit values over vague values like inherited, state-dependent, or disabled opacity.

    line 80
  14. Very specific:

    Use Goose extension tokens only for product-specific surfaces and identities, such as bg-surface-composer, bg-canvas-base, chip colors, …

    line 92
  15. Very specific:

    Do not use raw palette utilities like bg-gray-100, direct hex colors, or component-specific one-off color tokens without first adding them …

    line 97
  16. Distinctive:

    After changing component source or explorer pages, run:

    line 103

≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Design System Explorer

This folder contains the in-app Goose Design System Explorer. Treat it as a real product surface, not a docs dump.

Repeatable Component Page Contract

Every component page should use the same structure unless Morgan explicitly asks for a different treatment:

  1. PageIntro with a short human-readable purpose.
  2. ComponentSpec using the component name. This pulls source, variants, and slots from the generated manifest. Do not hand-write those facts.
  3. ComponentPlayground for the live component preview and controls.
  4. ComponentTokenDetails for the current preview's color states and text styling.

The generated manifest owns facts that can be read from code: source file, exports, data-slots, CVA variants, state classes, token classes, and source token classes. The page owns designer judgment: what the preview should render, which controls matter, anatomy labels, state rows, and the plain-language description.

Populating Component Pages

The manifest is an inventory scanner, not a page generator. Use it to keep generated facts honest and to prevent docs drift, but do not expect it to infer the best live demo.

When populating a component page:

  • Always use ComponentSpec for manifest-owned facts. Do not duplicate source paths, slots, variants, or generated token facts by hand.
  • Render the actual shared UI primitive in the playground whenever it can be safely shown in-page. A manifest summary card is only a fallback for helper modules or components that cannot be meaningfully rendered without app state.
  • Author playground controls around meaningful product states, even when the manifest reports Variants: None. Useful controls may include selected value, open/closed, disabled, invalid, loading, placeholder text, option count, orientation, density-sensitive size, or empty state.
  • For trigger/portal components, include the full composition, not only the trigger. For example, a Dialog playground needs DialogTrigger and DialogContent; a Popover playground needs PopoverTrigger and PopoverContent.
  • Keep the token details aligned to the current preview state. If a control changes disabled, invalid, open, selected, or destructive state, the token rows should describe that state.

Playground Control Heuristics

Playground controls should help designers inspect meaningful component behavior, not turn the preview into a remote-controlled demo.

  • Prefer controls for props, modes, composition choices, and states that cannot be easily inspected by directly interacting with the preview.
  • Do not add a control for state the user can naturally change in the preview, such as an accordion's open section, unless the state is otherwise hard to reach or compare.
  • Keep controls scoped to real component API or real product states. Do not invent visual variants just to fill the control panel.
  • Do not add scenario/content presets when they only swap demo copy. Add them only when each preset exposes a distinct component behavior, layout stress, or product state.
  • Hide controls when they do not apply to the selected mode instead of showing a disabled control with unclear meaning.
  • Remove impossible options when another control changes the valid state space. For example, if a single accordion cannot collapse, the open-section choices should not include None.
  • Use the smallest set of controls that explains the component. A strong page usually exposes 3-6 high-signal controls rather than every possible state.

Token Table Rules

  • Color rows answer: what background, text/icon, and border color is visible for each anatomy/state combination?
  • Text rows answer: what typography styling is visible? Keep color out of the text table.
  • Do not show visible label text as token metadata.
  • Do not show raw Tailwind utility pills in the Tokens section.
  • Prefer explicit values over vague values like inherited, state-dependent, or disabled opacity.
  • Disabled states should name the base token plus opacity, for example --foreground / 50%.

Token Usage

Component source should use the shadcn semantic token contract first: bg-background, text-foreground, bg-card, bg-popover, bg-muted, text-muted-foreground, bg-accent, bg-primary, bg-destructive, border-border, border-input, and ring-ring.

Use Goose extension tokens only for product-specific surfaces and identities, such as bg-surface-composer, bg-canvas-base, chip colors, status colors, and composer placeholder color. Use bg-card-glass for floating chrome glass (nav panes, right rail, the global composer pill).

Do not use raw palette utilities like bg-gray-100, direct hex colors, or component-specific one-off color tokens without first adding them to the design system.

Validation

After changing component source or explorer pages, run:

pnpm design-system:generate
pnpm design-system:coverage
just check

Then visually verify the changed page in the in-app explorer.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.