[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M723TWNK3AP82F1KBBDSD8VS":3,"skill-same:01M723TWNK3AP82F1KBBDSD8VS":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":6,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":46,"install":47,"resources":59},"01M723TWNK3AP82F1KBBDSD8VS","data-loss-gate",null,"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.","weiping\u002Fgbrain-cn","weiping","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F577376?v=4","01M723RHKK6K83FDAAGE48DDS1","01M723RHM767WYBV95VAHQ03A7",1,"MIT","https:\u002F\u002Fgithub.com\u002Fweiping\u002Fgbrain-cn\u002Fblob\u002Fgbrain-cn\u002Fplugin-variants\u002Fgbrain-coding\u002Fskills\u002Fdata-loss-gate\u002FSKILL.md",[],[],"2026-11-10 18:39:20",false,"---\nname: data-loss-gate\nversion: 1.0.0\ndescription: >\n  Confirmation gate before any bulk delete, cleanup, or destructive operation\n  that could result in data loss — shell-level (rm -rf, git rm, bulk sed) or\n  brain-level (bulk forget, delete sweeps, purge-deleted, source removal,\n  raw-SQL truncation). Presents a recoverability card and requires an explicit\n  \"yes\" from the user before proceeding. Routing convention, not an\n  operation-boundary enforcement.\ntriggers:\n  - \"bulk delete\"\n  - \"wipe the\"\n  - \"rm -rf\"\n  - \"purge the\"\n  - \"truncate\"\n  - \"free up space\"\n  - \"bulk forget\"\n  - \"remove the source\"\n  - \"drop the table\"\nmutating: true\nwrites_pages: true\nwrites_to:\n  - daily\u002F\nupstream: data-loss-gate@fc834ee\n# Brain-first applies in its inspection form: before deleting brain pages,\n# check backlinks \u002F graph dependencies (get_backlinks, graph) so the card's\n# \"what we'd lose\" section is grounded in the actual target, not guesses.\nbrain_first: true\nwhen_to_use: \"Use when the user asks: \\\"bulk delete\\\", \\\"wipe the\\\", \\\"rm -rf\\\", \\\"purge the\\\", \\\"truncate\\\".\"\n---\n\n# Data Loss Gate — Confirmation Before Destructive Operations\n\n> **Convention:** see [conventions\u002Fbrain-first.md](..\u002Fconventions\u002Fbrain-first.md) —\n> inspect the actual target before proposing deletion: `get_backlinks`,\n> `gbrain graph \u003Cslug>`, `git log` on the underlying files. The confirmation\n> card below is only as good as the inspection behind it.\n>\n> **Convention:** see [_brain-filing-rules.md](..\u002F_brain-filing-rules.md) —\n> the post-confirmation deletion log files date-keyed under `daily\u002F`.\n\n## What This Is\n\nA gate that fires BEFORE any destructive operation and requires explicit user\nconfirmation. The agent stops, presents a recoverability card, and waits.\n\n**Scope honesty:** this gate is a routing convention — the harness resolves it\ninto context when a destructive intent matches, and a well-behaved agent\nfollows it. It is NOT an operation-boundary enforcement: nothing in the gbrain\nruntime mechanically blocks a delete if the skill never loads. (A native\nconfirm gate at the operation boundary is a filed TODO; until it lands, this\nconvention is the line of defense.) Some CLI surfaces carry their own flag\ngates — e.g. `gbrain sources remove` requires `--confirm-destructive` — but\nthe flag confirms that the AGENT is sure. This skill exists to confirm that\nthe USER is.\n\n## When This Fires\n\n**Before ANY of these operations:**\n\nShell \u002F filesystem level:\n\n- `rm -rf` on any directory with data\n- `rm` \u002F `unlink` on more than 10 files\n- `sed -i` that modifies more than 10 files\n- `git rm` on tracked files\n- Truncating or stripping content from files in bulk\n- Overwriting files with smaller versions (content stripping)\n- Any operation described as \"cleanup\" or \"freeing space\" that touches data files\n\nBrain \u002F database level (gbrain-specific):\n\n- **Bulk forget** — scripting or looping `gbrain forget \u003Cfact-id>` over many\n  facts. One forget is a considered, idempotent act; a forget sweep is data loss.\n- **Page-delete sweeps** — `gbrain delete \u003Cslug>` in a loop, or any script that\n  sweeps `delete_page` across a set of slugs. Deletes are soft (recoverable via\n  `gbrain restore \u003Cslug>`) until purged — say so on the card, then gate anyway:\n  a sweep that's wrong in bulk is expensive to un-wrong in bulk.\n- **`gbrain delete --purge`** — skips the 72-hour soft delete and removes the\n  page at once with its chunks, versions, takes, timeline, links, raw data and\n  the facts filed on it. `gbrain restore` cannot undo it. Every purge needs the\n  user's explicit go for that purge: a request to \"scrub the repo\", \"clean up\n  the files\" or \"remove it from Git\" is not a go to purge database pages. After\n  the go, purge one page at a time (never a parallel `xargs` or a background\n  loop), confirm each one is gone (`gbrain get \u003Cslug> --include-deleted` reports\n  `page_not_found`) before the next, and stop the batch at the first refusal. A purge batch that was\n  stopped (SIGTERM, a write freeze, a timeout) stays stopped: report what\n  finished and ask again before relaunching it.\n- **`gbrain pages purge-deleted`** — permanently removes soft-deleted pages\n  from every source of the brain. This is the point of no return for the\n  soft-delete safety net. Show the user `gbrain pages purge-deleted --dry-run --json`\n  first; the command itself asks (exit 3 without a terminal) and runs with\n  `--yes` only after the user agrees. It keeps a file committed at the source's\n  last synced commit or at HEAD (the page waits or goes database-only), unless a\n  person's delete of the page never removed the file (e.g. another page shared it).\n- **Source removal** — `gbrain sources remove \u003Cid>` deletes the source AND\n  every page in it. The `--confirm-destructive` flag does not substitute for\n  the card. A managed removal deletes pages in committed batches: one that\n  stops early (`write_pending`) has already deleted some, so say so and rerun it\n  to finish.\n- **Mount removal** — `gbrain mounts remove \u003Cid>` only removes the local\n  registration (the mounted brain's database survives; re-add to recover). Gate\n  it anyway when the flow ALSO plans to delete the mount's underlying database\n  or files — then the full card applies to those.\n- **Raw-SQL truncation** — any `DROP TABLE`, `TRUNCATE`, or `DELETE` without a\n  narrow `WHERE` against the brain database, via any path (psql, a migration\n  script, an engine `executeRaw` call).\n- Deleting database rows in bulk; dropping tables, collections, or indexes.\n\n## What To Do\n\n### Step 1: STOP before executing\n\nDo NOT run the destructive command. Inspect the actual target first\n(backlinks, graph edges, git history, file contents — whatever grounds the\ncard), then present the user with:\n\n### Step 2: The Confirmation Card\n\n```\n⚠️ DATA DELETION — Confirmation Required\n\nWhat: [exactly what will be deleted\u002Fmodified]\nCount: [number of files\u002Frows\u002Fpages\u002Ffacts affected]\nSize: [how much data will be removed]\nLocation: [exact paths, slugs, or source\u002Fmount ids]\n\nWhy: [the reason for the deletion]\n\nRecoverable?\n- [ ] Backed up to a remote (git remote, database backup, object storage)\n- [ ] In git history (can git checkout)\n- [ ] Soft-deleted in the brain (restorable via `gbrain restore` until purged)\n- [ ] Re-fetchable from an upstream source (which one, how long)\n- [ ] NOT recoverable — permanent data loss\n\nWhat we'd lose:\n- [specific data\u002Fcapability that would be gone]\n- [any downstream systems that depend on this data]\n\nAlternative to deletion:\n- [compress instead of delete?]\n- [move to cold storage?]\n- [archive to a remote backup?]\n- [soft-delete and defer the purge?]\n\nProceed? (yes\u002Fno)\n```\n\n### Step 3: Wait for explicit \"yes\"\n\n- Do NOT proceed on \"ok\", \"sure\", \"go ahead\" — require \"yes\" or \"do it\"\n- If the user says \"wait\" or asks a question, answer it and re-present the card\n- If the user says \"no\", stop immediately and suggest alternatives\n\nFor the mechanics of presenting the gate and stopping the turn, use the\n[ask-user](..\u002Fask-user\u002FSKILL.md) choice-gate pattern — this skill supplies the\ncard content and the explicit-yes strictness; ask-user supplies the\nstop-and-wait discipline.\n\n### Step 4: Execute with logging\n\nAfter confirmation:\n\n1. Log what was deleted to `daily\u002Fnotes\u002FYYYY-MM-DD.md` under `## Data Deletions`\n2. Include: timestamp, what, count, size, recovery path\n3. If the deletion is large (>1GB or >1000 files\u002Fpages), do it in chunks with\n   progress updates\n\n## No Exception Classes\n\nThere are no categories of data that are disposable by default. Old logs, git\nstash entries, build artifacts, caches — each of these has, at some point,\nbeen the source of truth for something. Disposability is a property of the\nSPECIFIC target, verified by inspecting it (backlinks, git status, what\ndepends on it, whether it's re-fetchable and at what cost) — never a property\nof its category. If the inspection genuinely shows the target is ephemeral and\nregenerable, the card is quick to fill out and the user's \"yes\" is quick to\nget. That's the cost of the gate working.\n\n## Why This Exists\n\nA downstream agent once deleted a multi-gigabyte cache of raw source files\nfrom its brain's data directory to free disk space. The files looked like\n\"just cache\" — but they were the source data for a planned feature. The data\nhappened to be re-fetchable from its upstream source, but the deletion was\nstill wrong because:\n\n1. It destroyed work that had a planned use\n2. It happened without the data owner's consent\n3. The \"cleanup\" framing made it seem safe when it wasn't\n\n**The rule: if it's data and it's bulk, ASK FIRST. Always.**\n\n## When it fails\n\nFollow the [agent operator protocol](..\u002Fconventions\u002Fagent-operator-protocol.md) for any gbrain error `code`, exit code, `[AGENT]` block or notice block. Specific to this skill:\n\n- A destructive command exits 3 (`confirmation_required`) or asks for `--confirm-destructive`: that flag confirms the agent is sure, not the user. Show the recoverability card and wait for the user's explicit yes.\n- `gbrain pages purge-deleted` removes soft-deleted pages for good, so `gbrain restore` cannot bring them back afterwards: say so on the card. Never promise physical erasure or a recovery you cannot verify.\n- A delete or forget returns `write_pending` (exit 10): it was accepted and is still pending, so it may still commit. It is not \"not found\" or \"failed\": poll the receipt (`gbrain write-request \u003Crequest_id>`) before writing the deletion log entry, and never re-run the deletion or move to a wider one because of it.\n\n## Anti-Patterns\n\n- ❌ \"These are just cache files\" — cache files can be the source of truth\n- ❌ \"We can re-fetch from the API\" — re-fetching costs time, money, and may not produce identical data\n- ❌ \"It's gitignored so it doesn't matter\" — gitignored ≠ unimportant\n- ❌ \"The disk is full, I need to free space NOW\" — even under pressure, ask first\n- ❌ \"I'll clean up and tell the user after\" — the confirmation must come BEFORE the deletion\n- ❌ \"It's only a soft delete\" — a wrong sweep is still expensive to un-wrong in bulk, and purge makes it permanent\n- ❌ \"The command already has --confirm-destructive\" — the flag confirms the agent's intent, not the user's consent\n- ❌ \"They asked me to scrub it from the repo, so I purged the pages\" — a repository cleanup is not consent to delete database rows\n- ❌ Running purges in parallel, or reading a non-zero exit as \"nothing happened\" — exit 10 means the delete was accepted\n- ❌ Presenting deletion as the only option without listing alternatives\n\n## Dedup (sharp boundaries)\n\n- **[conventions\u002Ftest-before-bulk.md](..\u002Fconventions\u002Ftest-before-bulk.md)** —\n  the write-side sibling. test-before-bulk gates bulk WRITE quality (test 3-5\n  items before running 170); data-loss-gate gates bulk DESTRUCTION (confirm\n  before deleting anything in bulk). A flow that rewrites pages in place needs\n  both: test-before-bulk for the new content, data-loss-gate for what the\n  rewrite destroys.\n- **[ask-user](..\u002Fask-user\u002FSKILL.md)** — the confirmation MECHANICS (2-4\n  options, escape hatch, stop the turn, handle the response). data-loss-gate\n  is a specialized caller: it supplies the destructive-op card and the\n  strict explicit-yes rule (\"ok\" is not consent). Route to ask-user for any\n  non-destructive decision gate.\n- **[maintain](..\u002Fmaintain\u002FSKILL.md)** — brain health checks and routine\n  cleanup (orphans, backlinks, stale detection). maintain FINDS candidates\n  for cleanup; when acting on them crosses into bulk deletion, data-loss-gate\n  fires before execution. \"Check brain health\" routes to maintain, not here.\n\n## Contract\n\nThis skill guarantees:\n\n- No destructive operation in scope (the \"When This Fires\" list) executes\n  before the confirmation card is presented and the user answers with an\n  explicit \"yes\" \u002F \"do it\".\n- The card always includes the recoverability checklist, what-we'd-lose, and\n  at least one alternative to deletion.\n- Confirmed deletions are logged to `daily\u002Fnotes\u002FYYYY-MM-DD.md` under\n  `## Data Deletions` with timestamp, scope, and recovery path.\n- Routing matches the canonical triggers in the frontmatter.\n- Output written under the directories listed in `writes_to:`.\n- Privacy contract preserved: no real names, no fork-specific filesystem path\n  literals, no upstream-fork references.\n\nThe full behavior contract is documented in the body sections above; this\nsection exists for the conformance test.\n\n## Output Format\n\nTwo artifacts:\n\n1. **The confirmation card** (pre-execution) — the exact fenced block in\n   Step 2, presented via the ask-user stop-and-wait pattern. The turn ends\n   after the card; no further tool calls until the user responds.\n2. **The deletion log entry** (post-execution, only after explicit \"yes\") —\n   appended to `daily\u002Fnotes\u002FYYYY-MM-DD.md`:\n\n```markdown\n## Data Deletions\n\n- **[HH:MM]** [what was deleted] — [count], [size]. Reason: [why].\n  Recovery: [backup\u002Fgit\u002Frestore path, or \"none — permanent\"].\n```\n","# Data Loss Gate — Confirmation Before Destructive Operations\n\n> **Convention:** see [conventions\u002Fbrain-first.md](..\u002Fconventions\u002Fbrain-first.md) —\n> inspect the actual target before proposing deletion: `get_backlinks`,\n> `gbrain graph \u003Cslug>`, `git log` on the underlying files. The confirmation\n> card below is only as good as the inspection behind it.\n>\n> **Convention:** see [_brain-filing-rules.md](..\u002F_brain-filing-rules.md) —\n> the post-confirmation deletion log files date-keyed under `daily\u002F`.\n\n## What This Is\n\nA gate that fires BEFORE any destructive operation and requires explicit user\nconfirmation. The agent stops, presents a recoverability card, and waits.\n\n**Scope honesty:** this gate is a routing convention — the harness resolves it\ninto context when a destructive intent matches, and a well-behaved agent\nfollows it. It is NOT an operation-boundary enforcement: nothing in the gbrain\nruntime mechanically blocks a delete if the skill never loads. (A native\nconfirm gate at the operation boundary is a filed TODO; until it lands, this\nconvention is the line of defense.) Some CLI surfaces carry their own flag\ngates — e.g. `gbrain sources remove` requires `--confirm-destructive` — but\nthe flag confirms that the AGENT is sure. This skill exists to confirm that\nthe USER is.\n\n## When This Fires\n\n**Before ANY of these operations:**\n\nShell \u002F filesystem level:\n\n- `rm -rf` on any directory with data\n- `rm` \u002F `unlink` on more than 10 files\n- `sed -i` that modifies more than 10 files\n- `git rm` on tracked files\n- Truncating or stripping content from files in bulk\n- Overwriting files with smaller versions (content stripping)\n- Any operation described as \"cleanup\" or \"freeing space\" that touches data files\n\nBrain \u002F database level (gbrain-specific):\n\n- **Bulk forget** — scripting or looping `gbrain forget \u003Cfact-id>` over many\n  facts. One forget is a considered, idempotent act; a forget sweep is data loss.\n- **Page-delete sweeps** — `gbrain delete \u003Cslug>` in a loop, or any script that\n  sweeps `delete_page` across a set of slugs. Deletes are soft (recoverable via\n  `gbrain restore \u003Cslug>`) until purged — say so on the card, then gate anyway:\n  a sweep that's wrong in bulk is expensive to un-wrong in bulk.\n- **`gbrain delete --purge`** — skips the 72-hour soft delete and removes the\n  page at once with its chunks, versions, takes, timeline, links, raw data and\n  the facts filed on it. `gbrain restore` cannot undo it. Every purge needs the\n  user's explicit go for that purge: a request to \"scrub the repo\", \"clean up\n  the files\" or \"remove it from Git\" is not a go to purge database pages. After\n  the go, purge one page at a time (never a parallel `xargs` or a background\n  loop), confirm each one is gone (`gbrain get \u003Cslug> --include-deleted` reports\n  `page_not_found`) before the next, and stop the batch at the first refusal. A purge batch that was\n  stopped (SIGTERM, a write freeze, a timeout) stays stopped: report what\n  finished and ask again before relaunching it.\n- **`gbrain pages purge-deleted`** — permanently removes soft-deleted pages\n  from every source of the brain. This is the point of no return for the\n  soft-delete safety net. Show the user `gbrain pages purge-deleted --dry-run --json`\n  first; the command itself asks (exit 3 without a terminal) and runs with\n  `--yes` only after the user agrees. It keeps a file committed at the source's\n  last synced commit or at HEAD (the page waits or goes database-only), unless a\n  person's delete of the page never removed the file (e.g. another page shared it).\n- **Source removal** — `gbrain sources remove \u003Cid>` deletes the source AND\n  every page in it. The `--confirm-destructive` flag does not substitute for\n  the card. A managed removal deletes pages in committed batches: one that\n  stops early (`write_pending`) has already deleted some, so say so and rerun it\n  to finish.\n- **Mount removal** — `gbrain mounts remove \u003Cid>` only removes the local\n  registration (the mounted brain's database survives; re-add to recover). Gate\n  it anyway when the flow ALSO plans to delete the mount's underlying database\n  or files — then the full card applies to those.\n- **Raw-SQL truncation** — any `DROP TABLE`, `TRUNCATE`, or `DELETE` without a\n  narrow `WHERE` against the brain database, via any path (psql, a migration\n  script, an engine `executeRaw` call).\n- Deleting database rows in bulk; dropping tables, collections, or indexes.\n\n## What To Do\n\n### Step 1: STOP before executing\n\nDo NOT run the destructive command. Inspect the actual target first\n(backlinks, graph edges, git history, file contents — whatever grounds the\ncard), then present the user with:\n\n### Step 2: The Confirmation Card\n\n```\n⚠️ DATA DELETION — Confirmation Required\n\nWhat: [exactly what will be deleted\u002Fmodified]\nCount: [number of files\u002Frows\u002Fpages\u002Ffacts affected]\nSize: [how much data will be removed]\nLocation: [exact paths, slugs, or source\u002Fmount ids]\n\nWhy: [the reason for the deletion]\n\nRecoverable?\n- [ ] Backed up to a remote (git remote, database backup, object storage)\n- [ ] In git history (can git checkout)\n- [ ] Soft-deleted in the brain (restorable via `gbrain restore` until purged)\n- [ ] Re-fetchable from an upstream source (which one, how long)\n- [ ] NOT recoverable — permanent data loss\n\nWhat we'd lose:\n- [specific data\u002Fcapability that would be gone]\n- [any downstream systems that depend on this data]\n\nAlternative to deletion:\n- [compress instead of delete?]\n- [move to cold storage?]\n- [archive to a remote backup?]\n- [soft-delete and defer the purge?]\n\nProceed? (yes\u002Fno)\n```\n\n### Step 3: Wait for explicit \"yes\"\n\n- Do NOT proceed on \"ok\", \"sure\", \"go ahead\" — require \"yes\" or \"do it\"\n- If the user says \"wait\" or asks a question, answer it and re-present the card\n- If the user says \"no\", stop immediately and suggest alternatives\n\nFor the mechanics of presenting the gate and stopping the turn, use the\n[ask-user](..\u002Fask-user\u002FSKILL.md) choice-gate pattern — this skill supplies the\ncard content and the explicit-yes strictness; ask-user supplies the\nstop-and-wait discipline.\n\n### Step 4: Execute with logging\n\nAfter confirmation:\n\n1. Log what was deleted to `daily\u002Fnotes\u002FYYYY-MM-DD.md` under `## Data Deletions`\n2. Include: timestamp, what, count, size, recovery path\n3. If the deletion is large (>1GB or >1000 files\u002Fpages), do it in chunks with\n   progress updates\n\n## No Exception Classes\n\nThere are no categories of data that are disposable by default. Old logs, git\nstash entries, build artifacts, caches — each of these has, at some point,\nbeen the source of truth for something. Disposability is a property of the\nSPECIFIC target, verified by inspecting it (backlinks, git status, what\ndepends on it, whether it's re-fetchable and at what cost) — never a property\nof its category. If the inspection genuinely shows the target is ephemeral and\nregenerable, the card is quick to fill out and the user's \"yes\" is quick to\nget. That's the cost of the gate working.\n\n## Why This Exists\n\nA downstream agent once deleted a multi-gigabyte cache of raw source files\nfrom its brain's data directory to free disk space. The files looked like\n\"just cache\" — but they were the source data for a planned feature. The data\nhappened to be re-fetchable from its upstream source, but the deletion was\nstill wrong because:\n\n1. It destroyed work that had a planned use\n2. It happened without the data owner's consent\n3. The \"cleanup\" framing made it seem safe when it wasn't\n\n**The rule: if it's data and it's bulk, ASK FIRST. Always.**\n\n## When it fails\n\nFollow the [agent operator protocol](..\u002Fconventions\u002Fagent-operator-protocol.md) for any gbrain error `code`, exit code, `[AGENT]` block or notice block. Specific to this skill:\n\n- A destructive command exits 3 (`confirmation_required`) or asks for `--confirm-destructive`: that flag confirms the agent is sure, not the user. Show the recoverability card and wait for the user's explicit yes.\n- `gbrain pages purge-deleted` removes soft-deleted pages for good, so `gbrain restore` cannot bring them back afterwards: say so on the card. Never promise physical erasure or a recovery you cannot verify.\n- A delete or forget returns `write_pending` (exit 10): it was accepted and is still pending, so it may still commit. It is not \"not found\" or \"failed\": poll the receipt (`gbrain write-request \u003Crequest_id>`) before writing the deletion log entry, and never re-run the deletion or move to a wider one because of it.\n\n## Anti-Patterns\n\n- ❌ \"These are just cache files\" — cache files can be the source of truth\n- ❌ \"We can re-fetch from the API\" — re-fetching costs time, money, and may not produce identical data\n- ❌ \"It's gitignored so it doesn't matter\" — gitignored ≠ unimportant\n- ❌ \"The disk is full, I need to free space NOW\" — even under pressure, ask first\n- ❌ \"I'll clean up and tell the user after\" — the confirmation must come BEFORE the deletion\n- ❌ \"It's only a soft delete\" — a wrong sweep is still expensive to un-wrong in bulk, and purge makes it permanent\n- ❌ \"The command already has --confirm-destructive\" — the flag confirms the agent's intent, not the user's consent\n- ❌ \"They asked me to scrub it from the repo, so I purged the pages\" — a repository cleanup is not consent to delete database rows\n- ❌ Running purges in parallel, or reading a non-zero exit as \"nothing happened\" — exit 10 means the delete was accepted\n- ❌ Presenting deletion as the only option without listing alternatives\n\n## Dedup (sharp boundaries)\n\n- **[conventions\u002Ftest-before-bulk.md](..\u002Fconventions\u002Ftest-before-bulk.md)** —\n  the write-side sibling. test-before-bulk gates bulk WRITE quality (test 3-5\n  items before running 170); data-loss-gate gates bulk DESTRUCTION (confirm\n  before deleting anything in bulk). A flow that rewrites pages in place needs\n  both: test-before-bulk for the new content, data-loss-gate for what the\n  rewrite destroys.\n- **[ask-user](..\u002Fask-user\u002FSKILL.md)** — the confirmation MECHANICS (2-4\n  options, escape hatch, stop the turn, handle the response). data-loss-gate\n  is a specialized caller: it supplies the destructive-op card and the\n  strict explicit-yes rule (\"ok\" is not consent). Route to ask-user for any\n  non-destructive decision gate.\n- **[maintain](..\u002Fmaintain\u002FSKILL.md)** — brain health checks and routine\n  cleanup (orphans, backlinks, stale detection). maintain FINDS candidates\n  for cleanup; when acting on them crosses into bulk deletion, data-loss-gate\n  fires before execution. \"Check brain health\" routes to maintain, not here.\n\n## Contract\n\nThis skill guarantees:\n\n- No destructive operation in scope (the \"When This Fires\" list) executes\n  before the confirmation card is presented and the user answers with an\n  explicit \"yes\" \u002F \"do it\".\n- The card always includes the recoverability checklist, what-we'd-lose, and\n  at least one alternative to deletion.\n- Confirmed deletions are logged to `daily\u002Fnotes\u002FYYYY-MM-DD.md` under\n  `## Data Deletions` with timestamp, scope, and recovery path.\n- Routing matches the canonical triggers in the frontmatter.\n- Output written under the directories listed in `writes_to:`.\n- Privacy contract preserved: no real names, no fork-specific filesystem path\n  literals, no upstream-fork references.\n\nThe full behavior contract is documented in the body sections above; this\nsection exists for the conformance test.\n\n## Output Format\n\nTwo artifacts:\n\n1. **The confirmation card** (pre-execution) — the exact fenced block in\n   Step 2, presented via the ask-user stop-and-wait pattern. The turn ends\n   after the card; no further tool calls until the user responds.\n2. **The deletion log entry** (post-execution, only after explicit \"yes\") —\n   appended to `daily\u002Fnotes\u002FYYYY-MM-DD.md`:\n\n```markdown\n## Data Deletions\n\n- **[HH:MM]** [what was deleted] — [count], [size]. Reason: [why].\n  Recovery: [backup\u002Fgit\u002Frestore path, or \"none — permanent\"].\n```\n",{"name":5,"version":23,"mutating":24,"triggers":25,"upstream":35,"writes_to":36,"brain_first":24,"description":38,"when_to_use":39,"writes_pages":24},"1.0.0",true,[26,27,28,29,30,31,32,33,34],"bulk delete","wipe the","rm -rf","purge the","truncate","free up space","bulk forget","remove the source","drop the table","data-loss-gate@fc834ee",[37],"daily\u002F","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.\n","Use when the user asks: \"bulk delete\", \"wipe the\", \"rm -rf\", \"purge the\", \"truncate\".","gbrain-cn","b593c7f55100def8c860cb1d65c74631c9879c3b","plugin-variants\u002Fgbrain-coding\u002Fskills\u002Fdata-loss-gate",0,"https:\u002F\u002Fgithub.com\u002Fweiping\u002Fgbrain-cn","https:\u002F\u002Fgithub.com\u002Fweiping","2026-11-11 06:54:34",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":24},[49,52,55],{"tool":50,"command":51},"npx","npx skills add weiping\u002Fgbrain-cn --skill data-loss-gate",{"tool":53,"command":54},"bunx","bunx skills add weiping\u002Fgbrain-cn --skill data-loss-gate",{"tool":56,"command":57},"pnpm","pnpm dlx skills add weiping\u002Fgbrain-cn --skill data-loss-gate","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fweiping\u002Fgbrain-cn\u002Fblob\u002Fgbrain-cn\u002Fplugin-variants\u002Fgbrain-coding\u002Fskills\u002Fdata-loss-gate\u002FSKILL.md",[60],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"routing-eval.jsonl","OTHER","其他",1159,"https:\u002F\u002Fgithub.com\u002Fweiping\u002Fgbrain-cn\u002Fblob\u002Fgbrain-cn\u002Fplugin-variants\u002Fgbrain-coding\u002Fskills\u002Fdata-loss-gate\u002Frouting-eval.jsonl",[67,74,81,88,93,100],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M724KW82DWENSNNY6W7PWDHD","two-tier-extraction","Tiered LLM extraction pattern for large corpus processing (email archives,\ndocument dumps, transcript libraries). A utility-tier model triages and\nclassifies at speed; the reasoning tier does the default deep read; the\ndeep tier is the escalation for the highest-value content. Prevents\nspending deep-tier money on noise while ensuring the important content\ngets the best eyes. A deterministic privacy wall runs before any LLM call.","https:\u002F\u002Fgithub.com\u002Fweiping\u002Fgbrain-cn\u002Fblob\u002Fgbrain-cn\u002Fskills\u002Ftwo-tier-extraction\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":18},"01M724F7V2HQHRWJFT40DPZ0SK","research-compendium","Deep-research a topic end to end and produce a permanent, reusable knowledge asset: archive every primary source verbatim (gated by the user's privacy\u002Fretention posture), write one 1:1 summary per source, then synthesize a single self-contained compendium page. Depth is a dial (base synthesis → grounded primaries → books + counter-canon → saturation), each level an idempotent superset of the one below. Distinct from data-research (structured trackers) and perplexity-research (web deltas): this produces prose knowledge synthesis backed by an archived source corpus.","https:\u002F\u002Fgithub.com\u002Fweiping\u002Fgbrain-cn\u002Fblob\u002Fgbrain-cn\u002Fskills\u002Fresearch-compendium\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M724BWSE5R2ZE5P98BHEK65M","frontmatter-guard","Validate and auto-repair YAML frontmatter on brain pages. Catches malformed\npages before they enter the brain (missing closing ---, nested quotes, slug\nmismatches, null bytes, empty frontmatter, YAML parse failures), explains\nfiles sync holds instead of importing, and drives the previewed\n`gbrain repair frontmatter` fix. Wraps the `gbrain frontmatter` CLI for\nagent-driven workflows.","https:\u002F\u002Fgithub.com\u002Fweiping\u002Fgbrain-cn\u002Fblob\u002Fgbrain-cn\u002Fskills\u002Ffrontmatter-guard\u002FSKILL.md",[],[],{"skillNo":89,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":18},"01M724ANZBT3M2V17RZYRA9GJ3","https:\u002F\u002Fgithub.com\u002Fweiping\u002Fgbrain-cn\u002Fblob\u002Fgbrain-cn\u002Fskills\u002Fdata-loss-gate\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":18},"01M7248WZN33SV7Z4E3Z44WA9G","bulk-ingestion","End-to-end discipline for turning any large data source (audio libraries,\nemail takeouts, document corpora, chat exports, API dumps) into brain pages\nat scale. The lifecycle spine: SCHEMA → ACCESS → TRIAL → EVALUATE → IMPROVE\n→ CODIFY → TEST → SKILLIFY → BULK → MONITOR. State is tracked in a durable\nJSON manifest (see MANIFEST-PATTERN.md) so any crash, session boundary, or\nsubagent fan-out resumes from ground truth instead of memory.","https:\u002F\u002Fgithub.com\u002Fweiping\u002Fgbrain-cn\u002Fblob\u002Fgbrain-cn\u002Fskills\u002Fbulk-ingestion\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":18},"01M7248JBG4P1JFKF7F4475WG1","brain-ops","Brain knowledge base operations. The core read\u002Fwrite cycle: brain-first lookup,\nread-enrich-write loop, source attribution, ambient enrichment, back-linking.\nRead this before any brain interaction.","https:\u002F\u002Fgithub.com\u002Fweiping\u002Fgbrain-cn\u002Fblob\u002Fgbrain-cn\u002Fskills\u002Fbrain-ops\u002FSKILL.md",[],[]]