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/abderrahimghazali/cursor-rules/generic_bash_stylegit clone --depth 1 https://github.com/abderrahimghazali/cursor-rulesWhat 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.00009 | $0.00958 |
| Opus 5 | $0.00005 | $0.00479 |
| Sonnet 5 | $0.00002 | $0.00192 |
| Haiku 4.5 | $0.00001 | $0.00096 |
Grade A, and why
generic_bash_style scanned grade A with 0 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 yesterday.
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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
91% identical to generic_bash_style — 93 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
What it actually says
Enhanced Bash Scripting Standard with Colorized Logging
This rule enforces best practices for writing Bash scripts, with an emphasis on using colorized logging for better output readability.
actions:
-
type: enforce conditions:
-
pattern: "^#!/usr/bin/env bash$" message: "All scripts should start with the shebang '#!/usr/bin/env bash'."
-
pattern: "^set -eu$" message: "Enable 'set -eu' for script robustness."
-
pattern: "^set -x$" pattern_negate: "^\[ "\${DEBUG-}" = "1" ] && set -x$" message: "Use conditional 'set -x' based on debug flag."
-
pattern: "^# @formatter:off$" message: "Start of formatting block for log functions."
-
pattern: "note\(\) { printf " %s\n" "\${1}"; }$" message: "Include 'note' function for plain messages."
-
pattern: "info\(\) { \[ "\${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\\033\[34m\[INFO] %s\\033\[0m\n" "\${1}" || printf "\[INFO] %s\n" "\${1}"; }$" message: "Include 'info' function for blue informational messages."
-
pattern: "pass\(\) { \[ "\${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\\033\[32m\[ OK ] %s\\033\[0m\n" "\${1}" || printf "\[ OK ] %s\n" "\${1}"; }$" message: "Include 'pass' function for green success messages."
-
pattern: "fail\(\) { \[ "\${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\\033\[31m\[FAIL] %s\\033\[0m\n" "\${1}" || printf "\[FAIL] %s\n" "\${1}"; }$" message: "Include 'fail' function for red error messages."
-
pattern: "warn\(\) { \[ "\${TERM:-}" != "dumb" ] && tput colors >/dev/null 2>&1 && printf "\\033\[33m\[WARN] %s\\033\[0m\n" "\${1}" || printf "\[WARN] %s\n" "\${1}"; }$" message: "Include 'warn' function for yellow warning messages."
-
pattern: "^# @formatter:on$" message: "End of formatting block for log functions."
-
-
type: suggest message: | Bash Scripting Best Practices:
- Error Handling: Use
set -euto catch errors and undefined variables early. - Debugging: Implement conditional debugging with
set -xusing a DEBUG variable. - Logging Functions: Use colorized logging for better script output readability:
note()for plain notesinfo()for blue informational messagespass()for green success messagesfail()for red error messageswarn()for yellow warnings, ensuring users can distinguish different types of messages easily
- Security: Avoid using
evalor similar constructs; use safe alternatives. - Documentation: Include descriptive comments, especially for complex logic.
- Portability: Use
/usr/bin/env bashfor the shebang to ensure script runs with bash on any system. - Variable Checks: Ensure necessary variables are set, enhancing script reliability.
- Exit Codes: Use explicit exit codes for different failure scenarios.
- Color Support: Ensure logging functions check for terminal color support before applying colors.
- Error Handling: Use
metadata: priority: medium version: 1.1
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.
- yesterday First seen · 71 lines · 9 tokens per session scan A 0267902a76f1
generic_bash_style is a cursor rule published in the GitHub repository abderrahimghazali/cursor-rules (2 stars, last pushed 1y ago), licensed MIT. It adds 9 tokens to every session and 958 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. It is 91% identical to generic_bash_style, differing in 93 lines, and is treated as a copy.
Other cursor rules, from other repositories
creating-cursor-rules
Meta-rule for creating effective Cursor IDE rules with best practices, patterns, and examples.
creating-skills
Meta-guide for creating effective Claude Code skills with proper structure, CSO optimization, and real examples.
cursorrules
You are a disciplined senior engineer working with someone who may be a domain expert, not a programmer. Build it correctly and safely, not just fast.
cursorrules
Cursor rule "cursorrules" from BlueBirdBack/godot-cursorrules, covering godot 4.4 game development .cursorrules, core development guidelines, code style, naming conventions and scene organization.
new_feature
You are an expert Product Owner and Technical Lead focused on helping users define and plan new features through collaborative discovery and structured documentation.
new_project
You are an expert Product Owner focused on helping users define new software projects through collaborative vision creation.