Agent skill

React Native Mmkv

by margelo in margelo/react-native-skills

Fast synchronous key-value storage for React Native via react-native-mmkv (Nitro-backed).

MITAuto-check passedMobile

Install React Native Mmkv

skills CLI
$ npx skills add margelo/react-native-skills --skill react-native-mmkv -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install margelo/react-native-skills react-native-mmkv --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/margelo/react-native-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/react-native-mmkv .claude/skills/react-native-mmkv && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
react-native-mmkv
GitHub stars
175
Token cost
~2.1k tokens
SKILL.md length
600 words
Files
10 (incl. references)
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

Fast synchronous key-value storage for React Native via react-native-mmkv (Nitro-backed).

  • Works in 3 steps: Everything is synchronous. No await, no… → It's a key-value store, not a database.… → V4 is a breaking rewrite. The…
  • Tasks that involve Cross-platform mobile apps
  • SKILL.md covers Mental model, Routing table — problem to…, Installation and Quick reference — full MMKV…, plus 4 more sections
  • Calls npx and npm

What it does

React Native Mmkv is an agent skill from margelo/react-native-skills. Fast synchronous key-value storage for React Native via react-native-mmkv (Nitro-backed). Covers creating and configuring MMKV instances, reading/writing all value types (string, number, boolean, buffer), React hooks for reactive UI, value-change listeners, encryption, AsyncStorage migration, and state-management integrations (zustand, redux-persist, jotai, react-query). Also covers storage limits, multi-process mode, and the V4 upgrade from the class-based API.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 10 other files, including reference files (for example `references/create-instance.md`, `references/crud-operations.md` and `references/encryption.md`).

It sits in Mobile, covering Cross-platform mobile apps and State management. It works with React Native, React, Redux and TanStack. The repository describes itself as: The best react-native Agent Skills. Forget 10x, this is 100x. The licence is MIT.

When your agent uses it

  • Tasks that involve Cross-platform mobile apps
  • Tasks that involve State management

Example prompts

  • “/react-native-mmkv”

Requirements

  • Node.js

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Everything is synchronous. No await, no Promises. storage.getString('key') returns the value immediately. This is the whole point — MMKV…
  2. It's a key-value store, not a database. All data is cached in memory. Keep total size under ~100 MB; for larger datasets use…
  3. V4 is a breaking rewrite. The constructor changed from new MMKV() to createMMKV(), .delete() became .remove(), and…

What it can do on your machine

Read from SKILL.md and the folder at commit 1e9e17b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

React Native Mmkv loads about 2.1k tokens when it runs, and up to ~12k if it reads all its reference files. Until then it costs about 121 tokens; SKILL.md has 600 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~121
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~12k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from margelo/react-native-skills at commit 1e9e17b, republished under its MIT licence (© margelo). 600 words, ~2,147 tokens.

Download SKILL.mdSave it as .claude/skills/react-native-mmkv/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.
name
react-native-mmkv
description
Fast synchronous key-value storage for React Native via react-native-mmkv (Nitro-backed). Covers creating and configuring MMKV instances, reading/writing all value types (string, number, boolean, buffer), React hooks for reactive UI, value-change listeners, encryption, AsyncStorage migration, and state-management integrations (zustand, redux-persist, jotai, react-query). Also covers storage limits, multi-process mode, and the V4 upgrade from the class-based API.
license
MIT
metadata.author
margelo
metadata.scope
react-native-mmkv
metadata.tags
react-native, mmkv, storage, key-value, encryption, hooks, zustand, redux, jotai, react-query, async-storage, migration, nitro-modules

react-native-mmkv

A focused reference for AI coding assistants working in a project that uses react-native-mmkv. Answer using the real APIs from this library — not invented ones — by routing to the matching references/*.md file below.

Mental model

react-native-mmkv is a high-performance, synchronous key-value storage library for React Native, backed by Tencent's MMKV C++ engine via Nitro Modules (JSI). It is ~30x faster than AsyncStorage.

The three things that trip people up:

  1. Everything is synchronous. No await, no Promises. storage.getString('key') returns the value immediately. This is the whole point — MMKV memory-maps files and reads/writes in-process.
  2. It's a key-value store, not a database. All data is cached in memory. Keep total size under ~100 MB; for larger datasets use react-native-nitro-sqlite or WatermelonDB. There is no fixed storage limit — but memory warnings will fire if you go too large.
  3. V4 is a breaking rewrite. The constructor changed from new MMKV() to createMMKV(), .delete() became .remove(), and react-native-nitro-modules is now a required peer dependency. See the upgrade guide.

V4 requires React Native 0.75+. It works on both the New Architecture and the old architecture (Nitro is backwards compatible).

Routing table — problem to reference

Load the matching file from references/ before writing code. Each reference cites real APIs from the library.

User is asking about…Read
Creating an MMKV instance, configuration options (id, path, encryptionKey, mode, readOnly, compareBeforeSet), the createMMKV() factoryreferences/create-instance.md
Getting/setting values, all data types (string, number, boolean, buffer, objects via JSON), key management (contains, getAllKeys, remove, clearAll), size, trim, importAllFromreferences/crud-operations.md
React hooks (useMMKVString, useMMKVNumber, useMMKVBoolean, useMMKVBuffer, useMMKVObject, useMMKV, useMMKVListener, useMMKVKeys), reactive UIreferences/hooks.md
Listening for value changes outside of React, addOnValueChangedListener, cleaning up listenersreferences/listeners.md
Encryption (encrypt, decrypt, recrypt), AES-128 vs AES-256, encryptionKey configreferences/encryption.md
Migrating from AsyncStorage, data transfer pattern, completion flagreferences/migrate-from-async-storage.md
zustand persist middleware, redux-persist, jotai atomWithMMKV, react-query persister, MobXreferences/state-management.md
V4 upgrade, breaking changes from V3, new MMKV() → createMMKV(), .delete() → .remove()references/upgrade-v4.md
Storage size limits, memory warnings, when to use a database insteadreferences/limits-and-gotchas.md

If the question doesn't match any row, read references/create-instance.md first — most setup questions start there.

Installation

bash
npm install react-native-mmkv react-native-nitro-modules
cd ios && pod install

Expo:

bash
npx expo install react-native-mmkv react-native-nitro-modules
npx expo prebuild

After install, rebuild the app. No additional native wiring is required.

Show full SKILL.md (243 more words)Show less

Quick reference — full MMKV instance API

ts
import { createMMKV, existsMMKV, deleteMMKV } from 'react-native-mmkv'

const storage = createMMKV({ id: 'my-store' })

// Properties (read-only)
storage.id          // string
storage.length      // number of keys
storage.byteSize    // total file size in bytes
storage.size        // (deprecated — use byteSize)
storage.isReadOnly  // boolean
storage.isEncrypted // boolean

// Write
storage.set('key', 'string' | 42 | true | arrayBuffer)

// Read
storage.getString('key')   // string | undefined
storage.getNumber('key')   // number | undefined
storage.getBoolean('key')  // boolean | undefined
storage.getBuffer('key')   // ArrayBuffer | undefined

// Keys
storage.contains('key')    // boolean
storage.getAllKeys()        // string[]
storage.remove('key')      // boolean  (NOTE: was .delete() in V3)
storage.clearAll()         // void

// Encryption
storage.encrypt('password')
storage.encrypt('password', 'AES-256')
storage.decrypt()
storage.recrypt('newPassword' | undefined)  // (deprecated — use encrypt()/decrypt())

// Maintenance
storage.trim()                       // free unused space
storage.importAllFrom(otherStorage)  // returns count imported

// Listeners
const sub = storage.addOnValueChangedListener((key) => { ... })
sub.remove()

// Static helpers
existsMMKV('my-store')   // boolean
deleteMMKV('my-store')   // boolean

Testing

A mocked MMKV instance is automatically used when testing with Jest or Vitest. Use createMMKV() as normal in tests — no manual mocking needed.

Verifying the skill is loaded

Good test questions:

  • "How do I persist zustand state with MMKV?" → should produce a StateStorage adapter using storage.set, storage.getString, storage.remove — not AsyncStorage wrappers.
  • "How do I migrate from AsyncStorage to MMKV?" → should show the batch-copy pattern with a completion flag, not a drop-in replacement.
  • "What's the storage limit?" → should explain there's no fixed limit, but data is memory-mapped so keep it under ~100 MB; use SQLite for larger datasets.

References

FileDescription
create-instance.mdcreateMMKV() factory, all configuration options
crud-operations.mdSet/get all types, key management, objects, buffers
hooks.mdAll React hooks for reactive MMKV usage
listeners.mdaddOnValueChangedListener, cleanup
encryption.mdEncrypt/decrypt instances, AES options
migrate-from-async-storage.mdFull migration pattern from AsyncStorage
state-management.mdzustand, redux-persist, jotai, react-query, MobX
upgrade-v4.mdV3 → V4 breaking changes and migration
limits-and-gotchas.mdStorage limits, multi-process, logging, common pitfalls

Problem → Reference Mapping

ProblemReferenceAction
Don't know where to startcreate-instance.mdCreate instance with createMMKV()
Need reactive UI updateshooks.mdUse useMMKVString / useMMKVObject etc.
Encrypting sensitive dataencryption.mdCall storage.encrypt(key)
App uses AsyncStorage, want to switchmigrate-from-async-storage.mdBatch migrate then swap calls
Zustand/Redux/Jotai persistencestate-management.mdWire adapter for your state lib
Upgrading from V3 to V4upgrade-v4.mdnew MMKV() → createMMKV(), .delete() → .remove()
Storage growing too largelimits-and-gotchas.mdTrim or move to SQLite
Multi-process data sharinglimits-and-gotchas.mdSet mode: 'multi-process'

© margelo, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 9 other files (references) in skills/react-native-mmkv of margelo/react-native-skills.

  • SKILL.md
  • references/create-instance.md
  • references/crud-operations.md
  • references/encryption.md
  • references/hooks.md
  • references/limits-and-gotchas.md
  • references/listeners.md
  • references/migrate-from-async-storage.md
  • references/state-management.md
  • references/upgrade-v4.md

Open the folder on GitHubat commit 1e9e17b

Compare with similar skills

React Native Mmkv next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

React Native Mmkv compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
React Native Mmkv this skillmargelo/react-native-skills175—~2.1kAutomated safety check: PassMIT
React Native State ManagementHoangNguyen0403/agent-skills-standard570—~484Automated safety check: PassMIT
React Native Experttech-leads-club/agent-skills7k—~3.2kAutomated safety check: PassCC-BY-4.0
React NativeEliasOulkadi/shokunin114—~3kAutomated safety check: PassMIT
Olore Tanstack Form Latestolorehq/olore103—~1.1kAutomated safety check: PassMIT
React ExpertJeffallan/claude-skills12k—~1.4kAutomated safety check: PassMIT

Similar skills

  • React Native State Management

    HoangNguyen0403/agent-skills-standard

    Implement local and global state with Context, Zustand, and Redux Toolkit in React Native.

    570 GitHub stars~484 tokensUpdated yesterday
    MobileAuto-check passed
  • React Native Expert

    tech-leads-club/agent-skills

    Guides React Native and Expo work for cross-platform apps: Expo Router navigation, fast lists, Reanimated animation, platform-specific code and project structure.

    7k GitHub stars~3.2k tokensUpdated 17 days ago
    MobileAuto-check passed
  • React Native

    EliasOulkadi/shokunin

    Build production React Native apps with Expo SDK 53+, Expo Router (file-based navigation), New Architecture (Fabric + TurboModules), FlashList, Reanimated 4, Zustand for state, Hermes, EAS Build…

    114 GitHub stars~3k tokensUpdated 2 days ago
    MobileAuto-check passed
  • Local TanStack Form documentation reference (latest, v1.33.5).

    103 GitHub stars~1.1k tokensUpdated today
    MobileAuto-check passed
  • React Expert

    Jeffallan/claude-skills

    Builds React 19 components in TypeScript with Server Components, useActionState forms, custom hooks and state libraries, checked with tsc and React Testing Library.

    12k GitHub stars~1.4k tokensUpdated 4 days ago
    Frontend & DesignAuto-check passed
  • Lunora Realtime

    anolilab/lunora

    Wires Lunora's live data into a client. An agent skill from anolilab/lunora.

    283 GitHub stars~2.4k tokensUpdated today
    MobileAuto-check passed

More from margelo/react-native-skills

All 9 skills in this repo
  • Build Nitro Modules

    margelo/react-native-skills

    Builds and designs React Native Nitro Modules with Nitrogen, HybridObject TypeScript specs, Nitro View components, generated native implementations, zero-copy and native-state APIs, Swift/Kotlin/C++…

    175 GitHub stars~9.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Kotlin

    margelo/react-native-skills

    Design, implement, and review Kotlin and Android APIs. An agent skill from margelo/react-native-skills.

    175 GitHub stars~3k tokensUpdated 1 mo ago
    Auto-check passed
  • Swift

    margelo/react-native-skills

    Design, implement, and review Swift APIs and Apple-platform code.

    175 GitHub stars~3.2k tokensUpdated 1 mo ago
    Auto-check passed
  • Nitro Fetch

    margelo/react-native-skills

    Fast native networking primitives for React Native built on Nitro Modules — react-native-nitro-fetch, react-native-nitro-websockets, and react-native-nitro-text-decoder.

    175 GitHub stars~1.5k tokensUpdated 1 mo ago
    Auto-check passed
  • React Native Vision Camera Realtime

    margelo/react-native-skills

    Design and review production-grade low-latency VisionCamera v5 pipelines.

    175 GitHub stars~1.8k tokensUpdated 1 mo ago
    Auto-check passed
  • API Design

    margelo/react-native-skills

    Design and review predictable public APIs for TypeScript, JavaScript, React, and React Native libraries.

    175 GitHub stars~7.2k tokensUpdated 1 mo ago
    Auto-check passed

Categories

Questions about React Native Mmkv

What does React Native Mmkv do?

Fast synchronous key-value storage for React Native via react-native-mmkv (Nitro-backed). React Native Mmkv is an agent skill from margelo/react-native-skills. Fast synchronous key-value storage for React Native via react-native-mmkv (Nitro-backed).

When should I use React Native Mmkv?

React Native Mmkv fits situations like: tasks that involve Cross-platform mobile apps; tasks that involve State management.

How do I install React Native Mmkv in Claude Code?

Run `npx skills add margelo/react-native-skills --skill react-native-mmkv -a claude-code`. Or copy the skill folder (skills/react-native-mmkv in margelo/react-native-skills) into .claude/skills/react-native-mmkv in your project. Claude Code loads it when a task matches its description.

How do I install React Native Mmkv in Codex?

Run `npx skills add margelo/react-native-skills --skill react-native-mmkv -a codex`. Or copy the skill folder (skills/react-native-mmkv in margelo/react-native-skills) into .agents/skills/react-native-mmkv in your project. Codex loads it when a task matches its description.

Can I use React Native Mmkv in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add margelo/react-native-skills --skill react-native-mmkv -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/react-native-mmkv, .gemini/skills/react-native-mmkv, .github/skills/react-native-mmkv and .opencode/skills/react-native-mmkv in your project.

What does React Native Mmkv need to run?

Going by SKILL.md and its folder, React Native Mmkv needs the command-line tools its instructions call (npx and npm). Our summary lists: Node.js.

Does React Native Mmkv access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is React Native Mmkv safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does React Native Mmkv use?

React Native Mmkv is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does React Native Mmkv use?

About 2.1k tokens (SKILL.md is roughly 8.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 9.9k tokens, read only when the agent opens those files.

What are the alternatives to React Native Mmkv?

Skills that share tags, products or a category with React Native Mmkv: React Native State Management (HoangNguyen0403/agent-skills-standard, 570 stars), React Native Expert (tech-leads-club/agent-skills, 7k stars), React Native (EliasOulkadi/shokunin, 114 stars) and Olore Tanstack Form Latest (olorehq/olore, 103 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains React Native Mmkv?

margelo (a GitHub organization) maintains it in margelo/react-native-skills, which has 175 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on August 21, 2026.

Source: margelo/react-native-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.