editor-perf

A guide for measuring and improving the performance of Grida's web canvas editor. It focuses on the TypeScript state reducer, Immer state updates, React subscriptions, and benchmarks for editor interactions.

In plain words
What is it for?
Use it to profile or benchmark dragging, resizing, colour changes, opacity controls, reducer dispatches, and related TypeScript or React editor operations.
Why use it?
It helps identify whether slow behavior comes from state updates, rendering subscriptions, or another part of the web editor. It also distinguishes this work from performance tuning in the separate Rust rendering engine.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/gridaco/grida/editor-perf
Any agent
npx skills add gridaco/grida --skill editor-perf
Clone the repo
git clone --depth 1 https://github.com/gridaco/grida

Made for: Claude Code, Codex.

Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,677 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00069 $0.04677
Opus 5 $0.00034 $0.02338
Sonnet 5 $0.00014 $0.00935
Haiku 4.5 $0.00007 $0.00468

Measured 2d ago against content hash af10b626f256, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

editor-perf scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/editor-perf/SKILL.md · 497 lines

How it starts

The opening of the file, as written. The whole thing — 497 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Grida Canvas Editor — Performance Development

Workflow and reasoning framework for performance work on the TypeScript editor pipeline — the reducer, Immer state management, React subscription layer, and headless benchmarks.

Scope boundary: This skill covers the JS/TS editor pipeline (editor/grida-canvas/). For the Rust rendering engine (the grida crate), use the engine repo's render-perf skill: https://github.com/gridaco/nothing/blob/main/.agents/skills/render-perf/SKILL.md. The two pipelines are connected — a dispatch in JS may trigger a WASM re-render — but they are profiled with different tools, in different repos.

Maintaining this document: If you notice a section that has gone stale (e.g. a workflow step no longer matches the code, a discovery query returns nothing, or a pitfall has been resolved), update this SKILL.md as part of your current task. Keep it high-level — reference patterns and categories rather than specific function names or measured numbers, which change frequently.

When to Use This Skill

  • Benchmarking or profiling editor reducer operations
  • Diagnosing slow interactions (drag, resize, color picker, opacity slider)
  • Investigating Immer overhead or state cloning costs
  • Instrumenting code with PerfObserver spans
  • Writing or running the editor bench
  • Optimizing queries, snap targets, hover resolution
  • Reducing React re-render cost from editor state subscriptions

Pick your measurement tool

Performance work starts with the right signal. The three tools below are complementary — do not skip the browser trace if the user offers one, do not open a browser for a reducer-only regression.

Tool Use when What it catches What it misses
Browser trace (Chrome DevTools Performance) User provided a .json.gz trace, or the symptom is interaction-level (drag/nudge feels laggy). This is the truth. Everything on the main thread: React, selector cost, paint, compositor, GC, WASM, reducer, Immer, RAF. Not reproducible without the user's session
editor-bench (automated) Default for proactive investigation and A/B of a reducer / encode / WASM change. No user input needed. PerfObserver span table, per-scene (1K / 10K). Deterministic and comparable across runs. React render cost, DOM overlays, real RAF
Node CPU profile A bench span points at a hotspot but you need function-level detail inside it, or microtask timing. Function self-time and call chains within a single Node process. Browser-only code paths

Read the full file on GitHub · 497 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 497 lines · 69 tokens per session scan A af10b626f256

Subscribe to this mod's changes

editor-perf is a skill published in the GitHub repository gridaco/grida (2,629 stars, last pushed 12d ago), licensed Apache-2.0. It adds 69 tokens to every session and 4,677 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

react-hook-form

Correct React Hook Form usage anywhere in the monorepo — data flow, subscriptions, reset, dirty state, number inputs, and controlled-input rules. Load this BEFORE writing or modifying ANY form code, adding a field to an existing form, touching watch/useWatch/formState/getValues/setValue/reset, wiring a form into a…

supabase/supabase · 123 tokens

studio-queries

React Query conventions for data fetching in Supabase Studio. Use when writing or reviewing query hooks, mutation hooks, or query keys in apps/studio/data/ — including adding the first fetch or mutation for a new API endpoint or resource. Covers queryOptions pattern, keys.ts structure, mutation hook template, and…

supabase/supabase · 68 tokens

vercel-composition-patterns

React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.

supabase/supabase · 58 tokens

safe-sql-execution

Use whenever code will build, return, fetch, or execute SQL that runs against a user's real Postgres database — even when the request reads like an ordinary feature or bug fix and never says "security," "injection," or "SafeSqlFragment." This covers: writing or editing any pg-meta function, query builder, or endpoint…

supabase/supabase · 221 tokens

clickhouse-logs-queries

Write, review, and migrate Supabase logs queries against the ClickHouse-backed logs table (the logs.all.otel analytics endpoint). Use this whenever a task involves Logs Explorer SQL, the logattributes map, querying a log source (edgelogs, postgreslogs, authlogs, etc.), translating an old BigQuery cross join…

supabase/supabase · 152 tokens

studio-e2e-tests

Write and run Playwright E2E tests for Supabase Studio (e2e/studio). Use when asked to run e2e tests, write new E2E tests, or debug flaky or failing Playwright tests. Covers running commands, avoiding race conditions, waiting strategies, selectors, helper functions, and CI vs local differences.

supabase/supabase · 74 tokens