java-final-keyword

Enforce Java final keyword conventions on parameters, locals, and fields.

2|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/tomitribe/claude-plugins --skill java-final-keyword
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: java-final-keyword
Source: https://github.com/tomitribe/claude-plugins/tree/main/plugins/java-conventions/skills/java-final-keyword
Command: npx skills add https://github.com/tomitribe/claude-plugins --skill java-final-keyword

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tomitribe Java final keyword conventions standardize the use of final to improve immutability and code clarity across projects, preventing unintended mutations.

Core Features & Use Cases

  • Enforce final on method parameters, including constructors and lambda parameters.
  • Enforce final on local variables to prevent unintended reassignment.
  • Enforce final on instance fields, static fields, and enum fields to promote immutable data structures.

Quick Start

Apply the final keyword to all method parameters, local variables, and fields in new and modified code within Tomitribe projects.

Frequently Asked Questions about java-final-keyword

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce the Java final keyword on method parameters and local variables?

To enforce the Java final keyword, apply it to all method parameters, including constructors and lambda parameters, as well as local variables to prevent unintended reassignment and clarify intent.

What Java coding standards apply final to instance fields and static fields?

Java coding standards for immutability mark instance fields and static fields as final to promote immutable data structures, while intentionally excluding mutable fields from this requirement.

Should Java classes be marked as final when applying immutability conventions?

Java immutability conventions generally do not mark classes as final, focusing instead on applying the final keyword to method parameters, local variables, instance fields, static fields, and enum fields.

Do I need to mark enum fields as final in Java coding standards?

Yes, Java coding standards require enum fields to be marked as final to ensure immutability and prevent unintended mutations across the codebase.

Why use final on local variables in Java projects?

Using final on local variables in Java prevents unintended reassignment, ensuring clearer intent and supporting stricter immutability conventions across the codebase.