Advanced React 19 useTransition/useOptimistic

VerifiedSafe

Expert-level skill for implementing useTransition and useOptimistic in Next.js apps with server actions, following strict project doctrine and comprehensive E2E testing with Playwright.

Sby Skills Guide Bot
DevelopmentAdvanced
208/6/2026
Claude CodeCursorWindsurfCopilotCodex
#react-19#use-transition#use-optimistic#server-actions#nextjs

Recommended for

Our review

A specialized skill for applying React 19's useTransition and useOptimistic hooks within the arbitragex-v2 monorepo, following a strict 'Zero-Mocks / Fail-Closed' doctrine with validation through CI and E2E tests.

Strengths

  • Enforces a rigorous validation pipeline (lint, typecheck, build, tests, audit, E2E).
  • Provides explicit activation triggers for server actions form state.
  • Requires research-backed benchmarks and statistical evidence.
  • Aligns with repo-specific architecture and schema contracts.

Limitations

  • Tightly coupled to the arbitragex-v2 monorepo and its doctrine, so it is not a generic React tutorial.
  • May abort tasks on CI failures or schema drift, requiring fix-forward actions.
  • Focuses on process and doctrine; actual hook implementation details are not covered.
When to use it

When implementing or improving React 19 useTransition/useOptimistic patterns in a server actions form state context within the arbitragex-v2 frontend.

When not to use it

When working outside the arbitragex-v2 repo or when you need a general introduction to React 19 hooks without the Post-Doc rigor.

Security analysis

Safe
Quality score85/100

Skill is a static guide with no executable payloads. The Quick Start command runs a test suite with safe environment variables, and all instructions focus on development validation and reporting within a known repository.

No concerns found

Examples

Implement optimistic UI for server action form
Implement useOptimistic for the trade form server action in arbitragex-v2, following the G005 skill doctrine for advanced React 19 useTransition/useOptimistic.
Refactor form state with useTransition
Refactor the server actions form state in the frontend to use useTransition, respecting Zero-Mocks and Fail-Closed rules from arbitragex-v2 G005.
Run E2E validation for optimistic updates
Run the G005 Playwright E2E tests for optimistic UI updates in arbitragex-v2 and report evidence according to the skill's output format.

name: arbx-g-g005-advanced-react-19-usetransitionuseoptimistic description: "Post-Doc skill alineada al monorepo hefarica/arbitragex-v2 (Frontend Doctrinal (Next.js + Playwright)). Se activa cuando: server actions form state. Doctrina OMEGA Zero-Mocks · Fail-Closed · El Remoto Manda."

G005 — Advanced React 19 useTransition/useOptimistic

Dominio: Frontend Doctrinal (Next.js + Playwright) Nivel: Post-Doc Trigger: server actions form state Repos de referencia: vercel/next.js · facebook/react · microsoft/playwright · TanStack/query · shadcn-ui/ui · radix-ui/primitives · wevm/viem · wagmi-dev/wagmi Archivos del repo: frontend/app/* · frontend/components/* · frontend/tests/e2e/* · packages/schemas/*

Quick Start

ARBX_BUILD_FOR_LOCAL_E2E=1 ARBX_ASSUME_NO_RPC=1 pnpm playwright test --reporter=list,html

Core Workflow

  1. Cargar contexto del repo hefarica/arbitragex-v2 (rama actual, último PR, estado de CI).
  2. Identificar el subsistema impactado dentro de los archivos del repo listados arriba.
  3. Aplicar la doctrina del nivel Post-Doc sin desviaciones.
  4. Validar contra: lint → typecheck → build → tests → audit → E2E → deploy.
  5. Reportar evidencia en formato Markdown forense (logs, traces, métricas, hash de commit).

Doctrina del Nivel

  • Aporte de investigación: paper o RFC referenciado.
  • Benchmarks reproducibles con criterio estadístico (95% CI).
  • Comparativa contra estado del arte público.

Reglas de Ejecución

| Condición | Acción | |-----------|--------| | CI rojo en main | ABORT — fix-forward, nunca skip | | Drift schema producer↔consumer | ABORT — restaurar isomorfismo Zod/struct | | Cobertura E2E < contrato iter 18 | ABORT — añadir testid + assertion DEGRADED/UP/DOWN | | Secret en plaintext fuera de Vault/age | ABORT — rotar y reportar | | Profit neto ≤ gas + flashloan_fee | ABORT (skill C/E) | | Slippage > banda RiskGate | RESIZE o ABORT (skill C/E) |

Activation Triggers (regex parciales)

  • server actions form state
  • advanced react 19 usetransition/useoptimistic
  • arbitragex-v2 g

Output Esperado

  • Diff atómico (rustfmt aparte de semántica).
  • Evidencia: gh pr checks <N>, cargo nextest, traces OTel, screenshots Playwright.
  • ADR si la decisión cambia contrato (docs/adr/NNNN-*.md).

Related skills