patching-libraries

A reference for fixing broken third-party libraries in React Native apps by applying a local patch, maintaining a fork, replacing the library, or copying its code into the project.

In plain words
What is it for?
Use it to decide between patch-package, an upstream contribution, a fork, a replacement, or vendoring a small library.
Why use it?
It helps choose a maintainable response when a dependency has a bug, no released fix, or no active maintainer. It also explains how to keep local patches working through upgrades.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/anilburcu/claude-code-react-native/patching-libraries
Any agent
npx skills add AnilBurcu/claude-code-react-native --skill patching-libraries
Clone the repo
git clone --depth 1 https://github.com/AnilBurcu/claude-code-react-native

Made for: Claude Code, Codex.

Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 810 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00059 $0.00810
Opus 5 $0.00030 $0.00405
Sonnet 5 $0.00012 $0.00162
Haiku 4.5 $0.00006 $0.00081

Measured yesterday against content hash 7de2a68c1a42, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

patching-libraries scanned grade A with 0 findings 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 yesterday.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/rn/skills/patching-libraries/SKILL.md · 41 lines

How it starts

The opening of the file, as written. The whole thing — 41 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Patching third-party libraries without regret

The decision ladder

Work down, stop at the first rung that holds:

  1. A released fix exists: upgrade. Check the library's releases and the issue matching your exact error before doing anything clever.
  2. The fix is small and upstream is alive: patch locally AND open the upstream PR (or link the existing one). The patch is a bridge, not a home.
  3. The fix is small and upstream is dead: patch locally and put the library on the replacement list. A patched corpse is still a corpse.
  4. The library is dead and load-bearing: replace it with the maintained alternative. The new-architecture skill lists the standard swaps.
  5. No alternative exists and the code is small: vendor it (copy the source into the repo, keep its license header, own it openly). Honest ownership beats a fork nobody watches.
  6. Fork only when you truly need a living divergent copy. A fork is a maintenance subscription with no unsubscribe button: every upstream fix, security patch and New Architecture change becomes your homework.

Patch mechanics

The classic tool is patch-package (edit inside node_modules, run it, commit the generated diff, apply via a postinstall script). Modern package managers carry the same idea natively: pnpm patch, yarn patch, bun patch. Use whichever matches the repo's package manager; mixing patch-package into a pnpm repo when pnpm patch exists just adds a second mechanism to forget about.

Discipline that keeps patches from rotting:

  • Every patch carries a comment block at the top of the change or in the patch file's name area: WHY it exists and the upstream issue/PR link. A patch without a link is undeletable, because nobody remembers when it is safe to remove.
  • Patches are pinned to exact library versions. That is a feature: after any dependency upgrade, a failing patch application is the system telling you to re-check whether upstream fixed it. Re-diff or delete; never blindly re-roll.
  • Review patches in PRs with the same care as first-party code. They ARE first-party code now.
  • Keep count. One or two patches is normal life; ten is a sign the dependency choices need revisiting, not the patching tooling.

Read the full file on GitHub · 41 lines

Changes

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.

  1. yesterday First seen · 41 lines · 59 tokens per session scan A 7de2a68c1a42

Subscribe to this mod's changes

patching-libraries is a skill published in the GitHub repository AnilBurcu/claude-code-react-native (3 stars, last pushed 1mo ago), licensed MIT. It adds 59 tokens to every session and 810 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

uniwind

Uniwind — Tailwind CSS v4 styling for React Native. Use when adding, building, or debugging components in a React Native project that uses Uniwind classNames. Covers setup, Metro config, global.css, theming, className props, accent- color props, platform/data/state/responsive variants, CSS variables, custom utilities…

uni-stack/uniwind · 130 tokens

setup-react-native-storybook

Set up Storybook for React Native in Expo, React Native CLI, or Re.Pack projects. Use when adding Storybook to a project, configuring metro.config.js with withStorybook, creating .rnstorybook configuration files, setting up Storybook routes in Expo Router, configuring getStorybookUI, or adding the StorybookPlugin to a…

storybookjs/react-native · 102 tokens

upgrading-react-native-storybook

Incrementally upgrade React Native Storybook across the supported migration paths. Use when upgrading @storybook/react-native projects from 5.3.x to 6.5.x, 6.5.x to 7.6.x, 7.6.x to 8.3.x, 8.x to 9.x, or 9.x to 10.x. Detect the currently installed Storybook version, choose only the next migration step, update…

storybookjs/react-native · 151 tokens

migrate-nativewind-to-uniwind

Migrate a React Native project from NativeWind to Uniwind. Use when the user wants to replace NativeWind with Uniwind, upgrade from NativeWind, switch to Uniwind, or mentions NativeWind-to-Uniwind migration. Handles package removal, config migration, Tailwind 4 upgrade, cssInterop removal, theme conversion, and all…

uni-stack/uniwind · 82 tokens

unistyles-v2-to-v3-migration

Migrate react-native-unistyles from v2 to v3. Triggers on: "migrate unistyles", "upgrade unistyles", "v2 to v3", "unistyles migration", "update unistyles", "convert unistyles v2". Covers all API changes including StyleSheet.create, useStyles removal, theme configuration, variants, withUnistyles, Babel plugin setup…

jpudysz/react-native-unistyles · 104 tokens

react-native-unistyles-v3

Guide for using react-native-unistyles v3. Triggers on: "unistyles", "StyleSheet.create", "create stylesheet", "add theme", "breakpoints", "variants", "withUnistyles", "useUnistyles", "ScopedTheme", "UnistylesRuntime", "style component", "responsive styles", "media queries", "dynamic styles", "scoped theme", "adaptive…

jpudysz/react-native-unistyles · 125 tokens