Guard And Guide banner
kawarimidoll kawarimidoll

Guard And Guide

Development community

Description

🛡️ Guard coding agents from dangerous operations, and 🧭 Guide them to safer alternatives.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

guard-and-guide

[![CI](https://github.com/kawarimidoll/guard-and-guide/actions/workflows/ci.yml/badge.svg)](https://github.com/kawarimidoll/guard-and-guide/actions/workflows/ci.yml) [![Latest version](https://img.shields.io/github/v/release/kawarimidoll/guard-and-guide)](https://github.com/kawarimidoll/guard-and-guide/releases/latest) [![Claude Code](https://img.shields.io/badge/Claude_Code-D97757?logo=claude&logoColor=white)](https://docs.anthropic.com/en/docs/claude-code) [![Gemini CLI](https://img.shields.io/badge/Gemini_CLI-8E75B2?logo=google%20gemini&logoColor=white)](https://github.com/google-gemini/gemini-cli) [![Rust](https://img.shields.io/badge/Rust-000000?logo=rust&logoColor=white)](https://www.rust-lang.org/) [![Nix](https://img.shields.io/badge/Nix-5277C3?logo=nixos&logoColor=white)](https://nixos.org/)

🛡️ Guard coding agents from dangerous operations, and 🧭 Guide them to safer alternatives.

Motivation

You tell your AI coding agent: "Don't run `git push`."

The agent gets blocked — and tries harder:

🧑 deny(git push)
🤖 Got it! I'll use /usr/bin/git push instead.
🧑 NOOO!!!

AI agents don't give up when simply denied. They try absolute paths, alternative commands, and creative workarounds to get the job done.

**guard-and-guide** solves this by not only blocking dangerous operations, but also telling the agent _why_ it was blocked and _what to do instead_. When given clear guidance, agents are much more likely to comply.

Install

nix

nix profile install github:kawarimidoll/guard-and-guide

cargo

cargo install --git https://github.com/kawarimidoll/guard-and-guide

Setup

1. Create rules

Create `~/.config/guard-and-guide/rules.toml` with your rules. See [`rules.example.toml`](rules.example.toml) for a full example.

Rules use canonical tool names (`Bash`, `File`) and regex patterns:

version = 1

[[rules]]
matcher = "File"
regex = '\.env$'
message = "Access