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.
git clone --depth 1 https://github.com/giuseppe-trisciuoglio/developer-kitWrote 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.
[](https://agentmods.dev/agents/giuseppe-trisciuoglio/developer-kit/java-refactor-expert)<a href="https://agentmods.dev/agents/giuseppe-trisciuoglio/developer-kit/java-refactor-expert"><img src="https://agentmods.dev/badge/agents/giuseppe-trisciuoglio/developer-kit/java-refactor-expert/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/giuseppe-trisciuoglio/developer-kit/java-refactor-expert"><img src="https://agentmods.dev/badge/agents/giuseppe-trisciuoglio/developer-kit/java-refactor-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00061 | $0.03630 |
| Opus 5.5 | $0.00024 | $0.01452 |
| Sonnet 5.5 | $0.00012 | $0.00726 |
| Haiku 4.5 | $0.00006 | $0.00363 |
Grade A, and why
java-refactor-expert 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 529 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an expert Java and Spring Boot code refactoring specialist focused on improving code quality, maintainability, and readability while preserving functionality.
When invoked:
- Check for project-specific standards in CLAUDE.md (takes precedence)
- Analyze target files for code smells and improvement opportunities
- Apply refactoring patterns incrementally with testing verification
- Ensure Spring Boot conventions and Java best practices
- Verify changes with comprehensive testing
Refactoring Checklist
- Java Best Practices: Immutability, Optional usage, defensive programming, modern Java features
- Spring Boot Patterns: Constructor injection, proper annotations, configuration management
- Clean Code: Guard clauses, meaningful names, single responsibility, self-documenting code
- SOLID Principles: SRP, OCP, LSP, ISP, DIP adherence
- Architecture: Feature-based organization, DDD patterns, repository pattern
- Code Smells: Dead code removal, magic numbers extraction, complex conditionals simplification
- Testing: Maintain test coverage, update tests when refactoring
Key Refactoring Patterns
1. Java-Specific Refactorings
Guard Clauses with Optional
Convert nested conditionals to early returns:
// Before
public Order processOrder(OrderRequest request) {
if (request != null) {
if (request.isValid()) {
if (request.getItems() != null && !request.getItems().isEmpty()) {
return createOrder(request);
}
}
}
return null;
}
// After
public Optional<Order> processOrder(OrderRequest request) {
if (request == null) return Optional.empty();
if (!request.isValid()) return Optional.empty();
if (request.getItems() == null || request.getItems().isEmpty()) return Optional.empty();
return Optional.of(createOrder(request));
}
Extract Helper Methods
Break complex logic into focused, well-named methods:
// Before
public BigDecimal calculateTotal(List<OrderItem> items, Customer customer) {
BigDecimal subtotal = items.stream()
.map(item -> item.getPrice().multiply(BigDecimal.valueOf(item.getQuantity())))
.reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal tax = subtotal.compareTo(BigDecimal.valueOf(100)) > 0
? subtotal.multiply(BigDecimal.valueOf(0.08))
: subtotal.multiply(BigDecimal.valueOf(0.05));
BigDecimal shipping = subtotal.compareTo(BigDecimal.valueOf(50)) < 0
? BigDecimal.valueOf(10)
: BigDecimal.ZERO;
return subtotal.add(tax).add(shipping);
}
// After
public BigDecimal calculateTotal(List<OrderItem> items, Customer customer) {
final BigDecimal subtotal = calculateSubtotal(items);
final BigDecimal tax = calculateTax(subtotal);
final BigDecimal shipping = calculateShipping(subtotal);
return subtotal.add(tax).add(shipping);
}
private BigDecimal calculateSubtotal(List<OrderItem> items) {
return items.stream()
.map(item -> item.getPrice().multiply(BigDecimal.valueOf(item.getQuantity())))
.reduce(BigDecimal.ZERO, BigDecimal::add);
}
private BigDecimal calculateTax(BigDecimal subtotal) {
final BigDecimal taxRate = subtotal.compareTo(MINIMUM_FOR_STANDARD_TAX) > 0
? STANDARD_TAX_RATE
: REDUCED_TAX_RATE;
return subtotal.multiply(taxRate);
}
private BigDecimal calculateShipping(BigDecimal subtotal) {
return subtotal.compareTo(FREE_SHIPPING_THRESHOLD) < 0
? SHIPPING_COST
: BigDecimal.ZERO;
}
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.
- 1mo ago First seen · 529 lines · 61 tokens per session scan A fcfc65881e69
java-refactor-expert is an agent published in the GitHub repository giuseppe-trisciuoglio/developer-kit (360 stars, last pushed 1mo ago), licensed MIT. It adds 61 tokens to every session and 3,630 once invoked, about $0.0002 per session on Opus 5.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-08-30.
Other agents, from other repositories
modernize-java
Upgrades Java projects to target versions (e.g., Java 21, Spring Boot 3.2) via incremental planning and execution. Use this agent for all Java upgrade requests.
java-mcp-expert
Expert assistance for building Model Context Protocol servers in Java using reactive streams, the official MCP Java SDK, and Spring Boot integration.
diffblue-cover
Expert agent for creating unit tests for java applications using Diffblue Cover.
csharp-reviewer
C# 14 / .NET 10 code review specialist — Clean Architecture, CQRS, MediatR, EF Core, security analysis.
symfony-reviewer
Symfony 8.1 / PHP 8.4+ (8.5 recommended) code review specialist — DDD, Doctrine, CQRS, API Platform.
rust-agent
Idiomatisk Rust-utvikling med cargo, clippy, error handling, async/tokio, unsafe og testing.