Skip to content
Skill

Analytics and consent

Gates React Native app analytics behind opt-in consent, with typed, personal-data-free

Analytics and consent is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
JavaScript, TypeScript
Platforms
Claude Code, Codex, Cursor
GitHub stars
16
Last commit
License
MIT
Listing updated

Similar skills

About Analytics and consent

This skill sets up product analytics for an Expo app so that nothing is sent and no vendor SDK is created until the user agrees. It adds a consent gate that can be revoked from a settings row, with withdrawal that resets and opts out the SDK and clears stored identifiers, and a forget step for account deletion. It also asks again when the consent question changes.

Events come from a typed catalog where each event has a stated purpose and only enum, boolean, bucketed count or route properties are allowed, so free text and identifiers are dropped before sending. Screen views are recorded as route patterns, and analytics stays anonymous unless the contract declares identification. Ads consent and App Tracking Transparency are kept separate from analytics, and the skill sets up build modes and environment keys so test and audit builds send nothing.

The workflow uses PostHog as the default vendor and includes templates, examples and two Node checkers that verify the code and the store privacy declarations. Inputs include a choice of vendor region, audience and whether users are identified. Apps for children are excluded from third-party analytics.

When your agent uses it

Gates analytics on opt-in consent: no SDK before a yes, typed events without personal data, ATT. Use when adding analytics, events, screen views or a usage-data toggle. Not for crashes (crash-reporting-and-observability).

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 76 files (509 KB) on GitHub on 5 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

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

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

Or copy only this skill to ~/.claude/skills/analytics-and-consent:

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

For one project only, put the folder in .claude/skills/analytics-and-consent inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/analytics-and-consent to use it in every repository:

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

For one repository only, put the folder in .agents/skills/analytics-and-consent inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/analytics-and-consent to use it in every project:

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

For one project only, put the folder in .cursor/skills/analytics-and-consent inside it instead.

Cursor docs on skills

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

gemini skills install https://github.com/zakariaf/ReactNative-Skills.git --path skills/analytics-and-consent

Or copy the folder to ~/.gemini/skills/analytics-and-consent yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/analytics-and-consent:

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

For one project only, put the folder in .github/skills/analytics-and-consent inside it instead.

VS Code docs on skills

Get the folder:

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

Then copy ReactNative-Skills/skills/analytics-and-consent into your agent's skills folder as analytics-and-consent. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Opt-in consent gate
Blocks all event sending and delays SDK creation until the user explicitly grants consent.
Typed event catalog
Defines every analytics event with a purpose and closed property types, checked at run time.
Personal data filtering
Drops free-text and identifier-like properties before any event leaves the device.
Consent withdrawal and forgetting
Resets and opts out the SDK on a no, clears stored ids, and wipes consent on account deletion.
Route-based screen views
Records screens by route pattern rather than concrete paths or search parameters.
Store declaration generation
Derives App Store privacy manifest entries and Play Data safety rows from one contract.
Static and behaviour checkers
Two scripts verify the consent flow, lazy SDK creation and privacy rules in the code.

Good for

  • Add opt-in analytics to an Expo app with a usage-data toggle in settings
  • Track a new screen or button press with a typed event
  • Remove the analytics SDK from startup so it only loads after consent
  • Generate App Store and Play privacy answers that match the tracked events
  • Wire analytics off for test and end-to-end builds

Analytics and consent FAQ

What does Analytics and consent need to be installed?

It installs the PostHog React Native SDK pinned to version 4.79.1 and expo-application, and it needs an Expo app with a configuration file for the analytics keys.

When does the consent prompt appear?

The skill asks the user after onboarding and never over a task or at first launch, and it asks again only when the consent question version changes.

Does Analytics and consent use App Tracking Transparency?

Not by default. Analytics does not track, and ATT is only used if the app explicitly opts into a tracking profile.

Which tools does Analytics and consent run?

It runs two Node checker scripts plus Jest suites for the analytics code.

How do I install Analytics and consent in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/analytics-and-consent to use it in all your projects, or to .claude/skills/analytics-and-consent 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 Analytics and consent 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 Analytics and consent?

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 Analytics and consent?

The closest alternatives to Analytics and consent are Crash reporting and observability, Auth and secure storage, Debug menu and test hooks, Expo data fetching and Expo native UI.

Where this comes from

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

More from zakariaf/ReactNative-Skills

  1. Turns canvas taps, swipes and drags into typed intents hit-tested on the drawn layout

    • Open source
    • 16 GitHub stars
    • Developer tools
  2. Adds a gated debug menu, debug deep link and simulated clock and offline mode to React

    • Open source
    • 16 GitHub stars
    • Developer tools
  3. Checks React Native code for accessibility labels, touch targets, text scaling

    • Open source
    • 16 GitHub stars
    • Developer tools
  4. Sells a one-time Premium unlock through the App Store and Google Play

    • Open source
    • 16 GitHub stars
    • Finance and payments
  5. Walks an Expo app through an SDK, Xcode or Android toolchain upgrade in one commit

    • Open source
    • 16 GitHub stars
    • Developer tools
  6. Builds React Native forms with one valibot schema, catalog-key errors and keyboard-aware

    • Open source
    • 16 GitHub stars
    • Developer tools