data-loss-gate

Requires explicit user confirmation before bulk delete or destructive operations.

29.4k|4.4k|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/garrytan/gbrain --skill data-loss-gate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-loss-gate
Source: https://github.com/garrytan/gbrain/tree/main/plugin/skills/data-loss-gate
Command: npx skills add https://github.com/garrytan/gbrain --skill data-loss-gate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Destructive operations like rm -rf, bulk page deletes, table truncation, or source removal can permanently destroy data before anyone realizes what was lost. This Skill inserts a mandatory confirmation gate that stops the agent, presents a recoverability card, and waits for an explicit "yes" before any destructive command executes.

Core Features & Use Cases

  • Destructive Operation Detection: Fires before shell-level deletions (rm -rf, git rm, bulk sed) and brain-level deletions (bulk forget, page-delete sweeps, purge-deleted, source removal, raw-SQL truncation).
  • Recoverability Card: Presents a structured card showing what will be deleted, count, size, recoverability options, downstream impact, and alternatives to deletion.
  • Strict Confirmation & Logging: Accepts only an explicit "yes" or "do it", then logs confirmed deletions to daily notes with timestamp, scope, and recovery path.
  • Use Case: Before running a script that sweeps gbrain delete across 400 pages, the agent inspects backlinks and graph dependencies, presents the card with restore options, and only proceeds after the user explicitly confirms.

Quick Start

Ask the agent to bulk delete pages or free up disk space and it will present a confirmation card requiring your explicit yes before proceeding.

Frequently Asked Questions about data-loss-gate

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

FAQPage Schema
How do I prevent accidental bulk deletion of files or database pages?

Use a confirmation gate that intercepts destructive commands before execution. It presents a card listing what will be deleted, recoverability options, and alternatives, then waits for an explicit yes before running anything.

What operations trigger the data loss confirmation gate?

It fires before rm -rf, bulk rm or sed -i on more than 10 files, git rm, bulk forget, page-delete sweeps, purge-deleted, source removal, and raw-SQL DROP, TRUNCATE, or unscoped DELETE statements.

Does a soft delete still require confirmation?

Yes. Even though soft-deleted pages are restorable via gbrain restore until purged, a wrong bulk sweep is expensive to reverse, so the gate fires anyway and notes the restore path on the card.

Can the --confirm-destructive CLI flag replace user confirmation?

No. The flag only confirms the agent's intent, not the user's consent. The gate still presents the recoverability card and requires the user to explicitly answer yes before proceeding.

What happens after a confirmed deletion?

The deletion is logged to daily notes under a Data Deletions heading with timestamp, what was deleted, count, size, reason, and recovery path. Large deletions over 1GB or 1000 items run in chunks with progress updates.