Skip to content
Back to skills

Coding Standard Java

ASecurity

Enforce Java coding standards including camelCase variables, PascalCase classes, and PascalCase filenames matching class names.

  • 27 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 9, 2026
developmentjava

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add jdubray/puffin --skill coding-standard-java --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Coding Standard Java?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Coding Standard Java
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jdubray-coding-standard-java/badge)](https://www.skillsdirectory.com/skills/jdubray-coding-standard-java)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: coding-standard-java
description: Enforce Java coding standards including camelCase variables, PascalCase classes, and PascalCase filenames matching class names.
---

# Java Coding Standards

When reviewing or generating Java code, follow these rules:

## File Naming
- **Source files:** PascalCase matching the public class name (e.g., `UserService.java`)
- **One public class per file:** File name must match the public class name exactly
- **Test files:** Class name with `Test` suffix (e.g., `UserServiceTest.java`)
- **Interface files:** PascalCase (e.g., `Comparable.java`, `UserRepository.java`)

## Package Naming
- **Packages:** All lowercase, dot-separated (e.g., `com.example.service`, `org.project.utils`)
- **No underscores or hyphens** in package names
- Follow reverse domain name convention

## Variable Naming
- **Local variables:** camelCase (e.g., `userName`, `isActive`, `totalCount`)
- **Instance variables:** camelCase (e.g., `userId`, `createdAt`)
- **Constants:** UPPER_SNAKE_CASE with `static final` (e.g., `MAX_RETRIES`, `DEFAULT_TIMEOUT`)
- **Boolean variables:** Prefix with `is`, `has`, `can`, `should` (e.g., `isEnabled`, `hasPermission`)

## Method Naming
- **Methods:** camelCase, verb or verb phrase (e.g., `calculateTotal()`, `getUserById()`)
- **Getters:** `get` prefix (e.g., `getName()`, `getId()`)
- **Setters:** `set` prefix (e.g., `setName()`, `setId()`)
- **Boolean getters:** `is` or `has` prefix (e.g., `isActive()`, `hasChildren()`)
- **Factory methods:** `create`, `of`, `from`, `valueOf` (e.g., `createInstance()`, `of()`)

## Class/Interface Naming
- **Classes:** PascalCase, noun or noun phrase (e.g., `UserService`, `OrderProcessor`)
- **Interfaces:** PascalCase, adjective or noun (e.g., `Comparable`, `UserRepository`)
- **Abstract classes:** PascalCase, optionally prefix with `Abstract` (e.g., `AbstractHandler`)
- **Exception classes:** PascalCase with `Exception` suffix (e.g., `InvalidInputException`)
- **Enums:** PascalCase for type, UPPER_SNAKE_CASE for values

## Generics
- **Type parameters:** Single uppercase letter (e.g., `T`, `E`, `K`, `V`)
- **Meaningful names:** When clarity needed (e.g., `<Key, Value>`)

## Organization
- Package statement first
- Import statements (java.*, javax.*, third-party, project imports)
- Class declaration with fields, constructors, methods
- Public methods before private methods

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.