بنقرة واحدة
refactor-to-runelight-react
Refactor existing React TSX into production .g.tsx UI models without preview wrappers.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Refactor existing React TSX into production .g.tsx UI models without preview wrappers.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Install, upgrade, or ensure Runelight preview/capture integration in a TypeScript React project or TypeScript Vue 3 project. Use when a project asks for "install Runelight", "set up Runelight", "upgrade Runelight", or "update Runelight"; this bootstrap skill detects the host, wires the integration, and verifies end-to-end.
Write, edit, or review Runelight React components in .g.tsx files. Use when working on React/TSX .g protocol components, GFrames, createGScopeHook, createGProvider, provider variants, JSX branch coverage, or React Runelight authoring diagnostics.
Write, edit, or review Runelight Vue SFC components in .g.vue files. Use when working on Vue .g protocol components, <g:frames>, template-first scope frames, Vite Vue preview, or Vue Runelight authoring diagnostics.
Polish Runelight-covered GUI through a required explicit sync before editing, then a red-team observe-edit-reobserve loop that works from product surface model down to details one confirmed point at a time. Use when the user asks to polish, refine, improve visual quality, clean up UI details, or make an existing `.g.tsx` / `.g.vue` interface feel better.
Refactor existing Vue 3 TypeScript SFCs into production .g.vue UI models without preview wrappers.
Ask the agent to do agent-driven end-to-end validation for this Runelight repo. Use when the user mentions intelligence test, `.it.md`, agent-driven E2E, or wants confidence beyond unit/type/build checks.
| name | refactor-to-runelight-react |
| description | Refactor existing React TSX into production .g.tsx UI models without preview wrappers. |
Convert existing React components into .g.tsx UI models.
.g.tsx writing patterns, route to authoring-runelight-react and read Authoring Reference.If the project isn't wired for Runelight yet, follow the Runelight setup playbook first.
.g.tsx owns real visual UI and enumerable visual states. Not a wrapper.
React UI can always move toward Runelight coverage. If the current file cannot be migrated directly, the real visual surface, state seam, or inspectable branch shape has not been exposed yet. Your job is to expose it.
When the user asks to migrate an app, screen, or set of React components, do not frame the task as finding components "suitable for Runelight." Runelight refactor is not a suitability filter over the file tree. Treat user-visible React UI as migratable until inspection proves otherwise, then choose the refactor move that exposes the real visual surface:
.g.tsx componentrunelight check; rewrite it into direct props/scope/provider expressionsskip is not a first-pass category for "complex" React. Hooks, context, async data, server work, feature flags, provider-dependent rendering, helper predicates, switch, stored JSX, and JSX-producing loops are reasons to split, create scope, declare providers, descend, extract, or normalize. Skip only when there is no owned visual surface after descent, the component's real public contract is non-visual, or the required behavior cannot be represented without adding a wrapper/runtime shell/product-boundary change.
children, render props, icons, actions, or slots, trace the real production values. Decide whether they are the component's public visual contract or evidence that the chosen entry is too high-level..g.tsx just wrap old TSX?.g.tsx, add frames.g.tsx and leave production work as caller/scopedescend: keep reading until finding real visual surfaces.migrate: move real UI + types + helpers into .g.tsx, add static frames, update imports.split: define Scope type, move production behavior behind useRealScope, wrap with createGScopeHook, render real TSX from .g.tsx component.extract: keep fetches, mutations, server APIs, route params, and production-only providers outside the .g.tsx view; pass their visible results through props or scope.normalize: preserve behavior while exposing branch reachability as direct conditionals over props, scope, providers, or static const facts.GProviderFrame; keep provider values in providers: [[Provider, value]]..g.tsx public contract, write representative frame fixtures. Use real pure child components, imported design-system pieces, or local static fixtures that preserve the production density, hierarchy, labels, controls, and edge state. Do not use trivial placeholder nodes to stand in for the primary surface..g.tsx, or defer with the concrete runtime blocker.if returns, &&, ||, and traceable map/render callbacks. Refactor helper predicates, switch, JSX-returning loops, and stored JSX variables before calling the refactor done../Component to ./Component.g. Preserve barrels.runelight check + project typecheck. Render preview if available, defaulting to the nearest covered app/screen/parent entry that contains the migrated surface. Use runelight containing-frames <entry[#export]> --json to find those top-level contexts. Use isolated preview only when no covered parent exists or when debugging the component's own frame contract.For project-wide migration requests, keep a short migration inventory: target surface, chosen action (migrate, split, descend, extract, normalize, or defer), created .g.tsx coordinate, important frames, verification status, and any deferred blocker. The inventory is for coverage planning; do not bulk-generate .g.tsx files from it.
For the packaged command reference and workflow prompts, read node_modules/@runelight/skills/references/cli.md.
.g.tsx that only renders <ExistingComponent {...props} /><RunelightPreviewRuntime> wrapping old clientsscope: { node: <OldComponent /> }children: <div>Content</div> or actions: <div /> when that slot determines the visual value of the preview*.impl.tsx or *.preview.g.tsx filesswitch, loops, or local JSX variables.g.tsx owns the migrated visual TSXrunelight check passes