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.
npx skills add softspark/ai-toolkit --skill java-rulesgit clone --depth 1 https://github.com/softspark/ai-toolkitWrote 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/skills/softspark/ai-toolkit/java-rules)<a href="https://agentmods.dev/skills/softspark/ai-toolkit/java-rules"><img src="https://agentmods.dev/badge/skills/softspark/ai-toolkit/java-rules.svg" alt="Measured on agentmods" 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.00046 | $0.02847 |
| Opus 5 | $0.00023 | $0.01424 |
| Sonnet 5 | $0.00009 | $0.00569 |
| Haiku 4.5 | $0.00005 | $0.00285 |
Grade A, and why
java-rules 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.
How it starts
The opening of the file, as written. The whole thing — 274 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Java Rules
These rules come from app/rules/java/ in ai-toolkit. They cover
the project's standards for coding style, frameworks, patterns,
security, and testing in Java. Apply them when writing or
reviewing Java code.
Java Coding Style
Naming
- PascalCase: classes, interfaces, enums, records, annotations.
- camelCase: methods, variables, parameters.
- UPPER_SNAKE: constants (
static final). - Package names: lowercase, dot-separated, reverse domain (
com.company.project). - No Hungarian notation. No
Iprefix on interfaces.
Modern Java (17+)
- Use
recordfor immutable data carriers. No need for Lombok in most cases. - Use
sealedclasses/interfaces for restricted hierarchies. - Use pattern matching:
if (obj instanceof String s)instead of cast. - Use
switchexpressions with arrow syntax and exhaustiveness. - Use text blocks (
""") for multiline strings (SQL, JSON, HTML).
Types
- Use
varfor local variables when the type is obvious from the right-hand side. - Use
Optional<T>for return types that may be absent. Never for fields or params. - Prefer
List.of(),Map.of(),Set.of()for immutable collections. - Use
Streamfor collection transformations. Avoid streams for simple iterations.
Classes
- Prefer composition over inheritance. Use interfaces for abstraction.
- Keep classes focused: single responsibility.
- Use
finalon classes not designed for extension. - Use
privateconstructors + static factory methods for controlled instantiation. - Records over POJOs for value types. Lombok only if records are insufficient.
Methods
- Max 20-30 lines per method. Extract when longer.
- Use
@Overrideon every overridden method. - Return empty collections over
null. UseCollections.emptyList()orList.of(). - Avoid checked exceptions for programming errors. Use runtime exceptions.
Formatting
- Use project formatter (Google Java Format or IDE-configured).
- Use
@SuppressWarningssparingly and with specific warning names. - Use
finalfor parameters and local variables where practical.
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.
- 3d ago First seen · 274 lines · 46 tokens per session scan A 02fb15f89242
java-rules is a skill published in the GitHub repository softspark/ai-toolkit (170 stars, last pushed 2d ago), licensed Apache-2.0. It adds 46 tokens to every session and 2,847 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.
Other skills, from other repositories
go-code-reviewer
Review Go code with a defect-first approach using repository policy (constitution.md first, then AGENTS.md fallback). Use for code review, PR review, quality checks, risk analysis, and regression detection.
go-review-lead
Orchestrate a comprehensive Go code review by triaging code changes, dispatching vertical review skills (security, concurrency, error, logic, performance, quality, test, observability) as parallel agents, then consolidating results into a unified report. Use for full Go PR review or comprehensive code review. Replaces…
go-concurrency-review
Review Go code for concurrency safety and goroutine lifecycle issues including race conditions, deadlocks, goroutine leaks, mutex misuse, and context propagation. Trigger when code contains go func, channels, sync primitives, WaitGroup, errgroup, or goroutine lifecycle management. Use for concurrency-focused review of…
go-error-review
Review Go code for error handling correctness, nil safety, and failure-path integrity including ignored errors, missing wrapping, panic misuse, SQL/HTTP resource lifecycle, and transaction patterns. Trigger when code contains error returns, panic calls, sql.Rows, transactions, HTTP client/server code, or nil-sensitive…
go-logic-review
Review Go code for business logic correctness, boundary conditions, off-by-one errors, state management, data flow integrity, and return value contracts. Trigger on any Go code change that modifies behavior, conditional logic, state transitions, or data processing. Use for logic-correctness focused review.
go-performance-review
Review Go code for performance issues including slice/map pre-allocation, string concatenation, N+1 queries, connection pool configuration, sync.Pool, memory alignment, lock scope, buffered I/O, and HTTP transport tuning. Trigger when code contains make(), loops, database queries, string building, sync primitives…