---
name: reset-project
description: Reset a project's review data to zero — permanently delete its change requests, iterations, reviewer decisions, AND all pins/comments/screenshots on the server, then optionally remove the repo's /changes/ page and apply marker. NOT recoverable.
arguments: []
---
You are operating inside the user's source repository. Your job: reset this
project's PinAppAI review data to a clean slate. That means TWO halves —
(1) the server half: change requests, iterations, reviewer decisions, and
ALL pins/comments (with their screenshots) stored by PinAppAI, and (2) the
repo half: the static `/changes/` page and the
`.pinappai/last-applied.json` apply marker, which hold frozen copies of
the same review state (the deployed page can no longer re-register
itself — registration is privileged-only — but its static content keeps
showing the old items to visitors, and a stale marker misleads the next
apply run).

This is destructive and NOT recoverable — there is no grace window for
review data. Never proceed past Step 2 without the user's explicit
confirmation.

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

# Step 1 — Show what will be deleted

Call `get_review_summary({project: "<resolved slug>"})` and
`pinappai_list_iterations({project: "<resolved slug>"})` to get current
counts. Present a short summary to the user:

- N change requests (all states — inbox, in review, closed)
- N iterations (the project's apply history)
- N reviewer decisions
- ALL pins and comments (with their screenshots)
- The /changes/-page registration data (item snapshots the in-page review
  overlay serves)

Also state clearly what is PRESERVED: reviewer accounts, the project
itself, its API keys, and the widget embed.

# Step 2 — Ask for explicit confirmation

Ask: "Permanently delete this project's review data, including all pins
and comments? This cannot be undone. (y/N)" — default is NO. If the user
declines, stop here; do not touch the server or the repo.

# Step 3 — Server reset

Call `pinappai_reset_review_data({project: "<resolved slug>", confirm: true})`.
Report the per-table deletion counts from the response back to the user.

Admin role is required — if the tool returns a `forbidden` error, tell the
user their API key's workspace role is below admin and stop.

Note for reviewers' browsers: deleted pins disappear from a reviewer's
page on their next visit (the widget cross-checks its cached pins against
the server on every load and prunes the ones that no longer exist).

# Step 4 — Offer the repo-half cleanup

The repo still holds frozen review state. Offer BOTH of these, and apply
only what the user accepts:

1. **Delete the `/changes/` review page(s)** — `/changes/index.*` and any
   `/<locale>/changes/*` variants, plus routing / sitemap entries that
   target them. Without this the page keeps rendering the old items to
   visitors (the server now refuses to re-register or serve them, so the
   widget shows nothing — but the static content itself remains visible).
2. **Delete `.pinappai/last-applied.json`** — the apply marker caching the
   last iteration. A stale marker would confuse the next `/pinappai:apply`
   run's "what changed since" logic. Keep `.pinappai/context.json` — that's
   installation config, not review state.

If the user declines both, that's fine — the server-side guards make the
stale page harmless to reviewers; it's just dead weight in the repo.

# Step 5 — Land the changes

Skip this step entirely if Step 4 made no file changes.

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

For the suggested branch name, use `pinappai/reset-YYYY-MM-DD-HHMM`. For
the suggested commit message: `chore: reset PinAppAI review loop (remove /changes/ page + apply marker)`.

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

# What this prompt does NOT touch

- **The project, its reviewers, members, and API keys.**
- **The widget embed** — the site keeps collecting new feedback. To remove
  the integration entirely, use `/pinappai:remove` instead.
- **`.pinappai/context.json`** — installation config stays.

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