mcpField
J
java-fundamentals

java-fundamentals

github.com/pluginagentmarketplaceDevelopment41620 installsUpdated 42w ago
Repository

About java-fundamentals

A fundamentals skill guide for Java 8–21 developers, covering syntax, OOP, collections, the Streams API, and exception handling. It also offers collection-selection guidance and troubleshooting references.

Key features

  1. 01Java 8–21 core syntax
  2. 02OOP and SOLID principles
  3. 03Collection type selection
  4. 04Streams API and Optional
  5. 05Exception handling patterns

Use cases

  1. 01Write idiomatic Java code
  2. 02Choose collections for access patterns
  3. 03Process data with Streams
  4. 04Handle exceptions and concurrent modification issues

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pluginagentmarketplace/custom-plugin-java --skill java-fundamentals

After installing, type/java-fundamentalsin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

assets/
config.yaml
schema.json
references/
GUIDE.md
PATTERNS.md
scripts/
validate.py

Details

From the project README

Java Fundamentals Skill

Master core Java programming with production-quality patterns.

Overview

This skill covers Java fundamentals including syntax, OOP, collections, streams API, and exception handling for Java 8-21.

When to Use This Skill

Use when you need to:

  • Write clean, idiomatic Java code
  • Design classes following OOP principles
  • Choose appropriate collection types
  • Implement functional programming patterns
  • Handle exceptions properly

Topics Covered

Core Syntax (Java 8-21)
  • Variables, data types, operators
  • Control flow, methods, classes
  • Records (Java 16+), sealed classes (Java 17+)
  • Pattern matching (Java 21)
Object-Oriented Programming
  • Classes, inheritance, polymorphism
  • Interfaces and abstract classes
  • SOLID principles
Collections Framework
  • List: ArrayList, LinkedList
  • Set: HashSet, TreeSet
  • Map: HashMap, ConcurrentHashMap
  • Queue: ArrayDeque, PriorityQueue
Streams API
  • filter, map, flatMap, reduce, collect
  • Optional handling
  • Parallel streams
Exception Handling
  • Checked vs unchecked exceptions
  • Try-with-resources
  • Custom exceptions

Quick Reference

// Record (Java 16+)
public record User(String name, String email) {}

// Pattern matching (Java 21)
String format(Object obj) {
    return switch (obj) {
        case Integer i -> "Int: %d".formatted(i);
        case String s -> "String: %s".formatted(s);
        default -> obj.toString();
    };
}

// Stream operations
List<String> names = users.stream()
    .filter(User::isActive)
    .map(User::getName)
    .sorted()
    .toList();

// Optional handling
String name = Optional.ofNullable(user)
    .map(User::getName)
    .orElse("Unknown");

Collection Selection

NeedUseReason
Indexed accessArrayListO(1) random access
Unique elementsHashSetO(1) contains
Sorted uniqueTreeSetO(log n) sorted
Key-value pairsHashMapO(1) get/put

Troubleshooting

ProblemCauseSolution
NullPointerExceptionNull referenceUse Optional
ConcurrentModificationExceptionModify during iterationIterator.remove()
ClassCastExceptionWrong typeUse generics

Usage

Skill("java-fundamentals")

Comments

Markdown supported