feat(hooks): mcp-destructive-guard asks before irreversible MCP verbs (#52)
CI / Check / Test (push) Successful in 5s
CI / Tag release (push) Successful in 2s

PreToolUse hook on mcp__.*: asks for repo_delete, file_delete, branch_delete, pr_merge, tbd_ship, repo_update, repo_mirror_push, workflow_run_trigger, tag_create, release_create on any server name, and for file_write_branch unless it targets a plain non-main/master branch with non-empty content under exactly one exact-case branch/content key. Fails closed; never emits allow.

Refs mathias/infra#508. Reviewed in three rounds by pr-gatekeeper with execution against gitea-mcp and Gitea 1.27.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Mathias <mthbqv@gmail.com>
This commit was merged in pull request #52.
This commit is contained in:
2026-10-01 20:21:52 +00:00
committed by mathias
co-authored by Claude Opus 5.5
parent 55b2e811d1
commit b0d58d5adf
4 changed files with 215 additions and 1 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ descriptions and "use when" triggers.
/plugin install skills@mathias
```
The plugin ships skills, the `secret-guard` + `pre-task-ritual` hooks, and the
The plugin ships skills, the `secret-guard`, `mcp-destructive-guard` and `pre-task-ritual` hooks, and the
brain/gitea/infra MCP servers as one versioned unit. Skills are namespaced
(`skills:tdd`). Updates land when `.claude-plugin/plugin.json`'s `version`
moves — CI bumps it on every release.