format-figure

Reformats a figure component file to conform to the standard section order and naming conventions defined in the figure guidelines.

16 stars

Best use case

format-figure is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Reformats a figure component file to conform to the standard section order and naming conventions defined in the figure guidelines.

Teams using format-figure should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/format-figure/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/development/format-figure/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/format-figure/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How format-figure Compares

Feature / Agentformat-figureStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Reformats a figure component file to conform to the standard section order and naming conventions defined in the figure guidelines.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Format Figure

Reformats a Svelte figure component to follow the standard design pattern.

## Instructions

When the user invokes this skill, follow these steps:

### 1. Determine the target file

- If a file path is provided as an argument, use that
- If the user has been working on a figure file in this conversation, use that
- Otherwise, ask the user to specify the file path

### 2. Read the guidelines and target file

Read both files:
- Guidelines: `diffusion-explorer/apps/rectified-flow-explainer/src/lib/figures/README.md`
- The target figure file

### 3. Analyze the current structure

Identify the existing code sections within the `<script>` tag. Look for:
- Props (export let statements)
- State (local variables, canvas, ctx, scales, flags)
- Helper functions (pure utility functions)
- Setup functions (runInitialComputation or similar)
- Animation setup (setupTimeline or similar)
- Drawing functions (draw and draw helpers)
- Event handlers (canvas clicks, slider input, visibility changes)
- Lifecycle (onMount, onDestroy)
- Reactive blocks ($: statements)

Note which sections are present, their current order, and whether they have proper section comment separators.

### 4. Identify issues

Report to the user:
- Missing section separators
- Sections in wrong order
- Non-standard function names (e.g., `render` instead of `draw`)
- Missing visibility handling (if the figure has animations)

### 5. Propose reformatted code

Reorganize the `<script>` section into this order:

```
// ----------------------------------------------------------------
// Props
// ----------------------------------------------------------------

// ----------------------------------------------------------------
// State
// ----------------------------------------------------------------

// ----------------------------------------------------------------
// Helpers
// ----------------------------------------------------------------

// ----------------------------------------------------------------
// Setup
// ----------------------------------------------------------------

// ----------------------------------------------------------------
// Animations
// ----------------------------------------------------------------

// ----------------------------------------------------------------
// Drawing
// ----------------------------------------------------------------

// ----------------------------------------------------------------
// Event Handlers
// ----------------------------------------------------------------

// ----------------------------------------------------------------
// Lifecycle
// ----------------------------------------------------------------

// ----------------------------------------------------------------
// Reactive Blocks
// ----------------------------------------------------------------
```

Rules:
- Preserve all code functionality
- Only include sections that have content (don't add empty sections)
- Use the exact separator format: 64 dashes
- Keep related code together within sections
- Rename non-standard functions if applicable (e.g., `render` -> `draw`)

### 6. Ask for confirmation

Use AskUserQuestion to present the proposed changes and ask for approval:
- Summarize what will change (sections reordered, separators added, etc.)
- Ask if the user wants to proceed

### 7. Apply changes

If approved, use the Edit tool to apply the reformatted code.

### 8. Verify

Run type-check to ensure no errors were introduced:

```bash
cd diffusion-explorer && npm run check
```

Report the result to the user.

## Notes

- The draw function should take animation state as a parameter, not time directly
- For animated figures, ensure visibility handling is present using `useVisibilityHandler`
- The `setupTimeline()` function should configure the timeline and register `onTick`
- Reactive blocks (`$:`) should always be at the end of the script
- There should be no magic numbers in functions. Configurable parameters that change the computation that is done or how the animation is styled should be exposed as props and grouped appropriately.

Related Skills

format-euler-code

16
from diegosouzapw/awesome-omni-skill

Enforce the Euler repository C++ formatting and style rules from AGENTS.md. Use when writing, editing, or reviewing Euler solution code so it matches required includes, types, layout, namespaces, and I/O conventions.

Fixed Video Format (9:16)

16
from diegosouzapw/awesome-omni-skill

Fixed 1080x1920 pixel video format with percentage-based positioning. Use this when laying out video compositions, positioning elements on the canvas, or calculating dimensions. All videos render at exactly 9:16 aspect ratio for TikTok/Instagram Reels.

configure

16
from diegosouzapw/awesome-omni-skill

Configure pattern-radar sources, weights, and domains.

configure-chatkit

16
from diegosouzapw/awesome-omni-skill

This skill should be used when setting up OpenAI ChatKit in Next.js, adding domain allowlist to environment, building chat UI component, integrating with /api/chat endpoint, displaying history and tool calls visually, and integrating Better Auth session.

code_formatter

16
from diegosouzapw/awesome-omni-skill

Otomatik kod formatlama, Prettier/ESLint entegrasyonu ve kod stil tutarlılığı rehberi.

architecture-format-extended

16
from diegosouzapw/awesome-omni-skill

Extended architecture templates with full examples. Imports architecture-format-core for base structure.

actionable-review-format-standards

16
from diegosouzapw/awesome-omni-skill

Standardized output format for code reviews with severity labels, file:line references, and fix code snippets. Use when generating review reports that need consistent, actionable feedback structure.

1k-date-formatting

16
from diegosouzapw/awesome-omni-skill

Date and time formatting for OneKey applications. Use when displaying dates, timestamps, or formatting time in UI components. Always use OneKey utilities instead of native JS date methods. Triggers on date, time, timestamp, formatDate, formatTime, toLocaleDateString, toLocaleString, dateUtils, locale, format, display date, show time, datetime, calendar.

configure-downstream

16
from diegosouzapw/awesome-omni-skill

Configure Konflux for new Submariner version - creates overlays, tenant config, and RPAs for Y-stream releases.

dbt-transformation-patterns

16
from diegosouzapw/awesome-omni-skill

Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or ...

verify-information-rule

16
from diegosouzapw/awesome-omni-skill

This rule ensures that the AI always verifies information before presenting it, avoiding assumptions and speculation.

pre-configured-apis-rules

16
from diegosouzapw/awesome-omni-skill

Rules for using pre-configured APIs in the project, using them only if they are required by the project.