---
name: change-explainer
description: Explains in plain language what just changed in the app's code, from the uncommitted changes or otherwise the last commit, and flags the changes that could break the app or let the wrong people in. Looks for a removed or weakened sign-in or permission check, a database rule opened up, deleted input checks, a key pasted into the code, removed error handling, changed price or payment logic, and user data sent to a new outside service. Use when the user asks what the AI (Lovable, Bolt, Replit, Cursor, Claude Code) just changed, what the last commit did, whether the latest edits broke anything, or wants a check before keeping or publishing a change.
allowed-tools: Read Grep Glob Bash(git status:*) Bash(git diff:*) Bash(git log:*) Bash(git show:*)
license: MIT
---

# Change explainer

Tell the user, in words a non-engineer understands, what the latest change to their app did, and point out the parts of it that could break the app or open it up. Change nothing.

## Rules

- **Read only.** Use Read, Grep and Glob, and Bash only for `git status`, `git diff`, `git log` and `git show`. Run each git command on its own, starting with `git`: no pipes, no `&&`, no `cd`. Do not edit or create files, do not commit, check out, reset or stash. Give any fix as text the user can paste or send to their AI builder.
- **Never print a whole key.** If you quote one, show the first 6 characters, `…`, and the last 4.
- **Only flag what the change did.** A problem that was already there before this change is not part of this review. If you notice one, mention it in one line under "Could not judge" as something to check separately, and do not count it.
- **Flag on evidence, not on the file name.** A change to a sign-in file, a price file or a database file is not a risk by itself. Flag it only when the code that was removed or added does one of the things listed in Step 4.
- Write for someone who is not an engineer. Say "anyone on the internet", "any signed-in user", "the price the customer pays", not "anon role", "RLS predicate" or "unit_amount" on their own. Explain a technical word once if you must use it.
- Never call the app or the change "safe". Say what you looked at, what you found and what you could not judge.

## Step 1: Find the change

1. Run `git status --short --untracked-files=all`, then `git diff HEAD --stat`. If either lists files, the change to explain is the **uncommitted work**: staged and unstaged edits, plus brand-new files. Say so in the headline.
2. If it lists nothing, the change is the **last commit**. Run `git log -3 --format="%h %ad %an: %s" --date=short` to see it and the one before, then `git show HEAD --stat`.
3. If the user names something else ("the last three commits", "since yesterday", a commit id), honour it: `git log` to find the commits, then `git diff <from>..<to> --stat`.
4. If git reports that this is not a git repository, or there are no commits, say that you can only explain changes that git has recorded, suggest the user exports the project to GitHub or asks their builder for the change history, and stop.

Brand-new files that were never added to git show in `git status` with `??` in front, and do not appear in `git diff` at all. They are part of the uncommitted work and are often where the riskiest new code is: Read each one in full and treat every line in it as added. Count them in `<F>`. Files that git is told to ignore (such as `.env`) are not listed by `git status`; they are out of scope.

Build output and installed packages (`dist/`, `build/`, `.next/`, `node_modules/`) and lock files (`package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`, `bun.lockb`) are out of scope: mention them in one line if they changed, do not read their diffs.

## Step 2: Read the whole diff

Read the diff file by file: `git diff HEAD -- <file>` for uncommitted work (and Read for each new file marked `??`), `git show HEAD -- <file>` for the last commit. Read every changed file, not a sample.

When a removed line might have moved rather than disappeared, look before you judge:

- Grep the project for the removed check, function or value. If the same check now lives elsewhere and still runs on the same path, it moved; it was not removed.
- Read the full current file when the diff alone does not show what the code now does.
- For a rename, Grep for the old name. If something still uses the old name, the app may now break: that is a risk (Step 4, item 8). If nothing does, the rename is harmless.

## Step 3: Group the changes for the reader

Sort every change into one of these groups, in the reader's words. Skip a group that has nothing in it.

- **What people see**: text, layout, colours, images, new or removed pages.
- **Sign-in and who can see what**: sign-in, sign-up, pages limited to signed-in users or to admins, roles.
- **Your data**: database tables, columns and rules (Supabase migrations and `.sql` files), what the app saves or loads.
- **Payments**: prices, plans, checkout, subscriptions, webhooks from Stripe, Paddle, Lemon Squeezy and the like.
- **Server code**: Supabase Edge Functions (`supabase/functions/`), API routes, anything that runs away from the browser.
- **Outside services**: new or changed calls to other companies' services (email, analytics, AI, payments, maps).
- **Behind the scenes**: renames, comments, import order, formatting, settings, packages.

Describe each change by what it does for the user of the app, not by the code. "The pricing page heading now says 'Pricing that grows with you'" is right. "Changed the h1 string literal" is not.

## Step 4: Decide which changes to flag

Flag a change as **Check this** only when the diff shows one of these. Each flag names the evidence: the line removed or added.

1. **A sign-in or permission check removed or weakened.** A check that sent people away or refused them (`if (!session)`, `if (!user) return 401`, `role !== "admin"`, `auth.getUser()` followed by a refusal, a webhook signature or shared-secret check) deleted, commented out, made always-true (`if (false && …)`, `|| true`), or replaced with a weaker one (an admin check replaced by a signed-in check, a server check replaced by a browser-only check). Say who can now reach what.
2. **A database rule opened up.** In SQL: row-level security switched off (`disable row level security`), a policy dropped and replaced with a wider one, a condition changed to always-true (`using (true)`, `with check (true)`, `1 = 1`), a policy that compared the row's owner to the signed-in user (`auth.uid() = user_id`) replaced by one that does not, a policy widened to `anon` or `public` or with its `to` clause removed, or a new `grant … to anon`. Say what anyone on the internet, or any signed-in user, can now read or change that they could not before.
3. **Input checks deleted.** A validation step on data that comes from a visitor or a request removed: a schema check (`zod`, `yup`, `valibot`, `.parse(`, `.safeParse(`), a length or format check, an allow-list, a type check, especially on the server. A raw request body now passed straight into a database insert or update is the clearest case. Say what a visitor could now send.
4. **A secret pasted into the code.** A literal value that looks like a secret key replaced an environment variable read (`Deno.env.get`, `process.env`, `import.meta.env`), or appeared in a file that is committed. Secret-looking: `sk_`, `sk-`, `rk_`, `re_`, `whsec_`, `service_role`, `SUPABASE_SERVICE_ROLE_KEY`, long random strings assigned to names with `KEY`, `SECRET`, `TOKEN` or `PASSWORD`. The fix always includes replacing the key at the provider, because it is now in the git history.
5. **Error handling removed.** A `try`/`catch`, an `if (error)` check, an `if (!res.ok)` check, or a fallback removed so that a failure now goes unnoticed, shows the user a blank page, or saves half-finished data. Only when the removed handling covered something that can really fail (a network call, a database call, a payment call, a file upload).
6. **Price or payment logic changed.** The amount the customer is charged, the currency, the plan given after payment, a discount, trial or quantity, or the check that a payment really succeeded, changed in the code that talks to the payment provider or in a webhook. A price that now comes from the browser (the request body) instead of a fixed server-side list is always a flag: anyone can send their own price. Say what the customer could now pay or get.
7. **User data sent to a new outside service.** A new web request in the code, or a new package in `package.json` for an outside service, that goes to a domain the project did not call before and that sends personal data or content people typed: email, name, phone, address, IP address, messages, notes, files, or whole database rows. Grep the project for the domain to confirm it is new. Say what is sent, where, and that the privacy policy may need to name the service.
8. **A change that will break the app outright.** Something still uses a name, file, column, table or environment variable that the change removed or renamed; a required environment variable newly read that `.env.example` does not list; a database column dropped while the code still reads it. Only after you have checked with Grep.

**Do not flag** these. Summarise them under "What changed" and, if useful, list them under "Changes that look harmless":

- Text, copy, labels, headings, button wording, placeholder text, alt text.
- Styling: class names, colours, spacing, fonts, layout, CSS.
- Renames of variables, functions or files where every use was renamed too, and the logic is the same.
- Comments added, removed or reworded, including comments in a sign-in, payment or database file.
- Import order, formatting, whitespace, quote style.
- Edits inside a sign-in, payment or database file that leave the check, the amount and the rule working the same way. Example: renaming `isLoading` to `loading` in a page guard, with the `if (!session)` redirect untouched.
- A displayed price label whose wording changed when the amount charged by the server did not.
- The Supabase project URL or the anon or publishable key read from `VITE_SUPABASE_URL` and `VITE_SUPABASE_ANON_KEY` (or `…_PUBLISHABLE_KEY`). These are public by design.
- Calls to the app's own Supabase project or its own server functions (`supabase.from(…)`, `supabase.functions.invoke(…)`, `/functions/v1/…`, `/api/…`).

When you are not sure whether a change belongs in Step 4, do not guess either way: put it under "Could not judge" with the reason.

## Output

Reply with this report. The first line of your reply is the headline, `Change explainer: …`. Write nothing before it: no introduction, no "Here is the report", no note about the skill or the commands you ran.

````
Change explainer: <N> change(s) to check, out of <F> file(s) changed
Looked at: <"uncommitted changes" or "the last commit, <short id> '<message>' (<date>)">

## In short

<Two to four plain sentences: what this change set does overall, and whether anything needs a look before you keep it.>

## What changed

**<Group name>**
- <plain description> (`<file>`)

## Check these before you keep this change

1. <What changed, in one plain sentence>
   Where: `<file>:<line>`
   What this means: <who can now do what, or what will now go wrong, in plain words>
   What to do: <a short fix in plain words. Then, when it helps, a prompt the user can paste into their AI builder, or a few lines of code to restore what was removed.>

## Changes that look harmless

- <one line each: text, styling, renames, comments, import order>

## Could not judge

- <what this review could not see or decide>
````

- `<F>` counts every file in the change, not only the flagged ones.
- Fill in `<N>` last. Write the numbered list under "Check these before you keep this change" first and finish it, then count its items: `<N>` is that number, exactly. It must match the last item number in the list.
- Order the checks by damage: secrets and permission or database rules that let anyone in first, then payment changes, then user data sent outside, then deleted input checks, then removed error handling, then anything that will simply break.
- One numbered item per risky change. Two separate risky changes get two items, even in the same file.
- A knock-on effect of a listed change goes inside that change's item, under "What this means", not as a new item. This includes an effect on a line this change did not touch (for example, an unchanged query that now returns more because a rule was opened up).
- A further detail of a change already listed (another line in the same new file, a weaker side effect, a related tidy-up) goes inside that item too, not as a new item.
- No empty items and no duplicates. If an item would only say "see item 2" or "covered above", leave it out, renumber, and recount `<N>`.
- Before you count, test every item. It must be one of the eight kinds in Step 4, with its own removed or added line as evidence. If fixing another item would also fix it (its fix is "the same fix as item 3"), or it is the other half of the same change (the browser sending a price and the server charging it are one change), merge it into that item. General advice about the change as a whole goes under "In short", never as an item.
- If there is nothing to check, write `Change explainer: 0 changes to check, out of <F> file(s) changed`, write "None of the changes fall into the groups this review flags." under "Check these before you keep this change", and keep the other sections. Do not invent a risk, and do not say the change is safe.

"Could not judge" always includes:

- That this review read the code that changed, not the running app: it did not run the app, its tests or its database.
- Anything changed by hand in a dashboard (Supabase, the payment provider, the hosting service), which git does not record.
- Files that git is told to ignore (such as `.env`), when the change was uncommitted work: they were not reviewed.
- Any change you could not place in a group with confidence, with the reason.

<!--
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.
-->
