Dangerous config file protection

From ychampion/cskill-agents · View interactive version

Dangerous config file protection is an AI agent skill from the GitHub repository ychampion/cskill-agents. Keep writes out of sensitive dotfiles and claude folders by checking canonicalized basenames before granting permission.

How to use this skill

Skill file

SKILL: Dangerous Config File Protection

Domain: sensitive-paths

Trigger: Guard every filesystem modification that touches .git, .claude, .gitconfig, or other config-critical paths before running the tool.

Source Pattern: Distilled from reviewed permission, shell-safety, and worktree-management implementations.

Core Method

Maintain explicit lists of filenames and directories that should never be touched automatically. Before allowing any tool action, expand the requested path, normalize casing, and compare the basename or enclosing directory against those lists. If a match appears, decline the action or require a human permission grant with the narrowest scope possible.

Key Rules

Example Application

When the user asks to edit ~/.claude/skills/confidential-skill/SKILL.md, detect that the path enters .claude, normalize it, and refuse the automatic edit while suggesting a narrower permission grant instead of broad config-directory access.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.