Initialize testing strategy file for this project
Creates interactive testing strategy configuration file for your project architecture.
/plugin marketplace add bengous/claude-code-plugins/plugin install claude-orchestration@bengous-pluginsarchitecture-typeInitialize .claude/testing-strategy.md for your project interactively.
Interactive mode (recommended for first time):
/setup-testing-strategy
Template mode (if you know your architecture):
/setup-testing-strategy hexagonal
/setup-testing-strategy clean
/setup-testing-strategy layered
This command helps you create a .claude/testing-strategy.md file that defines:
The layer-testing skill reads this file to understand how to test your project.
Check if .claude/testing-strategy.md already exists:
if [ -f .claude/testing-strategy.md ]; then
echo "Strategy file exists"
fi
If it exists:
⚠️ Testing strategy already exists: .claude/testing-strategy.md
Options:
1. View current strategy
2. Overwrite with new strategy
3. Cancel (keep existing)
What would you like to do?
Use AskUserQuestion tool to get choice.
If user chooses "View": Read and display the file, then exit. If user chooses "Cancel": Exit without changes. If user chooses "Overwrite": Continue to Step 2.
If argument provided (e.g., hexagonal):
If no argument (interactive mode):
Use AskUserQuestion to ask:
Question: What architecture pattern does your project use?
Header: Architecture
Options:
1. Hexagonal (Ports & Adapters)
Description: Core/domain, application (ports), infrastructure (adapters), boundary
2. Clean Architecture
Description: Entities, use cases, interface adapters, frameworks & drivers
3. Layered (3-tier)
Description: Presentation, business logic, data access
4. Custom
Description: I'll provide my own layer definitions
Store selected architecture.
Ask follow-up questions based on architecture:
For all architectures, ask:
Question: What testing framework do you use?
Header: Framework
Options:
1. Vitest
Description: Modern, fast, Vite-powered testing
2. Jest
Description: Popular, full-featured testing framework
3. Mocha + Chai
Description: Flexible testing with separate assertion library
4. Other
Description: Specify your test runner
Question: What do you use for database testing?
Header: Database
Options:
1. PGlite (in-memory PostgreSQL)
Description: Fast, real PostgreSQL for testing
2. SQLite in-memory
Description: Lightweight in-memory database
3. Test containers
Description: Docker containers for testing
4. Mock/no database
Description: Don't test with real database
For custom architecture, additionally ask:
Question: What are your layer names? (comma-separated)
Examples: "api,services,repositories" or "controllers,domain,data"
Based on architecture selection:
If hexagonal/clean/layered: Read template file:
PLUGIN_ROOT="$(realpath ~/.claude/plugins/marketplaces/*/orchestration 2>/dev/null || echo "${CLAUDE_PLUGIN_ROOT}")"
TEMPLATE="${PLUGIN_ROOT}/skills/layer-testing/templates/examples/${ARCHITECTURE}-strategy.md"
If custom: Use blank template:
TEMPLATE="${PLUGIN_ROOT}/skills/layer-testing/templates/testing-strategy-template.md"
Read the template file.
Replace placeholders in template with project-specific values:
[DATE] → Current date[hexagonal | clean | layered | custom] → Selected architectureVitest|Jest|Mocha → Selected test frameworkPGlite|SQLite|Testcontainers → Selected database approachFor custom architecture:
Create .claude/testing-strategy.md:
# Ensure .claude directory exists
mkdir -p .claude
# Write strategy file
cat > .claude/testing-strategy.md << 'EOF'
[Customized template content]
EOF
Verify file was created:
if [ -f .claude/testing-strategy.md ]; then
echo "✅ Created .claude/testing-strategy.md"
wc -l .claude/testing-strategy.md
fi
Show user what was created:
✅ Testing Strategy Created
Location: .claude/testing-strategy.md
Architecture: ${ARCHITECTURE}
Test Framework: ${FRAMEWORK}
Database Testing: ${DATABASE}
Content Summary:
- ${LAYER_COUNT} layers defined
- Coverage targets configured
- Testing patterns included
- Critical rules specified
Next Steps:
1. Review the file:
cat .claude/testing-strategy.md
2. Customize for your project:
- Adjust coverage targets
- Modify "what to test" patterns
- Add project-specific rules
3. Start testing:
/test-layer <module> <layer>
Or ask naturally:
"Test the core layer of my auth module"
The layer-testing skill will now use this strategy to guide testing.
Ask if user wants to see the generated file:
Would you like to see the generated testing strategy file?
If yes: Read and display .claude/testing-strategy.md
If no: Done
Template: skills/layer-testing/templates/examples/hexagonal-strategy.md
Layers:
Key patterns:
Template: skills/layer-testing/templates/examples/clean-strategy.md
Layers:
Key patterns:
Template: skills/layer-testing/templates/examples/layered-strategy.md
Layers:
Key patterns:
Template: skills/layer-testing/templates/testing-strategy-template.md
User defines their own layers, coverage targets, and patterns.
User: /setup-testing-strategy hexagonal
✅ Testing Strategy Created
Location: .claude/testing-strategy.md
Architecture: Hexagonal (Ports & Adapters)
Test Framework: Vitest
Database Testing: PGlite
Content Summary:
- 4 layers defined (core, application, infrastructure, boundary)
- Result<T,E> type guard patterns
- Contract testing for ports
- Quality gates specified
Next Steps: Review .claude/testing-strategy.md and customize for your project
User: /setup-testing-strategy
What architecture pattern does your project use?
> Hexagonal (Ports & Adapters)
What testing framework do you use?
> Vitest
What do you use for database testing?
> PGlite (in-memory PostgreSQL)
✅ Creating testing strategy...
✅ Testing Strategy Created
Location: .claude/testing-strategy.md
...
User: /setup-testing-strategy
What architecture pattern does your project use?
> Custom
What are your layer names? (comma-separated)
> api,services,repositories
What testing framework do you use?
> Jest
...
✅ Testing Strategy Created
You've created a custom strategy with:
- api layer
- services layer
- repositories layer
Please edit .claude/testing-strategy.md to:
- Define coverage targets for each layer
- Specify what to test vs skip
- Add testing patterns
"Can't find template files"
Cause: Plugin not installed or CLAUDE_PLUGIN_ROOT not set
Fix:
# Check plugin location
ls -la ~/.claude/plugins/marketplaces/*/orchestration/skills/layer-testing/templates/examples/
# Or check if in development
ls -la $CLAUDE_PLUGIN_ROOT/skills/layer-testing/templates/examples/
"Permission denied writing .claude/testing-strategy.md"
Cause: No write permission in current directory
Fix: Run from project root where you have write access
"Strategy file exists but is outdated"
Solution: Choose "Overwrite" option when prompted, or manually edit the file
/test-layer <module> <layer> - Use the strategy to test a layerls orchestration/skills/layer-testing/templates/examples/