CtrlK
BlogDocsLog inGet started
Tessl Logo

131-java-testing-unit-testing

Use when you need to review, improve, or write Java unit tests — including migrating from JUnit 4 to JUnit 5, adopting AssertJ for fluent assertions, structuring tests with Given-When-Then, ensuring test independence, applying parameterized tests, mocking dependencies with Mockito, verifying boundary conditions (RIGHT-BICEP, CORRECT, A-TRIP), leveraging JSpecify null-safety annotations, or eliminating testing anti-patterns such as reflection-based tests or shared mutable state. This should trigger for requests such as Review Java code for unit tests; Apply best practices for unit tests in Java code. Part of cursor-rules-java project

67

Quality

Does it follow best practices?

Impact

No eval scenarios have been run

SecuritybySnyk

Passed

No known issues

SKILL.md
Quality
Evals
Security

Quality

Content

70%

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

Well-structured body with a clear, validated workflow and good single-level reference disclosure. Weaker on conciseness (redundancy between Constraints and Workflow) and actionability (test-writing guidance is abstract and deferred without inline examples).

Suggestions

Remove the redundant compile/verify bullets from the Constraints section since the Workflow already specifies them, or vice versa.

Add one or two short inline good/bad test snippets (e.g. a JUnit 5 + AssertJ example) so the body is actionable without forcing a reference read.

Drop the 'When to use this skill' section since it duplicates the frontmatter description triggers.

DimensionReasoningScore

Conciseness

Mostly efficient and well-organized, but the Constraints section repeats the compile/verify commands already stated in the Workflow, and 'When to use this skill' duplicates the description's triggers, so it could be tightened.

2 / 3

Actionability

Provides concrete executable commands ('./mvnw compile', 'mvn clean verify') and a specific reference path, but the core test-writing guidance ('Implement or refactor tests using JUnit 5, AssertJ, Mockito...') is abstract with no inline examples.

2 / 3

Workflow Clarity

A clear 4-step sequence with explicit validation checkpoints and a feedback loop: 'Run ./mvnw compile ... stop immediately if compilation fails' and 'Run ./mvnw clean verify after applying improvements'.

3 / 3

Progressive Disclosure

A concise overview with a single, clearly signaled one-level-deep reference (references/131-java-testing-unit-testing.md, verified to exist), referenced in both the Workflow and the Reference section, with well-organized sections for easy navigation.

3 / 3

Total

10

/

12

Passed

Description

90%

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

A strong, highly specific description with explicit trigger guidance and a clear niche. The only weakness is the second-person 'Use when you need to...' voice, which costs a specificity point under the rubric's voice rule.

Suggestions

Rewrite in third person to avoid the second-person 'Use when you need to review...'; e.g. 'Use when reviewing, improving, or writing Java unit tests — including...'.

Trim the lengthy enumerated capability list to the most common triggers to reduce verbosity while keeping distinctiveness.

DimensionReasoningScore

Specificity

Lists many concrete actions ('migrating from JUnit 4 to JUnit 5, adopting AssertJ for fluent assertions, structuring tests with Given-When-Then, ... mocking dependencies with Mockito'), which would be a 3, but the phrasing 'Use when you need to review...' is second person, so specificity is reduced by 1 per the voice guideline.

2 / 3

Completeness

Clearly answers both what (review/improve/write Java unit tests plus enumerated capabilities) and when via an explicit 'Use when...' clause and a 'This should trigger for requests such as...' trigger list.

3 / 3

Trigger Term Quality

Includes natural user phrasings via 'This should trigger for requests such as Review Java code for unit tests; Apply best practices for unit tests in Java code', giving good coverage of terms users would actually say.

3 / 3

Distinctiveness Conflict Risk

The Java unit-testing niche with JUnit 5/AssertJ/Mockito/JSpecify and named methodologies (RIGHT-BICEP, A-TRIP) is a clear, distinct trigger set unlikely to conflict with other skills.

3 / 3

Total

11

/

12

Passed

Validation

100%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation16 / 16 Passed

Validation for skill structure

No warnings or errors.

Repository
jabrena/cursor-rules-java
Reviewed

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.