---
name: personal-data-map
description: Maps what personal data an app collects (sign-up and profile fields, forms, database columns, uploaded files, browser storage), where it is stored, and which outside services receive it, such as analytics, email, AI, error tracking and payment providers. If the app has a privacy policy page, compares the policy with what the code actually does and lists what the policy leaves out. Use when the user asks whether their privacy policy covers everything, what data their app collects or shares, who they send people's data to, or wants the facts for writing a privacy policy before launch. Groundwork for a policy, not legal advice.
allowed-tools: Read Grep Glob
license: MIT
---

# Personal data map

Read the project and write down, as facts, what personal data the app collects, where it keeps it, and which outside services receive it. If there is a privacy policy page, compare it with those facts. Change nothing.

## Rules

- **Read only.** Use Read, Grep and Glob. Do not edit or create files and do not run commands.
- **Point out gaps; do not write policy wording.** For each gap, say what the code does and what the policy says or leaves out. Do not draft sentences for the policy, suggest wording, or rewrite any part of it, even as an example. Writing the policy is the user's job, with a lawyer or privacy professional if they need one.
- **Never state a service's defaults as fact.** Do not say what a service or library records, captures, keeps or switches on by default (for example "the analytics library records typed text by default" or "the error tracker stores IP addresses"), and do not say the code "does not turn off" such a feature. You cannot see the service's settings, and defaults change. Report only what the code itself passes to the service. Anything else goes under "Not checked", phrased as something to check in that service's dashboard or settings.
- **Not legal advice.** You are mapping what the code does. Whether the policy meets the law where the user's visitors live (UK GDPR, EU GDPR, California and others) is a question for a lawyer or a privacy professional. Say this in every reply, once, near the top.
- **Active means it runs.** List a service as receiving data only when you can follow a working path from something the app runs to a call that sends the data. These do **not** count, and go under "Found but not active":
  - an environment variable or API key that no code reads, or that is read but never passed to a call that sends anything;
  - a package in `package.json` that no file imports;
  - a call inside a comment (`//`, `/* */`, `{/* */}`, `<!-- -->`);
  - a function or component that is defined but never imported, never rendered and never called from code that runs;
  - code behind a condition that is always false (`if (false)`, a flag hard-coded off).
- **Personal data means data about a person**: name, email, phone, address, date of birth, photos and other uploaded files, messages and other free text a person writes, payment details, location, IP address, device or account identifiers linked to a person, and health, money or other sensitive details. A random visit counter with no identifier is not personal data.
- Write for someone who is not an engineer. Say "the service that sends your emails (Resend)", not only "Resend". Explain a technical word once.
- Do not guess. If you cannot tell whether something runs or what it sends, say so under "Not checked".

## Background you need

AI builders (Lovable, Bolt, Replit, Claude Code) usually produce a React app in `src/` that runs in the visitor's browser, a database (often Supabase) defined in `supabase/migrations/`, and small server functions in `supabase/functions/` or `api/`. Personal data can leave the app from either side: from the browser (an analytics or error-tracking script) or from a server function (a call to an AI or email provider).

Things that often send personal data without it being obvious:

- `posthog.identify(id, { email, name })`, `mixpanel.identify`, `analytics.identify`, `gtag('config', …, { user_id })`, `amplitude.setUserId`: link a person's activity to who they are.
- `Sentry.setUser({ email })`, `LogRocket.identify`, `datadogRum.setUser`, `Bugsnag.setUser`: attach a person to error reports.
- A `fetch` to `api.openai.com`, `api.anthropic.com`, `generativelanguage.googleapis.com` (Gemini), `api.groq.com`, `api.mistral.ai`, `openrouter.ai`, or an SDK for one of them: sends whatever text goes into the prompt.
- A `fetch` to `api.resend.com`, `api.sendgrid.com`, `api.postmarkapp.com`, `api.mailgun.net`, `api.brevo.com`, Loops or Mailchimp, or their SDKs: sends email addresses and whatever goes in the message.
- Stripe, Paddle, Lemon Squeezy and similar checkout calls: send email and payment details (the card itself usually goes straight to the payment provider).
- Supabase itself: everything in its database, its sign-in (Auth: email, password, anything in `options.data` on `signUp`, which ends up in the user's metadata) and its file storage buckets.
- Supabase's browser client keeps the signed-in session in the browser. If the code passes `auth: { storage: ... }`, say where. If it does not, list the session as kept in the browser without guessing the exact place.

Cookieless counters such as Plausible, Fathom, Simple Analytics, Umami and Cloudflare Web Analytics, loaded as a plain `<script>` with no identify call and no personal data passed to them, are active services that receive no personal data from the app's code. List them, but not as receiving personal data.

## Step 1: Find the code that runs

1. Read `package.json` for the libraries the app uses. Read `index.html` (and `public/*.html`) for `<script>` tags.
2. Glob `src/**/*.{ts,tsx,js,jsx}`, `app/**/*`, `pages/**/*`, `supabase/functions/**/*`, `api/**/*`, `server/**/*`, `functions/**/*`, `netlify/functions/**/*`.
3. Find the entry points: `src/main.*` and `src/App.*` (routes), framework page and route folders, and every server function. Code reachable from these runs. A file that nothing imports does not.
4. Glob `.env`, `.env.*` and read them. These name services, but a variable alone proves nothing (see Rules).

## Step 2: List the personal data collected

Look for each kind of source and note the file and line:

- **Forms and inputs**: `<input>`, `<textarea>`, `<select>`, file inputs, and the state they feed. Check the component is rendered by a route or by a component that is. A form component nobody renders collects nothing.
- **Sign-up and sign-in**: `signUp`, `signInWithPassword`, `signInWithOAuth` (which providers), magic links, and what goes into `options.data`.
- **Database columns**: read `supabase/migrations/**/*.sql` (and `schema.sql`, Prisma or Drizzle schemas). List columns that hold personal data and the table they are in. Then check the app writes them (`.insert`, `.upsert`, `.update`, or a server function).
- **Files**: `storage.from(...).upload`, other upload calls, and whether the bucket is public (`public: true` means anyone with the link can open the file).
- **Browser storage**: `localStorage`, `sessionStorage`, `document.cookie`, IndexedDB, and the Supabase client's session storage. Say what is stored.
- **Data the app sends on**: free text such as chat messages, notes or prompts.

For each item, record where it is stored: which table or bucket, Supabase Auth, the browser, or nowhere (sent on and not kept).

## Step 3: List the outside services and what each receives

For each service you find (by import, `fetch` URL, SDK, `<script>` tag or env var):

1. Find the calls that send something. Follow the arguments back to their source until you know which personal data items go in.
2. Confirm the call runs: it is in a file reached from an entry point, it is not commented out, and the function that holds it is called from code that runs.
3. Put the service in exactly one group:
   - **Receives personal data**: active, and at least one personal data item reaches it. Name the items and the file and line of the call.
   - **Active, receives no personal data from the code**: active, but nothing personal is passed to it.
   - **Found but not active**: see the Rules. Say why in a few words ("env var, no code uses it", "call is commented out", "component is never used").

Count Supabase as a service that receives personal data when the app stores personal data there. It is the app's own database, but it is still an outside company holding the data.

## Step 4: Compare with the privacy policy

1. Find it: Glob `**/*privacy*`, `**/*Privacy*`, `**/*policy*`, `**/*legal*`, `**/*terms*` (skip `node_modules`), and Grep for `Privacy Policy` and `privacy` in `src/` and `public/`. It may be a page component, a Markdown file or static HTML.
2. If there is no policy, say so in the headline, skip the comparison, and say that the map is the starting point for writing one.
3. If there is one, read all of it. Then check, item by item:
   - **Each personal data item**: does the policy say the app collects it? Covering it under a clear general heading counts ("your profile details" covers a name only if the policy says what the profile holds). Not mentioned at all is a gap.
   - **Each service that receives personal data**: does the policy say this data goes to this service, or to this kind of service ("an email provider", "an AI provider")? If the policy names neither the service nor its kind, it is a gap. If it names the service but not the personal data it receives, it is a gap.
   - **Contradictions**: a sentence the code proves wrong ("we never share your messages" while messages go to an AI provider) is a gap. Quote the sentence.
4. Do not report as a gap: services under "Found but not active", services under "receives no personal data", or a policy that mentions more than the code does. You may note extra mentions in one line under "Policy mentions things the code does not do" so the user can tidy the policy, but they are not gaps.

## Output

Reply with this and nothing before it.

````
Personal data map: <D> kinds of personal data, <S> outside service(s) receive it, <G> gap(s) in your privacy policy

This is the factual groundwork for a privacy policy, not legal advice. It describes what the code does; whether your policy meets the law where your users live is a question for a lawyer or privacy professional.

## What your app collects

| Data | Collected where | Stored where |
| --- | --- | --- |
| <item> | <screen or code, `file:line`> | <table, bucket, Supabase Auth, browser, or "not stored"> |

## Who receives it

| Service (what it does) | What it receives | Where in the code |
| --- | --- | --- |
| <service> (<plain description>) | <items> | `<file>:<line>` |

## Gaps in your privacy policy

Policy read: `<file>`

1. <What the policy does not say, in one plain sentence>
   The code: <what actually happens> (`<file>:<line>`)
   The policy: <"not mentioned", or the quoted sentence it contradicts>

## Found but not active

- <service or field>: <why it does not count> (`<file>:<line>`)

## Active, receives no personal data from your code

- <service>: <what it does and why no personal data reaches it from the code> (`<file>:<line>`)

## Not checked

- <what code cannot show>
````

- `<D>` counts each row of "What your app collects". `<S>` counts each row of "Who receives it". `<G>` counts the numbered gaps.
- One gap per missing data item, per service flow, and per contradiction. If a service is missing from the policy and the policy also contradicts it, give one gap per point.
- Order gaps by how surprising they would be to a user: free text and sensitive data sent to outside companies first, then identifiers sent to analytics and error tracking, then data items the policy does not list, then the rest.
- If there is no policy, write `no privacy policy found` in place of the gap count and write "No privacy policy found. Use the two tables above as the facts your policy needs to cover." under the gaps heading.
- If there are no gaps, write `0 gaps in your privacy policy`, write "None. Every data item and every service above is covered by the policy." under the gaps heading, and keep every other section. Do not invent a gap.
- Write "None." under any other empty section.

Every "Not checked" section includes at least these, plus anything else you could not see:

- Settings in each service's dashboard: check there what each service records on its own beyond what your code sends (for example whether it records IP addresses, device details, clicks, page views or session recordings), and how long it keeps data. Code cannot show these, so do not say what they are.
- Data each service may collect on its own, outside your code, from every visitor who loads its script. Check this in the service's dashboard and documentation.
- Retention and deletion: how long Supabase and each service keep data, whether backups hold it, and whether account deletion removes it everywhere.
- Where each service stores data (country or region), and whether you have a data processing agreement with it.
- Changes made outside the code: tables or columns added in the Supabase dashboard, sign-in providers switched on there, scripts added through a tag manager or the hosting platform.
- Whether the live app runs this version of the code.

<!--
MIT License

Copyright (c) 2026 PT Maverick Rintis Karya

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
