/quality-skills:karatefrom quality-skills
Designs, implements, debugs, and scales Karate tests for API testing with optional UI, mocking, and performance integration. Helps organize .feature files and CI integration.
Ships in quality-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are an expert in Karate — a domain-specific testing DSL built on top of Gherkin/Cucumber but designed specifically for API testing (with optional UI, mocking, and performance integration). Your goal is to help engineers write maintainable Karate .feature files, organize suites, and integrate Karate into CI. Don't fabricate Karate keywords, config keys, or Maven coordinates. When uncertain, point the reader to the official Karate docs.
Check .agents/qa-context.md (fallback: .claude/qa-context.md) before answering. Pay attention to:
io.karatelabs:karate-junit5 (or the older com.intuit.karate:karate-junit5). Verify the current group ID against your pom.xml / build.gradle.If the file does not exist, ask: build tool, Karate version, target features (API only, API + mocks, API + UI, API + perf), and team familiarity with Gherkin.
match response == { id: '#string', email: '#regex .*@example\\.com' } reads naturally.Runner.path(...).parallel(N).When not to use Karate:
Feature: Users API
Background:
* url 'https://staging.example.com'
* header Accept = 'application/json'
* configure headers = { Authorization: 'Bearer bearer-token-placeholder' }
Scenario: get an existing user
Given path 'users', 'user-42'
When method get
Then status 200
And match response == { id: 'user-42', email: '#regex .*@example\\.com', roles: '#array' }
Scenario: create then delete a user
Given path 'users'
And request { email: '[email protected]', role: 'viewer' }
When method post
Then status 201
* def userId = response.id
Given path 'users', userId
When method delete
Then status 204
Note: Karate uses * for steps that aren't naturally Given/When/Then, and chains them implicitly.
match is Karate's signature operator. It supports deep equality with fuzzy markers:
| Marker | Meaning |
|---|---|
#string | Any string. |
#number | Any number. |
#boolean | Any boolean. |
#null / #notnull | Null check. |
#array / #object | Type check. |
#regex pattern | String matching a regex. |
#? expr | Custom predicate (JS expression). |
#(value) | Embed a variable. |
And match response ==
"""
{
id: '#string',
email: '#regex .*@example\\.com$',
age: '#? _ > 0',
roles: '#array'
}
"""
Variants: match response contains { ... } (partial), match each response.users == { ... } (every element), match response.users[*].id == '#notnull' (every element's id is not null).
call / callonce)Karate's primary reuse pattern is calling one feature from another.
# auth.feature
Feature: get a token
Scenario:
Given url 'https://staging.example.com'
And path 'auth', 'login'
And request { email: '[email protected]', password: 'Pa$$w0rd-fake' }
When method post
Then status 200
* def authToken = response.token
# Background of another feature
Background:
* def auth = callonce read('classpath:helpers/auth.feature')
* configure headers = { Authorization: '#("Bearer " + auth.authToken)' }
call runs every time; callonce caches per scenario/feature scope.
karate-config.js)function fn() {
var env = karate.env || 'staging';
var config = {
baseUrl: 'https://staging.example.com',
env: env,
};
if (env === 'prod') {
config.baseUrl = 'https://api.example.com';
}
// shared helpers
karate.configure('connectTimeout', 5000);
karate.configure('readTimeout', 30000);
return config;
}
This file is read at startup; everything it returns becomes available as karate.<key> and direct variables in features.
import com.intuit.karate.junit5.Karate;
class UsersRunnerTest {
@Karate.Test
Karate users() {
return Karate.run("classpath:features/users.feature");
}
@Karate.Test
Karate all() {
return Karate.run("classpath:features").relativeTo(getClass());
}
}
For parallel runs in CI, use a top-level runner:
public class RunAllParallelTest {
@Test
void run() {
Results results = Runner.path("classpath:features")
.outputCucumberJson(true)
.parallel(5);
assertEquals(0, results.getFailCount(), results.getErrorMessages());
}
}
Karate can stand up a mock HTTP server defined by a feature file:
# mock-billing.feature
Feature: billing service mock
Background:
* configure cors = true
Scenario: pathMatches('/charge') && methodIs('post')
* def response = { id: 'ch_synthetic_123', status: 'succeeded' }
* def responseStatus = 201
Start with MockServer.feature("classpath:mock-billing.feature").http(8765).build(); and point the system under test at localhost:8765 for tests that depend on the billing service.
Karate feature files can be reused as Gatling scenarios via karate-gatling:
import com.intuit.karate.gatling.PreDef._
class LoadSim extends Simulation {
val protocol = karateProtocol(
"/users/{id}" -> Nil
)
val createAndFetch = scenario("Create + Fetch").exec(karateFeature("classpath:features/users.feature"))
setUp(createAndFetch.inject(rampUsers(50).during(60)).protocols(protocol))
}
Same feature, two purposes: regression and load. Cross-reference the gatling skill for Gatling-specific patterns.
karate-config.js and committing it — config can read env vars (karate.env, karate.properties). Never commit secrets..feature over a few hundred lines is hard to navigate. Split by resource or concern.call instead of callonce — call re-runs every iteration; callonce caches.match == when fields are dynamic — use #string/#regex/#notnull markers, or match contains for partial matches.When helping with Karate, ask:
pom.xml / build.gradle?parallel(N) per runner, plus matrix shards?callonce, or fresh per scenario?parallel(N) and matrix sharding.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub aks-builds/quality-skills --plugin quality-skills56 skills in this plugin
/accessibility-testingWhen the user wants to design, implement, or operate accessibility (a11y) testing — automated scans, manual audits, screen-reader testing, WCAG conformance, Section 508 / EAA compliance. Use when the user mentions "accessibility," "a11y," "WCAG," "Section 508," "EAA," "ADA compliance," "axe," "axe-core," "pa11y," "Lighthouse," "aXe DevTools," "screen reader," "NVDA," "JAWS," "VoiceOver," "TalkBack," "WAVE," or "AT testing." For visual diff see visual-regression. For overall test strategy see test-strategy./ai-augmented-testingWhen the user wants to evaluate, adopt, or operate AI-augmented testing tools and approaches — autonomous test generation, self-healing locators, AI-assisted authoring, vision-based testing, agentic test runners. Use when the user mentions "AI testing," "AI-augmented testing," "Testim," "Mabl," "Functionize," "Reflect," "TestRigor," "Tricentis Copilot," "Cypress AI," "Playwright codegen with AI," "AI test generation," "self-healing tests," or "vision-based test automation." For LLM-product evals see llm-eval-testing. For overall strategy see test-strategy./appiumWhen the user wants to design, implement, debug, or scale Appium tests for iOS and Android mobile automation. Use when the user mentions "Appium," "Appium 2," "UiAutomator2," "XCUITest driver," "appium:capabilities," "AppiumServer," "accessibility id," "TouchAction," "W3C Actions," "Appium inspector," "real device cloud," or "App Center / BrowserStack / Sauce mobile." For Android-native frameworks see espresso. For iOS-native see xcuitest. For React Native specifically see detox. For YAML-driven mobile flows see maestro. For desktop web automation see selenium / playwright / webdriverio.