cleanup-users

Migrates and syncs backend data with cleanup automation for Dev/Test environments.

Updated Nov 5, 2025
One-click install
npx skills add https://github.com/imankha/video-editor --skill cleanup-users
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cleanup-users
Source: https://github.com/imankha/video-editor/tree/main/.claude/skills/cleanup-users
Command: npx skills add https://github.com/imankha/video-editor --skill cleanup-users

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates migrating a single user's database, syncing it to Cloudflare R2, and cleaning up other users both locally and on R2 to maintain a clean development and test environment.

Core Features & Use Cases

  • Migrate and apply pending migrations for the kept user and ensure the database is properly initialized.
  • Sync the kept user's database to Cloudflare R2 and verify synchronization.
  • Delete non-kept local user data under user_data and remove corresponding R2 objects, with optional pattern filtering.
  • Supports a default keep user and a deletion pattern (e.g., e2e_*) for precise cleanup.
  • Use Case: In CI runs, keep the primary tester account, remove ephemeral test accounts locally and in R2 after test completion.

Quick Start

  • cd src/backend
  • python cleanup.py
  • python cleanup.py keep:b
  • python cleanup.py delete:e2e_*

Frequently Asked Questions about cleanup-users

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

FAQPage Schema
How do I sync a user database to Cloudflare R2 and delete other users?

To sync a user database to Cloudflare R2 and delete other users, you can run the cleanup.py script in your backend Python environment to migrate a single kept user, sync to R2, and purge non-kept local and cloud data.

How do I clean up ephemeral test accounts from local storage and R2 after a CI run?

You can clean up ephemeral test accounts from local storage and R2 after a CI run by using a deletion pattern like e2e_* with the cleanup script, which removes matching local user data and corresponding R2 objects while keeping your primary tester account.

Does user database cleanup with R2 sync require a specific backend environment?

User database cleanup with R2 sync requires a backend Python environment configured with dotenv, internal app modules, and an active R2 client to execute the migration, synchronization, and deletion processes successfully.

Can I filter which user datasets are purged during a cloud sync cleanup?

Yes, you can filter which user datasets are purged during a cloud sync cleanup by applying a specific deletion pattern, such as e2e_*, to precisely target and remove only matching non-kept users locally and on R2.

What is the best way to isolate and maintain a clean development database using Cloudflare R2?

The best way to isolate and maintain a clean development database using Cloudflare R2 is to apply a keep/delete pattern that migrates a single kept user's database, applies pending migrations, and purges all other users both locally and on the cloud.