k6-load-testing – skill Lập trình cho agent AI
Skill kiểm thử tải k6 toàn diện cho API, trình duyệt và kiểm thử khả năng mở rộng. Viết kịch bản tải thực tế, phân tích kết quả và tích hợp với CI/CD.
Cài skill k6-load-testing bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/k6-load-testing-b6787.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /k6-load-testing – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/k6-load-testing-b6787.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $k6-load-testing – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/k6-load-testing-b6787.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /k6-load-testing – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/k6-load-testing-b6787.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /k6-load-testing – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
k6 Load Testing
Execution scope
Confirm exact target, environment, VU/request-rate/duration ceilings, window, stop conditions, downstream effects and test-data cleanup before load. Start at one VU; examples are not permission to stress a public endpoint. Cloud output requires authorization to upload results and incur charges. Checks alone do not fail a k6 run: add checks thresholds for asserted functional correctness. Fixtures must be nonempty and user allocation must match concurrency; modulo reuse can distort auth results.
Detailed Guide
Read [the detailed guide](references/detailed-guide.md) before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.
When to Use This Skill
- Use when you need to load test HTTP APIs, WebSocket endpoints, or browser scenarios
- Use when setting up performance regression tests in CI/CD
- Use when analyzing system behavior under various load conditions
- Use when comparing performance between code changes
- Use when validating SLA requirements and performance budgets
---
Examples
Example 1: Basic API Load Test
import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
vus: 50,
duration: '2m',
thresholds: {
http_req_duration: ['p(95)<500'],
http_req_failed: ['rate<0.01'],
},
};
export default function () {
const res = http.get('https://api.example.com/users');
check(res, {
'status is 200': (r) => r.status === 200,
'response time < 500ms': (r) => r.timings.duration < 500,
});
sleep(1);
}Example 2: Test with Authentication and Data Parameterization
import http from 'k6/http';
import { check } from 'k6';
import { SharedArray } from 'k6/data';
const users = new SharedArray('users', function () {
return JSON.parse(open('./users.json'));
});
export default function () {
const user = users[__VU % users.length];
const loginRes = http.post('https://api.example.com/login',
JSON.stringify({ email: user.email, password: user.password }),
{headers: {'Content-Type': 'application/json'}, timeout: '10s', redirects: 0}
);
if (!check(loginRes, {'login succeeded': r => r.status === 200})) return;
let token;
try { token = loginRes.json('access_token'); } catch (_) { return; }
if (typeof token !== 'string' || !token) return;
const headers = { 'Authorization': `Bearer ${token}` };
const res = http.get('https://api.example.com/profile', { headers });
check(res, { 'profile loaded': (r) => r.status === 200 });
}---
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Skill liên quan
- kaizen – Hướng dẫn cải tiến liên tục, phòng ngừa lỗi và chuẩn hóa. Dùng skill này khi người dùng…
- kimi-delegate – Giao tác vụ lập trình cho Kimi Code CLI (`kimi`) chỉ khi người dùng yêu cầu rõ ràng…
- kotlin – Hướng dẫn super-code theo ngôn ngữ cho Kotlin.
- kotlin-coroutines-expert – Các mẫu chuyên sâu về Kotlin Coroutines và Flow, bao gồm structured concurrency, xử lý…
- vendor-management – Dùng khi xem xét, chấm điểm hoặc kiểm toán quan hệ với nhà cung cấp SaaS/bên thứ ba…
- langchain-architecture – Làm chủ framework LangChain để xây dựng ứng dụng LLM phức tạp với agent, chain, memory…
- vpe-review – /c-level-agents:vpe-review [plan] — Rà soát kế hoạch ưu tiên thông lượng của VP of…
- learn – Giúp người dùng học một chủ đề qua kèm cặp thích ứng, lập kế hoạch bài học, luyện tập…