This page documents the end-to-end integration test cases that verify complete workflow execution in Superpowers. These tests scaffold actual projects, execute implementation plans using the subagent-driven-development skill, and verify that the resulting code is functional, tested, and follows the specified workflow. Integration tests typically take between 10 and 30 minutes to complete as they involve real AI interactions and multi-step development cycles tests/claude-code/test-subagent-driven-development-integration.sh24-32
Additionally, this suite includes platform-specific integration tests for environments like Claude Code and OpenCode, verifying plugin loading, tool functionality, and skill priority resolution in isolated environments. It also covers the behavior of specific subagents, such as the code reviewer, by planting bugs and verifying detection.
For unit tests of individual skills without full execution, see 9.1 Test Suite Overview For the token usage analysis tools used by these tests, see 9.4 Testing Tools and Helpers
Integration tests differ from unit tests by executing actual AI-driven workflows rather than just verifying skill content. Each integration test follows a pattern: scaffold a project, execute the target logic via the platform CLI (Claude Code or OpenCode), verify results through assertions, and analyze consumption or protocol compliance.
The following diagram bridges the natural language requirements of a test into the code entities that manage the execution flow.
Natural Language Space to Code Entity Space
Sources: tests/claude-code/test-subagent-driven-development-integration.sh1-18 tests/opencode/test-plugin-loading.sh1-14 tests/opencode/test-priority.sh1-18 tests/opencode/setup.sh1-14
Claude Code integration tests verify the tool resolution logic and the subagent-driven-development (SDD) workflow in an isolated environment.
The test-subagent-driven-development-integration.sh script creates a temporary project using create_test_project tests/claude-code/test-subagent-driven-development-integration.sh36
package.json, src/, test/, and docs/superpowers/plans/ tests/claude-code/test-subagent-driven-development-integration.sh45-56docs/superpowers/plans/implementation-plan.md to test task isolation and subagent dispatch tests/claude-code/test-subagent-driven-development-integration.sh59-116The test executes claude with a specific prompt forcing the use of the SDD skill tests/claude-code/test-subagent-driven-development-integration.sh149-158 It uses the following flags for automation:
--allowed-tools=all: Enables tool usage in headless mode tests/claude-code/test-subagent-driven-development-integration.sh167--permission-mode bypassPermissions: Prevents interactive prompts during the test run tests/claude-code/test-subagent-driven-development-integration.sh167The test-helpers.sh script provides a suite of assertion functions to validate the AI's behavior by analyzing the session transcript tests/claude-code/test-helpers.sh1-124
| Function | Purpose |
|---|---|
run_claude | Executes Claude CLI with a prompt and optional timeout/tool-access tests/claude-code/test-helpers.sh6-29 |
assert_contains | Verifies specific text or patterns exist in the output tests/claude-code/test-helpers.sh33-48 |
assert_count | Ensures a tool (like Task or Skill) was called the expected number of times tests/claude-code/test-helpers.sh71-90 |
assert_order | Validates the sequence of events (e.g., spec review before code quality) tests/claude-code/test-helpers.sh94-123 |
Sources: tests/claude-code/test-subagent-driven-development-integration.sh1-167 tests/claude-code/test-helpers.sh1-124
OpenCode integration tests focus on plugin lifecycle, tool mapping, and skill priority resolution.
setup.sh)The tests/opencode/setup.sh script creates a hermetic environment for testing OpenCode plugins tests/opencode/setup.sh1-4:
HOME, XDG_CONFIG_HOME, and OPENCODE_CONFIG_DIR to a temporary directory tests/opencode/setup.sh9-14$OPENCODE_CONFIG_DIR/plugins/superpowers.js tests/opencode/setup.sh16-36test-priority.sh)This test verifies the three-tier priority system (Project > Personal > Superpowers) by creating duplicate skill names in all three locations and asserting which one is loaded tests/opencode/test-priority.sh20-63
Priority Resolution Data Flow
Sources: tests/opencode/test-priority.sh20-63 tests/opencode/setup.sh16-36
To monitor resource consumption and cost of integration tests, the script analyze-token-usage.py parses session transcripts tests/claude-code/analyze-token-usage.py1-6
The script distinguishes between:
agentId and including prompt descriptions for identification tests/claude-code/analyze-token-usage.py23-60It computes estimated costs in USD using common rates ($3 per million input tokens, $15 per million output tokens), assisting developers in optimizing test prompt designs tests/claude-code/analyze-token-usage.py76-81
Sources: tests/claude-code/analyze-token-usage.py1-81
| Command | Purpose |
|---|---|
./tests/claude-code/test-subagent-driven-development-integration.sh | Executes full SDD workflow integration test tests/claude-code/test-subagent-driven-development-integration.sh1-15 |
./tests/opencode/run-tests.sh --integration | Runs OpenCode integration tests including tool and priority checks tests/opencode/run-tests.sh24-75 |
./tests/claude-code/test-worktree-native-preference.sh all | Verifies preference for native tools in worktree workflows tests/claude-code/test-worktree-native-preference.sh143-178 |
python3 tests/claude-code/analyze-token-usage.py <session.jsonl> | Analyzes token usage and cost of a session tests/claude-code/analyze-token-usage.py84-88 |
Integration tests output results to the console, with failures providing snippets of the session logs. For OpenCode, the run-tests.sh runner captures output and reports duration per test tests/opencode/run-tests.sh123-141
Sources: tests/claude-code/test-subagent-driven-development-integration.sh1-32 tests/opencode/run-tests.sh1-166 tests/claude-code/analyze-token-usage.py83-168 tests/claude-code/test-worktree-native-preference.sh1-20
Refresh this wiki