lucas-saldanha-werneck

Plugin Dev Guard — Git skill for Claude Code

Git community

Stops Claude from editing the installed copy of a plugin, where the next update would wipe the change, and points it to your source repo, or to a fork of the plugin's repo and a pull request to its au.

How to install Plugin Dev Guard

This entry records only its repository, not the path inside it, so there is no exact command to give. Open lucas-saldanha-werneck/plugin-dev-guard and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Plugin Dev Guard does

Stops Claude from editing the installed copy of a plugin, where the next update would wipe the change, and points it to your source repo, or to a fork of the plugin's repo and a pull request to its author; plugin-dev-check lists your repos next to their installed copies and what is out of step.

Alternatives in Git

  • Claude.md Template For Users — Attribution: Behavioral patterns adapted from obra/superpowers by Jesse Vincent (@obra), MIT License 6.8k ★
  • TDD Guard — by Nizar Selander - A hooks-driven system that monitors file operations in real-time and blocks changes that v 1.9k ★
  • Destructive Command Guard — The Destructive Command Guard (dcg) is for blocking dangerous git and shell commands from being executed by ag 869 ★

README

plugin-dev-guard

A Claude Code hook that stops Claude from editing the installed copy of a plugin, and tells it where the change belongs: your source repo when you have one on this machine, or a clone or fork of the plugin's repo and a pull request to its author.

Claude Code runs plugins from a copy under `~/.claude/plugins/cache/` (and keeps catalog clones under `~/.claude/plugins/marketplaces/`). The next plugin update replaces that copy, so a fix made there is lost, and nobody else ever gets it. Claude still edits it often, because that is the file it saw running.

The plugin also ships `plugin-dev-check`, a command that lists your source repos next to their installed copies and says which ones are out of step.

Example

Claude tries to edit a hook inside the installed copy. The edit is not made; Claude gets this tool error instead:

plugin-dev-guard: this changes the INSTALLED copy of give-up-guard (~/.claude/plugins/cache/lucas-plugins/give-up-guard/0.3.1/hooks/guard.py). That copy is replaced on the next plugin update, so the change would be lost.
- give-up-guard: its source repo is on this machine: ~/code/give-up-guard. Make the change there (branch, commit, bump the version in .claude-plugin/plugin.json, push), then update the installed plugin from it.
Exception (a quick test or one-off fix): only if the user asked for this exact edit or approves it now (ask first), run `mkdir -p "~/.claude/state" && touch "~/.claude/state/plugin-dev-guard.pass"` (valid 30 minutes) and retry.

For a plugin with no local source repo (someone else's, or yours on another machine), the line points to its repo instead:

- superpowers: no local source repo found. Clone or fork https://github.com/obra/superpowers, make the change there and open a pull request to its author. Never patch the installed copy.

(The real message shows full paths; `~` is used here for short lines.)

`plugin-dev-check` in a terminal:

repo              branch  dirty  not pushed