---
name: remove
description: Remove ALL PinAppAI integration from this repository (widget script, /changes/ pages, optional helpers) so it's ready to publish without the feedback widget. Preserves the .pinappai/ directory by default.
arguments: []
---
You are operating inside the user's source repository. Your job: remove ALL
PinAppAI integration from this repository so it's ready to publish to
production without the feedback widget. Strip the widget script, delete the
`/changes/` review page(s), clean up any optional helpers a customer may have
added — leave the repo as if PinAppAI had never been integrated.

{{include: _shared/project-resolution.md}}

# Step 1 — Pull the grep targets

Call `get_project({project: "<resolved slug>"})`. From the response, capture the
`project_key` (a `pk_…` value) that may appear in `data-project="..."`
attributes you'll need to find. The response also exposes the same value as
`api_key` for back-compat — same string, legacy name.

Reference URLs / keys for grep targets:
- Widget: `https://api.pinappai.com/widget.js`
- This project's key: the `project_key` from `get_project` (note: remove ALL
  PinAppAI scripts regardless of which `data-project` they carry — multiple
  projects may have been installed in this repo)

# Step 2 — Remove the widget script embeds

Find every `<script src="https://api.pinappai.com/widget.js" ...></script>` in
the repo, regardless of which `data-project` value it carries. Delete the tag
entirely.

- Search for: `api.pinappai.com/widget.js` AND `api.pinappai.com` AND
  `data-project=`.
- Common locations: base layout, root template, footer partial, `_layouts/`,
  `components/`, framework helpers that emit the script via a config key
  (env var, CMS setting, plugin config). For config-driven embeds, **unset
  the config rather than editing rendered HTML**.
- Handle multi-line tags (the snippet often wraps onto two lines).
- Remove sibling decoration: `<!-- PinAppAI -->` comments, wrapper `<div>`s
  added at install time, etc.

# Step 3 — Delete the /changes/ review page(s)

Delete the `/changes/` page(s) entirely. They're self-contained, so one delete
removes the whole review surface.

- Files: `/changes/index.{html,md,astro,njk,vue,svelte,jsx,tsx}`, and any
  `/<locale>/changes/*` (e.g. `/tr/changes/`, `/en/changes/`).
- Routing / collection config that specifically targets `/changes/`
  (`getStaticPaths()` entries, content collection schemas, dynamic-route
  configs).
- Any `<link>`, redirect, or sitemap entry pointing at `/changes/`.

# Step 4 — Clean up optional runtime JS API references

If anyone called `window.PinAppAI.*` (e.g. `setDictationLang`,
`setDictationLangs`, `getDictationLang`) from JS / TS / framework hooks,
remove those calls — they become no-ops once the widget is gone. Also remove
any local helper / wrapper module that imported or re-exported the widget URL.

Most installs have none of this. If a quick search for `window.PinAppAI` and
`api.pinappai.com/widget.js` in your `.js` / `.ts` / framework files turns up
nothing, skip this step.

# Step 5 — Clean up optional host-side CSS overrides

If your stylesheets contain rules targeting widget chrome (`.pp-fab`,
`.pp-popover`, `.pp-review-*`, etc.), those become dead code. The widget
injects its own styles, so most customers don't have any host-side `.pp-*`
rules. Skip this step if a quick search for `.pp-` in your CSS files turns up
nothing.

# Step 6 — Update documentation

Update README / CONTRIBUTING / `AGENT.md` / `.cursorrules` / etc. if they
describe the PinAppAI integration or the `/changes/` workflow. Remove sections
that walk a developer through "regenerate /changes/" or similar.

# Step 7 — Verify cleanup

Run all four greps from the repo root before committing. Each must return
ZERO matches. `git grep` respects `.gitignore` so `node_modules` / `dist` /
`build` / `.next` are skipped automatically — no flags needed:

```sh
git grep -nIF "pinappai"
git grep -nIF "data-pp-"
git grep -nIF "window.PinAppAI"
git grep -nIF "/changes/"
```

If this isn't a git repo, the fallback is plain grep with explicit directory
excludes:

```sh
grep -rnFI "pinappai" --exclude-dir=node_modules --exclude-dir=dist --exclude-dir=build --exclude-dir=.next .
```

After the greps are clean, run a fresh production build and smoke-test a
handful of pages — the floating widget button must NOT appear, and navigating
to `/changes/` must 404. Then move on to landing.

# Step 7b — Disable the review link (the proxy outlives the embed!)

The no-install review link does NOT depend on the widget script you
just removed — `review.pinappai.com/p/<slug>/` injects the widget
itself, so with `primary_origin` still set, reviewers can KEEP
annotating this site after the removal. A user running /pinappai:remove
almost certainly doesn't want that surprise.

Check the `get_project` response from Step 1: if `primary_origin` is
set, ask:

> The no-install review link (`review.pinappai.com/p/<slug>/`) is still
> active and works without the widget embed. Disable it too? **[Y/n]**

- **Y / empty** → `update_project({project: "<slug>", primary_origin:
  null, preview_origin: null})`. Confirm: "Review link disabled."
- **n / no** → leave it; note that reviewers can still review the live
  site through the link.

If `primary_origin` is null, skip silently.

# What this prompt does NOT touch

- **Submitted feedback, decisions, and reviewer accounts on PinAppAI's
  servers.** Those survive — to fully wind down the project, delete it from
  the PinAppAI admin UI separately.
- **The `.pinappai/` directory** (`last-applied.json`, `context.json`). Those
  are audit trail / configuration artifacts; preserve them in case the
  project is reinstalled later. If the user explicitly asks to remove them
  too, that's a separate confirmation step — do NOT delete `.pinappai/`
  without their direct ask.
- **Unrelated analytics tags, marketing widgets, or any third-party code
  that doesn't reference PinAppAI.**

# Step 8 — Land the changes

{{include: _shared/landing-chooser.md}}

For the suggested branch name, use `pinappai/remove-YYYY-MM-DD-HHMM`. For
the suggested commit message: `chore: remove PinAppAI feedback widget integration`.

This is the final step — once the human picks an option, you're done.

{{include: _shared/output-language.md}}
