Home / AI Integration / Claude Code Skill
Claude Code Skill¶
The ProTest skill for Claude Code teaches the AI assistant how to use ProTest's CLI to generate covering arrays directly from your codebase.
What It Does¶
When installed, the skill enables Claude Code to:
- Identify parameters and values from your code or context
- Recognize constraints (invalid combinations)
- Create
.cahttmodel files - Run ProTest's CLI to generate covering arrays
- Present results as actionable test cases
Installation¶
Option 1: Download the Skill File¶
- Download the skill file: protest-covering-arrays.md
-
Place it in your project's
.claude/commands/directory:your-project/ └── .claude/ └── commands/ └── protest-covering-arrays.md -
The skill is now available in Claude Code for that project.
Option 2: Copy and Paste¶
Create the file .claude/commands/protest-covering-arrays.md in your project with the following content:
Click to expand skill file content
---
name: protest-covering-arrays
description: Use when you need to systematically test combinations of parameters,
feature flags, configuration options, or input variations where interactions
between settings could cause failures
---
# ProTest -- Covering Array Generator
Generate minimal test matrices that cover all t-way parameter interactions.
A covering array guarantees every pair (or triple, etc.) of parameter values
appears in at least one test case, using far fewer cases than exhaustive testing.
Research shows nearly all software failures are caused by interactions between
2-6 parameters.
## When to Use
- Testing combinations of configuration options, feature flags, or input parameters
- 3+ parameters with multiple values each where exhaustive testing is impractical
- You want pairwise (2-way) or higher-order coverage guarantees
## How to Run
The CLI executable is `protest.exe`. Run it with:
protest generate -i model.cahtt -o results.csv
## Workflow
1. Identify parameters and their possible values from code or context
2. Identify constraints -- invalid combinations
3. Create a .cahtt model file (see format below)
4. Run: protest generate -i model.cahtt -o results.csv
5. Read results.csv -- each row is a test case
## Model File Format (.cahtt)
{
"Version": 1,
"GlobalOrder": 2,
"Parameters": [
{
"Name": "OS",
"Values": [
{ "Name": "Windows", "Weight": 1, "IsNegative": false },
{ "Name": "Linux", "Weight": 1, "IsNegative": false }
]
}
],
"ConstraintText": "IF [OS] = \"Windows\" THEN [Browser] <> \"Safari\";",
"Seeds": [],
"SubModels": []
}
## CLI Quick Reference
| Flag | Default | Purpose |
|------|---------|---------|
| -i, --input | required | Model file (.cahtt or .pict) |
| -o, --output | required | Output file; repeatable |
| --engine | from model | pict or sipo |
| --strength | from model (2) | T-way coverage strength |
| --trials | 1000/10000 | Parallel trials (best result kept) |
| --max-time | no limit | Seconds before stopping |
Usage Examples¶
Once installed, you can use the skill in Claude Code:
Analyze Feature Flags¶
"I have these feature flags in my app: darkMode (on/off), newCheckout (on/off), betaAPI (v1/v2/v3), cacheStrategy (memory/redis/none). Generate a covering array for testing."
Test API Parameters¶
"Look at the endpoint in
src/api/search.tsand generate a covering array for all the query parameter combinations."
Configuration Testing¶
"Generate test cases for the database connection options in
config/database.yml."
Requirements¶
- ProTest CLI must be installed and accessible (see Installation)
- Claude Code must have permission to run the CLI command