Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/bullish0x/GameStudionpx agentmods add skills/bullish0x/gamestudio/r3f-state-managementWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/bullish0x/gamestudio/r3f-state-management)<a href="https://agentmods.dev/skills/bullish0x/gamestudio/r3f-state-management"><img src="https://agentmods.dev/badge/skills/bullish0x/gamestudio/r3f-state-management/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/bullish0x/gamestudio/r3f-state-management"><img src="https://agentmods.dev/badge/skills/bullish0x/gamestudio/r3f-state-management.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00024 | $0.03144 |
| Opus 5.5 | $0.00010 | $0.01258 |
| Sonnet 5.5 | $0.00005 | $0.00629 |
| Haiku 4.5 | $0.00002 | $0.00314 |
Grade A, and why
r3f-state-management scanned grade A with 1 finding 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 2mo 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
const response = await fetch(url); How it starts
The opening of the file, as written. The whole thing — 495 lines — stays where its author put it; the contents beside it link to each section on GitHub.
R3F State Management
When to Use
Use this skill when:
- Managing global game state in R3F
- Sharing state between 3D and UI components
- Implementing player state, inventory, score
- Coordinating multiple 3D objects
- Optimizing state updates for performance
Core Principles
- Zustand for Global State: Fast, minimal re-renders
- React Context for Scoped State: Component trees
- Local State for Component-Only: useState
- Immutable Updates: Never mutate state directly
- Selectors for Performance: Subscribe to slices
- Avoid Props Drilling: Use stores or context
Implementation
1. Zustand Store Setup
// stores/gameStore.ts
import { create } from 'zustand';
import { devtools, persist } from 'zustand/middleware';
interface GameState {
// Player state
playerPosition: [number, number, number];
playerHealth: number;
playerScore: number;
// Game state
isPaused: boolean;
gameLevel: number;
enemies: Array<{ id: string; position: [number, number, number] }>;
// Actions
setPlayerPosition: (position: [number, number, number]) => void;
damagePlayer: (amount: number) => void;
addScore: (points: number) => void;
togglePause: () => void;
nextLevel: () => void;
spawnEnemy: (id: string, position: [number, number, number]) => void;
removeEnemy: (id: string) => void;
reset: () => void;
}
const initialState = {
playerPosition: [0, 1, 0] as [number, number, number],
playerHealth: 100,
playerScore: 0,
isPaused: false,
gameLevel: 1,
enemies: [],
};
export const useGameStore = create<GameState>()(
devtools(
persist(
(set) => ({
...initialState,
setPlayerPosition: (position) =>
set({ playerPosition: position }),
damagePlayer: (amount) =>
set((state) => ({
playerHealth: Math.max(0, state.playerHealth - amount),
})),
addScore: (points) =>
set((state) => ({ playerScore: state.playerScore + points })),
togglePause: () =>
set((state) => ({ isPaused: !state.isPaused })),
nextLevel: () =>
set((state) => ({
gameLevel: state.gameLevel + 1,
enemies: [],
})),
spawnEnemy: (id, position) =>
set((state) => ({
enemies: [...state.enemies, { id, position }],
})),
removeEnemy: (id) =>
set((state) => ({
enemies: state.enemies.filter((e) => e.id !== id),
})),
reset: () => set(initialState),
}),
{
name: 'game-storage',
partialize: (state) => ({
playerScore: state.playerScore,
gameLevel: state.gameLevel,
}),
}
)
)
);
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.
- 2mo ago First seen · 495 lines · 24 tokens per session scan A d8ccc4200b84
r3f-state-management is a skill published in the GitHub repository bullish0x/GameStudio (29 stars, last pushed 5mo ago), licensed MIT. It adds 24 tokens to every session and 3,144 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
r3f-state-management compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| r3f-state-managementbullish0x/GameStudio | Skill | 29 | 5mo ago | MIT | A | 24 | Claude Code |
| generic-react-ux-designertravisjneuman/.claude | Skill | 115 | yesterday | MIT | A | 69 | Claude Code |
| generic-react-feature-developertravisjneuman/.claude | Skill | 115 | yesterday | MIT | A | 53 | Claude Code |
| generic-react-code-reviewertravisjneuman/.claude | Skill | 115 | yesterday | MIT | A | 71 | Claude Code |
| generic-react-design-systemtravisjneuman/.claude | Skill | 115 | yesterday | MIT | A | 59 | Claude Code |
| ar-vr-xrtravisjneuman/.claude | Skill | 115 | yesterday | MIT | A | 50 | Claude Code |
| agent-react-experttravisjneuman/.claude | Skill | 115 | yesterday | MIT | A | 11 | Claude Code |