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/abderrahimghazali/cursor-rulesWrote 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/abderrahimghazali/cursor-rules/code-generation-standards)<a href="https://agentmods.dev/rules/abderrahimghazali/cursor-rules/code-generation-standards"><img src="https://agentmods.dev/badge/rules/abderrahimghazali/cursor-rules/code-generation-standards/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/abderrahimghazali/cursor-rules/code-generation-standards"><img src="https://agentmods.dev/badge/rules/abderrahimghazali/cursor-rules/code-generation-standards.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.00000 | $0.00758 |
| Opus 5.5 | $0.00000 | $0.00303 |
| Sonnet 5.5 | $0.00000 | $0.00152 |
| Haiku 4.5 | $0.00000 | $0.00076 |
Grade A, and why
code-generation-standards 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 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.
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 code-generation-standards — 100 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 Code Generation Standards
Ensures high-quality, executable code generation adhering to best practices across multiple programming languages.
actions:
-
type: enforce conditions:
-
pattern: "// TODO:|#\s*TODO:" message: "Replace TODOs with actual implementation - no placeholders allowed."
-
pattern: "function\s+\w+\s*\([^)]\)\s\{\s*(?:return\s+null|throw\s+new\s+Error|console\.log)\s*\}" message: "Implement full functionality - no stub methods."
-
pattern: "\bif\b\s*\(\sfalse\s\)" message: "Remove or replace conditional statements that are always false."
-
pattern: "\bconsole\.[^(]+|print\s*\(" pattern_negate: "DEBUG|LOGGING" message: "Remove debug logging unless it's conditional on a debug flag."
-
pattern: "^\s*#\s*\w+:\s*\w+\s*$" language: python message: "In Python, prefer type hints over comments for type annotations."
-
-
type: suggest message: | Code Generation Best Practices:
- Executable Solutions: Generate fully functional code, not just skeletons or stubs.
- Readability:
- Prioritize code readability, with clear naming conventions and logical structure.
- Use whitespace effectively to enhance code clarity.
- Error Handling:
- Implement comprehensive error handling with appropriate exceptions or error codes.
- Consider edge cases and provide meaningful error messages.
- Imports/Dependencies:
- Include all necessary imports or require statements at the beginning of the file.
- Manage dependencies to ensure the code is self-contained or clearly documented for setup.
- Integration:
- Code should be immediately usable within the project's existing framework or technology stack.
- Ensure compatibility with existing patterns or libraries used in the project.
- Formatting:
- Adhere to the project's coding style guide (e.g., Prettier, Black for Python, etc.).
- Use linters and formatters to maintain consistent code style.
- Testing:
- Include unit or integration tests where applicable to validate generated code.
- Encourage test-driven development if part of the project's culture.
- Documentation:
- Provide inline comments for complex logic or algorithms.
- Write docstrings or JSDoc for functions, classes, and modules to describe usage, parameters, and return values.
- Consider generating external documentation if the project uses tools like Swagger for APIs or Sphinx for Python.
- Security:
- Avoid hardcoded credentials or sensitive information.
- Follow security best practices for the language (e.g., SQL injection prevention in PHP, XSS in JavaScript).
- Performance: While readability takes precedence, be mindful of performance implications of the generated code.
metadata: priority: critical 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.
- 1mo ago First seen · 70 lines · 758 tokens per session scan A 63f284714bcd
code-generation-standards is a cursor rule published in the GitHub repository abderrahimghazali/cursor-rules (2 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 758 tokens. A static security scan graded it A with 0 findings. It is 91% identical to code-generation-standards, differing in 100 lines, and is treated as a copy.
Other cursor rules, from other repositories
typescript-type-safety
Use when encountering TypeScript any types, type errors, or lax type checking - eliminates type holes and enforces strict type safety through proper interfaces, type guards, and module augmentation.
debug-protocol
Hypothesis → evidence → fix; no blind guessing.
engine-internals
Coding Agent engine implementation details (Cursor + Claude Code) — reference when modifying engine.ts or debugging Agent behavior.
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.
error-handling-and-validation
A code-quality guide for handling errors, invalid inputs, edge cases, preconditions, logging, and user-friendly error messages.