Case normalized sensitive path guards

From ychampion/cskill-agents · View interactive version

Case normalized sensitive path guards is an AI agent skill from the GitHub repository ychampion/cskill-agents. Normalize filesystem paths and reject matches that try to spoof sensitive directories with mixed case or alternate separators.

How to use this skill

Skill file

SKILL: Case-Normalized Sensitive Path Guards

Domain: sensitive-paths

Trigger: Use whenever user input targets .claude, dotfiles, or other dangerous locations on case-insensitive filesystems such as Windows and macOS.

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

Core Method

Normalize every candidate path before comparing it against the sensitive-path denylist. That means lowercasing when the platform is case-insensitive and standardizing separators so \ and / are treated consistently. Compare the normalized path against intact dangerous filenames and directory suffixes, not against the raw user input. This closes bypasses that rely on mixed case or alternate separators to sneak past exact-match checks.

Key Rules

Example Application

Before granting an edit permission to ~/.claude/settings.local.json, normalize the path, detect that it still ends in .claude/settings.local.json, and route it through the strict config-file safety gate.

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.