Install
$ agentstack add skill-lugassawan-swe-workbench-language-java ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Java
Records and sealed types
Modern Java models data without boilerplate.
record Point(double x, double y) {}
sealed interface Shape permits Circle, Rectangle {}
record Circle(Point center, double radius) implements Shape {}
record Rectangle(Point topLeft, Point bottomRight) implements Shape {}
- Use
recordfor immutable data carriers — equals, hashCode, toString, and accessors for free. sealedcloses a hierarchy; exhaustiveswitchreplacesinstanceofchains.
double area = switch (shape) {
case Circle c -> Math.PI * c.radius() * c.radius();
case Rectangle r -> Math.abs(r.bottomRight().x() - r.topLeft().x())
* Math.abs(r.bottomRight().y() - r.topLeft().y());
};
Optional and null discipline
- Return
Optionalfrom methods that may have no result; never use it as a field or parameter type. Optionalis not a null check replacement — it signals "absence is a valid outcome."- Annotate parameters and fields with
@NonNull/@Nullablefor static analysis.
Optional find(String id) { ... }
find(id).map(User::email).orElseThrow(() -> new NotFoundException(id));
Concurrency — virtual threads (JDK 21+)
Virtual threads (Project Loom) make blocking-style IO safe at scale.
try (var scope = new StructuredTaskScope.ShutdownOnFailure()) {
Future user = scope.fork(() -> fetchUser(id));
Future order = scope.fork(() -> fetchOrder(orderId));
scope.join().throwIfFailed();
return new Response(user.get(), order.get());
}
Executors.newVirtualThreadPerTaskExecutor()— drop-in fornewCachedThreadPool()with virtual-thread semantics.- Do not pool virtual threads; create-per-task is the idiom.
- Watch for carrier-thread pinning:
synchronizedblocks and some native calls pin a virtual thread to its carrier. PreferReentrantLockwhen high-throughput blocking is expected. StructuredTaskScope(JDK 21–24 preview — not yet standard; enable with--enable-preview) enforces structured concurrency: tasks are joined before the scope exits.
Error handling
- Prefer unchecked exceptions at boundaries; translate checked exceptions from libraries early.
try-with-resourcesfor anythingAutoCloseable— never close in afinallyblock manually.- Exception translation: catch a library-specific exception at the boundary, rethrow as your domain exception.
try (var conn = dataSource.getConnection()) {
// ...
} catch (SQLException e) {
throw new RepositoryException("fetch user " + id, e);
}
Streams and collections
Streamfor transformations; avoid imperative loops when a pipeline is clearer..toList()(JDK 16+) overCollectors.toList()— returns an unmodifiable list.- Use
List.of,Map.of,Set.offor small immutable collections;Map.copyOfto defensively copy.
List emails = users.stream()
.filter(User::isActive)
.map(User::email)
.toList();
Build and packaging
- Maven:
pom.xmlwith `for BOM imports; prefer the wrapper (./mvnw`). - Gradle:
build.gradle(Groovy) orbuild.gradle.kts(Kotlin DSL — preferred for IDE support). - JPMS (
module-info.java): adopt only when publishing a library that needs strong encapsulation.
Tooling
- Imports/Format:
mvn spotless:apply/./gradlew spotlessApply - Lint:
mvn checkstyle:check/./gradlew checkstyleMain - Test:
mvn test/./gradlew test(see Testing below)
Testing
- JUnit 5 (
@Test,@ParameterizedTest,@MethodSource) — not JUnit 4. - AssertJ for fluent assertions:
assertThat(actual).isEqualTo(expected). - Mockito for external boundaries; do not mock domain objects.
@ParameterizedTest
@MethodSource("provideInputs")
void computesTax(double income, double expectedTax) {
assertThat(TaxCalculator.compute(income)).isCloseTo(expectedTax, within(0.01));
}
Avoid
- Raw types (
Listinstead ofList). - Returning or passing
nullwhereOptionalor a sentinel value communicates intent. - Mutable
staticstate outside of intentional singletons. equalswithout a matchinghashCodeoverride.- Blocking inside a reactive pipeline or
CompletableFuturechain.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: lugassawan
- Source: lugassawan/swe-workbench
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.