npx claudepluginhub kimdoubleb/grafana-k6-skills --plugin k6This skill uses the workspace's default tool permissions.
Analyze an existing API codebase to automatically generate k6 load test scripts. Detects endpoints, authentication patterns, request/response shapes, and generates comprehensive test suites.
Build API test suites — endpoint testing, contract testing, load testing for REST/GraphQL/gRPC APIs. Use when asked to "test this API", "API tests", "endpoint testing", "contract tests", or "load test".
Generates k6, Artillery, wrk scripts for API load/stress/soak tests to validate performance, identify bottlenecks, and establish baselines under configurable loads.
Guides k6 load testing for APIs, WebSockets, browsers; writes scenarios (smoke/load/stress/spike/soak), sets thresholds, analyzes results, integrates with CI/CD.
Share bugs, ideas, or general feedback.
Analyze an existing API codebase to automatically generate k6 load test scripts. Detects endpoints, authentication patterns, request/response shapes, and generates comprehensive test suites.
Follow this workflow strictly in order:
Before analyzing routes, always detect the authentication mechanism first.
Scan for auth middleware/decorators:
Extract the authentication flow:
Generate k6 auth setup:
setup() function for authenticationdefault() functionSee reference/auth-analysis.md for auth detection patterns per framework.
Scan route definitions:
Extract request/response shapes:
Categorize endpoints:
See reference/framework-patterns.md for framework-specific analysis patterns.
Map endpoints to test scenarios:
Design realistic user flows:
Generate the k6 test script with:
setup() for authenticationdefault() with grouped endpoint callsapp.get(), router.get(), route filesfastify.get(), route plugins, schemas@Controller(), @Get(), @Post() decorators, Guards@RestController, @GetMapping, @PostMapping, @RequestMapping, Security config@app.get(), @router.get(), Pydantic models, Depends()ViewSet, @api_view, urlpatterns, permissionsThe generated script should follow this structure:
import http from 'k6/http';
import { check, group, sleep } from 'k6';
import { SharedArray } from 'k6/data';
// Test data (if applicable)
const testData = new SharedArray('data', function () {
return JSON.parse(open('./test-data.json'));
});
export const options = {
scenarios: { /* ... */ },
thresholds: { /* ... */ },
};
// Authentication setup
export function setup() {
// Login and return auth token/session
}
// Main test function
export default function (data) {
const headers = {
'Content-Type': 'application/json',
'Authorization': `Bearer ${data.token}`,
};
group('Resource A', () => {
// CRUD operations for Resource A
});
group('Resource B', () => {
// CRUD operations for Resource B
});
sleep(1);
}
export function teardown(data) {
// Cleanup if needed
}
/k6:generating-api-load-tests/k6:designing-test-scenarios/k6:generating-tests-from-openapi