ia-react-frontend
React architecture patterns, TypeScript, Next.js, hooks, and testing. Use when working with React component structure, state management, Next.js routing, Vitest, React Testing Library, reviewing React code, or synchronizing JSON locales and reviewing translations in a React or frontend interface. For visual design and aesthetic direction, use frontend-design instead. Skill: ia-react-frontend Owner: iliaal Summary: React architecture patterns, TypeScript, Next.js, hooks, and testing. Use when working with React component structure, state management, Next.js routing, Vitest, React Testing Library, reviewing React code, or synchronizing JSON locales and reviewing translations in a React or frontend interface. For visual design and aesthetic direction, use frontend-design instead. Ta
Rank
62
Safety
84
Downloads
2.7k
Updated
Oct 9, 2026
Version
5.0.1
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 2.7K downloads reported by the source. Last updated 10/9/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 9, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 9, 2026
- Adoption signal
- 2.7K downloadsadoption · observed Oct 9, 2026
- Latest release
- 5.0.1release · observed Oct 3, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s17bcar8wq0xhegs0ny6f57ypd8484bw:compound-eng-react-frontend- Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-iliaal-compound-eng-react-frontend/snapshot"
Documentation
CLAWHUB
145,818 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
---
name: ia-react-frontend
class: language
description: >-
React architecture patterns, TypeScript, Next.js, hooks, and testing. Use when
working with React component structure, state management, Next.js routing,
Vitest, React Testing Library, reviewing React code, or synchronizing JSON
locales and reviewing translations in a React or frontend interface. For
visual design and aesthetic direction, use frontend-design instead.
paths: "**/*.tsx,**/*.jsx,**/*.ts,**/*.css,**/tailwind.config.*,**/*.html,**/*.vue,**/*.blade.php"
---
# React Frontend
**Verify before implementing**: For App Router patterns, React 19 APIs, or version-specific behavior, look up current docs (Context7 `query-docs` if available, else the framework's official docs via web search) before writing code. Training data may lag current releases.
## Working rules
- Keep derived state in render and user actions in event handlers; use effects for external synchronization.
- Give async work a lifecycle and cancellation policy; represent failure separately from pending and empty data.
- Preserve focus when hiding interactive regions and exercise keyboard navigation in a real browser.
- Validate and authorize every public server action; send only needed fields across server/client boundaries.
- Measure performance changes and test user-visible behavior, not type-checking alone.
## Effects Decision Tree
Effects are escape hatches; most logic should NOT use effects.
| Need | Solution |
|------|----------|
| Derived value from props/state | Calculate during render (useMemo if expensive) |
| Reset state on prop change | `key` prop on component |
| Respond to user event | Event handler |
| Notify parent of state change | Call onChange in event handler, or fully controlled component |
| Chain of state updates | Calculate all next state in one event handler |
| Sync with external system | Effect with cleanup |
**Effect rules:**
- Never suppress the linter; fix the code instead
- Use updater functions (`setItems(prev => [...prev, item])`) to remove state dependencies
- Move objects/functions inside effects to stabilize dependencies
- `useEffectEvent` for non-reactive values (e.g., theme in a connection effect)
- Always return cleanup for subscriptions, connections, listeners
- Data fetching cancellation (pick by situation): `AbortController` for fetch; `ignore` flag for non-cancellable promises. With React Query, pass the query function's signal to the transport, such as `queryFn: ({ signal }) => fetch(url, { signal })`. Without consuming that signal, an unused query can finish and populate the cache; do not describe that behavior as transport cancellation.
## Discipline
- Simplicity first: every change as simple as possible, impact minimal code
- Only touch what's necessary; avoid introducing unrelated changes
- No hacky workarounds: if a fix feels wrong, step back and implement the clean solution
- Before adding a new abstraction, verify it appears in 3+ places
## Refere_meta.json
{
"ownerId": "kn715jrbbh71q9zncr0bqdkr8n848q1a",
"slug": "compound-eng-react-frontend",
"version": "5.0.1",
"publishedAt": 1791047222338
}references/components-and-state.md
# Components, state, and interaction
## Component TypeScript
- Extend native elements with `ComponentPropsWithoutRef<'button'>`, add custom props via intersection
- Use `React.ReactNode` for children, `React.ReactElement` for single element, render prop `(data: T) => ReactNode`
- Discriminated unions for variant props; TypeScript narrows automatically in branches
- Generic components: `<T>` with `keyof T` for column keys, `T extends { id: string }` for constraints
- Event types: `React.MouseEvent<HTMLButtonElement>`, `FormEvent<HTMLFormElement>`, `ChangeEvent<HTMLInputElement>`
- `as const` for custom hook tuple returns
- `useRef<HTMLInputElement>(null)` for DOM (use `?.`), `useRef<number>(0)` for mutable values
- Explicit `useState<User | null>(null)` for unions/null
- Pass optional handlers through unwrapped: `onX={(a) => handler?.(a)}` is always truthy, so a child that renders a control only when `onX` is provided always renders it, and the click silently does nothing. Pass `handler` (or `undefined`) and gate the control on the real handler's presence.
- useReducer actions as discriminated unions: `{ type: 'set'; payload: number } | { type: 'reset' }`
- useContext null guard: throw in custom `useX()` hook if context is null
- **A parameter type whose properties are all optional is a weak type, and a mismatched argument fails to compile rather than passing `undefined`.** TypeScript requires the argument to share at least one property with a weak type, so `(record: { newField?: boolean })` rejects a generated type that does not yet carry `newField` with `TS2559: Type 'X' has no properties in common with type 'Y'`. Intersect with the base type instead (`T & { newField?: boolean }`); the shim then deletes cleanly once the field lands upstream
## Concurrency & Race Classes
Five race classes survive type-checking and unit tests; hunt each one during review (cleanup/cancellation mechanics: Effect rules above):
| Class | Production signal | Fix |
|-------|-------------------|-----|
| Lifecycle cleanup gap | "state update on unmounted component" warnings, leaks under rapid navigation | Return cleanup from every effect that registers a listener/timer/observer |
| Remount-timing mistake | Async callback mutates state/DOM after route change/unmount (`fetch().then(setData)` resolves post-navigation) | Cancel per the cancellation hierarchy |
| Boolean-as-state for non-binary UI | Contradictory combos (`isLoading: true, error: Error`) | State constant (`'idle' \| 'loading' \| 'success' \| 'error'`) + transition function; invalid states unreachable |
| Stale promise/timer, no cancel path | Promise chain or `setTimeout` holds `setState` after the component moved on | Bind every async op to a cancel mechanism; test the cleanup path |
| Per-element handlers on large lists | N closures/subscriptions per row, stale-closure bugs on rapid re-renders | Delegate: one parent handler + `event.target.closest(...)` when >~50 items or frequent updates |
| Gate keyed references/e2e-testing.md
# E2E Testing with Playwright
> When to read: when authoring Playwright end-to-end tests: directory layout, fixtures, page objects, network mocking, CI integration.
## Directory Structure
```
project-root/
├── playwright.config.ts
└── e2e/
├── fixtures/
│ ├── auth.fixture.ts
│ └── test-data.fixture.ts
├── pages/
│ ├── base.page.ts
│ └── <page-name>.page.ts
├── tests/
│ ├── auth/
│ │ └── login.spec.ts
│ └── smoke/
│ └── critical-paths.spec.ts
└── utils/
└── api-helpers.ts
```
Naming: tests `<feature>.spec.ts`, page objects `<page>.page.ts`, fixtures `<concern>.fixture.ts`.
## Configuration
Keep this config at the project root and run the CLI from that root. Playwright resolves `testDir` relative to the config file. For a nested config, adjust its relative directories and pass `--config <path>` explicitly.
```typescript
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './e2e/tests',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: 'html',
expect: {
toHaveScreenshot: { animations: 'disabled' },
},
use: {
baseURL: 'http://localhost:5173',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
},
projects: [
{ name: 'setup', testDir: './e2e/fixtures', testMatch: 'auth.fixture.ts' },
{
name: 'chromium',
use: { ...devices['Desktop Chrome'], storageState: 'e2e/.auth/user.json' },
dependencies: ['setup'],
},
],
webServer: {
command: 'npm run dev',
url: 'http://localhost:5173',
reuseExistingServer: !process.env.CI,
},
});
```
## Page Object Model
Tests never use selectors directly; page objects encapsulate all locators and actions.
```typescript
// e2e/pages/base.page.ts
import { type Page, type Locator } from '@playwright/test';
export abstract class BasePage {
constructor(protected readonly page: Page) {}
abstract goto(): Promise<void>;
abstract readonly ready: Locator;
async waitForLoad() { await this.ready.waitFor(); }
get toast(): Locator { return this.page.getByRole('alert'); }
}
// e2e/pages/users.page.ts
export class UsersPage extends BasePage {
readonly ready: Locator;
readonly createButton: Locator;
readonly searchInput: Locator;
constructor(page: Page) {
super(page);
this.ready = page.getByRole('heading', { name: /users/i });
this.createButton = page.getByRole('button', { name: /create/i });
this.searchInput = page.getByRole('searchbox', { name: /search/i });
}
async goto() {
await this.page.goto('/users');
await this.waitForLoad();
}
async searchFor(query: string) {
const resp = this.page.waitForResponse('**/api/users?*');
await this.searchInput.fill(query);
await resp;
}
}
```
Rules: locators as public readonly properties, actions as async methods with internal waits, noreferences/locale-synchronization.md
# JSON locale synchronization Synchronize the requested messages with the application's installed message formatter and usage context. Produce a focused locale diff and report structural checks separately from language review. 1. Read the locale configuration and source messages. Trace each changed key to its component or call site. Identify the message's meaning, UI role, interpolation values, and space constraints; a key name alone does not establish translation context. 2. Compare source history to identify added, changed, and removed messages. If history is unavailable, report translation staleness as unknown. Key parity alone cannot show whether an existing translation still matches a changed source message. 3. Update only the authorized keys and locales. Preserve unrelated translations, non-string values, and array structure. Confirm usage before removing a message; absence from one source file does not prove the application no longer uses the key. 4. Preserve required placeholder names and formatter tokens exactly. Validate plural and select grammar with the installed formatter. Use the categories required by the target locale rather than copying the source locale's categories. Preserve interpolation bindings and the markup expected by the renderer; translated text may reorder placeholders or tags where the formatter permits it. 5. Parse the edited JSON and run the repository's locale or message validation. Check key coverage against the configured fallback policy. Verify placeholder compatibility, plural branches, markup structure, and unchanged non-string values. Reject a structurally valid message that loses a required substitution or branch. 6. Exercise changed messages in the UI, including representative plural values, long text, and right-to-left layout when applicable. Report linguistic accuracy or visual fit as unverified when no fluent review or browser check occurred. A parser or placeholder check establishes structural compatibility, not translation quality.
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/iliaal/skills/compound-eng-react-frontend",
"sourceUrl": "https://clawhub.ai/iliaal/skills/compound-eng-react-frontend",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-09T12:23:05.550Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-iliaal-compound-eng-react-frontend/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-iliaal-compound-eng-react-frontend/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-09T12:23:05.550Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "2.7K downloads",
"href": "https://clawhub.ai/iliaal/compound-eng-react-frontend",
"sourceUrl": "https://clawhub.ai/iliaal/compound-eng-react-frontend",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-09T12:23:05.550Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "5.0.1",
"href": "https://clawhub.ai/iliaal/compound-eng-react-frontend",
"sourceUrl": "https://clawhub.ai/iliaal/compound-eng-react-frontend",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-10-03T17:07:02.338Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-iliaal-compound-eng-react-frontend/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-iliaal-compound-eng-react-frontend/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 5.0.1",
"description": "v5.0.1",
"href": "https://clawhub.ai/iliaal/compound-eng-react-frontend",
"sourceUrl": "https://clawhub.ai/iliaal/compound-eng-react-frontend",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-10-03T17:07:02.338Z",
"isPublic": true
}
]
}Record generated Oct 10, 2026.
