agentleFS
CloudflareKnown publishercloudflare/cloudflare-os/.agents/skills/frontend-conventions/SKILL.md

frontend-conventions

Skill11k starsChanged 2 months agoApache-2.0View on GitHub

Use for creating, modifying, moving, or reviewing React frontend code anywhere in packages/*, including Workshop pages, gatekeeper management apps, shared UI, components, hooks, forms, interactions, styling, accessibility, and frontend tests.

3 other projects use a version of this.

Trending

Quiet since October.about the whole repository

Jan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 28 mentionsSep 2026: 3 mentionsOct 2026: 10 mentionsNov 2026: 0 mentionsDec 2026: 0 mentions
Jan 2026Jul 2026Dec 2026
Mentions a month of the cloudflare/cloudflare-os repository that our weekly crawl found. There is no adoption data for this file yet.

Most recently taken up by

Who's talking about cloudflare/cloudflare-os

The biggest 5 of 41 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 41

Talked about on GitHub and Bluesky (41 times).

On GitHub · 27

22 more on GitHub

On Bluesky · 14

9 more on Bluesky

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Start directories flat. Do not introduce components/, hooks/, helpers/, or tests/ subdirectories merely to classify files.

    line 16
  2. Very specific:

    Use PascalCase filenames for components and camelCase filenames for hooks and non-component modules.

    line 20
  3. Distinctive:

    Keep product behavior with its product even when another feature consumes it.

    line 24
  4. Distinctive:

    Do not merge components merely because they look similar.

    line 31
  5. Distinctive:

    Create a separate component when it owns meaningful state, effects, interactions, accessibility behavior, or reusable responsibility.

    line 36
  6. Very specific:

    Prefer named arrow-function components and hooks.

    line 44
  7. Very specific:

    Add children, slots, variants, className, DOM passthrough, and imperative refs only for current callers, not speculative reuse.

    line 54
  8. Distinctive:

    Use context for genuinely application-wide values such as authentication, theme, and toasts.

    line 57
  9. Very specific:

    Use Kumo components and semantic tokens by default.

    line 62
  10. Distinctive:

    Do not add custom color literals, arbitrary Tailwind colors, feature-local token systems, or local replacements for Kumo surfaces, borders, …

    line 66
  11. Distinctive:

    When Kumo is unsuitable, identify the concrete behavioral or accessibility gap before introducing a shared abstraction.

    line 75
  12. Distinctive:

    Treat Effects as synchronization with external systems, not as derived-state machinery or a way to sequence user interactions.

    line 80
  13. Very specific:

    Do not add useMemo or useCallback without a concrete identity or performance need.

    line 87
  14. Distinctive:

    Prefer names and types that communicate intent.

    line 93

≈ “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 Conventions

Apply these conventions to the Workshop SPA, gatekeeper management SPAs, and @gadgets/ui. Package-level AGENTS.md files add product-specific rules but do not replace this guidance.

Ownership And Organization

Organize code by product ownership before implementation type. Feature directories own product behavior and may contain components, hooks, tests, and utilities that change for the same reason.

Start directories flat. Do not introduce components/, hooks/, helpers/, or tests/ subdirectories merely to classify files. Introduce a responsibility-named subsystem directory only when several files form a coherent unit or the flat directory becomes difficult to scan.

Use PascalCase filenames for components and camelCase filenames for hooks and non-component modules. Colocate *.test.ts(x) files with their subject. Feature organization does not replace the one-component-per-file model.

Keep product behavior with its product even when another feature consumes it. Promote code only as high as its ownership requires:

  • Code shared within one feature belongs at the nearest common feature directory.
  • Feature-independent code shared across unrelated areas of one app may live in that app's components/ or hooks/ directory.
  • Runtime UI shared by independent frontends belongs in @gadgets/ui.
  • Do not merge components merely because they look similar. Avoid generic prop-heavy abstractions that erase domain behavior.

Components And Hooks

Create a separate component when it owns meaningful state, effects, interactions, accessibility behavior, or reusable responsibility; represents a distinct UI concern; or obscures its parent's main flow. Keep small stateless render helpers private until they develop an independent concern.

Extract a hook when it owns a coherent behavior or external synchronization lifecycle, not simply to shorten a file. Keep code together when an extracted child would mostly forward markup or depend on the parent's refs, setters, and synchronization callbacks.

Prefer named arrow-function components and hooks. Type props directly rather than using React.FC. Give wrappers such as memo and forwardRef stable DevTools names.

Component APIs

Represent props that are valid only together as an object or discriminated union. A controlled value requires a change callback; otherwise expose an uncontrolled initial value. Do not copy a controlled prop into local state with an Effect.

Name callbacks on<Action> and pass domain values rather than React setters or browser events. Add children, slots, variants, className, DOM passthrough, and imperative refs only for current callers, not speculative reuse.

Use context for genuinely application-wide values such as authentication, theme, and toasts. Pass instance-specific feature data and actions through props.

Kumo And Styling

Use Kumo components and semantic tokens by default. Check Kumo and @gadgets/ui before creating a control or interaction pattern. A shared Gadgets component should compose Kumo behavior, not merely rename or restyle a primitive.

Do not add custom color literals, arbitrary Tailwind colors, feature-local token systems, or local replacements for Kumo surfaces, borders, text, status, focus, and interaction tokens unless the user explicitly requests them. Existing legacy colors are not precedent.

Tailwind is appropriate for structure, spacing, sizing, positioning, responsive behavior, and typography. Use custom CSS only for technical behavior Kumo and utilities cannot express. Global Kumo token theming is an application-level decision and must not be changed during ordinary feature work.

When Kumo is unsuitable, identify the concrete behavioral or accessibility gap before introducing a shared abstraction.

React

Treat Effects as synchronization with external systems, not as derived-state machinery or a way to sequence user interactions. Calculate render data during render, keep state near its owner, prefer a component key for identity resets, and use useSyncExternalStore for suitable external stores.

Effects that fetch or subscribe must clean up stale work and remain correct when restarted. Avoid chains of Effects and do not synchronize two pieces of React state when one can be derived.

Do not add useMemo or useCallback without a concrete identity or performance need. Preserve keyboard behavior, focus management, accessible names, announcements, and mouse/touch/hybrid input parity. RPC stubs must follow the disposal and React state rules in the root AGENTS.md.

Comments

Prefer names and types that communicate intent. Comments should explain non-obvious constraints, security or performance reasons, and deliberate departures from conventions. Do not narrate the next line. Remove or update comments when their constraint changes.

Tests

Tests should protect observable behavior, product rules, accessibility, state transitions, races, and failure paths. Do not test React, JavaScript, Kumo, or another framework's own behavior merely for coverage. Avoid assertions coupled only to implementation details or trivial passthrough.

Behavior-preserving moves should keep tests unchanged apart from imports. Add focused coverage only when an extraction exposes important previously untested logic.

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.