Reformats a figure component file to conform to the standard section order and naming conventions defined in the figure guidelines.
Reformats a Svelte figure component to follow the standard design pattern.
When the user invokes this skill, follow these steps:
Read both files:
diffusion-explorer/apps/rectified-flow-explainer/src/lib/figures/README.mdIdentify the existing code sections within the <script> tag. Look for:
Note which sections are present, their current order, and whether they have proper section comment separators.
Report to the user:
render instead of draw)Reorganize the <script> section into this order:
// ----------------------------------------------------------------
// Props
// ----------------------------------------------------------------
// ----------------------------------------------------------------
// State
// ----------------------------------------------------------------
// ----------------------------------------------------------------
// Helpers
// ----------------------------------------------------------------
// ----------------------------------------------------------------
// Setup
// ----------------------------------------------------------------
// ----------------------------------------------------------------
// Animations
// ----------------------------------------------------------------
// ----------------------------------------------------------------
// Drawing
// ----------------------------------------------------------------
// ----------------------------------------------------------------
// Event Handlers
// ----------------------------------------------------------------
// ----------------------------------------------------------------
// Lifecycle
// ----------------------------------------------------------------
// ----------------------------------------------------------------
// Reactive Blocks
// ----------------------------------------------------------------
Rules:
render -> draw)Use AskUserQuestion to present the proposed changes and ask for approval:
If approved, use the Edit tool to apply the reformatted code.
Run type-check to ensure no errors were introduced:
cd diffusion-explorer && npm run check
Report the result to the user.
useVisibilityHandlersetupTimeline() function should configure the timeline and register onTick$:) should always be at the end of the script