delete-batch

Delete OptimalOS transactions in bulk using scoped filters with dry-run previews.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/clenisa/optimal-cli --skill delete-batch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: delete-batch
Source: https://github.com/clenisa/optimal-cli/tree/main/skills/delete-batch
Command: npx skills add https://github.com/clenisa/optimal-cli --skill delete-batch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Performs controlled bulk deletion of transactions from the OptimalOS transactions table to remove bad imports, duplicate batches, or test data while preserving provenance through auditing and scoped filters.

Core Features & Use Cases

  • Scoped filtering: Support for batch-id, user-id, date-range, and bank/source to precisely target records.
  • Safe execution: Counts affected rows, supports dry-run previews, requires explicit confirmation, and deletes in controlled batches.
  • Auditability: Inserts audit records into cli_task_logs and optionally marks upload_batches as deleted to maintain provenance.
  • Use case: Remove an erroneous CSV import by deleting all transactions associated with its upload batch and marking the batch as deleted.

Quick Start

Use the delete-batch command to preview deletions for batch 42 with a dry run and then confirm to execute the removal.

Frequently Asked Questions about delete-batch

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

FAQPage Schema
How do I bulk delete transactions in Supabase to clean up bad CSV imports?

To bulk delete transactions, filter the records by batch-id, user-id, date-range, or bank, preview the affected rows with a dry run, confirm the action, and execute batched deletions while inserting audit logs.

Can I preview a bulk delete of Supabase transactions before permanently removing the records?

Yes, you can preview a bulk delete using the dry-run feature to count affected rows and review scoped filters before requiring explicit interactive confirmation to execute the permanent removal.

How does auditing work when removing duplicate transaction batches from the OptimalOS table?

Auditing works by inserting provenance records into cli_task_logs and optionally marking the associated upload_batches status as deleted, ensuring a traceable record of the bulk transaction removal exists.

What Supabase environment variables do I need to set up before running a bulk transaction delete?

Before running a bulk transaction delete, you need to configure the OPTIMAL_SUPABASE_URL and OPTIMAL_SUPABASE_SERVICE_KEY environment variables to authenticate and authorize access to the transactions table.

What is the safest way to remove test data and duplicate batches from a Supabase transactions table?

The safest way to remove test data is to use scoped filters for precise targeting, execute a dry-run preview to verify the filtered counts, and require interactive confirmation before deleting in controlled batches.

Are there limitations when using date-range and bank filters for data cleanup in Supabase?

Limitations include needing exact filter parameters like batch-id or date-range to avoid broad scoping, and deletions require explicit confirmation since improperly scoped filters may target unintended transaction records.