This test validates that the temporal-java.md skill works correctly when actually used in Claude Code to generate a Temporal application.
This is a real integration test that:
- ✅ Installs the skill in a test workspace (
.claude/skills/temporal-java.md) - ✅ Uses Claude Code to process a prompt that triggers the skill
- ✅ Generates a complete application using Claude Code with the skill
- ✅ Validates the generated code:
- Correct file structure
- All required files present
- Code compiles successfully
- Uses latest Temporal SDK version
- ✅ Optionally runs the application if Temporal server is available
Unlike a simple code validation test, this integration test:
- Tests the actual user workflow - how the skill will really be used
- Validates skill installation - ensures the skill file is correctly formatted
- Tests Claude Code integration - verifies Claude can parse and use the skill
- Validates end-to-end flow - from prompt to working application
- Catches skill formatting issues - ensures markdown is properly structured
test/skill-integration/
├── setup-test-workspace.sh # Creates test workspace with skill
├── run-integration-test.sh # Runs standard SDK integration test
├── run-spring-boot-test.sh # Runs Spring Boot integration test
├── test-spring-boot-prompt.txt # Prompt for Spring Boot test
├── run_claude_code.py # Invokes claude-code CLI for automation
├── automate_test.py.deprecated # Old API-based script (deprecated)
├── test-execution.sh # Execution test (runs worker/client)
├── .gitignore # Ignores generated workspaces
└── README.md # This file
Generated during standard test:
test-workspace/
├── .claude/
│ └── skills/
│ └── temporal-java.md # The skill being tested
├── test-prompt.txt # Prompt that triggers the skill
├── validate.sh # Validates structure and build
├── test-execution.sh # Tests actual execution
└── [generated code here] # Application created by Claude
Generated during Spring Boot test:
test-workspace-spring/
├── .claude/
│ └── skills/
│ └── temporal-java.md # The skill being tested
├── test-prompt.txt # Spring Boot specific prompt
├── validate.sh # Validates Spring Boot application
└── [generated Spring Boot app] # Spring Boot application with autoconfiguration
- Checks all required files exist
- Validates @SignalMethod pattern
- Verifies Temporal SDK dependency
- Compiles the project
- Temporal Management:
- Checks if running on port 7233
- Starts with
temporal server start-devif not running - Detects "address already in use" and proceeds if Temporal is accessible
- Only stops Temporal if we started it
- Worker: Starts in background, monitors startup
- Client: Executes workflow with test data
- Verification: Checks workflow completes successfully
- Cleanup: Stops worker, stops Temporal only if we started it
- Auto-cleanup: Uses trap to cleanup on exit/error
- claude-code CLI - Install with
npm install -g @anthropic-ai/claude-code - Anthropic API Key - Set as
ANTHROPIC_API_KEYenvironment variable - Python 3 (for test orchestration scripts)
- Java 11+ and Maven (for validation and building)
- Claude Code installed and configured
- Java 11+ and Maven (for validation and building)
- Temporal CLI installed:
Or follow: https://docs.temporal.io/cli
brew install temporal # macOS
The execution test will automatically start Temporal if it's not running using:
temporal server start-devThe automated test uses claude-code CLI to:
- Set up workspace - Creates
.claude/skills/with the temporal skill - Invoke claude-code - Runs
claude-code --cwd <workspace>with the test prompt - Auto-load skill - claude-code automatically loads skills from
.claude/skills/ - Generate files - claude-code creates files directly in the workspace using its file tools
- Validate - Runs compilation and structure checks on generated code
The automation script (run_claude_code.py):
- Invokes claude-code CLI with the workspace as working directory
- Pipes the test prompt to claude-code via stdin
- Streams claude-code output to console for visibility
- Reports success/failure based on exit code
This approach tests the actual user workflow - the same way real users interact with Claude Code.
Prerequisites:
- Install claude-code:
npm install -g @anthropic-ai/claude-code - Set API key:
export ANTHROPIC_API_KEY='your-api-key-here'
Run the test:
export ANTHROPIC_API_KEY='your-api-key-here'
cd test/skill-integration
./run-integration-test.shThis will:
- Set up the test workspace
- Invoke claude-code CLI with the test prompt
- claude-code auto-loads the skill and generates the complete application
- Validate structure and build
- Test execution with Temporal (optional, skippable)
- Report success or failure
To skip execution test:
export SKIP_EXECUTION=true
./run-integration-test.shIf claude-code is not installed: The script will provide installation instructions and exit.
Test the Spring Boot integration separately:
export ANTHROPIC_API_KEY='your-api-key-here'
cd test/skill-integration
./run-spring-boot-test.shThis tests that the skill correctly guides Claude to:
- Use Spring Boot Temporal starter dependency
- Configure Spring Boot parent in pom.xml
- Use Spring Boot annotations (@WorkflowImpl, @ActivityImpl)
- Create a Spring Boot application class with @SpringBootApplication
- Leverage Spring Boot autoconfiguration
Validation includes:
- Spring Boot parent configuration
- temporal-spring-boot-starter dependency
- Spring Boot application class
- Spring annotations on workflows/activities
- Successful Maven build
To run the generated Spring Boot app:
cd test-workspace-spring
mvn spring-boot:runNote: Spring Boot apps with workers run continuously. Press Ctrl+C to stop.
cd test/skill-integration
./setup-test-workspace.shcd test-workspace
# Open in your IDE with Claude Code, or use CLI:
claude-code .In Claude Code, send the content from test-prompt.txt:
Create a Temporal workflow that executes two activities. After the first activity
the workflow awaits a signal. When the signal is received it executes the second activity.
Use the temporal-java skill.
Requirements:
- Create a workflow with a signal method
- First activity processes initial data
- Workflow waits for a signal after first activity
- Second activity processes final data after signal received
- Create a Worker that registers the workflow and activities
- Create a Client that starts the workflow and sends the signal
- Use Maven for dependency management
- Use the latest Temporal Java SDK version
Package: io.temporal.hello
Claude Code will:
- Read the
temporal-java.mdskill - Fetch the latest Temporal SDK version
- Generate all required files following skill patterns
./validate.shThis validates:
- ✅ All required files are present
- ✅ Code structure matches expected layout
- ✅ pom.xml contains Temporal SDK dependency
- ✅ Project compiles successfully
./test-execution.shThis will:
- Check if Temporal server is running
- Start Temporal with
temporal server start-devif not running - Start the worker in background
- Execute the workflow via client
- Verify workflow completes successfully
- Clean up (stop worker, stop Temporal if we started it)
After Claude Code processes the prompt, you should see:
test-workspace/
├── pom.xml
└── src/main/java/io/temporal/hello/
├── Worker.java (or *Worker.java)
├── Client.java (or *Client.java)
├── workflows/
│ ├── [Workflow interface with @SignalMethod]
│ └── [Workflow implementation with signal handling]
└── activities/
├── [Activity interface with 2 activities]
└── [Activity implementation]
Key Features to Validate:
- Workflow has
@SignalMethodannotation - Workflow waits for signal between activities
- Client sends signal to workflow
- Activities are executed before and after signal
- ✅ Skill file is correctly placed in
.claude/skills/ - ✅ Skill file is readable by Claude Code
- ✅ Skill metadata is correct
- ✅ Claude Code successfully uses the skill
- ✅ All required files are generated
- ✅ File structure matches conventions
- ✅ Package names are correct
- ✅ Generated code compiles without errors
- ✅ Uses latest Temporal SDK version
- ✅ Follows patterns from the skill:
- Workflow interface/implementation
- Activity interface/implementation
- Activity options with timeouts/retries
- Worker registration
- Client invocation
- Proper logging configuration
- ✅ Worker starts successfully
- ✅ Workflow executes end-to-end
- ✅ Activities are invoked
- ✅ Results are correct
The validate.sh script checks:
# Structure validation
✓ Found pom.xml
✓ Found: src/main/java/io/temporal/hello/workflows/HelloWorldWorkflow.java
✓ Found: src/main/java/io/temporal/hello/workflows/HelloWorldWorkflowImpl.java
✓ Found: src/main/java/io/temporal/hello/activities/HelloWorldActivities.java
✓ Found: src/main/java/io/temporal/hello/activities/HelloWorldActivitiesImpl.java
✓ Found: src/main/java/io/temporal/hello/HelloWorldWorker.java
✓ Found: src/main/java/io/temporal/hello/HelloWorldClient.java
# Dependency validation
✓ pom.xml contains Temporal SDK dependency
✓ Using Temporal SDK version: 1.32.0
# Build validation
✓ Build successful!
# Optional: Execution test (if Temporal running)
✓ Temporal server is running
You can now test the application:
1. Start worker: mvn exec:java -Dexec.mainClass="io.temporal.hello.HelloWorldWorker"
2. Run client: mvn exec:java -Dexec.mainClass="io.temporal.hello.HelloWorldClient" -Dexec.args="YourName"Install claude-code:
npm install -g @anthropic-ai/claude-codeOr use npx without installation:
npx @anthropic-ai/claude-code- Get your API key from https://console.anthropic.com/
- Set it:
export ANTHROPIC_API_KEY='your-key'
- Check that claude-code CLI is working:
claude-code --help - Verify your API key is valid
- Check console output for claude-code errors
- Try running claude-code manually in the workspace directory
- Verify skill file is in
.claude/skills/temporal-java.md - Check skill file format (must be valid markdown)
- Try mentioning the skill explicitly in your prompt
- Check if Java 11+ is installed
- Verify Maven can download dependencies
- Review Claude's output for any errors
- Ensure Claude completed generating all files
- Check if any errors occurred during generation
- Try regenerating with a more explicit prompt
Once validation passes, you can test the actual application:
docker run -p 7233:7233 -p 8233:8233 temporalio/auto-setup:latestcd test-workspace
mvn exec:java -Dexec.mainClass="io.temporal.hello.HelloWorldWorker"cd test-workspace
mvn exec:java -Dexec.mainClass="io.temporal.hello.HelloWorldClient" -Dexec.args="World"You should see:
=================================
Hello, World!
=================================
For automated testing in CI/CD:
# Example GitHub Actions workflow
steps:
- name: Set up test workspace
run: |
cd test/skill-integration
./setup-test-workspace.sh
- name: Install Claude Code
run: |
# Install Claude Code CLI
# (implementation depends on your setup)
- name: Generate application
run: |
cd test/skill-integration/test-workspace
claude-code --prompt "$(cat test-prompt.txt)"
- name: Validate generated code
run: |
cd test/skill-integration/test-workspace
./validate.sh
- name: Start Temporal and test
run: |
docker run -d -p 7233:7233 temporalio/auto-setup:latest
sleep 10
cd test/skill-integration/test-workspace
# Run worker and client testsThe test passes if:
- ✅ Skill installs correctly in test workspace
- ✅ Claude Code successfully processes the prompt
- ✅ All required files are generated
- ✅ Generated code compiles without errors
- ✅ Code follows patterns from the skill
- ✅ (Optional) Application runs successfully
If this test passes, it proves:
- ✅ The skill file is correctly formatted for Claude Code
- ✅ Claude can parse and use the skill effectively
- ✅ The skill generates working code not just documentation
- ✅ The patterns in the skill are correct and compilable
- ✅ The skill is production-ready for real users
- ✅ The user workflow works end-to-end from skill to running app
This is the gold standard for skill validation!