Advanced React 19 useTransition/useOptimistic

VerifiedSafe

Master useTransition/useOptimistic for server actions and optimistic updates, with Playwright E2E validation.

Sby Skills Guide Bot
DevelopmentAdvanced
108/9/2026
Claude Code
#react-19#usetransition#useoptimistic#nextjs#playwright

Recommended for

Our review

This skill guides advanced use of React 19 useTransition and useOptimistic in the Next.js frontend of the arbitragex-v2 monorepo, with Playwright E2E validation and strict doctrine.

Strengths

  • Enforces Zero-Mocks and Fail-Closed doctrine
  • Integrates the full lint, typecheck, build, test and E2E pipeline
  • Requires statistical benchmarks and comparison with public state of the art
  • Provides concrete safety rules (red CI, schema drift, secrets, risk gates)

Limitations

  • Specific to the arbitragex-v2 monorepo and its setup
  • Depends on existing Playwright infrastructure and Zod schemas
  • Not a generic recipe; no reusable implementation outside that repo
When to use it

Use when modifying server-action form state in the Next.js frontend of arbitragex-v2 and needing robust transition and optimistic update behavior.

When not to use it

Do not use for simple changes outside this monorepo, or when the validation infrastructure (CI, E2E, schemas) is unavailable.

Security analysis

Safe
Quality score75/100

The skill does not declare or instruct any tool usage that could be destructive or exfiltrate data. It outlines a structured development workflow, validation steps, and triggers tied to specific project contexts, with no shell commands or network operations beyond what a typical CI/CD pipeline entails.

No concerns found

Examples

Optimistic update for a server action form
Using the G005 skill, implement useOptimistic for the server action form state in frontend/app, and add Playwright E2E assertions for DEGRADED/UP/DOWN states with testid.
Benchmark useTransition vs direct mutation
Apply ARBX G005 doctrine: benchmark useTransition vs direct mutation on the arbitragex-v2 Next.js frontend with 95% CI, then validate with the Playwright test suite.
Audit existing form state against G005
Run the G005 skill to audit current server action form usage in frontend/app for useTransition/useOptimistic compliance, and produce forensic evidence with commit hash.

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