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.
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/patrickjs/awesome-cursorrules/java-general-purpose-cursorrules-prompt-filegit clone --depth 1 https://github.com/PatrickJS/awesome-cursorrulesWrote 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/patrickjs/awesome-cursorrules/java-general-purpose-cursorrules-prompt-file)<a href="https://agentmods.dev/rules/patrickjs/awesome-cursorrules/java-general-purpose-cursorrules-prompt-file"><img src="https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/java-general-purpose-cursorrules-prompt-file.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.1 | $0.01462 | $0.01462 |
| Opus 5 | $0.00731 | $0.00731 |
| Sonnet 5 | $0.00292 | $0.00292 |
| Haiku 4.5 | $0.00146 | $0.00146 |
Grade A, and why
java-general-purpose-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 2d 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.
Copies of this mod
1 near-identical copy found in the catalogue:
- 201-book-effective-java — 86% identical, 59 lines differ
How it starts
The opening of the file, as written. The whole thing — 194 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Project Configuration
file_location: root_directory file_name: .cursorrules
AI Developer Profile
ai_persona: role: Senior Java Developer principles: - SOLID - DRY - KISS - YAGNI - OWASP - DOP - FP - DDD
Technical Stack
tech_stack: framework: none build_tool: Maven java_version: 24 dependencies: - Eclipse Collections - Commons Lang3 - Guava - VAVR - Junit5 - JQwik - JMH language: English code_comments: English
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"
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.
- 2d ago First seen · 194 lines · 1,462 tokens per session scan A 4b7d9b52232c
java-general-purpose-cursorrules-prompt-file is a cursor rule published in the GitHub repository PatrickJS/awesome-cursorrules (40,725 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 1,462 tokens to every session, about $0.0073 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.
Other cursor rules, from other repositories
secure-dev-java
These rules apply to all Java code in the repository (including Spring, Jakarta EE, and standalone apps) and aim to prevent common security risks through disciplined use of input validation, safe APIs, and secure coding patterns.
java
Modern Java: records, sealed classes, streams, virtual threads.
spring-boot
Spring Boot: annotations, dependency injection, JPA patterns.
restcontroller-conventions
description: Specifies standards for RestController classes, including API route mappings, HTTP method annotations, dependency injection, and error handling with ApiResponse and GlobalExceptionHandler. globs: /src/main/java/com/example/controllers/.java.
entity-class-conventions
description: Sets the standards for entity class design including annotations, ID generation strategies, and relationship configurations for database interaction. globs: /src/main/java/com/example/entities/.java.
general-java-development-practices
description: Applies general coding standards and best practices for Java development, focusing on SOLID, DRY, KISS, and YAGNI principles, along with OWASP security guidelines. globs: /.java.