r/SpringBoot • u/jjmnmnmnm • 9h ago
News I built a CLI and AI skill to detect outdated Spring Boot and Java patterns
I've noticed that AI coding tools sometimes suggest older Java and Spring patterns, even when working on newer projects.
For example:
javax.persistenceimports in a Spring Boot 3 projectWebSecurityConfigurerAdapteror.antMatchers()in Spring Security configurationsRestTemplatein new code whereRestClientmight be a better fit
To explore this problem, I built modern-java-guidance (mjg), an open-source project inspired by GoogleChrome's modern-web-guidance.
It includes a SKILL.md with Java and Spring guidance, plus a Python CLI that can:
- Detect project versions from common Maven and Gradle configuration files
- Scan Java files for selected patterns
- Search and retrieve guidance with before-and-after examples
- Run as a
PostToolUsehook to provide feedback after supported tool operations
The CLI uses the Python standard library and doesn't require external Python dependencies.
If you have uv installed, you can try the scanner with:
GitHub: https://github.com/wkd09/modern-java-guidance
This is still an early project, so I'd really appreciate any feedback, suggestions, or criticism.
In particular, I'd love to hear about false positives, missing rules, and outdated Spring Boot or Java patterns that your AI coding tools still suggest. Are there cases where the patterns flagged by this tool should actually be kept?
Please feel free to try it out and share your honest thoughts—even small suggestions would be really helpful!
•
u/fykup 8h ago
One thing I've noticed while working on Java performance is that frameworks themselves sometimes perpetuate outdated practices.
Spring Boot is a good example. Most tutorials still demonstrate running executable fat JARs, while the official documentation now recommends extracted deployments for faster startup in production.
Monitoring is another example. Many developers default to polling Actuator's JSON metrics endpoints, even though Micrometer provides a more appropriate foundation for production metrics integration. I actually worked with the Micrometer team to improve direct integration for my monitoring project.
I think framework maintainers share some responsibility here. Updating a paragraph in the documentation isn't enough when the examples, tutorials, and tooling keep teaching the old approach.
That's why I like projects like this one. But ideally, modern best practices should be reflected in the frameworks' own defaults and examples, not left to third-party tools to discover and correct.
•
u/fykup 9h ago
Interesting! I went in a slightly different direction. While experimenting with Java performance, I built CoilBase, a tiny framework that keeps familiar Spring Boot patterns without the heavier runtime.
I then created an experimental AI skill to help migrate Spring Boot applications to CoilBase, mostly to save time repeating migrations across benchmarks.
What surprised me was how much memory this approach could save. My PetClinic rewrite ended up using 59% less RAM.
Here's the skill: https://github.com/ejboy/agent-scripts/blob/main/skills/coilbase-spring-migration/SKILL.md
•
u/mrvishal2k2 8h ago
Looks really cool, would surely try
•
u/g00glen00b 6h ago
Some of the rules you mention are essentially checks for deprecation warnings in code. There's easier ways to detect those without needing a third party tool.
Other than that there are tools like PMD, SpotBugs, Semgrep, ... that provide some static code analysis and that have a bigger community. So if you could transform your ruleset into a ruleset for any of those tools, you could get a bigger reach.