Repository navigation
Releases
v0.4.0 — All-Version Spring Boot Production Guardrail (3-Pillar Architecture)
What's New in v0.4.0
modern-java-guidance (mjg) evolves from a Java 21 / Boot 3 modernization linter into an all-version (Java 8–25, Spring Boot 2.7–3.4+) Spring Boot production guardrail across 3 pillars—still with zero third-party Python dependencies.
Pillar 1 — 14 Version-Independent Production Footguns
Catches real outage & security causes that javac compiles with zero warnings (works on Boot 2.7 through Boot 3.4+):
- AOP & Transactions:
TX-001(@Transactionalonprivate/final),TX-002(JDK checkedthrowswithoutrollbackFor),CONC-001(@Asynconprivate/final) - JPA / Hibernate:
JPA-001(Lombok@Dataon@Entity),JPA-002(@ManyToOne/@OneToOnemissingFetchType.LAZY) - Spring & Precision:
SPRING-001(new ObjectMapper()in services),JAVA-020(new BigDecimal(0.1)double literal),OPS-001(e.printStackTrace()) - Security & WebFlux:
SEC-001(SQL string concatenation inJdbcTemplate/createNativeQuery, ignoring literal+literal concat),SEC-002(CORSallowedOrigins("*")+allowCredentials(true)startup crash),REACT-001(.block()in WebFlux-only apps) - Spring Config (
application*.yml/.properties):CFG-001(Actuator*wildcard),CFG-002(prodddl-auto: update/create/create-drop),CFG-003(explicitopen-in-view: true)
Pillar 2 — 6 Bidirectional Version Compatibility Guards (COMPAT-001..006)
Protects teams on older Java 8/11/17 or Spring Boot 2.7/3.0–3.3 repos from AI-hallucinated future APIs (activates only when build files declare explicit versions):
COMPAT-001: Blocksjakarta.*EE imports on Spring Boot 2.xCOMPAT-002: BlocksRestClient/@HttpExchangeon Spring Boot< 3.2COMPAT-003: Blocks@MockitoBean/@MockitoSpyBeanon Spring Boot< 3.4COMPAT-004: Blocks Virtual Threads /SequencedCollectionon Java< 21(never false-positives onLinkedList.getLast()/Comparator.reversed())COMPAT-005: Blocksrecord(< 16) andsealed(< 17)COMPAT-006: Blocks.formatted()(< 15) and.stream()...toList()(< 16)
Pillar 3 — Team Config (.mjg.toml), --profile prod, ARCH-001 & mjg init
- Zero-dependency
.mjg.tomlloader via Python 3.11+ stdlibtomllib --profile prod(andprofile: prodinaction.yml) skips pure style rules (JAVA-003,JAVA-004,BOOT-010) so enterprise teams only see real bugs, security, JPA/TX footguns, and version safetymjg init [--profile prod]auto-generates.mjg.tomland suggestsARCH-001(forbid_controller_repository = true) when a*Servicelayer exists- Supports
disable,severityoverrides, and[[custom_rules]]
Verification
unittest(Python 3.11, 3.12, 3.13): 16/16 passed- A/B eval suite: 8/8 passed (100.0%, +87.5 pp vs. 12.5% unguided baseline)
- Semgrep CI job: 20/20 Java AST rules (
semgrep --validate0 errors,semgrep --test20/20 passed) - GitHub Action E2E job (
47539452922): all 5 CI jobs passed
v0.3.0 — GitHub Action (SARIF 2.1.0), Animated Demo & PyPI Publishing Pipeline
What's New in v0.3.0
modern-java-guidance (mjg) now works seamlessly for both AI coding agents and standard Java / Spring Boot CI teams, with native GitHub Code Scanning (SARIF 2.1.0) and a zero-dependency Composite GitHub Action.
Highlights
- Composite GitHub Action (
action.yml) + SARIF 2.1.0 Code Scanning:- Run
mjgon every PR with a single workflow step—no AI agent required:- uses: wkd09/modern-java-guidance@v0.3.0 with: path: . upload-sarif: "true"
- Generate OASIS SARIF 2.1.0 locally via
mjg check . --sarif mjg-results.sarif(repo-relative POSIX URIs,caught_by_javacmetadata, zero third-party deps).
- Run
- Animated Terminal Demo (
assets/demo.svg):- Added a lightweight CSS-animated terminal walkthrough at the top of English, Korean, and Simplified Chinese READMEs showing the 38 ms
PostToolUseguardrail catching and correcting legacy Boot 2.x patterns before Maven/Gradle runs.
- Added a lightweight CSS-animated terminal walkthrough at the top of English, Korean, and Simplified Chinese READMEs showing the 38 ms
- PyPI OIDC Trusted Publishing Workflow (
.github/workflows/publish.yml):- Complete PyPI metadata (
pyproject.toml) + automated sdist/wheel build (twine check+ bundled skill assertion) + OIDC publishing workflow.
- Complete PyPI metadata (
- GitHub Discovery:
- Expanded repository topics (
java,spring-boot-3,spring-security,semgrep,sarif,github-action,linter,code-quality).
- Expanded repository topics (
Verification
unittest(Python 3.11, 3.12, 3.13): 13/13 passed (including SARIF 2.1.0 schema & CLI tests)- A/B eval suite: 6/6 passed (100.0%, +83.3 pp, 0 false positives on Java 8 / Boot 2.7)
- Semgrep CI job:
diff -uYAML sync,diff -rubundled skill sync,semgrep --validate(0 errors, 13 rules),semgrep --test(13/13 passed) - GitHub Action E2E job (
47535735487): Compositeuses: ./verified onubuntu-latestwith SARIF 2.1.0 output validation
v0.2.1 — Wheel-Bundled Skill, Multi-Module Detector, Scanner Hardening & Boot 3.4 Rules
What's New in v0.2.1
A major reliability, accuracy, and rule-coverage hardening release fixing every P0/P1 edge case found during full codebase & edge-case auditing, plus new Java 16+ / Spring Boot 3.3–3.4+ rules.
P0 Reliability Fixes
- Wheel-Bundled Skill Assets: Bundled
skills/modern-java-guidanceinside the Python package (bundled_skill/viapackage-data), soinstall.sh(uv tool install/pip install) +mjg setupnow reliably installs skills for both Antigravity and Claude Code (.claude/skills/modern-java-guidance). - Gradle
JavaVersion.VERSION_1_8Fix: Fixed regex parsing so Gradle Java 8 projects are accurately detected as Java 8 (0 false positives) instead of falling back to Java 21. - Multi-Module Maven / Gradle & Maven BOM Support:
detect_project()now walks upward across child → parentpom.xml, Maven<dependencyManagement>BOM (spring-boot-dependencieswith${...}property resolution), and ancestorgradle/libs.versions.toml(including camelCase keys likespringBoot/javaVersion).
P1 Scanner & Hook Hardening
- String Literal & Text-Block Sanitization: Strips
//,/* ... */,"..."(properly handling escaped backslashes like"\\"),'...', and Java 15+"""..."""text blocks before scanning—eliminating false positives in log messages and docs. - Smart
BOOT-004(@Autowired) Detection: Distinguishes field injection (both multi-line and inline@Autowired private Foo foo;) from constructor/method@Autowired, and skips test files (src/test/,*Test.java,*IT.java). - Explicit
LocaleExclusion onJAVA-003:String.format(Locale.US, ...)no longer triggers false positives (full parity with Semgrep). - Multiline
BOOT-006Detection: Catches multiline.csrf()\n.disable()chains. - Inline Suppression & Smart Claude Hook Severity:
- Suppress intentional exceptions with
// mjg:ignore JAVA-010or// mjg:ignore(inline or preceding line). - Claude Code
PostToolUsehooks now hard-block ("decision": "block") only onerrorfindings and return non-blockingadditionalContextforwarning/info(pass--strictto block all). - Updated Antigravity hook matcher to include
write_file|edit_file.
- Suppress intentional exceptions with
P2 New Rules, Guides & CLI Polish
JAVA-001&BOOT-001Expanded: AddedCalendar.getInstance()andjavax.{inject,mail,xml.bind,ws.rs}.*(bothmjgand Semgrep).JAVA-004(Java 16+):.collect(Collectors.toList())→Stream.toList()(scanner + guide + Semgrep).BOOT-008(Spring Boot 3.4+): Deprecated@MockBean/@SpyBean→@MockitoBean/@MockitoSpyBean(scanner + guide + Semgrep).BOOT-009(Spring Boot 3.0+, build files): Flags incompatiblespring-cloud-starter-sleuth→ Micrometer Tracing + OpenTelemetry OTLP (#1).BOOT-010(Spring Boot 3.3+,Dockerfile): Flags unextracted fat-JARjava -jarcontainers →-Djarmode=tools ... extract, Buildpacks, or AppCDS (#1).- CLI Polish: Added
mjg --version/-Vand strict validation for invalid--bootvalues.
Verification
unittest(Python 3.11, 3.12, 3.13): 12/12 passed- A/B eval suite: 6/6 passed (100.0%, +83.3 pp, 0 false positives on Java 8 / Boot 2.7)
- Semgrep CI job (
44530722886):diff -uYAML sync,diff -rubundled skill sync,semgrep --validate(0 errors, 13 rules),semgrep --test(13/13 passed) - Wheel inspection (
uv build --wheel): verifiedmodern_java_guidance/bundled_skill/SKILL.mdandreferences/*.mdpackaged inside wheel.
v0.2.0 — Semgrep Java AST Export & Compiler Overlap Clarity
What's New in v0.2.0
Driven by community feedback from r/SpringBoot, this release clarifies how mjg complements javac/IDEs and lets teams reuse the exact same version-gated rules in Semgrep CI pipelines.
Highlights
- Semgrep Java AST Ruleset (
rules/semgrep/modern-java-boot3.yaml):- Run directly without installing
mjg:semgrep --config https://raw.githubusercontent.com/wkd09/modern-java-guidance/main/rules/semgrep/modern-java-boot3.yaml . - Export a version-gated ruleset matched to your repo's
pom.xml/build.gradle(.kts):mjg export --format semgrep --path . -o .semgrep/modern-java.yaml
- All 11 rules are validated (
semgrep --validate) and unit-tested (semgrep --testagainstrules/semgrep/modern-java-boot3.java) in CI on every push.
- Run directly without installing
- Compiler (
javac) Overlap Metadata (caught_by_javac):- Every
Ruleand JSONFindingnow reportscaught_by_javac(no,compile-error,deprecated). - Documented clearly across English, Korean, and Chinese READMEs: 7 of 11 rules are completely silent in
javac(new Date(),RestTemplate,@Autowiredfield injection,Executors.newFixedThreadPool, etc.), while the other 4 catch breakages in ~31 ms inside the AI agent's edit loop before a 10–30 s Maven/Gradle build.
- Every
- Zero Third-Party Dependencies Preserved:
mjgstill runs on the Python 3.11+ standard library alone (exporters.pyemits valid YAML with zero external packages).
- Roadmap Opened:
- Tracked Spring Boot 3.x deployment (Layered JAR / AppCDS) and observability (Micrometer / OTLP) rules in #1.
Verification
unittest(Python 3.11, 3.12, 3.13): 7/7 passed- A/B eval suite: 6/6 passed (100.0%, +83.3 pp vs. unguided baseline, 0 false positives on Java 8 / Boot 2.7)
- Semgrep CI job:
diff -usync check,semgrep --validate(0 errors, 11 rules), andsemgrep --test(11/11 passed)
v0.1.0 — Initial Release (CLI, PostToolUse Hook & Agent Skill)
Highlights
- Version-Aware Detection (
mjg detect): Parsespom.xml,build.gradle(.kts),gradle/libs.versions.toml, and.java-versionso Java 8/11 and Spring Boot 2.x repos never get false-positive warnings. - Zero-Dependency Scanner &
PostToolUseHook (mjg check,mjg hook): 11 version-gated rules covering Java 17/21+ (record,sealed,SequencedCollection, Virtual Threads,java.time) and Spring Boot 3.x+ (jakarta.*,SecurityFilterChain,RestClient, constructor injection, Lambda DSL). - On-Demand Lookup (
mjg search,mjg retrieve): 13 Before/After guides with caveats while keepingSKILL.mdat 4.1 KB. - One-Line Setup:
curl -fsSL https://raw.githubusercontent.com/wkd09/modern-java-guidance/main/install.sh | bashor try without installing viauvx. - Verified: 6/6 unit tests pass, 16.7% → 100.0% (+83.3 pp) on the A/B assertion eval suite, 1,000 Java files scanned in 183.4 ms, and ~31 ms median
PostToolUseCLI E2E latency.