/ratchet-code:react-app-structurefrom ratchet-code
Use when writing or reviewing React components, Next.js pages, layouts, route handlers, forms, navigation, server/client boundaries, data fetching, auth redirects, entity links, or browser configuration. Structure a React or Next.js app so its API calls, links, redirects, and configuration each have one traceable owner.
Ships in ratchet-code. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Read every applicable AGENTS.md first. Repository-local policy overrides these defaults.
These rules keep one owner for each cross-cutting concern, and keep the links between the page and the API readable by a person or a tool without running the app.
fetch(`/api/orders/${orderId}`).Abort an in-flight request when a newer one replaces it, such as typeahead search, with an
AbortController aborted in the effect cleanup. Otherwise a slow earlier response can arrive
after a newer one and overwrite it with stale results.
useEffect(() => {
const controller = new AbortController()
fetch(`/api/search?q=${query}`, { signal: controller.signal })
.then((r) => r.json())
.then(setResults)
.catch((e) => {
if (e.name !== 'AbortError') throw e
})
return () => controller.abort()
}, [query])
Polling and scope-switching hooks (a tab, filter, or workspace switch that refetches) follow the same rule: tag each request, ignore a response that is no longer current, and never start a refresh while one is in flight or while the user is saving.
null) distinct
from an empty list. Otherwise the client depends on the API's shape and every envelope field
ships in the page payload.Suspense, but await the main content.[param]
segment only for values that really vary, so each page is findable by its path.A paginated list ends only when the API's flag says so. Do not stop, or show the empty state,
because a page came back short or empty: keep a way to load more while the response reports a
next page and a cursor. ratchet-backend:list-reads owns the contract.
A fetch wrapper that returns null maps only a 404 to null. Never catch everything into
null; every other failure reaches the error boundary, so an outage does not look like a missing
resource.
router.push or router.refresh() in startTransition and
disable on isPending as well, or the user can submit twice while the page is still stale.router.refresh() re-renders server components but keeps client state. A promise held in
client state and read with use() is not recreated by it; create a new one when the mutation
succeeds.useCallback, useMemo, or memo only for referential
stability. Keep a value that only event handlers read in useRef, so it never re-renders.The root layout owns the landmarks (header, one main, footer). One shared page component
owns the page container: the heading, the breadcrumb, and the width. A page renders only its
content inside it. Do not give a page its own centered shell, such as
<main className="mx-auto max-w-3xl">: each copy drifts, pages stop lining up, and a second
main breaks landmark navigation for screen readers.
Which actions a page shows, how it renders an error, and what a submit checks first belong to
interface-feedback.
Decide where signed-out users go in one place: the layout or the middleware that wraps the protected section. Do not repeat the check and redirect in each page. A page added later is then protected by where it sits, not by remembering to copy the check.
Build the URL for an entity (a user, an order, a document) through one shared helper per entity. Do not assemble it from string pieces at the call site. When the route changes, one helper changes, and no link is left behind.
Load browser-side configuration at runtime, from the server response or a config endpoint. Do not bake it into the bundle at build time. One build can then be promoted through every environment, and a configuration change does not need a rebuild.
toLocaleDateString() with no locale uses the runtime's default, so the server render and the
browser disagree and hydration fails or the text flickers.lang.
When its language is unknown, set lang="" and dir="auto"; with no lang it inherits the
page's. Screen readers pick the voice
and browsers pick hyphenation and direction from it.Serve an image URL a user supplied through an image proxy the app controls. Rendering it directly sends each viewer's IP address and user agent to a host the uploader chose, lets that host change the content after review, and can mix insecure content into the page.
Do not use an immediately invoked function inside JSX to compute a branch. Extract a component or a helper. The extracted piece has a name, can be tested, and keeps the render readable.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jongleberry/ratchet-stack --plugin ratchet-code12 skills in this plugin
/interface-feedbackUse when writing or reviewing interface code that shows an action button, a toast or error message, or a form's submit, including a review of such a diff. Show only the actions the server allows this viewer and why one is blocked, render errors by code with their details, and check a submit's preconditions so it never succeeds partly in silence./lint-rule-authoringUse when writing or reviewing the code of a lint rule, analyzer, or codemod that walks a syntax tree, such as an ESLint or oxlint rule, a Clippy lint, or a custom AST check, including a request to "write a rule that bans X". Covers finding the rule's subject by what a name is bound to, reporting a name it cannot trace, and the fixtures that prove both./Other plugins' skills for the same job