delete-test-accounts

Deletes test accounts and tenant data from a Supabase-backed LeadAce database.

3|Updated May 28, 2026
One-click install
npx skills add https://github.com/aitit-inc/leadace --skill delete-test-accounts-aitit-inc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: delete-test-accounts
Source: https://github.com/aitit-inc/leadace/tree/main/.claude/skills/delete-test-accounts
Command: npx skills add https://github.com/aitit-inc/leadace --skill delete-test-accounts-aitit-inc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires tsx.

What problem does it solve? Removing test or signup-test accounts from a production or local LeadAce database requires deleting the Supabase Auth user plus every tenant-scoped row, and doing it by hand risks partial cleanup or deleting a real user by mistake. ## Core Features & Use Cases - Dry-run inventory: Runs in read-only mode by default, showing email, tenant id, plan, role, member count, Stripe ids, and row counts before anything is deleted. - Guarded deletion: The --apply flag deletes only when every target is deletable; a single BLOCKED or not-found target aborts the whole run so a typo cannot cause partial cleanup. - Stripe handling: Cancels the recorded Stripe subscription before deletion when STRIPE_SECRET_KEY is available, matching the in-app account deletion behavior. - Use Case: After signup-flow testing, an engineer runs the inventory command against production with the test users' emails, confirms each is a test account, then re-runs with --apply to remove the tenants and auth users. ## Quick Start Ask the assistant to delete the test accounts with the given emails or auth UUIDs from the LeadAce database, starting with the dry-run inventory before approving the actual deletion.

Frequently Asked Questions about delete-test-accounts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I delete test accounts from a Supabase database?

Run backend/scripts/delete-accounts.ts with the target auth UUIDs or emails. It defaults to a dry-run inventory; add --apply to delete the tenants row (cascading to tenant-scoped tables) and the auth.users row.

How do I delete accounts from a production database safely?

Run the inventory command first with --env-file=.env.production and get user approval, then run the same command with --apply. The script aborts entirely if any target is BLOCKED or not found, preventing partial cleanup.

Why is an account marked BLOCKED during deletion?

A target is BLOCKED when its membership is not owner, when the tenant has other members, or when the tenant records a Stripe subscription and no STRIPE_SECRET_KEY is available to cancel it first.

Does deleting an account cancel its Stripe subscription?

Yes, when STRIPE_SECRET_KEY is present in the env file the subscription is canceled before deletion, using the same call as the in-app account deletion. Without the key, tenants with a recorded subscription are refused.

What data is not removed when deleting a test account?

Stripe customer objects remain, MCP OAuth tokens in KV expire on their own within 30 days, Google OAuth grants are not revoked, and no account_deletion_surveys row is written.