Java Patch Workflow
SkillSecurityWorkflow for creating and applying patches to Java projects - diff format, patch application, and Maven rebuilds for security fixes.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Java Patch Workflow skill
What this skill tells your AI
The instructions your AI receives, as published by cxcscmu/skilllearnbench in skills/b1-one-shot-claude-sonnet-4-6/fix-security-bug/java-patch-workflow/SKILL.md and read by ahel’s review.
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 compilefirst - Verify imports are added for new classes used
- Check Guice injection: ensure
@Injectannotation is present for DI
Finding the Right JAR After Build
find /root/druid -name "druid-indexing-service-*.jar" -not -path "*/test*"
# Typically at: druid/indexing-service/target/druid-indexing-service-*.jar
Signals
- GitHub stars
- 83
- Forks
- 5
- Last commit
- Jul 2026
Advanced
- Catalog kind
- skill
- Gateway key
java-patch-workflow- Source
- github.com/cxcscmu/skilllearnbench