agentsclimarketplace

Dangerous config file protection

Skill ychampion/cskill-agents/agents/claude-code/skills/dangerous-config-file-protection

Agent skills for coding CLIs, multi-agent runtimes, context engines, MCP extensions, and terminal tooling. Instead of using claude code's source code, give your agent skills to create your own!

Install
npx -y skills add ychampion/cskill-agents --skill dangerous-config-file-protection

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its author says it does

Copied from the file, not written here

Keep writes out of sensitive dotfiles and claude folders by checking canonicalized basenames before granting permission.

SKILL.md

1.9 KB, 340 tokens by cl100k_base, as published. Nobody here has run it

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

  • Normalize to lowercase and POSIX separators before comparing, matching Windows/macOS semantics.
  • Check both file-level names (e.g., .gitconfig) and directories (e.g., .git, .claude, .vscode) to block entire trees that hold secrets or tooling.
  • Prefer generating narrow permission scopes when the path lives inside a controlled skill directory; otherwise, deny outright.
  • Log each blocked attempt with a sanitized path so operators can trace why the denial happened.

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)

  • Don’t rely on loose wildcard matching that can accidentally miss or overmatch sensitive config paths.
  • Don’t skip casing normalization; mixed-case variants of the same protected path must behave the same.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.