react-typescript
Skill5 starsChanged 22 days agoMITView on GitHub
Working in an existing React + TypeScript client of an ASP.NET API — detecting its framework, package manager, test runner and conventions, and the Next.js / Vite gotchas at the API boundary.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- cohen-liel/hivemindtheir own version, first seen Mar 17, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- cohen-liel/hivemind★ 108same 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 repository19 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- api-contractSkill
- aspnet-api-patternsSkill
- authenticationSkill
- cachingSkill
- clean-architectureSkill
- convention-learnerSkill
- dddSkill
- dotnet-project-initSkill
- ef-core-patternsSkill
- error-handlingSkill
- lean-dotnetSkill
- loggingSkill
- modern-csharpSkill
- opentelemetrySkill
- resilienceSkill
- testing-dotnetSkill
- ui-ux-designSkill
- vertical-sliceSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Read package.json and the lockfile first.
- Distinctive: line 30
Read two or three neighbouring components and one test before writing.
- Very specific: line 46
fetchdoes not reject on 4xx/5xx: Check response.ok, and read the error body as ProblemDetails. - Distinctive: line 62
Test behaviour through the rendered output: query by role and label, act as a user would, assert on what the user sees.
- Distinctive: line 67
Never change an existing test to make it pass.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
React + TypeScript
The frontend counterpart of convention-learner: learn what the app already does, then match it.
An existing choice always wins over a default from this file.
Detection
Read package.json and the lockfile first. They answer most of it.
| Question | Where to look |
| Framework | next dependency → Next.js; an app/ folder → App Router, pages/ → Pages Router. vite + react and no next → Vite SPA |
| Package manager | pnpm-lock.yaml → pnpm, yarn.lock → yarn, bun.lock/bun.lockb → bun, package-lock.json → npm. Never mix them: a second lockfile is a broken install for the next person |
| Scripts | scripts in package.json: the real names for test, lint, typecheck, type generation. Run those, not a guessed command |
| Test runner | vitest or jest dependency; @testing-library/react; playwright/cypress for end-to-end; msw for network mocks |
| TypeScript strictness | tsconfig.json: strict, noUncheckedIndexedAccess, path aliases (@/*) |
| Data fetching | @tanstack/react-query, swr, RTK Query, or plain fetch in Server Components. Follow the one in use |
| API client | A generated schema.d.ts, openapi-fetch, orval, NSwag output, or a hand-written wrapper. Find the wrapper and call through it |
| Forms and validation | react-hook-form, zod, yup, formik |
| Styling | Tailwind config, CSS Modules, styled-components/emotion, a component library (shadcn/ui, MUI, Mantine, Ant) |
| Folder style | Feature folders (features/orders/…) or type folders (components/, hooks/). File naming: OrderList.tsx or order-list.tsx |
| Repo rules | The frontend's own CLAUDE.md / AGENTS.md, ESLint and Prettier config. In a two-repository setup the session did not load them |
Read two or three neighbouring components and one test before writing. State what was detected in one line, then match it.
References
Load only the one that matches the framework:
| File | Covers |
references/nextjs.md | Server/client boundary, env variables, rewrites to the API, what unit tests cannot cover |
references/vite-spa.md | Dev proxy vs production, VITE_ env variables, CORS |
Gotchas at the API boundary
- Types come from the seam module, not from the component. See
skills/api-contract/SKILL.md. A component that declares its own copy of a response type hides contract drift. fetchdoes not reject on 4xx/5xx. Checkresponse.ok, and read the error body asProblemDetails. A wrapper that callsresponse.json()on a204throws.asis not validation.(await res.json()) as Orderasserts; it does not check. The generated types are the check at build time. Add a runtime schema only where the project already uses one.- Every request needs its loading, empty and error path. The contract lists the error
statuses; each one is a branch in the UI, not a
console.error. - Cancel what the user left. Pass the
AbortSignalthe data library gives you; a late response must not overwrite newer state. - Auth follows the existing wrapper. A cookie session needs
credentials: 'include'and server-side CORS with credentials; a bearer token belongs in the wrapper, never in a component. - Do not start the dev server to check work. Use the typecheck, test and lint scripts; a dev server does not exit.
Tests
- Test behaviour through the rendered output: query by role and label, act as a user would, assert on what the user sees. No assertions on component internals or state.
- Mock at the network (
msw, or the project's fetch mock) with payloads that match the contract exactly. A mock that returns a shape the API does not is a green test for a broken screen. - One test per state the contract creates: success, empty, each error status that has its own UI.
- Never change an existing test to make it pass.
Do / Don't
| Do | Don't |
| Use the scripts and package manager the repo already has | Add a second lockfile, generator, data library or component library |
Keep strict type errors at zero; fix the type | Silence with any, as unknown as, // @ts-ignore |
| Reuse the shared components and tokens | Hard-code a colour, spacing value or one-off button |
| Put contract types in one seam module | Re-declare response types per component |
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.

