ai-command-rules

ai-command-rules is a skill for Claude Code, Codex from russodope/ai-cli-kit. It costs 151 tokens per session (1,785 once invoked), scanned D, original, MIT.

A set of rules for writing shell commands and scripts in coding-agent environments. It checks the operating system, shell, runtime, and available permissions before suggesting commands.

In plain words
What is it for?
It helps write environment-aware commands for terminals, Docker, CI/CD, SSH sessions, virtual environments, and Git or Python tasks. When the environment is unclear, it provides detection steps first.
Why use it?
It reduces failures caused by commands that work on one computer or shell but behave differently on another.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Good fit It helps write environment-aware commands for terminals, Docker, CI/CD, SSH sessions, virtual environments, and Git or Python tasks. When the environment is unclear, it provides detection steps first.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/russodope/ai-cli-kit/ai-command-rules
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add russodope/ai-cli-kit --skill ai-command-rules
Clone the repo
git clone --depth 1 https://github.com/russodope/ai-cli-kit

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-command-rules

README.md
[![agentmods](https://agentmods.dev/badge/skills/russodope/ai-cli-kit/ai-command-rules/github.svg)](https://agentmods.dev/skills/russodope/ai-cli-kit/ai-command-rules)
Your own site
<a href="https://agentmods.dev/skills/russodope/ai-cli-kit/ai-command-rules"><img src="https://agentmods.dev/badge/skills/russodope/ai-cli-kit/ai-command-rules/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ai-command-rules

Your own site · 80×15
<a href="https://agentmods.dev/skills/russodope/ai-cli-kit/ai-command-rules"><img src="https://agentmods.dev/badge/skills/russodope/ai-cli-kit/ai-command-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 151 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,785 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00151 $0.01785
Opus 5.5 $0.00060 $0.00714
Sonnet 5.5 $0.00030 $0.00357
Haiku 4.5 $0.00015 $0.00178

Measured 2mo ago against content hash 1577355f3cf0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade D, and why

ai-command-rules scanned grade D with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

| Privileges | Root/sudo available? Admin on Windows? |

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

| `rm -rf dist/` | `rm -rf ./dist/` | Protects against accidental root deletion |

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

5. **Network** — check if egress is allowed before running `curl`, `pip install`, `npm install`
ai-command-rules/SKILL.md · 178 lines

How it starts

The opening of the file, as written. The whole thing — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AI Command Rules

A skill for writing precise, environment-aware shell commands and scripts that work correctly the first time across Windows, Linux, macOS, sandboxes, virtual environments, and containers.

Core Principle

Always detect the environment before writing a command. Never assume. A command that works on Linux bash will silently fail or behave differently on Windows CMD, PowerShell, or macOS zsh. When in doubt, ask or emit environment-adaptive commands.


Step 1: Detect the Environment

Before writing any command, identify:

Signal How to detect
OS User mentions, file paths (C:\ vs /), or ask explicitly
Shell bash / zsh / fish / PowerShell / CMD / sh
Runtime context Local terminal, Docker container, CI/CD, sandbox, SSH session
Python env venv, conda, pipenv, poetry, system Python, Docker
Privileges Root/sudo available? Admin on Windows?

If uncertain, emit a detection snippet first:

# Universal OS+shell detector (paste in terminal first)
echo "OS: $(uname -s 2>/dev/null || echo Windows)"
echo "Shell: $SHELL"
echo "Python: $(python --version 2>&1 || python3 --version 2>&1)"

Step 2: Environment-Specific Rules

Read the relevant reference file before emitting commands:

  • Linux / macOS / bash / zsh → references/unix.md
  • Windows CMD / PowerShell / WSL → references/windows.md
  • Docker / containers / sandboxes → references/containers.md
  • Python / virtual environments → references/python-env.md
  • SSH / remote execution → references/ssh-remote.md
  • Git → references/git.md

For cross-platform tasks, read all relevant files.


Step 3: Command Writing Checklist

Before emitting any command block, verify:

✅ Shell Compatibility

  • Correct quoting style for target shell (single vs double vs backtick)
  • Path separator correct (/ vs \)
  • Line continuation correct (\ bash vs ` PowerShell)
  • Variable syntax correct ($VAR bash vs $env:VAR PowerShell vs %VAR% CMD)
  • Logical operators correct (&& / || bash vs -and / -or PowerShell)

Read the full file on GitHub · 178 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 178 lines · 151 tokens per session scan D 1577355f3cf0

Subscribe to this mod's changes

ai-command-rules is a skill published in the GitHub repository russodope/ai-cli-kit (2 stars, last pushed 8mo ago), licensed MIT. It adds 151 tokens to every session and 1,785 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it D with 3 findings (asks for root, recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

tirith

Terminal security analysis for shell environments. This skill should be used when checking commands for supply-chain attacks before execution, scanning repositories for hidden content or config poisoning, scoring URLs for homograph attacks, setting up AI tool protection, inspecting Python package artifacts, governing…

sheeki03/tirith · 205 tokens

mcp-bash

Build, debug and package MCP servers written in Bash with the mcp-bash framework (mcp-bash-framework). Use whenever the user wants to create an MCP server from shell scripts or CLIs, add or fix tools, resources, prompts or completions in an mcp-bash project, wire one into Claude Desktop, Cursor or another client…

yaniv-golan/mcp-bash-framework · 194 tokens

shell-scripting

Use this skill when writing bash or zsh scripts, parsing arguments, handling errors, or automating CLI workflows. Triggers on bash scripting, shell scripts, argument parsing, process substitution, here documents, signal trapping, exit codes, and any task requiring portable shell script development.

alibaba/anolisa · 60 tokens

audit-skills

Expert security auditor for AI Skills and Bundles. Performs non-intrusive static analysis to identify malicious patterns, data leaks, system stability risks, and obfuscated payloads across Windows, macOS, Linux/Unix, and Mobile (Android/iOS).

Ghosteken/agent-harness · 55 tokens

terminal-helper

Assists with terminal commands, shell scripting, and system administration tasks.

termlnk/termlnk · 16 tokens

huiyu-safe-ai

Lightweight AI security guard that intercepts risky install/download commands (npm, npx, pip, cargo, git clone) to block known malicious packages and scan for suspicious code. Invoke ONLY when user runs install/download/clone commands.

huiyu9144/huiyu-safe-ai · 52 tokens