devkit.prompt-optimize
CommandProvides expert prompt optimization using advanced techniques (CoT, few-shot, constitutional AI) for LLM performance enhancement.…
Generates comprehensive JUnit 5 unit tests for Java classes with Mockito mocking and AssertJ assertions. Use when writing unit tests for service, controller, or utility classes.
> /plugin marketplace add giuseppe-trisciuoglio/developer-kit> /plugin install developer-kit@developer-kit
allowed-tools: Read, Edit, Write, Bash, Grep, Glob argument-hint: <class-file-path> description: Generates comprehensive JUnit 5 unit tests for Java classes with Mockito mocking and AssertJ assertions. Use when writing unit tests for service, controller, or utility classes. model: inherit
You are a Java testing expert specializing in JUnit 5, Mockito, and AssertJ. Generate comprehensive, maintainable unit tests following Spring Boot best practices.
Generates comprehensive JUnit 5 unit tests for Java classes with Mockito mocking and AssertJ assertions. Use when writing unit tests for service, controller, or utility classes.
/devkit.java.write-unit-tests $ARGUMENTS
| Argument | Description | |--------------|------------------------------------------| | `$ARGUMENTS` | Combined arguments passed to the command |
**Agent Selection**: To execute this task, use the following agent with fallback:
`spring-boot-test-patterns` skill
Read and analyze the Java class provided in the argument: `$1`
Identify:
Based on the class type, apply the relevant skill:
**For @Service classes**:
**For @RestController classes**:
**For mappers/converters**:
**For utility classes**:
**For validation logic**:
**For exception handlers**:
**For caching logic**:
**For scheduled/async tasks**:
**For security/authorization**:
**For external API clients**:
Create a test class following these conventions:
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import static org.mockito.Mockito.*;
import static org.assertj.core.api.Assertions.*;
@ExtendWith(MockitoExtension.class) class [ClassName]
Test {
@Mock
private [Dependency]dependency;
@InjectMocks
private [ClassName]classUnderTest;
// Test methods here
}For each public method, create tests covering:
**Happy path**:
@Test
void shouldReturnExpectedResult_whenValidInput() {
// Arrange
when(dependency.method()).thenReturn(expectedValue);
// Act
var result = classUnderTest.methodUnderTest(input);
// Assert
assertThat(result).isNotNull();
assertThat(result.getField()).isEqualTo(expectedValue);
verify(dependency).method();
}**Edge cases** (use skill: `unit-test-boundary-conditions`):
@Test
void shouldHandleNullInput() {
assertThatThrownBy(() -> classUnderTest.method(null))
.isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("must not be null");
}
@Test
void shouldHandleEmptyCollection() {
var result = classUnderTest.method(List.of());
assertThat(result).isEmpty();
}**Exception scenarios**:
@Test
void shouldThrowException_whenDependencyFails() {
when(dependency.method()).thenThrow(new RuntimeException("Error"));
assertThatThrownBy(() -> classUnderTest.methodUnderTest())
.isInstanceOf(ServiceException.class)
.hasRootCauseInstanceOf(RuntimeException.class);
}**Parameterized tests** (use skill: `unit-test-parameterized`):
@ParameterizedTest
@ValueSource(strings = {"valid1", "valid2", "valid3"})
void shouldAcceptValidInput(String input) {
var result = classUnderTest.validate(input);
assertThat(result).isTrue();
}Modular plugin marketplace for Claude Code and agentic CLIs, with validated, spec-driven skills, agents, commands, and workflows for Java, TypeScript, Python, PHP, AWS, and AI.
Provides expert prompt optimization using advanced techniques (CoT, few-shot, constitutional AI) for LLM performance enhancement.…
Provides guided feature development capability with codebase understanding and architecture focus. Use when implementing a new…
Provides guided bug fixing and debugging capability with systematic root cause analysis. Use when encountering bugs, errors, or…
Creates a GitHub pull request with branch creation, commits, and detailed description. Use when you need to submit changes for…
Provides comprehensive GitHub pull request review with code quality, security, and best practices analysis. Use when reviewing a…
Provides guided code refactoring capability with deep codebase understanding, compatibility options, and comprehensive…
Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.