Agent skill

143 Java Functional Exception Handling

by jabrena in jabrena/plinth

A skill your agent uses when you need to apply functional exception handling best practices in Java — including replacing exception overuse with Optional and VAVR Either types, designing error type…

Apache-2.0Auto-check passedDevelopment

Install 143 Java Functional Exception Handling

skills CLI
$ npx skills add jabrena/plinth --skill 143-java-functional-exception-handling -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jabrena/plinth 143-java-functional-exception-handling --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jabrena/plinth.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/143-java-functional-exception-handling .claude/skills/143-java-functional-exception-handling && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
143-java-functional-exception-handling
GitHub stars
446
Token cost
~985 tokens
SKILL.md length
364 words
Files
2 (incl. references)
Skills in repo
124
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses when you need to apply functional exception handling best practices in Java — including replacing exception overuse with Optional and VAVR Either types, designing error type…

  • Designing error type hierarchies using sealed classes and enums
  • SKILL.md covers Constraints, When to use this skill, Workflow and Reference
  • Calls mvn
  • Implementing monadic error composition pipelines

What it does

143 Java Functional Exception Handling is an agent skill from jabrena/plinth. Use when you need to apply functional exception handling best practices in Java — including replacing exception overuse with Optional and VAVR Either types, designing error type hierarchies using sealed classes and enums, implementing monadic error composition pipelines, establishing functional control flow patterns, and reserving exceptions only for truly exceptional system-level failures. This should trigger for requests such as Improve the code with Functional Exception Handling; Apply Functional Exception…

Its SKILL.md is about 990 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/143-java-functional-exception-handling.md`).

It sits in Development, covering Error handling. It works with Java. The repository describes itself as: Plinth is an AI-native engineering toolkit for modern Java enterprise SDLC, built around reusable Commands, Agents, Skills, and MCP Servers. The licence is Apache-2.0.

When your agent uses it

  • Designing error type hierarchies using sealed classes and enums
  • Implementing monadic error composition pipelines
  • Establishing functional control flow patterns
  • Reserving exceptions only for truly exceptional system-level failures

Example prompts

  • “/143-java-functional-exception-handling”

What it can do on your machine

Read from SKILL.md and the folder at commit dca88dc. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • mvn

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

143 Java Functional Exception Handling loads about 985 tokens when it runs, and up to ~16k if it reads all its reference files. Until then it costs about 187 tokens; SKILL.md has 364 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~187
When it runs · the whole SKILL.md, loaded when a task matches
~985
With references · SKILL.md plus every file in references/, read only if the agent opens them
~16k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jabrena/plinth at commit dca88dc, republished under its Apache-2.0 licence (© jabrena). 364 words, ~985 tokens.

Download SKILL.mdSave it as .claude/skills/143-java-functional-exception-handling/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
143-java-functional-exception-handling
description
Use when you need to apply functional exception handling best practices in Java — including replacing exception overuse with Optional and VAVR Either types, designing error type hierarchies using sealed classes and enums, implementing monadic error composition pipelines, establishing functional control flow patterns, and reserving exceptions only for truly exceptional system-level failures. This should trigger for requests such as Improve the code with Functional Exception Handling; Apply Functional Exception Handling; Refactor the code with Functional Exception Handling; Model Java errors with Result or Either types; Replace exception-heavy flows with functional error handling. Part of Plinth Toolkit
license
Apache-2.0
metadata.author
Juan Antonio Breña Moral
metadata.version
0.19.0

Java Functional Exception handling Best Practices

Identify and apply functional exception handling best practices in Java to improve error clarity, maintainability, and performance by eliminating exception overuse in favour of monadic error types.

What is covered in this Skill?

  • Optional<T> for nullable values over throwing NullPointerException or NotFoundException
  • VAVR Either<L,R> for predictable business-logic failures
  • CompletableFuture<T> for async error handling
  • Sealed classes and records for rich error type hierarchies with exhaustive pattern matching
  • Enum-based error types for simple failure cases
  • Functional composition: flatMap/map/peek/peekLeft for chaining operations that can fail
  • Structured logging: warn/info for business failures, error for system failures
  • Checked vs unchecked exception discipline
  • Exception chaining with full causal context when exceptions are unavoidable

Scope: The reference is organized by examples (good/bad code patterns) for each core area. Apply recommendations based on applicable examples.

Constraints

Before applying any functional exception handling changes, ensure the project validates. When introducing Either types, confirm the VAVR dependency (io.vavr:vavr) and SLF4J are present.

  • MANDATORY: Run ./mvnw validate or mvn validate before applying any changes
  • SAFETY: If validation fails, stop immediately — do not proceed until the project is in a valid state
  • DEPENDENCY: When introducing Either types, confirm VAVR (io.vavr:vavr) and SLF4J are present
  • VERIFY: Run ./mvnw clean verify or mvn clean verify after applying improvements
  • BEFORE APPLYING: Read the reference for detailed good/bad examples, constraints, and safeguards for each functional exception handling pattern
Show full SKILL.md (136 more words)Show less

When to use this skill

  • Improve the code with Functional Exception Handling
  • Apply Functional Exception Handling
  • Refactor the code with Functional Exception Handling
  • Model Java errors with Result or Either types
  • Replace exception-heavy flows with functional error handling

Workflow

  1. Validate project before functional-exception changes

Run ./mvnw validate or mvn validate and stop immediately if validation fails.

  1. Check required dependencies

When introducing Either, confirm VAVR (io.vavr:vavr) and SLF4J are present before implementation.

  1. Read functional-exception reference and identify targets

Read references/143-java-functional-exception-handling.md and identify places to replace exception-heavy control flow with monadic error types.

  1. Apply functional exception-handling refactorings

Implement selected Optional/Either/async error patterns with structured logging and clear error contracts.

  1. Verify with full build

Run ./mvnw clean verify or mvn clean verify after applying improvements.

Reference

For detailed guidance, examples, and constraints, see references/143-java-functional-exception-handling.md.

© jabrena, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/143-java-functional-exception-handling of jabrena/plinth.

  • SKILL.md
  • references/143-java-functional-exception-handling.md

Open the folder on GitHubat commit dca88dc

Compare with similar skills

143 Java Functional Exception Handling next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

143 Java Functional Exception Handling compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
143 Java Functional Exception Handling this skilljabrena/plinth446—~985Automated safety check: PassApache-2.0
Cross-Language Coding Standardszereight/gitlab-mcp2k1 repos~1.4kAutomated safety check: PassMIT
Code Qualitypiomin/claude-ai-spring-boot1.3k—~2.2kAutomated safety check: PassApache-2.0
Java Code Reviewdecebals/claude-code-java751—~2.5kAutomated safety check: PassMIT
Databricks Zerobus Ingestdatabricks/databricks-agent-skills345—~3.1kAutomated safety check: PassCustom licence
Mole Bug Patternstw93/Mole70k—~2kAutomated safety check: PassGPL-3.0

Similar skills

  • Shared reference for naming, function size, complexity and error handling rules that reviewer agents apply across TypeScript, Python, Go, Rust, Java, C# and Swift.

    2k GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Code Quality

    piomin/claude-ai-spring-boot

    Comprehensive code review for Java - clean code principles, API contracts, null safety, exception handling, and performance.

    1.3k GitHub stars~2.2k tokensUpdated 5 mo ago
    DevelopmentAuto-check passed
  • Java Code Review

    decebals/claude-code-java

    Checklist-driven review of Java code covering null safety, exception handling, collections and streams, and concurrency, with findings reported by severity.

    751 GitHub stars~2.5k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Databricks Zerobus Ingest

    databricks/databricks-agent-skills

    Official

    Build Zerobus Ingest clients for near real-time data ingestion into Databricks Delta tables via gRPC.

    345 GitHub stars~3.1k tokensUpdated today
    Backend & APIsAuto-check passed
  • A catalog of recurring bug shapes in the Mole Mac cleaner, used to review safety-sensitive diffs for deletion safety, unbounded commands, shell traps and weak tests.

    70k GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed
  • Native Data Fetching

    CherryHQ/cherry-studio-app

    A skill your agent uses when implementing or debugging ANY network request, API call, or data fetching.

    4k GitHub starsUsed in 6 repos~2.9k tokens
    DevelopmentAuto-check: notes

More from jabrena/plinth

All 124 skills in this repo
  • A skill your agent uses when you need to add or review fuzz testing for Java APIs with CATS — including contract-driven negative testing, malformed payload validation, boundary input exploration, CI…

    446 GitHub stars~874 tokensUpdated today
    Auto-check passed
  • A skill your agent uses when you need to generate Java project diagrams — including UML sequence diagrams, UML class diagrams, C4 model diagrams, UML state machine diagrams, UML Deployment Diagrams…

    446 GitHub stars~3.1k tokensUpdated today
    Auto-check passed
  • A skill your agent uses when you need to add or configure Maven plugins in your pom.xml — including quality tools (enforcer, surefire, failsafe, jacoco, pitest, spotbugs, pmd), security scanning…

    446 GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • A skill your agent uses when you need to set up JMeter performance testing for a Java project — including creating the run-jmeter.sh script from the exact template, configuring load tests with…

    446 GitHub stars~842 tokensUpdated today
    Auto-check passed
  • A skill your agent uses when you need to set up Java application profiling to detect and measure performance issues — including trusted preinstalled async-profiler v4.x setup, problem-driven…

    446 GitHub stars~903 tokensUpdated today
    Auto-check passed
  • A skill your agent uses when you need to generate a checklist document with embedded commands inventory, following the embedded template exactly and producing INVENTORY-COMMANDS-JAVA.md in the…

    446 GitHub stars~697 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about 143 Java Functional Exception Handling

What does 143 Java Functional Exception Handling do?

A skill your agent uses when you need to apply functional exception handling best practices in Java — including replacing exception overuse with Optional and VAVR Either types, designing error type…. 143 Java Functional Exception Handling is an agent skill from jabrena/plinth. Use when you need to apply functional exception handling best practices in Java — including replacing exception overuse with Optional and VAVR Either types, designing error type hierarchies using sealed classes and enums, implementing monadic error composition pipelines, establishing functional control flow patterns, and reserving exceptions only for truly exceptional system-level failures.

When should I use 143 Java Functional Exception Handling?

143 Java Functional Exception Handling fits situations like: designing error type hierarchies using sealed classes and enums; implementing monadic error composition pipelines; establishing functional control flow patterns; reserving exceptions only for truly exceptional system-level failures.

How do I install 143 Java Functional Exception Handling in Claude Code?

Run `npx skills add jabrena/plinth --skill 143-java-functional-exception-handling -a claude-code`. Or copy the skill folder (skills/143-java-functional-exception-handling in jabrena/plinth) into .claude/skills/143-java-functional-exception-handling in your project. Claude Code loads it when a task matches its description.

How do I install 143 Java Functional Exception Handling in Codex?

Run `npx skills add jabrena/plinth --skill 143-java-functional-exception-handling -a codex`. Or copy the skill folder (skills/143-java-functional-exception-handling in jabrena/plinth) into .agents/skills/143-java-functional-exception-handling in your project. Codex loads it when a task matches its description.

Can I use 143 Java Functional Exception Handling in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jabrena/plinth --skill 143-java-functional-exception-handling -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/143-java-functional-exception-handling, .gemini/skills/143-java-functional-exception-handling, .github/skills/143-java-functional-exception-handling and .opencode/skills/143-java-functional-exception-handling in your project.

What does 143 Java Functional Exception Handling need to run?

Going by SKILL.md and its folder, 143 Java Functional Exception Handling needs the command-line tools its instructions call (mvn).

Does 143 Java Functional Exception Handling access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is 143 Java Functional Exception Handling safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does 143 Java Functional Exception Handling use?

143 Java Functional Exception Handling is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does 143 Java Functional Exception Handling use?

About 985 tokens (SKILL.md is roughly 3.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 15k tokens, read only when the agent opens those files.

What are the alternatives to 143 Java Functional Exception Handling?

Skills that share tags, products or a category with 143 Java Functional Exception Handling: Cross-Language Coding Standards (zereight/gitlab-mcp, 2k stars), Code Quality (piomin/claude-ai-spring-boot, 1.3k stars), Java Code Review (decebals/claude-code-java, 751 stars) and Databricks Zerobus Ingest (databricks/databricks-agent-skills, 345 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains 143 Java Functional Exception Handling?

jabrena (a GitHub user) maintains it in jabrena/plinth, which has 446 GitHub stars. The repository holds 124 skills in this directory. The repository was last updated on October 7, 2026.

Source: jabrena/plinth on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.