agentleFS
adymireadymire/CraftLayer/skills/component-engineering/SKILL.md

component-engineering

Skill0 starsChanged 3 days agoMITView on GitHub

Design reusable UI components with clear contracts, semantic behavior, and only the flexibility real consumers need.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    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:

    Use when creating shared components or extracting a repeated, stable UI pattern for multiple consumers.

    line 10
  2. Distinctive:

    Do not abstract a one-off element before its behavior is understood or build a generic component framework for a single feature.

    line 15
  3. Distinctive:

    Keep data fetching and domain policy outside presentational components unless repository conventions specify otherwise.

    line 29
  4. Distinctive:

    Add tests for public behavior and document examples and limitations.

    line 33
  5. Distinctive:

    Prefer composition for distinct content over many configuration flags.

    line 38
  6. Distinctive:

    Avoid hidden global state and undocumented CSS coupling.

    line 39
  7. Distinctive:

    Test semantic behavior, keyboard access, state transitions, long/empty content, component API typing, and at least two representative …

    line 57

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Component Engineering

When to use

Use when creating shared components or extracting a repeated, stable UI pattern for multiple consumers.

When not to use

Do not abstract a one-off element before its behavior is understood or build a generic component framework for a single feature.

Inputs and assumptions

Inspect consumers, accessibility semantics, styling conventions, state ownership, composition patterns, and compatibility requirements.

Workflow

  1. Identify repeated structure and meaningful differences across consumers.
  2. Define a small typed API around user-facing behavior, not implementation details.
  3. Choose semantic HTML and predictable keyboard interactions.
  4. Keep data fetching and domain policy outside presentational components unless repository conventions specify otherwise.
  5. Support required states and content lengths without excessive boolean combinations.
  6. Add tests for public behavior and document examples and limitations.
  7. Migrate representative consumers and check for regressions.

Decision rules

  • Prefer composition for distinct content over many configuration flags.
  • Avoid hidden global state and undocumented CSS coupling.
  • Give controlled and uncontrolled modes only when consumers need both.
  • Preserve a11y props and native browser behavior.

Example

A dialog contract should define open/close control, title, description, focus behavior, escape handling, and whether outside-click dismissal is allowed; merely rendering a positioned panel is not a dialog.

Common failures

  • A component API that mirrors internal state instead of intent.
  • Reuse that forces unrelated screens into identical markup.
  • Missing disabled, error, and keyboard behaviors.

Validation

Test semantic behavior, keyboard access, state transitions, long/empty content, component API typing, and at least two representative consumers.

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.