data-loss-gate
Fungsinya
Skill ini memasang langkah konfirmasi sebelum agent AI menjalankan operasi destruktif pada file atau brain pengetahuan. Cocok untuk siapa pun yang ingin pemeriksaan keamanan sebelum penghapusan besar.
Kapan dipakai
- βSaat agent Anda akan menjalankan penghapusan massal atau perintah seperti rm -rf.
- βKetika pembersihan akan menghapus banyak halaman brain atau seluruh sumber data.
- βSaat suatu operasi tidak bisa dibatalkan dan Anda ingin melihat apa yang akan hilang terlebih dahulu.
Link skill
https://github.com/garrytan/gbrain/blob/master/plugin-variants/gbrain-coding/skills/data-loss-gate/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBersihkan semua file draf lama di folder ini, tetapi tunjukkan dulu apa saja yang akan dihapus.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent memeriksa target, menampilkan ringkasan tentang apa yang akan hilang dan apakah bisa dipulihkan, lalu menunggu persetujuan tegas Anda sebelum melanjutkan.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Data Loss Gate β Confirmation Before Destructive Operations
Convention: see conventions/brain-first.md β inspect the actual target before proposing deletion:
get_backlinks,gbrain graph <slug>,git logon the underlying files. The confirmation card below is only as good as the inspection behind it.Convention: see _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 -rfon any directory with datarm/unlinkon more than 10 filessed -ithat modifies more than 10 filesgit rmon 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):
- Bulk forget β scripting or looping
gbrain forget <fact-id>over many facts. One forget is a considered, idempotent act; a forget sweep is data loss. - Page-delete sweeps β
gbrain delete <slug>in a loop, or any script that sweepsdelete_pageacross a set of slugs. Deletes are soft (recoverable viagbrain restore <slug>) until purged β say so on the card, then gate anyway: a sweep that's wrong in bulk is expensive to un-wrong in bulk. gbrain delete --purgeβ skips the 72-hour soft delete and removes the page at once with its chunks, versions, takes, timeline, links, raw data and the facts filed on it.gbrain restorecannot undo it. Every purge needs the user's explicit go for that purge: a request to "scrub the repo", "clean up the files" or "remove it from Git" is not a go to purge database pages. After the go, purge one page at a time (never a parallelxargsor a background loop), confirm each one is gone (gbrain get <slug> --include-deletedreportspage_not_found) before the next, and stop the batch at the first refusal. A purge batch that was stopped (SIGTERM, a write freeze, a timeout) stays stopped: report what finished and ask again before relaunching it.gbrain pages purge-deletedβ permanently removes soft-deleted pages from every source of the brain. This is the point of no return for the soft-delete safety net. Show the usergbrain pages purge-deleted --dry-run --jsonfirst; the command itself asks (exit 3 without a terminal) and runs with--yesonly after the user agrees.- Source removal β
gbrain sources remove <id>deletes the source AND every page in it. The--confirm-destructiveflag does not substitute for the card. - Mount removal β
gbrain mounts remove <id>only removes the local registration (the mounted brain's database survives; re-add to recover). Gate it anyway when the flow ALSO plans to delete the mount's underlying database or files β then the full card applies to those. - Raw-SQL truncation β any
DROP TABLE,TRUNCATE, orDELETEwithout a narrowWHEREagainst the brain database, via any path (psql, a migration script, an engineexecuteRawcall). - Deleting database rows in bulk; dropping tables, collections, or indexes.
What To Do
Step 1: STOP before executing
Do NOT run the destructive command. Inspect the actual target first (backlinks, graph edges, git history, file contents β whatever grounds the card), then present the user with:
Step 2: The Confirmation Card
β οΈ DATA DELETION β Confirmation Required
What: [exactly what will be deleted/modified]
Count: [number of files/rows/pages/facts affected]
Size: [how much
Pertanyaan umum
Apakah ini kunci teknis yang benar-benar memblokir?
Skill ini menyatakan bahwa ini adalah konvensi routing yang diikuti agent yang baik, bukan kunci yang dipaksakan.
Apa yang diperiksa sebelum bertanya?
Skill memeriksa target yang sebenarnya, seperti backlink dan riwayat git, agar ringkasannya akurat.
Di mana log penghapusan disimpan?
Skill menyatakan bahwa log penghapusan diarsipkan menurut tanggal di bawah folder harian setelah konfirmasi.
Detail
Deskripsi asli dari pembuat
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.
repo: garrytan/gbrain
Popularitas
- Bintang GitHub
- 31k
- Peringkat
- #9254
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
gbrain
31kMemungkinkan agent Anda mencari fakta tentang orang, proyek, dan keputusan di basis pengetahuan bersama perusahaan, serta menyimpan catatan penting.
brain-ingest-gate
31kMemeriksa konten baru terhadap basis pengetahuan yang sudah ada sebelum ditambahkan, untuk menghindari duplikat dan menyelesaikan entitas bernama lebih dulu.
brain-link-discipline
31kMemastikan agent Anda menyertakan tautan yang berfungsi ke setiap halaman basis pengetahuan yang dilaporkannya, dalam pesan yang sama, agar Anda bisa langsung membukanya.
brain-ops
31kMemberi agent Anda rutinitas inti untuk basis pengetahuan: memeriksa konteks yang ada terlebih dahulu, menyimpan catatan eksplisit beserta sumbernya, dan menautkan halaman terkait.
Skill serupa
openclaw-update
394kMembantu agent Anda memperbarui OpenClaw Gateway yang sudah ada, dengan memilih metode pembaruan yang sesuai cara pemasangannya dan menjaga sesi Anda tetap berjalan.
diagnose-gateway
394kMembantu agent Anda mencari tahu mengapa OpenClaw Gateway gagal dengan memeriksa pengaturan, channel, dan port tanpa mengubah apa pun.
crabbox-apps
394kMembantu agent Anda membuka dan menjalankan aplikasi di mesin cloud sementara, lalu menampilkan tampilannya di panel samping chat Anda.