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/jabrena/jbang-mcp-examples/201-book-effective-javagit clone --depth 1 https://github.com/jabrena/jbang-mcp-examplesWrote 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/jabrena/jbang-mcp-examples/201-book-effective-java)<a href="https://agentmods.dev/rules/jabrena/jbang-mcp-examples/201-book-effective-java"><img src="https://agentmods.dev/badge/rules/jabrena/jbang-mcp-examples/201-book-effective-java.svg" alt="Measured on agentmods" 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 | $0.01147 | $0.01147 |
| Opus 5 | $0.00574 | $0.00574 |
| Sonnet 5 | $0.00229 | $0.00229 |
| Haiku 4.5 | $0.00115 | $0.00115 |
Grade A, and why
201-book-effective-java 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 3d 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.
How it starts
The opening of the file, as written. The whole thing — 141 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Development Guidelines
effective_java_notes: chapter_2: title: "Creating and Destroying Objects" items: - "Consider static factory methods instead of constructors" - "Consider a builder when faced with many constructor parameters" - "Enforce the singleton property with a private constructor or an enum type" - "Enforce noninstantiability with a private constructor" - "Prefer dependency injection to hardwiring resources" - "Avoid creating unnecessary objects" - "Eliminate obsolete object references" - "Avoid finalizers and cleaners" - "Prefer try-with-resources to try-finally"
chapter_3: title: "Methods Common to All Objects" items: - "Obey the general contract when overriding equals" - "Always override hashCode when you override equals" - "Always override toString" - "Override clone judiciously" - "Consider implementing Comparable"
chapter_4: title: "Classes and Interfaces" items: - "Minimize the accessibility of classes and members" - "In public classes, use accessor methods, not public fields" - "Minimize mutability" - "Favor composition over inheritance" - "Design and document for inheritance or else prohibit it" - "Prefer interfaces to abstract classes" - "Design interfaces for posterity" - "Use interfaces only to define types" - "Prefer class hierarchies to tagged classes" - "Favor static member classes over nonstatic" - "Limit source files to a single top-level class"
chapter_5: title: "Generics" items: - "Don't use raw types" - "Eliminate unchecked warnings" - "Prefer lists to arrays" - "Favor generic types" - "Favor generic methods" - "Use bounded wildcards to increase API flexibility" - "Combine generics and varargs judiciously" - "Consider typesafe heterogeneous containers"
chapter_6: title: "Enums and Annotations" items: - "Use enums instead of int constants" - "Use instance fields instead of ordinals" - "Use EnumSet instead of bit fields" - "Use EnumMap instead of ordinal indexing" - "Emulate extensible enums with interfaces" - "Prefer annotations to naming patterns" - "Consistently use the Override annotation" - "Use marker interfaces to define types"
chapter_7: title: "Lambdas and Streams" items: - "Prefer lambdas to anonymous classes" - "Prefer method references to lambdas" - "Favor the use of standard functional interfaces" - "Use streams judiciously" - "Prefer side-effect-free functions in streams" - "Prefer Collection to Stream as a return type" - "Use caution when making streams parallel"
chapter_8: title: "Methods" items: - "Check parameters for validity" - "Make defensive copies when needed" - "Design method signatures carefully" - "Use overloading judiciously" - "Use varargs judiciously" - "Return empty collections or arrays, not nulls" - "Return optionals judiciously" - "Write doc comments for all exposed API elements"
chapter_9: title: "General Programming" items: - "Minimize the scope of local variables" - "Prefer for-each loops to traditional for loops" - "Know and use the libraries" - "Avoid float and double if exact answers are required" - "Prefer primitive types to boxed primitives" - "Avoid strings where other types are more appropriate" - "Beware the performance of string concatenation" - "Refer to objects by their interfaces" - "Prefer interfaces to reflection" - "Use native methods judiciously" - "Optimize judiciously" - "Adhere to generally accepted naming conventions"
chapter_10: title: "Exceptions" items: - "Use exceptions only for exceptional conditions" - "Use checked exceptions for recoverable conditions and runtime exceptions for programming errors" - "Avoid unnecessary use of checked exceptions" - "Favor the use of standard exceptions" - "Throw exceptions appropriate to the abstraction" - "Document all exceptions thrown by each method" - "Include failure-capture information in detail messages" - "Strive for failure atomicity" - "Don't ignore exceptions"
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.
- 3d ago First seen · 141 lines · 1,147 tokens per session scan A fedc208a6ed5
201-book-effective-java is a cursor rule published in the GitHub repository jabrena/jbang-mcp-examples (1 stars, last pushed 1y ago), licensed Apache-2.0. It adds 1,147 tokens to every session, about $0.0057 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-08-31.
Other cursor rules, from other repositories
backend
Backend Java — Spring Boot controllers/services, JUnit controller tests, MakeMe. Read this first for any backend work.
java-import-fqn
Java 禁止不必要的全限定类名,必须 import(类名冲突除外).
component-parameter-key-no-dot
@ComponentParameter 的 key 禁止包含 ".",统一使用下划线 / 顶层扁平命名.
java-springboot-jpa-cursorrules-prompt-file
description: "Cursor rules for Java development with Springboot and JPA integration." globs: / alwaysApply: false.
java-springboot-standards
Java Spring Boot coding standards and patterns for your monorepo services.
ecoconception-java
Règles d'écoconception pour le code Java, JPA/Hibernate sobre, mémoire, batch, logs.