agentleFS
sohaibdevvsohaibdevv/AI-AGENT-SKILLS/skills/frontend-engineering/SKILL.md

frontend-engineering

Skill2 starsChanged 6 months agoMITView on GitHub

Build UIs that are fast, accessible, maintainable, and tested

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 6

    Distinctive

    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:

    Before implementing a new UI feature

    line 14
  2. Distinctive:

    Before a frontend component is marked complete

    line 15
  3. Distinctive:

    Every component has states: loading, empty, error, populated, and edge cases.

    line 21
  4. Distinctive:

    No side effects in render

    line 37
  5. Distinctive:

    Prefer: local state → lifted state → context → global store (in that order).

    line 42
  6. Distinctive:

    No dangerouslySetInnerHTML or equivalent without sanitization

    line 54

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “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

Overview

Frontend engineering is full-stack engineering from the network edge to the pixel. Performance, accessibility, maintainability, and security are all first-class concerns - not features to add later.

When to Use

  • Before implementing a new UI feature
  • Before a frontend component is marked complete
  • As part of the /review workflow for frontend PRs

Process

Step 1: Define the UI states

Every component has states: loading, empty, error, populated, and edge cases. Define and implement all of them before calling it done.

Step 2: Accessibility first

See accessibility-engineering skill. Apply before visual polish.

Step 3: Performance budget

Define before building:

  • Largest Contentful Paint (LCP) target: < 2.5s
  • Cumulative Layout Shift (CLS) target: < 0.1
  • First Input Delay (FID) / INP target: < 200ms
  • Bundle size budget for new routes

Measure with Lighthouse on a representative device.

Step 4: Component design

  • Components are pure functions of their props/state
  • No side effects in render
  • Extract business logic from UI components
  • Co-locate styles with components

Step 5: State management

Prefer: local state → lifted state → context → global store (in that order). Only reach for global state when local state genuinely doesn't work.

Step 6: Error boundaries

Wrap sections of the UI in error boundaries. A crash in one section should not take down the whole page.

Step 7: Testing

  • Unit test business logic extracted from components
  • Component tests for component behavior (not implementation)
  • E2E tests for critical user journeys

Step 8: Security

  • Sanitize all user-generated HTML rendered to the DOM
  • No dangerouslySetInnerHTML or equivalent without sanitization
  • Content Security Policy headers configured

Verification Requirements

  • All UI states implemented (loading, empty, error, populated)
  • Accessibility requirements met (see accessibility-engineering)
  • Lighthouse performance score ≥ 90
  • Error boundaries in place
  • Critical journeys covered by E2E tests
  • No XSS vulnerabilities in dynamic HTML rendering

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.