agentleFS
ek33450505ek33450505/claude-agent-team/skills/typescript-conventions/SKILL.md

typescript-conventions

Skill8 starsChanged 32 days agoMITView on GitHub

TypeScript, React, and UI accessibility conventions for CAST projects. Load when writing, reviewing, or debugging TypeScript/TSX/React code, or when checking accessibility (a11y, aria, focus, contrast, keyboard navigation). Covers file naming, type patterns, hooks, component conventions, testing approach, and the a11y checklist.

4 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

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

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 3

    Distinctive

    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:

    Use React 19 patterns: functional components, hooks, no class components

    line 10
  2. Very specific:

    Test files live alongside source: Foo.tsx -> Foo.test.tsx

    line 14
  3. Distinctive:

    Use Vitest + React Testing Library for tests (not Jest in Vite projects)

    line 15
  4. Very specific:

    Test behavior with getByRole/getByText, not getByTestId

    line 16
  5. Distinctive:

    Import order: React, third-party, local modules, types (enforce with ESLint)

    line 17
  6. Very specific:

    Prefer interface over type for object shapes that may be extended

    line 18
  7. Very specific:

    Use satisfies operator for type-safe config objects

    line 19
  8. Very specific:

    Every icon-only button/link gets aria-label.

    line 26

“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

TypeScript Conventions

  • Use React 19 patterns: functional components, hooks, no class components
  • Extend existing types rather than type casting: type UserAdmin = User & { isAdmin: true } instead of (user as UserAdmin)
  • Component files: PascalCase (UserProfile.tsx)
  • Hook files: camelCase prefixed with use (useLocalStorage.ts)
  • Test files live alongside source: Foo.tsx -> Foo.test.tsx
  • Use Vitest + React Testing Library for tests (not Jest in Vite projects)
  • Test behavior with getByRole/getByText, not getByTestId
  • Import order: React, third-party, local modules, types (enforce with ESLint)
  • Prefer interface over type for object shapes that may be extended
  • Use satisfies operator for type-safe config objects

Accessibility (UI projects)

Applies on the FIRST pass, never as a later sweep. Dispatch frontend-qa for a dedicated a11y review before commit on UI-heavy changes.

  • Every icon-only button/link gets aria-label; decorative icons get aria-hidden="true"
  • Visible :focus-visible state on every interactive element — never rely on browser default rings on dark themes
  • Color contrast >= 4.5:1 for text and meaningful icons
  • Hit target >= 44x44 px on touch surfaces
  • Form inputs have <label>, autoComplete, and aria-describedby for errors
  • Animation respects prefers-reduced-motion via useReducedMotion() or CSS media query
  • Semantic HTML first (<button>, <a>, <nav>, <main>); ARIA only when semantic HTML is insufficient
  • Keyboard navigation works end-to-end — logical tab order, modal focus trap, Escape closes overlays

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.