Skip to content
Back to skills

Typescript Conventions

ASecurity

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.

  • 8 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 3, 2026
ai-agentstypescriptreacttestingdebuggingfrontend

Security analysis

A100/100

Scanned October 3, 2026

npx -y skills add ek33450505/claude-agent-team --skill typescript-conventions --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Typescript Conventions?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Typescript Conventions
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ek33450505-typescript-conventions/badge)](https://www.skillsdirectory.com/skills/ek33450505-typescript-conventions)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: typescript-conventions
description: 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.
user-invocable: false
allowed-tools: []
---

# 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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.