Skip to content
Development
Command

/context-load-testing-java

Load comprehensive Java testing documentation with project-specific analysis and adaptive context loading

From plugin
claude-cmd
313180 skills180 commands

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/context-load-testing-java

Context preview

What this command does when you run it.

Load comprehensive Java testing documentation with project-specific analysis and adaptive context loading

Command definition

context-load-testing-java.md
allowed-tools: WebFetch, mcp__context7__resolve-library-id, mcp__context7__get-library-docs, Bash(fd:*), Bash(rg:*), Bash(gdate:*), Bash(jq:*), Bash(wc:*), Read, Write, Task
name: "Context Load Testing Java"
description: "Load comprehensive Java testing documentation with project-specific analysis and adaptive context loading"
author: "wcygan"
tags: ["context","testing"]
version: "1.0.0"
created_at: "2025-07-14T00:00:00Z"
updated_at: "2025-07-14T00:00:00Z"

Context

  • Session ID: !`gdate +%s%N`
  • Current directory: !`pwd`
  • Java projects detected: !`fd "(pom\.xml|build\.gradle|build\.gradle\.kts)$" . -d 3 | wc -l | tr -d ' ' || echo "0"`
  • Build tools: !`fd "(pom\.xml|build\.gradle|build\.gradle\.kts)$" . -d 3 | head -5 || echo "No build files found"`
  • Test directories: !`fd "test" . -t d | head -10 || echo "No test directories found"`
  • JUnit version indicators: !`rg "junit" . --type xml --type gradle --type kotlin | wc -l | tr -d ' ' || echo "0"`
  • Spring Boot indicators: !`rg "@SpringBootTest|@WebMvcTest|@DataJpaTest" . --type java | wc -l | tr -d ' ' || echo "0"`
  • Quarkus indicators: !`rg "@QuarkusTest|quarkus" . --type java --type xml --type gradle | wc -l | tr -d ' ' || echo "0"`
  • Mockito usage: !`rg "@Mock|@MockBean|Mockito" . --type java | wc -l | tr -d ' ' || echo "0"`
  • Testcontainers usage: !`rg "@Testcontainers|TestcontainersExtension" . --type java | wc -l | tr -d ' ' || echo "0"`
  • Existing test files: !`fd "\.java$" . | rg "(Test|Spec)\.java$" | wc -l | tr -d ' ' || echo "0"`
  • Git repository: !`git rev-parse --is-inside-work-tree 2>/dev/null && echo "Yes" || echo "No"`

Your Task

STEP 1: Initialize Java testing context session

  • CREATE session state file: `/tmp/java-testing-context-$SESSION_ID.json`
  • SET initial state:
  {
    "sessionId": "$SESSION_ID",
    "timestamp": "ISO_8601_TIMESTAMP",
    "phase": "initialization",
    "project_analysis": {
      "build_tool": "auto-detect",
      "java_framework": "auto-detect",
      "testing_maturity": "unknown",
      "existing_test_patterns": []
    },
    "documentation_sources": {},
    "context_focus_areas": [],
    "recommendations": [],
    "checkpoints": []
  }
  • CREATE context workspace: `/tmp/java-testing-context-$SESSION_ID/`
  • INITIALIZE project analysis for Java testing framework detection

STEP 2: Java project analysis and testing framework detection

  • ANALYZE detected build tools and Java project structure from Context section
  • DETERMINE primary testing frameworks and maturity level:
  • **Enterprise**: Multiple frameworks, Spring Boot/Quarkus, Testcontainers, >50 test files
  • **Moderate**: JUnit 5, some integration testing, 10-50 test files
  • **Basic**: JUnit 4/5, unit tests only, <10 test files
  • IDENTIFY testing gaps and improvement opportunities
  • ASSESS current testing patterns and anti-patterns

CASE detected_testing_maturity: WHEN "enterprise":

  • SET complexity_level = "enterprise"
  • ENABLE comprehensive documentation loading with sub-agents
  • FOCUS on advanced patterns, performance testing, CI/CD integration

WHEN "moderate":

  • SET complexity_level = "moderate"
  • USE focused documentation loading with extended thinking
  • Think harder about optimal testing strategies for detected Java framework
  • PRIORITIZE integration testing, mocking patterns, test organization

WHEN "basic":

  • SET complexity_level = "basic"
  • PROCEED with fundamental testing documentation
  • EMPHASIZE JUnit basics, assertion patterns, test structure

STEP 3: Adaptive documentation loading strategy

TRY:

IF complexity_level == "enterprise":

  • USE Task tool to delegate parallel documentation loading:

1. **JUnit Advanced Agent**: JUnit 5 extensions, parameterized tests, dynamic tests

  • LOAD: `https://junit.org/junit5/docs/current/user-guide/`
  • SAVE findings to: `/tmp/java-testing-context-$SESSION_ID/junit-advanced.json`

2. **Integration Testing Agent**: Testcontainers, database testing, API testing

  • LOAD: `https://testcontainers.com/`
  • LOAD: Spring Boot Testing Guide
  • SAVE findings to: `/tmp/java-testing-context-$SESSION_ID/integration-testing.json`

3. **Mocking & Stubbing Agent**: Mockito, WireMock, test doubles

  • LOAD: `https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html`
  • SAVE findings to: `/tmp/java-testing-context-$SESSION_ID/mocking-patterns.json`

4. **Framework Testing Agent**: Spring Boot/Quarkus specific testing

  • LOAD framework-specific testing documentation
  • SAVE findings to: `/tmp/java-testing-context-$SESSION_ID/framework-testing.json`

5. **Performance & Quality Agent**: Performance testing, test optimization

  • LOAD: Testing performance patterns and quality metrics
  • SAVE findings to: `/tmp/java-testing-context-$SESSION_ID/performance-testing.json`

ELSE IF complexity_level == "moderate":

  • EXECUTE focused documentation loading with extended thinking:
  • Think harder about optimal testing strategies for detected Java framework
  • LOAD core documentation sources:

1. **JUnit 5 Documentation**: Annotations, assertions, lifecycle 2. **Mockito Documentation**: Mocking patterns and best practices 3. **Framework-Specific Testing**: Spring Boot OR Quarkus testing guides 4. **Integration Testing**: Basic Testcontainers and database testing

  • FOCUS on practical implementation patterns and common pitfalls

ELSE:

  • PERFORM streamlined documentation loading:
  • LOAD essential testing documentation:

1. **JUnit Basics**: Core annotations, assertions, test structure 2. **Mockito Fundamentals**: Basic mocking and verification 3. **Testing Best Practices**: Test naming, organization, maintainability

  • PRIORITIZE getting-started examples and fundamental patterns

CATCH (documentation_fetch_failed):

  • LOG failed sources to session state
  • CONTINUE with available documentation
  • PROVIDE manual context loading instructions for failed sources
  • SAVE fallback documentati
Read more
Ships withclaude-cmd

A lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.

Get the whole plugin