coding-guidelines

coding-guidelines is a cursor rule for Cursor from j4flmao/agent-skills. It costs 20 tokens per session (363 once invoked), scanned A, original, MIT.

General rules for writing and refactoring code, including complete implementations, clear error handling, useful logs, and small focused functions.

In plain words
What is it for?
Use them as broad coding standards when creating or refactoring application code.
Why use it?
They discourage unfinished code, hidden failures, vague error messages, and large functions that are difficult to test or maintain.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use them as broad coding standards when creating or refactoring application code.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/j4flmao/agent-skills/coding-guidelines
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.

Clone the repo
git clone --depth 1 https://github.com/j4flmao/agent-skills

Made for: Cursor.

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 coding-guidelines

README.md
[![agentmods](https://agentmods.dev/badge/rules/j4flmao/agent-skills/coding-guidelines/github.svg)](https://agentmods.dev/rules/j4flmao/agent-skills/coding-guidelines)
Your own site
<a href="https://agentmods.dev/rules/j4flmao/agent-skills/coding-guidelines"><img src="https://agentmods.dev/badge/rules/j4flmao/agent-skills/coding-guidelines/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 coding-guidelines

Your own site · 80×15
<a href="https://agentmods.dev/rules/j4flmao/agent-skills/coding-guidelines"><img src="https://agentmods.dev/badge/rules/j4flmao/agent-skills/coding-guidelines.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 363 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00020 $0.00363
Opus 5.5 $0.00008 $0.00145
Sonnet 5.5 $0.00004 $0.00073
Haiku 4.5 $0.00002 $0.00036

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

Security

Grade A, and why

coding-guidelines 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.

.cursor/rules/coding-guidelines.mdc · 28 lines

What it actually says

Agentic Coding Guidelines

Cursor/AI MUST follow these principles when writing or refactoring code.

1. NO Placeholders or TODOs

  • Rule: Never generate code containing // TODO: Implement this later or pass unless explicitly instructed to create a stub.
  • Why: AI is here to write the code, not to leave homework for the user. If you lack context, ASK the user or write the complete implementation based on best assumptions.

2. Fail Fast & Loud

  • Rule: Never swallow exceptions. Do not return null or -1 when a critical error occurs. Throw an exception immediately.
  • Example (Bad): if (!file) return null;
  • Example (Good): if (!file) throw new FileNotFoundException("Failed to load config.json");

3. Structured and Contextual Logging

  • Rule: Whenever you write an error handling block, include contextual logging.
  • Example: Do not log "Error parsing user". Log "Failed to parse user payload for userId: {userId}. Error: {errorMsg}".

4. Single Responsibility Principle (SRP)

  • Rule: If a function exceeds 30-40 lines of logic, aggressively break it down into smaller, testable private helper methods. Do not create God Functions.

5. Security by Default

  • Rule: Never hardcode credentials, secrets, or API keys in the generated code. Always use environment variables (e.g., process.env.API_KEY).
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. 1mo ago First seen · 28 lines · 20 tokens per session scan A ce93e11c1d46

Subscribe to this mod's changes

coding-guidelines is a cursor rule published in the GitHub repository j4flmao/agent-skills (33 stars, last pushed 10d ago), licensed MIT. It adds 20 tokens to every session and 363 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.