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
Font Subsetting
Font Subsetting
Load only the glyphs a page needs, without breaking the alphabets it did not expect.
What it does
Per-script font subsets with declared character ranges and a fallback order for characters no subset covers.
How it works
- 1 Inventory the weights, styles, and families the app genuinely renders. Most projects ship two or three weights they never use, and dropping those is a larger win than any subsetting.
- 2 Split each family by writing system and declare the character ranges each file covers, so a page that renders only Latin text never fetches the Cyrillic or Greek file.
- 3 Choose subsets from the locales the product supports and the languages its users actually write in, not from the words currently on the page.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/font-subsetting
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
Adaptive Media Source Component
Adaptive Media Source Component
Serve each image and video at a size and format the viewer's device can actually use.
What it does
One media component that chooses source, format, and dimensions from the rendered box and the browser's declared support.
How it works
- 1 Find every place the app renders a raw image or video element and route them all through a single component, so source selection is decided in one place rather than per template.
- 2 Derive the candidate widths from the sizes the element is genuinely rendered at across the app's breakpoints, and describe those sizes to the browser accurately — an inaccurate size hint is worse than none.
- 3 Always render an intrinsic width and height or an aspect ratio, so the box occupies its final space before any bytes arrive.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/adaptive-media-source-component
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.