Skip to content
Back to skills

Rules React

ASecurity

ANVIL coding rules for react code (**/*.tsx, **/*.jsx, **/*.test.tsx, **/*.spec.tsx): React, React Testing.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
developmentreacttesting

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill rules-react --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rules React?

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

Security grade badge for Rules React
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-rules-react/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-rules-react)

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: rules-react
description: "ANVIL coding rules for react code (**/*.tsx, **/*.jsx, **/*.test.tsx, **/*.spec.tsx): React, React Testing."
---

<!-- Generated by `anvil plugin build` from catalog/. Edit the catalog, not this file. -->

# ANVIL rules: react

Follow these rules for react code (**/*.tsx, **/*.jsx, **/*.test.tsx, **/*.spec.tsx).

## React

# React
- Function components and hooks; follow the rules of hooks.
- Keep state minimal and colocated; derive instead of syncing.
- Accessible names for all interactive elements; semantic HTML first.
- Stable keys for lists.

## React Testing

# React Testing

- Query components with React Testing Library by accessible role and label (`getByRole`, `getByLabelText`) instead of CSS classes or `testId` fallbacks.
- Simulate real user interactions via `@testing-library/user-event` and assert rendered behavior, not internal component state or hook internals.
- Stub network responses at the fetch/MSW boundary rather than mocking child components wholesale unless isolating heavy third-party widgets.
- Avoid fixed `setTimeout` waits; await `findBy*` queries cleanly and use fake timers only when testing debounce/interval behavior.

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.

View all in development →

Comments

Loading comments…

Newsletter

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