Declarative read only command allowlists

From ychampion/cskill-agents · View interactive version

Declarative read only command allowlists is an AI agent skill from the GitHub repository ychampion/cskill-agents. Express shell-command safety as declarative flag maps so tooling knows exactly what passes.

How to use this skill

Skill file

SKILL: Declarative Read Only Command Allowlists

Domain: shell-validation

Trigger: Use when you want tooling to enforce read-only shell commands by referencing a static map of command names, allowed flags, and supplemental callbacks.

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

Core Method

Define each safe command as a declarative entry keyed by its full name such as git diff, docker logs, or rg. Each entry should describe allowed flags, argument rules, and any extra validation needed for edge cases. Build the shell policy layer by consulting these tables instead of scattering safety logic across the executor. The executor then only needs to look up the command, validate its flags against the declarative spec, and reject anything not explicitly allowed.

Key Rules

Example Application

When building a new shell agent, load the read-only command map, validate the tokenized flags for each request against that map, and allow execution only when the command matches an approved entry. This makes the policy auditable and consistent across shells.

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.