Skip to main content
rule CX Codex

animation-derived-value — Claude Code rule: what it does

animation-derived-value is a Claude Code rule for computing one animated shared value from another. It applies to React Native Reanimated code that derives values.

AGPL-3.0 ★ 88 updated 2026-11-17

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/animation-derived-value.md
Open on GitHub

What animation-derived-value does

The rule directs the agent to use useDerivedValue for a value calculated from another shared value. The hook follows the values used in its calculation and exposes the result for use elsewhere.

Reserve useAnimatedReaction for effects such as logging or calling runOnJS. It is not the rule’s choice for producing a derived value. The guidance concerns animations built with React Native Reanimated.

What it helps with

  • calculate opacity from animation progress
  • replace a reaction that computes a value with a derived value
  • separate animated calculations from side effects

Example prompts for the agent

  • Calculate opacity from animation progress with the appropriate Reanimated hook.
  • Check whether useAnimatedReaction is being used correctly to compute this value.
  • Rewrite this shared-value calculation as a derived value.

How to install animation-derived-value

Manually: put the files in place

.claude/rules/animation-derived-value.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about animation-derived-value

How do I install animation-derived-value in Claude Code?

Add the rule file at .claude/rules/animation-derived-value.md.

What does animation-derived-value do?

It recommends useDerivedValue when one shared value is calculated from another. It reserves useAnimatedReaction for side effects.

When should I use useAnimatedReaction rather than useDerivedValue?

Use useDerivedValue for a value calculated from other values. useAnimatedReaction is for effects such as logging or calling runOnJS.

Similar IDE rules

All IDE rules for Design →

From the same set47

The whole set →
react-compiler-reanimated-shared-values react-compiler-reanimated-shared-values is a Claude Code rule for handling Reanimated shared values with React Compiler enabled. It directs code to use .get() and .set() rather than .value. CX Codex +1 ★ 88repo stars react-compiler-destructure-functions react-compiler-destructure-functions is a Claude Code rule that enforces extracting hook functions early in render scope. It targets projects running the React Compiler. CX Codex +1 ★ 88repo stars ui-scrollview-content-inset ui-scrollview-content-inset is a Claude Code rule for changing ScrollView spacing when keyboards, toolbars, or content alter the available space. CX Codex +1 ★ 88repo stars monorepo-single-dependency-versions monorepo-single-dependency-versions is a Claude Code rule that pins identical dependency versions across monorepo packages. It stops bundle bloat and runtime version clashes. CX Codex +1 ★ 88repo stars fonts-config-plugin fonts-config-plugin is a Claude Code rule that embeds Expo fonts at build time. It directs the assistant to configure the expo-font plugin instead of runtime loaders. CX Codex +1 ★ 88repo stars list-performance-images list-performance-images is a Claude Code rule for loading appropriately sized images in lists. It applies when editing interfaces that display image thumbnails. CX Codex +1 ★ 88repo stars imports-design-system-folder imports-design-system-folder is a Claude Code rule that forbids importing UI packages directly into application code. All components must pass through a local design system directory. CX Codex +1 ★ 88repo stars ui-pressable ui-pressable is a Claude Code rule for choosing touch components in React Native. It applies when an agent adds or edits buttons and list items. CX Codex +1 ★ 88repo stars

Project sponsors

Companies that keep this analytics open