data-loss-gate
Skill này làm gì
Skill này đặt một bước xác nhận trước khi agent AI thực hiện các thao tác phá hủy trên tệp hoặc kho tri thức. Skill dành cho bất kỳ ai muốn có bước kiểm tra an toàn trước khi xóa hàng loạt.
Khi nào nên dùng
- ✓Khi agent sắp chạy một lệnh xóa hàng loạt hoặc lệnh như rm -rf.
- ✓Khi một đợt dọn dẹp sẽ xóa nhiều trang trong kho tri thức hoặc cả một nguồn dữ liệu.
- ✓Khi một thao tác không thể hoàn tác và bạn muốn xem trước những gì sẽ mất.
Liên kết skill
https://github.com/garrytan/gbrain/blob/master/plugin-variants/gbrain-coding/skills/data-loss-gate/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy dọn các tệp nháp cũ trong thư mục này, nhưng cho tôi xem trước những gì sẽ bị xóa.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent kiểm tra các mục tiêu, hiển thị bản tóm tắt khả năng khôi phục của những gì sẽ mất, rồi chờ bạn nói có rõ ràng trước khi tiếp tục.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Đây có phải chặn kỹ thuật cứng không?
Skill cho biết đây là một quy ước định tuyến mà một agent tuân thủ tốt sẽ làm theo, chứ không phải khóa được thi hành.
Trước khi hỏi, nó kiểm tra gì?
Nó kiểm tra các mục tiêu thực tế, như backlink và lịch sử git, để bản tóm tắt chính xác.
Nhật ký xóa được lưu ở đâu?
Skill cho biết nhật ký xóa được lưu theo ngày trong thư mục daily sau khi được xác nhận.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 31k
- Vị trí xếp hạng
- #9254
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
gbrain
31kCho phép agent của bạn tìm trong kho tri thức dùng chung của công ty các thông tin về con người, dự án và quyết định, và lưu ghi chú bền vững vào đó.
brain-ingest-gate
31kKiểm tra nội dung mới với kho tri thức hiện có trước khi thêm vào, để tránh trùng lặp và xác định các thực thể được nêu tên trước.
brain-link-discipline
31kĐảm bảo agent của bạn kèm một liên kết hoạt động đến mỗi trang kho tri thức mà nó báo cáo, trong cùng một tin nhắn, để bạn mở được ngay.
brain-ops
31kCung cấp cho agent của bạn thói quen cốt lõi cho kho tri thức: kiểm tra ngữ cảnh có sẵn trước, lưu ghi chú rõ ràng kèm nguồn và liên kết các trang liên quan.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.