# Data Loss Gate

Confirmation gate before any bulk delete, cleanup, or destructive operation that could...

- Repository: https://github.com/garrytan/gbrain (31427 stars)
- Category: Data and ML
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add garrytan/gbrain --skill data-loss-gate -g -a claude-code -y`
Codex: `npx skills add garrytan/gbrain --skill data-loss-gate -g -a codex -y`
Cursor: `npx skills add garrytan/gbrain --skill data-loss-gate -g -a cursor -y`
Gemini CLI: `npx skills add garrytan/gbrain --skill data-loss-gate -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add garrytan/gbrain`

## Description

Confirmation gate before any bulk delete, cleanup, or destructive operation that could result in data loss, shell-level (rm -rf, git rm, bulk sed) or brain-level (bulk forget, delete sweeps, purge-deleted, source removal, raw-SQL truncation). Presents a recoverability card and requires an explicit "yes" from the user before proceeding. Routing convention, not an operation-boundary enforcement.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Data Loss Gate, Confirmation Before Destructive Operations

> **Convention:** see [conventions/brain-first.md](../conventions/brain-first.md), > inspect the actual target before proposing deletion: `get_backlinks`,
> `gbrain graph <slug>`, `git log` on the underlying files. The confirmation
> card below is only as good as the inspection behind it.
>
> **Convention:** see [_brain-filing-rules.md](../_brain-filing-rules.md), > the post-confirmation deletion log files date-keyed under `daily/`.

## What This Is

A gate that fires BEFORE any destructive operation and requires explicit user
confirmation. The agent stops, presents a recoverability card, and waits.

**Scope honesty:** this gate is a routing convention, the harness resolves it
into context when a destructive intent matches, and a well-behaved agent
follows it. It is NOT an operation-boundary enforcement: nothing in the gbrain
runtime mechanically blocks a delete if the skill never loads. (A native
confirm gate at the operation boundary is a filed TODO; until it lands, this
convention is the line of defense.) Some CLI surfaces carry their own flag
gates, e.g. `gbrain sources remove` requires `--confirm-destructive`, but
the flag confirms that the AGENT is sure. This skill exists to confirm that
the USER is.

## When This Fires

**Before ANY of these operations:**

Shell / filesystem level:

- `rm -rf` on any directory with data
- `rm` / `unlink` on more than 10 files
- `sed -i` that modifies more than 10 files
- `git rm` on tracked files
- Truncating or stripping content from files in bulk
- Overwriting files with smaller versions (content stripping)
- Any operation described as "cleanup" or "freeing space" that touches data files

Brain / database level (gbrain-specific):

The rest: https://github.com/garrytan/gbrain/blob/HEAD/plugin-variants/gbrain-coding/skills/data-loss-gate/SKILL.md
