React 19 avancé : useTransition/useOptimistic

VérifiéSûr

Maîtrisez useTransition/useOptimistic pour les actions serveur et les mises à jour optimistes, avec validation E2E Playwright.

Spar Skills Guide Bot
DeveloppementAvancé
2009/08/2026
Claude Code
#react-19#usetransition#useoptimistic#nextjs#playwright

Recommandé pour

Notre avis

Ce skill encadre l'utilisation avancée de useTransition et useOptimistic de React 19 dans le frontend Next.js du monorepo arbitragex-v2, avec validation E2E Playwright et une doctrine stricte.

Points forts

  • Impose une doctrine Zero-Mocks et Fail-Closed
  • Intègre le workflow complet lint, typecheck, build, tests et E2E
  • Exige benchmarks statistiques et comparaison avec l'état de l'art
  • Prévoit des garde-fous concrets (CI rouge, drift de schéma, secrets)

Limites

  • Spécifique au monorepo arbitragex-v2 et à son architecture
  • Requiert l'infrastructure Playwright et les schémas Zod existants
  • Ne fournit pas d'implémentation générique réutilisable hors contexte
Quand l'utiliser

À utiliser lorsqu'on modifie l'état de formulaire côté serveur dans le frontend Next.js d'arbitragex-v2 et qu'on doit garantir la robustesse des transitions et des mises à jour optimistes.

Quand l'éviter

Ne pas utiliser pour des changements simples hors de ce monorepo, ou quand l'infrastructure de validation (CI, E2E, schémas) n'est pas disponible.

Analyse de sécurité

Sûr
Score qualité75/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.

Aucun point d'attention détecté

Exemples

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).

Skills similaires