# java-fundamentals

Guides coding assistants through modern Java development from version 8 to 21, including Streams, collections, records, and OOP patterns.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 616 installs · ★ 41
- Author: pluginagentmarketplace
- License: LicenseRef-Proprietary · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pluginagentmarketplace/custom-plugin-java/tree/HEAD/skills/java-fundamentals/SKILL.md
- Updated: 2026-01-05
- HTML: https://affpapa.org/en/nevibecode/skills/java-fundamentals

## What it does

This skill equips your coding agent with conventions across Java versions 8, 11, 17, and 21. It covers object-oriented design, collections, stream transformations, generics, and exception handling. Version 21 is the default.

The skill defines data structure choices based on complexity, favoring `HashSet` for O(1) membership lookups and `TreeSet` for O(log n) ordered data. Your agent receives access to `Read`, `Write`, `Bash`, `Glob`, and `Grep` to inspect and modify project files.

Because the skill defaults to Java 21, projects on legacy versions like Java 8 require specifying the `java_version` parameter to avoid unsupported switch syntax or records.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-fundamentals -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/java-fundamentals/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/java-fundamentals/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-fundamentals -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/java-fundamentals/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-fundamentals -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/java-fundamentals/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install pluginagentmarketplace/custom-plugin-java java-fundamentals
```

2. **Manually: put the files in place**
- File: `.github/skills/java-fundamentals/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-fundamentals -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/pluginagentmarketplace/custom-plugin-java --path skills/java-fundamentals
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/java-fundamentals/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-java --skill java-fundamentals -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/pluginagentmarketplace/custom-plugin-java/tree/HEAD/skills/java-fundamentals/SKILL.md

## When to use it
- refactor nested loops into functional Stream pipelines
- select appropriate collection types based on algorithmic complexity
- convert verbose POJOs into compact Java records
- replace risky null dereferences with safe `Optional` patterns

## Example prompts
- Refactor this data processing loop into a Java 21 stream pipeline with toList().
- Convert this mutable DTO class into a record.
- Pick the right collection for fast lookups by key and explain the choice.

## Similar
- [migrate-to-shoehorn](https://affpapa.org/en/nevibecode/skills/migrate-to-shoehorn.md) — skill · 475388 installs
- [write-swift](https://affpapa.org/en/nevibecode/skills/write-swift.md) — skill · 119300 installs
- [megacave](https://affpapa.org/en/nevibecode/skills/megacave.md) — skill · 25400 installs
- [find-docs](https://affpapa.org/en/nevibecode/skills/find-docs.md) — skill · 9400 installs
- [typescript-advanced-types](https://affpapa.org/en/nevibecode/skills/typescript-advanced-types.md) — skill · 92169 installs
- [smart-explore](https://affpapa.org/en/nevibecode/skills/smart-explore.md) — skill · 7300 installs

From the same set: [pluginagentmarketplace/custom-plugin-java](https://affpapa.org/en/nevibecode/by/pluginagentmarketplace/custom-plugin-java.md) — 9 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
