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.
npx agentmods add rules/d-padmanabhan/agent-engineering-handbook/250-cligit clone --depth 1 https://github.com/d-padmanabhan/agent-engineering-handbookWhat 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 | $0.00012 | $0.01956 |
| Opus 5 | $0.00006 | $0.00978 |
| Sonnet 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 2d 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.
- 2d 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 (15 stars, last pushed 2d ago), licensed MIT. It adds 12 tokens to every session and 1,956 once invoked, about $0.0001 per session on Opus 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
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.
control-plane-descriptors
Control plane descriptor and instance implementation patterns.
family-instance-domain-actions
Family instance domain action implementation patterns.