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.
git clone --depth 1 https://github.com/d-padmanabhan/agent-engineering-handbookWrote 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.
[](https://agentmods.dev/rules/d-padmanabhan/agent-engineering-handbook/250-cli)<a href="https://agentmods.dev/rules/d-padmanabhan/agent-engineering-handbook/250-cli"><img src="https://agentmods.dev/badge/rules/d-padmanabhan/agent-engineering-handbook/250-cli/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.
<a href="https://agentmods.dev/rules/d-padmanabhan/agent-engineering-handbook/250-cli"><img src="https://agentmods.dev/badge/rules/d-padmanabhan/agent-engineering-handbook/250-cli.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00012 | $0.01956 |
| Opus 5.5 | $0.00005 | $0.00782 |
| Sonnet 5.5 | $0.00002 | $0.00391 |
| Haiku 4.5 | $0.00001 | $0.00196 |
Grade A, and why
250-cli scanned grade A with 1 finding 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 1mo 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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
subprocess.run(command, shell=True) How it starts
The opening of the file, as written. The whole thing — 384 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLI Application Engineering Ruleset
Goal: Build secure, user-friendly, debuggable command-line interfaces that follow platform conventions.
Core Principles
- User Experience First: Clear error messages, helpful usage, intuitive flags
- Debuggability: Always provide debug mode for troubleshooting
- Security: Never log secrets, validate inputs, fail fast
- Platform Conventions: Follow platform-specific CLI patterns
Debug Mode Patterns
Environment Variable Pattern
# Enable debug mode
DEBUG=1 my-cli command
# Or with specific namespaces
DEBUG=my-cli:* my-cli command
Command-Line Flag Pattern
# Enable debug mode
my-cli --debug command
# Verbose mode (different from debug)
my-cli --verbose command
# Quiet mode
my-cli --quiet command
Implementation Examples
Python
import os
import logging
import sys
# Setup logging
log_level = logging.INFO
if os.getenv("DEBUG") == "1" or "--debug" in sys.argv:
log_level = logging.DEBUG
logging.basicConfig(
level=log_level,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)
def main():
logger.debug("Debug mode enabled")
# ... rest of CLI logic
Node.js / JavaScript
Use the debug library:
import debug from 'debug';
// Enable debug via environment variable
// DEBUG=1 npm start
// DEBUG=my-cli:* npm start
// DEBUG=my-cli:auth npm start
const debugLog = debug('my-cli:main');
const authDebug = debug('my-cli:auth');
function main() {
debugLog('Starting CLI application');
authDebug('Authenticating user');
// ... rest of CLI logic
}
// Enable debug output
if (process.env.DEBUG || process.env.AI_DEBUG_ENABLE === "1") {
debug.enabled = true;
}
Go
package main
import (
"flag"
"log"
"os"
)
var (
debugFlag = flag.Bool("debug", false, "Enable debug logging")
verboseFlag = flag.Bool("verbose", false, "Enable verbose output")
)
func main() {
flag.Parse()
// Check environment variable
debugMode := *debugFlag || os.Getenv("DEBUG") == "1"
if debugMode {
log.SetFlags(log.LstdFlags | log.Lshortfile)
log.SetOutput(os.Stderr)
}
log.Printf("Debug mode: %v", debugMode)
// ... rest of CLI logic
}
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.
- 1mo ago First seen · 384 lines · 12 tokens per session scan A b9917886fcac
250-cli is a cursor rule published in the GitHub repository d-padmanabhan/agent-engineering-handbook (19 stars, last pushed 2d ago), licensed MIT. It adds 12 tokens to every session and 1,956 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
api-property-optionality-hygiene
Fix ApiProperty/ApiPropertyOptional optionality mismatches in DTO files; use for scheduled batch fixes or DTO edits.
python
Python best practices and patterns for modern software development with Flask and SQLite.
cursor
You are working on the checkout service. Preserve transaction integrity and auditability.
django
Definitive guidelines for writing maintainable, performant, and secure Django applications, emphasizing modern best practices, clear code organization, and efficient patterns.
shared-libraries
Shared libraries - condition framework, inventory containers, file-backed DB, itinerary, references.
selectools-providers
Rules for working with LLM provider adapters in selectools.