Render Stability Guardrails
Make render optimisation provable, so it removes work instead of introducing stale UI.
What it adds
A set of rules and checks governing memoisation, keys, and render boundaries on the app's busiest views.
What your agent is told to do
5
What your agent is told to do
5-
1
Profile a real interaction on a real view before changing anything, and write down the cost being removed. An optimisation with no measured baseline cannot be shown to have worked and cannot be safely reverted.
-
2
Require every cached callback and derived value to declare each value it reads, and treat a missing declaration as a defect — a handler holding last render's values will act on data the user can no longer see.
-
3
Derive list keys from the stable identity of the record. A position-based key silently reuses the wrong element as soon as the list is sorted, filtered, or has an item removed from the middle.
-
4
Exercise the app under the framework's development double-render and its concurrent scheduling behaviour, because side effects performed during render and effects that assume they run exactly once only misbehave there.
-
5
Do not memoise every component as a matter of course. Comparison is not free, a component receiving a freshly built object or inline function on each render is never actually skipped, and blanket caching hides the one place that was genuinely slow.
Edge cases it handles
7
Edge cases it handles
7- An optimisation added without a measurement is indistinguishable from a regression. Keep the before-and-after profile with the change so the next person can tell which it was.
- A cached handler that captured an earlier value will submit stale form data, act on a record the user already deleted, or ignore a filter that has since changed. Verify handlers against changing state, not just against a first render.
- Keys must be stable across reorders and meaningful across renders. Reusing a position as a key will leave typed input, selection, and scroll position attached to the wrong row.
- Development double-rendering and concurrent scheduling will run effects and render bodies more than once. Subscriptions, timers, and analytics events must tolerate that without duplicating, and cleanup must genuinely undo setup.
- Memoisation is defeated by props rebuilt on each render — objects, arrays, and inline functions declared in the parent. Confirm the boundary actually skips work rather than assuming it does.
- Deriving state from props into local state creates two sources of truth that drift; prefer computing during render over copying.
- Cell and row components inside a windowed list are the usual subject here — memoisation of those belongs to this brief, while the windowing itself belongs to the Windowed Grid Primitive.
Definition of done
8
Definition of done
8- Every memoisation in the codebase has a recorded measurement showing what it saves.
- Cached callbacks and derived values declare all the values they read.
- No list key is derived from array position on a list that can reorder, filter, or delete.
- The app behaves correctly under development double-rendering and concurrent scheduling, with no duplicated subscriptions, timers, or events.
- Memoised boundaries verifiably skip work rather than being defeated by freshly constructed props.
- No component copies props into local state where a derived value would do.
- The feature matches the existing design system.
- No existing functionality is broken.
Related features
Layout Shift Guard
Layout Shift Guard
Stop content jumping as a page loads, and catch it when it starts happening again.
What it does
Reserved space for everything that arrives late, plus measurement that reports unexpected movement on the app's main screens.
How it works
- 1 Walk the app's main screens with the network throttled and note everything that moves after first paint. Images, avatars, embeds, banners, ad slots, and asynchronously loaded panels are the usual sources.
- 2 Give every image, video, iframe, and embed explicit dimensions or a fixed aspect ratio so its box exists before its content arrives, including the ones whose size comes from data.
- 3 Control the swap from fallback to web font so the two have compatible metrics, and accept a slightly imperfect fallback over a page that reflows once the real font lands.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/layout-shift-guard
UI Performance Budget
UI Performance Budget
Put a number on how heavy and how slow each screen is allowed to get.
What it does
Per-route limits on script, stylesheet, image and font weight, first render, and interaction delay, checked automatically before a change ships.
How it works
- 1 Measure the app's current numbers per route first and set the budget slightly under them. A budget invented from a best-practice article that the app already exceeds is ignored on the day it lands.
- 2 Budget each route separately. The marketing page, the sign-in screen, and the main editor have nothing in common, and one global number either strangles the editor or lets the landing page rot.
- 3 Cover both weight and behaviour: bytes shipped by category, time to first meaningful render, and the delay between a click and a visible response.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/ui-performance-budget
Visual Asset Optimization Pipeline
Visual Asset Optimization Pipeline
Turn source artwork into small, correct derivatives without losing the detail that matters.
What it does
A repeatable processing step that derives sized and compressed variants for every image, icon, and illustration the app ships.
How it works
- 1 Locate every visual asset the app serves — bundled artwork, icons, illustrations, and user uploads — and bring them all through one processing path instead of optimising some by hand.
- 2 Keep the untouched original of every asset in a place the pipeline can reach, so a change in format or quality target can be applied by reprocessing rather than by re-sourcing artwork nobody can find.
- 3 Set the compression target per kind of asset. A photograph tolerates aggressive compression; a screenshot containing text and a flat illustration with hard edges show artefacts at the same setting.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/visual-asset-optimization-pipeline
How it works
-
1
Copy the link
Grab the Markdown instruction URL for this feature.
-
2
Give it to your AI
Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.
-
3
It inspects, then implements
Your agent reads your existing app first, then adds the feature to fit it.
Works with your stack
These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.
Need it tighter than that? Customize the feature and tell it exactly what you're running.