java-patch-workflow

java-patch-workflow is a skill for Claude Code, Codex from cxcscmu/SkillLearnBench. It costs 30 tokens per session (607 once invoked), scanned A, original, MIT.

A Java patching guide covering unified diff files, Git patches, dry runs, and Maven rebuilds. A patch is a file describing changes that can be applied to source code.

In plain words
What is it for?
Use it to create and apply security patches, check them before applying, and rebuild Java projects with Maven.
Why use it?
It gives a repeatable way to share, test, and apply Java fixes without editing each file by hand.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create and apply security patches, check them before applying…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cxcscmu/skilllearnbench/java-patch-workflow
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cxcscmu/SkillLearnBench --skill java-patch-workflow
Clone the repo
git clone --depth 1 https://github.com/cxcscmu/SkillLearnBench

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for java-patch-workflow

README.md
[![agentmods](https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/java-patch-workflow.svg)](https://agentmods.dev/skills/cxcscmu/skilllearnbench/java-patch-workflow)
Your own site
<a href="https://agentmods.dev/skills/cxcscmu/skilllearnbench/java-patch-workflow"><img src="https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/java-patch-workflow.svg" alt="Measured on agentmods" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 607 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00030 $0.00607
Opus 5 $0.00015 $0.00303
Sonnet 5 $0.00006 $0.00121
Haiku 4.5 $0.00003 $0.00061

Measured 3d ago against content hash 8f2888fa186e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

java-patch-workflow scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/b1-one-shot-claude-sonnet-4-6/fix-security-bug/java-patch-workflow/SKILL.md · 87 lines

How it starts

The opening of the file, as written. The whole thing — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Java Patch Workflow

Creating Unified Diff Patches

# Create a patch from changes to a specific file
diff -u original_file.java modified_file.java > my_fix.patch

# Create patch with context lines
diff -u -p original.java modified.java > fix.patch

# Apply a patch
patch -p1 < fix.patch           # Strip 1 prefix component
patch -p0 < fix.patch           # Don't strip (exact path match)
patch --dry-run -p1 < fix.patch # Test without applying

Git-Based Patching

# Create patch from staged changes
git diff HEAD > my_fix.patch

# Create patch from specific commit
git format-patch HEAD~1

# Apply git format-patch
git am patch_file.patch

# Apply unified diff
git apply patch_file.patch
git apply --check patch_file.patch  # Dry run

Apache Druid Build

Full Build (skip web-console for OOM prevention)

cd /root/druid
mvn clean package -DskipTests \
  -Dcheckstyle.skip=true -Dpmd.skip=true \
  -Dforbiddenapis.skip=true -Dspotbugs.skip=true \
  -Danimal.sniffer.skip=true -Denforcer.skip=true \
  -Djacoco.skip=true -Ddependency-check.skip=true \
  -pl '!web-console' -pl indexing-service -am

Module-Specific Build

# Build only the indexing-service and dependencies
mvn package -DskipTests -pl indexing-service -am

# Build specific module with quality checks skipped
mvn package -DskipTests -Dcheckstyle.skip=true -pl processing

Patch File Organization

/root/patches/
├── 01-fix-javascript-injection.patch     # Primary root cause fix
├── 02-fix-sampler-validation.patch       # Defense in depth
└── README.md                            # Fix description

Common Issues

Patch Offset Errors

If patch reports "offset" or "fuzz", the patch may be for a different file version. Use patch --fuzz=3 to allow more context flexibility.

Build Failures After Patch

  • Check for compilation errors: mvn compile first
  • Verify imports are added for new classes used
  • Check Guice injection: ensure @Inject annotation is present for DI

Read the full file on GitHub · 87 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 87 lines · 30 tokens per session scan A 8f2888fa186e

Subscribe to this mod's changes

java-patch-workflow is a skill published in the GitHub repository cxcscmu/SkillLearnBench (83 stars, last pushed 1mo ago), licensed MIT. It adds 30 tokens to every session and 607 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.