react-naming
Skill1 starsChanged 6 months agoMITView on GitHub
Reference for naming and folder structure in React/TypeScript projects. Distilled from the Maximilian Schwarzmüller React course (modules 02-29). Use when naming a new component, hook, handler, lib function, or organising src/. Trigger phrases: name this component, what should I call this hook, handle vs on, where do I put, src structure, react conventions.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Nupke/react-claude-skillstheir own version, first seen May 27, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Nupke/react-claude-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository41 other files it gives its agents.
- AGENTS.mdAGENTS.md
- academic-evaluationSkill
- academic-writingSkill
- agent-orchestrationSkill
- agents-md-writerSkill
- algorithmic-artSkill
- brand-guidelinesSkill
- codebase-architectureSkill
- code-reviewSkill
- commit-workflowSkill
- context-checkpointSkill
- doc-coauthoringSkill
- docxSkill
- etl-runnerSkill
- eval-runnerSkill
- feature-devSkill
- frontend-designSkill
- hpc-deucalionSkill
- internal-commsSkill
- langchainSkill
- langfuseSkill
- langgraphSkill
- llm-observability-stackSkill
- mcp-builderSkill
- neo4j-verifySkill
- pdfSkill
- pptxSkill
- project-conventionsSkill
- python-best-practicesSkill
- security-hooksSkill
- service-verifySkill
- skill-creatorSkill
- skill-inspectorSkill
- slack-gif-creatorSkill
- sprint-contractSkill
- theme-factorySkill
- uml-modelingSkill
- webapp-testingSkill
- web-artifacts-builderSkill
- web-debugSkill
- xlsxSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 124
If the runtime check fails: load web-debug for the React error patterns.
- Very specific: line 141
If the warning fires: load web-debug for the React-specific debugging checklist.
- Very specific: line 148
Don't change established names across modules: If a hook is useFetch in module 16, keep it useFetch in module 21.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
Single source of truth for React naming and folder structure in this workspace. Distilled from the Maximilian Schwarzmüller React course (modules 02-29). Progressive disclosure: this file carries the routing table and the headline rules; details live in references/ and load on demand.
When to Use
- Naming a new component, hook, handler prop, or lib function.
- Deciding where a file lives in
src/(components, hooks, util, store, pages…). - Choosing between
handle*andon*for an event handler. - Picking an extension (
.jsvs.jsxvs.tsvs.tsx). - Reviewing whether a new file's name matches the project's existing pattern.
When NOT to Use
- Generic code style (indentation, quotes) → AGENTS.md §5 in the workspace.
- General architecture (refactoring, deep modules) →
codebase-architecture. - Build/test/lint commands → workspace AGENTS.md §4 / §6.
- Aesthetic/design choices →
frontend-design.
Hard Rules
- Component file = component name (
Header.jsxexportsHeader). One file per component, PascalCase, insrc/components/. - Event props are
onXxx(PascalCase, capital O):onClick,onChange,onSubmit,onSelect,onBlur. - Internal handlers are
handleXxx(camelCase):handleClick,handleSubmit,handleEmailBlur. The parent'son*prop is wired to the localhandle*function. - Custom hooks start with
useand live insrc/hooks/. One hook per file, file name = hook name (useFetch.js). - Lib/helpers are verbs or actions in camelCase:
formatDate.js,validateEmail.js,http.js. They live insrc/util/(orsrc/lib/— pick one per project and stay consistent). - Vite + React 19 (modules 03-17):
.jsxfor components,.jsfor everything else. Entry issrc/main.jsxorsrc/index.jsx. - CSS lives next to the component in
src/components/<Name>.module.css(CSS Modules, modules 07/21/29) OR in a single globalsrc/index.css(module 03 starter). Pick one per project. - TypeScript modules (29):
.tsxfor components,.tsfor everything else, types insrc/models/<entity>.ts.
Routing table
Load the matching reference before writing a name. Each reference is short and self-contained.
| If you are… | Read first… |
| Naming a new component | references/naming-components.md |
| Naming a custom hook | references/naming-hooks.md |
Picking handle* vs on* for an event | references/naming-handlers.md |
| Choosing a filename / folder name | references/naming-files-folders.md |
Organising src/ for an Essentials project (modules 3-7) | references/structure-essentials.md |
| Adding global state (Redux/Context) | references/structure-state.md |
| Adding routing (module 21) | references/structure-routing.md |
| Adding tests (module 28) | references/structure-testing.md |
| Starting a TypeScript project (module 29) | references/structure-typescript.md |
| Wanting the full project skeleton (one-glance tree) | references/project-skeleton.md |
Module map (where each pattern is established)
| Module | Pattern it introduces |
| 02 JS Refresher | Plain JS, no bundler, no React yet |
| 03 React Essentials | Vite + .jsx + src/components/ + one global index.css |
| 04 Essentials Deep Dive | public/ folder, props forwarding, two-way binding |
| 05 Essentials Practice | Same as 04, polished |
| 06 Debugging | src/util/<domain>.js for pure logic |
| 07 Styling | CSS Modules per-component (<Name>.module.css) |
| 15 HTTP Requests | src/http.js for fetch wrapper |
| 16 Custom Hooks | src/hooks/use<Name>.js |
| 17 Forms User Input | src/util/validation.js + custom input hook |
| 21 Routing | src/pages/<Route>.js + per-page components |
| 22 Authentication | Same as 21 + src/util/auth.js |
| 28 Testing | src/components/<Name>.test.js co-located |
| 29 React TypeScript | .tsx + src/models/<entity>.ts + src/store/ |
Examples
// Component — file = component name, PascalCase
// File: src/components/Player.jsx
export default function Player({ name, onSelect, isActive }) { ... }// Custom hook — use* prefix, src/hooks/
// File: src/hooks/useFetch.js
export default function useFetch(url) { ... }// Event prop = on* (parent → child); internal handler = handle* (child internal)
<button onClick={handleClick}>...</button> // in Header.jsx
<Player onSelect={(p) => selectPlayer(p)} /> // in App.jsx
function handleClick() { /* internal */ }Anti-patterns (from the course)
Three recurring mistakes the Maximilian course flags explicitly. Each one
becomes a runtime error or silent no-op — load web-debug if you hit the
symptom.
Setting state directly (m03, 14-managing-state)
// ❌ Assignment doesn't trigger a re-render
let count = 0;
count = 5; // React doesn't notice the change// ✅
const [count, setCount] = useState(0);
setCount(5); // triggers a re-renderMutating then setting (m04, 12-updating-state-immutably)
// ❌ Same reference → React skips the update
const next = current;
next.push(newItem);
setItems(next); // React sees the same array// ✅
setItems([...current, newItem]); // new reference, new identityIf the runtime check fails: load web-debug for the React error patterns.
Input sem onChange (m04, 10-two-way-binding)
// ❌ Read-only field; React warns "value without onChange"
<input value={playerName} />// ✅
<input
value={playerName}
onChange={(e) => setPlayerName(e.target.value)}
/>If the warning fires: load web-debug for the React-specific debugging checklist.
Best Practices
- Name by concept, not by type.
Player.jsx(what) beatsPlayerComponent.jsx(redundant suffix). - Domain prefix for hooks of the same shape:
useFetchUser,useFetchPlaces— the domain comes first. - One concern per file. Split a hook that does both fetching and caching into two files.
- Don't change established names across modules. If a hook is
useFetchin module 16, keep ituseFetchin module 21.
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
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.

