darknecrocities/skillbuilder/frontend

Claude Code and agent skill by darknecrocities/skillbuilder

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Frontend architecture, state management, and lifecycle engineering skill. Governs React 19, Next.js, and Flutter with clean boundary isolation.

Install

npx vskill@latest install darknecrocities/skillbuilder/frontend

SKILL.md

The same SKILL.md was published earlier as darknecrocities/skillbuilder/frontend.

Frontend Architecture & State Management (/frontend)

Philosophy: Keep components pure. Isolate side effects. Manage state deliberately. Handle errors at the boundary. Never leak business logic into render trees.

This skill enforces high-performance client architecture across React 19, Next.js App Router, TypeScript, and modern web applications.


1. Quick Navigation & Progressive Disclosure

Resource TypeDocumentDescription
Referencereferences/rsc-and-action-boundaries.mdRSC rules, leaf client boundaries, Server Actions with Zod validation.
Referencereferences/client-state-lifecycle.mdState scope matrix, optimistic UI updates via useOptimistic, URL state.
Utilityscripts/verify_frontend_architecture.pyScans components for inline fetch calls, bloated client boundaries, and missing error boundaries.

2. Architecture Tiers & Component Separation

mermaid
flowchart TD
subgraph Server["Server Layer"]
A["React Server Component (RSC)"]
B["Server Actions (Zod-validated)"]
end
subgraph ClientData["Client Data & State"]
C["TanStack Query / SWR / URL State"]
D["Optimistic State (useOptimistic)"]
end
subgraph UI["Pure Presentation"]
E["Stateless Presentational Components"]
F["Error Boundary & Suspense Skeletons"]
end
A --> C
B --> D
C --> D
D --> E
E --> F
1.1 Clean Boundary Separation Rules
  1. Server Components by Default: In Next.js App Router, all components are React Server Components (RSC) unless interactive hooks (useState, useEffect, useRef, browser events) are strictly required.
  2. Push `"use client"` to the Leaves: Never mark an entire page or large container "use client". Wrap only the interactive controls (buttons, inputs, dropdowns) at the leaf nodes.
  3. Zero Inline Fetches in JSX: Never trigger raw HTTP requests directly inside presentation components. Use dedicated hooks or server functions.

2. State Management Decision Matrix

Choose the simplest state layer appropriate for the data lifecycle:

State ScopeRecommended ToolExample Use CaseAnti-Pattern
URL StateuseSearchParams / nuqsFilters, pagination, active tab, modal open statusDuplicating URL search params into local useState
Server CacheTanStack Query or RSCAPI data, entity collections, cached user profilesStoring API responses in Redux/Zustand without cache invalidation
Interactive FormReact 19 Actions + useActionStateForm submission, password updates, checkout flowManaging 15 separate useState variables for inputs
Client UI GlobalZustand (minimal stores)Theme preference, audio player state, active sidebar drawerPutting massive complex database entities into global client store
Local EphemeraluseState / useReducerDropdown open/close, hover tooltip, slider valuePassing down 5 levels of props instead of local state

3. React 19 Server Actions & Optimistic Updates

Standardize form mutations using React 19 Actions and useOptimistic:

tsx
"use client";
import { useActionState, useOptimistic, startTransition } from "react";
import { updateProfile } from "@/actions/profile";
import { UserCheck } from "lucide-react";
interface ProfileFormProps {
initialName: string;
}
export function ProfileForm({ initialName }: ProfileFormProps) {
const [state, formAction, isPending] = useActionState(updateProfile, { success: true, error: null });
const [optimisticName, setOptimisticName] = useOptimistic(
initialName,
(current, newName: string) => newName
);
const handleSubmit = (formData: FormData) => {
const nextName = formData.get("name") as string;
startTransition(() => {
setOptimisticName(nextName);
});
formAction(formData);
};
return (
<form action={handleSubmit} className="flex flex-col gap-3 max-w-sm">
<label htmlFor="name-input" className="text-xs font-medium text-zinc-300">
Display Name (Current: {optimisticName})
</label>
<input
id="name-input"
name="name"
defaultValue={initialName}
disabled={isPending}
className="px-3 py-1.5 bg-zinc-900 border border-zinc-800 rounded text-sm text-zinc-100 focus:outline-none focus:ring-2 focus:ring-zinc-400"
/>
{state.error && <p className="text-xs text-rose-400">{state.error}</p>}
<button
type="submit"
disabled={isPending}
className="inline-flex items-center justify-center gap-2 px-3 py-1.5 bg-zinc-100 hover:bg-zinc-200 text-zinc-900 text-xs font-semibold rounded transition-colors disabled:opacity-50"
>
<UserCheck className="w-3.5 h-3.5" aria-hidden="true" />
{isPending ? "Saving..." : "Save Changes"}
</button>
</form>
);
}

4. Memory Safety & Effect Cleanup

Always wire an AbortController or cancellation signal to async operations inside useEffect:

typescript
useEffect(() => {
const controller = new AbortController();
let isMounted = true;
async function loadData() {
try {
const res = await fetch("/api/v1/metrics", { signal: controller.signal });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
if (isMounted) setMetrics(data);
} catch (err: unknown) {
if ((err as Error).name !== "AbortError" && isMounted) {
setError(err instanceof Error ? err.message : "Fetch failed");
}
}
}
loadData();
return () => {
isMounted = false;
controller.abort();
};
}, []);

5. Platform Domain Routing & Token Discipline

To eliminate token quota bloat and maintain sharp agent context fidelity:

  • Mobile Applications (React Native, Flutter, Swift, Kotlin): Delegate presentation, touch targets (44x44pt/48x48dp), safe areas, and gesture springs strictly to `/mobile-ui`. Never inject web DOM CSS or container query rules into native mobile tasks.
  • Web Applications (React 19, Next.js, Vue, Tailwind CSS): Delegate responsive layouts, Component-Level Container Queries (@container), CSS View Transitions, and fluid clamp() curves strictly to `/web-ui`. Never inject native SwiftUI or Compose Lookahead rules into web tasks.
  • Token Quota Rule: Agents must never mount both /mobile-ui and /web-ui into the same prompt turn, saving up to ~1,850 tokens per turn.

6. Frontend Architecture Validator CLI

Scan frontend modules for architecture violations, inline fetches in JSX, and missing cleanup:

bash
python3 skills/frontend/scripts/verify_frontend_architecture.py --path .

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/darknecrocities/skillbuilder/frontend/badge)](https://verified-skill.com/skills/darknecrocities/skillbuilder/frontend)

Something wrong with this skill or its page? Tell us.