# Debug menu and test hooks

> Debug menu and test hooks is an open-source agent skill for developer tools. Adds a gated debug menu, debug deep link and simulated clock and offline mode to React. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/zakariaf/ReactNative-Skills/tree/main/skills/debug-menu-and-test-hooks
- **Repository:** https://github.com/zakariaf/reactnative-skills
- **GitHub stars:** 16
- **License:** MIT
- **Skill name:** debug-menu-and-test-hooks
- **Collection:** https://github.com/zakariaf/ReactNative-Skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

This skill gives a React Native app a set of test-only tools: a debug menu, a single strict debug deep link, and a simulated clock and network state that every part of the app reads. All of it sits behind one literal build-time switch, so production builds are meant to contain none of this code. A checker script verifies the gate, the entry point, the wiring, the registry and the simulations against the app's own source.

The skill walks the agent through a fixed sequence: copying the template files into their paths, declaring the test-only folders in the architecture contract, wiring the hooks through the app's root-kit registry, and writing the link parameters in a contract file alongside the registry. It also sets out rules such as refusing deep links with unknown or repeated parameters, and proving the production strip by comparing development and production bundles.

The instructions assume an Expo and Expo Router project with Jest, TypeScript, ESLint and knip, and reference companion skills for variants, navigation and networking. The skill ships templates, example files, test fixtures and a Node-based checker, and it is published under the MIT license.

## When your agent uses it

> Gates test-only code behind one literal TEST_ONLY switch: debug menu, debug link, simulated clock and offline. Use when adding a debug screen, a test hook, a debug link or a fake date for E2E or QA. Not for E2E flows (e2e-maestro).

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Runs JavaScript and TypeScript scripts](https://github.com/zakariaf/ReactNative-Skills/tree/HEAD/skills/debug-menu-and-test-hooks)
- [No network calls found in its scripts](https://github.com/zakariaf/ReactNative-Skills/tree/HEAD/skills/debug-menu-and-test-hooks)
- [License: MIT](https://github.com/zakariaf/ReactNative-Skills/tree/HEAD/skills/debug-menu-and-test-hooks)

## Features

- **Single build-time gate:** Routes all test-only code through one literal environment comparison so production bundles exclude it.
- **Strict debug deep link:** Provides one Expo Router debug route that rejects unknown, repeated or malformed parameters.
- **Simulated clock:** Replaces the current day for date logic while leaving timers and timestamps on the real clock.
- **Simulated offline mode:** Presents a full connectivity port that follows a switch, so consumers react as they would to a real outage.
- **Debug menu and switches:** Stores debug overrides in a separate persisted store that survives reloads and is shown in a debug menu.
- **Bundle and checker proof:** Includes a Node checker and bundle comparison steps that verify the gate and the production strip.

## Good for

- Add a debug screen to a React Native app for QA testers
- Set a fake date in a preview build to test due-date logic
- Simulate offline mode to check how screens handle lost connectivity
- Open a debug link that puts the app into a known state for E2E tests
- Verify that a production export contains no test-only code

## Install

### Claude Code

This skill ships in the `react-native` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add zakariaf/ReactNative-Skills
/plugin install react-native@react-native-skills
```

Or copy only this skill to `~/.claude/skills/debug-menu-and-test-hooks`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/debug-menu-and-test-hooks &&
cp -R "$tmp/skills/debug-menu-and-test-hooks" ~/.claude/skills/debug-menu-and-test-hooks &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/debug-menu-and-test-hooks` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/debug-menu-and-test-hooks` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/debug-menu-and-test-hooks &&
cp -R "$tmp/skills/debug-menu-and-test-hooks" ~/.agents/skills/debug-menu-and-test-hooks &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/debug-menu-and-test-hooks` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/debug-menu-and-test-hooks` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/debug-menu-and-test-hooks &&
cp -R "$tmp/skills/debug-menu-and-test-hooks" ~/.cursor/skills/debug-menu-and-test-hooks &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/debug-menu-and-test-hooks` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/zakariaf/ReactNative-Skills.git --path skills/debug-menu-and-test-hooks
```

Or copy the folder to `~/.gemini/skills/debug-menu-and-test-hooks` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/debug-menu-and-test-hooks`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/debug-menu-and-test-hooks &&
cp -R "$tmp/skills/debug-menu-and-test-hooks" ~/.copilot/skills/debug-menu-and-test-hooks &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/debug-menu-and-test-hooks` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git
```

Then copy `ReactNative-Skills/skills/debug-menu-and-test-hooks` into your agent's skills folder as `debug-menu-and-test-hooks`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need from the project?

It expects an Expo and Expo Router app with Jest, TypeScript, ESLint and knip, plus the companion skills for app variants, architecture, navigation and networking. It also needs a composition root and a ConnectivityPort, according to its prerequisites.

### Does Debug menu and test hooks change production builds?

It is designed so production builds carry none of the debug code. The skill says this is proven by comparing development and production bundles with its check-variant-bundle step.

### How does the debug deep link handle bad input?

An unknown, repeated or invalid parameter makes the link fail with a typed error, applies nothing, and shows a debug setup error on screen.

### Has the skill been tested on a device?

The skill notes it was verified in Jest and with iOS and Android export bundles, but had not yet been driven on a simulator or emulator.

### How do I install Debug menu and test hooks in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/debug-menu-and-test-hooks to use it in all your projects, or to .claude/skills/debug-menu-and-test-hooks in one project. Or install the react-native plugin, which includes it: /plugin marketplace add zakariaf/ReactNative-Skills, then /plugin install react-native@react-native-skills.

### Does Debug menu and test hooks run scripts?

Yes. It runs JavaScript and TypeScript scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Debug menu and test hooks?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Debug menu and test hooks?

The closest alternatives to Debug menu and test hooks are Deep links and universal links, Expo prebuild and config plugins, Expo router, Expo project bootstrap and Expo router.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Deep links and universal links](https://ai-powered.com/skills/deep-links-and-universal-links): Deep links and universal links is an open-source agent skill for developer tools.
- [Expo prebuild and config plugins](https://ai-powered.com/skills/expo-prebuild-and-config-plugins): Expo prebuild and config plugins is an open-source agent skill for developer tools.
- [Expo router](https://ai-powered.com/skills/expo-router-scaledockhq): Expo router is an open-source agent skill for developer tools.
- [Expo project bootstrap](https://ai-powered.com/skills/expo-project-bootstrap): Expo project bootstrap is an open-source agent skill for developer tools.
- [Expo router](https://ai-powered.com/skills/expo-router): Expo router is an open-source agent skill for developer tools.
- [App variants and environment](https://ai-powered.com/skills/app-variants-and-environment): App variants and environment is an open-source agent skill for developer tools.
- [Test mac app](https://ai-powered.com/skills/test-mac-app): Test mac app is an open-source agent skill for developer tools.
- [Architecture and boundaries](https://ai-powered.com/skills/architecture-and-boundaries): Architecture and boundaries is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/debug-menu-and-test-hooks
