skillfed

java-rules

Java Rules enforces coding standards across style conventions, framework usage, design patterns, and security practices. It covers Spring Boot, Spring Data JPA, Hibernate, build tools, and modern Java features like records and pattern matching. Apply these rules when writing or reviewing Java code to maintain consistency and best practices.

Java Rules applies comprehensive coding standards covering style, frameworks, patterns, security, and testing for Java projects.

AI-generated summary based on this skill's SKILL.md

161 21 Apache-2.0 updated by softspark

Install

softspark/ai-toolkit/java-rules · repository language: Python

git clone https://github.com/softspark/ai-toolkit
cp -r ai-toolkit/app/skills/java-rules ~/.claude/skills/java-rules
npx skillfed install softspark/ai-toolkit/java-rules

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What java coding standards and best practices does java-rules cover?

java-rules enforces coding standards across style conventions, framework usage, design patterns, and security practices. The skill prioritizes applying Java coding standards, style, and framework best practices (35% weight), covering naming conventions, code formatting with Checkstyle and Spotless, exception handling patterns, stream API best practices, and dependency injection with Spring beans. Use java-rules when writing or reviewing Java code to maintain consistency.

How does java-rules help secure Java applications?

java-rules addresses security risks through guidelines on injection prevention, authentication, authorization, and serialization safety (25% weight). It covers SQL injection prevention, XSS and CSRF protection with Spring Security, secrets management with Vault, and secure deserialization practices. Apply these security guidelines when implementing authentication, handling user input, or managing sensitive data in Java applications.

What testing frameworks and approaches does java-rules recommend?

java-rules emphasizes effective unit and integration testing with JUnit 5 and Mockito (20% weight). The skill covers JUnit 5 framework setup, Mockito mocking patterns, AssertJ assertions, and TestContainers for integration testing. Use these testing approaches to ensure robust test coverage and maintainable test suites in your Java projects.

Which modern java 17+ features and patterns are covered?

java-rules implements modern Java 17+ patterns including records, sealed classes, and pattern matching (15% weight). It also covers immutability best practices, Optional usage, and virtual threads for concurrency. Apply these patterns to write cleaner, more expressive Java code that leverages the latest language capabilities.

Does java-rules address Spring Data JPA and Hibernate optimization?

java-rules includes optimization guidance for Spring Data JPA and Hibernate queries and associations (5% weight). The skill provides tips for efficient query writing, proper association configuration, and performance tuning. Reference these guidelines when working with database layers to ensure optimal data access patterns.

What build tools and configuration does java-rules support?

java-rules covers configuration for both Gradle and Maven build tools. It provides best practices for dependency management, build optimization, and tool-specific conventions. Use these guidelines when setting up or maintaining your Java project's build infrastructure.

SKILL.md

rendered from the published skill — quoted content, verbatim

Java Rules

These rules come from app/rules/java/ in ai-toolkit. They cover the project's standards for coding style, frameworks, patterns, security, and testing in Java. Apply them when writing or reviewing Java code.

Java Coding Style

Naming

  • PascalCase: classes, interfaces, enums, records, annotations.
  • camelCase: methods, variables, parameters.
  • UPPER_SNAKE: constants (static final).
  • Package names: lowercase, dot-separated, reverse domain (com.company.project).
  • No Hungarian notation. No I prefix on interfaces.

Modern Java (17+)

  • Use record for immutable data carriers. No need for Lombok in most cases.
  • Use sealed classes/interfaces for restricted hierarchies.
  • Use pattern matching: if (obj instanceof String s) instead of cast.
  • Use switch expressions with arrow syntax and exhaustiveness.
  • Use text blocks (""") for multiline strings (SQL, JSON, HTML).

Types

  • Use var for local

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 1 file
app/skills/java-rules/SKILL.md

Related skills

Tags

enterprise-java framework-patterns secure-coding test-automation code-quality async-concurrency orm-persistence api-design