agentleFS
danmestasdanmestas/wardrobe/skills/frontend-component-decision-trees/SKILL.md

frontend-component-decision-trees

Skill4 starsChanged 7 months agoMITView on GitHub

Use this skill whenever the user needs to choose the correct UI component for forms, notifications, errors, loading, buttons, overflow, onboarding, or design system contributions. Always start with the Main Entry Point dispatcher to select the right tree, then follow the exact branching logic. This skill prevents ad-hoc component choices by enforcing production design system decision trees.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If multiple apply, start with the most specific primary reference.

    line 40
  2. Distinctive:

    Read only the relevant reference file(s).

    line 50
  3. Distinctive:

    Ask at most one clarifying question if context is ambiguous.

    line 58

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill 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
SKILL.md

Frontend Component Decision Trees

When to Use This Skill (Trigger Conditions)

  • User asks "what component should I use for...", "which UI pattern for X", "form control recommendation", "notification vs toast vs banner", "loading state choice", "button vs link", "how to handle overflow/truncation", "onboarding pattern", or "should we add this to the design system?"
  • Any frontend architecture, component library design, design review, or spec writing task involving UI element selection.
  • The conversation is about making a repeatable, defensible choice rather than a one-off visual preference.

Do NOT use for pure visual polish, copywriting, icon selection, or non-component decisions.

Main Entry Point — Scenario to Tree Dispatcher

Always run this dispatcher first. Identify the scenario, then jump to the matching reference file in references/.

User ScenarioPrimary ReferenceKey Questions to Ask
Form inputs (radio, checkbox, dropdown, switch, toggle)references/form-components.mdMulti-select? Short vs long labels? Filtering?
Notifications / feedback (toast, banner, modal, dialog, push)references/notifications.mdSystem or user generated? Passive or actionable? Attention level?
Errors, alerts, validation, empty statesreferences/errors-alerts.mdCritical error or warning? Element, page, or global?
Loading / waiting statesreferences/loading.mdDuration? Predictable content? Progress trackable?
Buttons, CTAs, alignment, groupingreferences/calls-to-action.mdEmphasis level? Alignment needs? Number of actions?
Truncation, overflow, "show more", scrollreferences/truncation-overflow.mdPrimary or secondary info? Fixed container?
Onboarding / feature discoveryreferences/onboarding.mdInterrupt, subtle show, or contextual discovery?
Adding new component/pattern to DSreferences/design-system-contribution.mdReady to share? Multi-product? Maintainers agree?

Quick Start Questions (ask these to route):

  • Form control choice? → form-components.md
  • Status / error / feedback messaging? → notifications.md or errors-alerts.md
  • Waiting for content? → loading.md
  • Action button or link? → calls-to-action.md
  • Content hidden or overflowing? → truncation-overflow.md
  • Guiding user through feature? → onboarding.md
  • Design system governance? → design-system-contribution.md

If multiple apply, start with the most specific primary reference.

How to Use the References

Each file in references/ contains:

  • The full decision tree with root questions and branches
  • "When to Use" and "When to Use Something Else" guidance
  • Accessibility rules and anti-patterns
  • Concrete examples and tables from the source design systems
  • Output contract for that tree

Read only the relevant reference file(s). Do not load all of them into context at once.

Output Requirements (Every Time)

  1. State the exact component chosen.
  2. Quote the root question and the branch taken.
  3. One-sentence rationale.
  4. 1–2 rejected alternatives with the branch that would have selected them.
  5. Cite the reference file used.
  6. Ask at most one clarifying question if context is ambiguous.

This structure guarantees repeatable, source-backed decisions.

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.