scala-kafka-cursorrules-prompt-file

scala-kafka-cursorrules-prompt-file is a cursor rule for Cursor from PatrickJS/awesome-cursorrules. It costs 1,062 tokens per session, scanned A, original, CC0-1.0.

A set of style and development rules for Scala applications that use Apache Kafka, a system for sending and processing streams of messages. It emphasizes immutable data, small focused code, and explicit handling of effects and nullable values.

In plain words
What is it for?
Use it when building or reviewing Scala services and Kafka producers or consumers, especially code involving collections, functional patterns, and message streams.
Why use it?
It helps reduce complexity and accidental state changes in Scala code. It also encourages safer handling of Java interoperability, errors, and message-processing logic.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: mentions Cursor.

Good fit Use it when building or reviewing Scala services and Kafka producers or consumers, especially code involving collections, functional patterns, and message streams.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/patrickjs/awesome-cursorrules/scala-kafka-cursorrules-prompt-file
About the project

PatrickJS/awesome-cursorrules is a collection of Markdown rule files that give Cursor AI editor project-specific instructions about code, frameworks, workflows, and standards. Developers use it to find reusable guidance for shaping Cursor’s behavior in different kinds of software projects.

PatrickJS/awesome-cursorrules · 40,734 stars · on GitHub

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/PatrickJS/awesome-cursorrules

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 scala-kafka-cursorrules-prompt-file

README.md
[![agentmods](https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/scala-kafka-cursorrules-prompt-file.svg)](https://agentmods.dev/rules/patrickjs/awesome-cursorrules/scala-kafka-cursorrules-prompt-file)
Your own site
<a href="https://agentmods.dev/rules/patrickjs/awesome-cursorrules/scala-kafka-cursorrules-prompt-file"><img src="https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/scala-kafka-cursorrules-prompt-file.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,062 This file is loaded in full into every session.
When invoked 1,062 The same file — it is already loaded in full.
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.01062 $0.01062
Opus 5 $0.00531 $0.00531
Sonnet 5 $0.00212 $0.00212
Haiku 4.5 $0.00106 $0.00106

Measured 4d ago against content hash 8e3c95af9d1e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

scala-kafka-cursorrules-prompt-file 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 4d 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.

rules/scala-kafka-cursorrules-prompt-file.mdc · 77 lines

How it starts

The opening of the file, as written. The whole thing — 77 lines — stays where its author put it; the contents beside it link to each section on GitHub.

general-scala-clean-code.mdc

  • Declare vals/vars as close as possible to first use.
  • Name length should be proportional to scope: 1-2 chars allowed only inside small lambdas.
  • Avoid nested for-comprehensions deeper than two levels; factor out steps into helpers.
  • Split a single source file by responsibility.
  • Use tail-rec optimisation (@tailrec) where appropriate.
  • Prefer immutable collections and avoid mutation during iteration.
  • When interop with Java forces mutability, wrap it in a pure facade with the use of .asScala, to retain functional API.
  • When something is nullable, wrap it into an Option, to retain functional API.
  • Keep cyclomatic complexity below 10 for any method; IDE inspections should warn.

general-scala-development-practices.mdc

========== GENERAL PRINCIPLES ==========

  • You are an experienced Senior Scala Developer.
  • You always adhere to SOLID, DRY, KISS and YAGNI principles.
  • Prefer pure functions; minimise side-effects. Where effects are required, make them explicit (e.g. using scala.util.Try, Either, or cats-effect IO/Task if adopted).
  • Use val over var; collections must be immutable unless mutability is proven cheaper & safe.
  • Replace null with Option, Either or a domain-specific ADT.
  • Use pattern matching exhaustively and handle the default case only when truly open-ended.
  • Prefer for-comprehensions, map/flatMap/fold, and higher-order functions over imperative loops.
  • Prefer case classes and sealed traits for algebraic data types.
  • Extract common logic into private or package-private helpers; avoid long methods (> 30 LOC).
  • Prefer extension methods or type classes over inheritance when adding behaviour.
  • Keep public APIs small, surface only what the module owns.
  • Break every task into the smallest composable pure functions before wiring them together.

========== NAMING & SYNTAX ==========

  • Class / object / trait names are UpperCamelCase nouns (e.g. NotificationStreamApp).
  • Methods & vals are lowerCamelCase verbs or nouns (e.g. process, serde, productKey).
  • Constants use SCREAMING_SNAKE_CASE.
  • Similar to Java’s static final members, if the member is final, immutable and it belongs to a package object or an object, it may be considered a constant.
  • Symbolic names (|>) are allowed only when they align with widespread FP idioms.
  • Match expressions use match/case over nested if/else chains; for simple two-branch logic prefer if … then … else … expressions.

Read the full file on GitHub · 77 lines

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. 4d ago First seen · 77 lines · 1,062 tokens per session scan A 8e3c95af9d1e

Subscribe to this mod's changes

scala-kafka-cursorrules-prompt-file is a cursor rule published in the GitHub repository PatrickJS/awesome-cursorrules (40,734 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 1,062 tokens to every session, about $0.0053 per session on Opus 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-03.