Performance Test K6 logo

Performance Test K6

Community
joe-qai
performance-test-k6

Use this skill when you need to generate executable k6 load/stress/spike/soak test scripts from API specs or business scenarios; triggers include k6, k6 性能测试, 生成k6脚本, k6脚本, and k6 performance testing.

Overview

Publisherjoe-qai
Repositoryqa-skills
Skill nameperformance-test-k6
Stars
30
Forks
4
Bundled files
15
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 15 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by joe-qai on GitHub. Read the source before you install it.

Installation

Install the Performance Test K6 AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/joe-qai/qa-skills/tree/main/performance-test-k6
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/joe-qai/qa-skills.git /tmp/qa-skills
mkdir -p .claude/skills
cp -r /tmp/qa-skills/performance-test-k6 .claude/skills/performance-test-k6
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Performance Test K6 in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Performance Test K6 on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Performance Test K6 is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

k6 性能测试

何时使用

  • 用户提供 API 接口或业务场景,需要生成可直接执行的 k6 测试脚本(.js)。
  • 需要对已有 k6 脚本做优化、扩展或结果分析。

输入要求

必填字段说明
✅目标接口/场景接口路径、方法、参数,或业务场景描述
✅测试类型load / stress / spike / soak / smoke(选一或多选)
⬜并发模型VU 数、RPS 目标、持续时长、阶段配置
⬜性能阈值响应时间 P95/P99、错误率上限
⬜测试数据请求体、参数化数据、登录凭证
⬜环境信息BASE_URL、环境名、网络条件

执行流程

1. 输入审计

  • 检查接口信息是否完整(路径、方法、参数、鉴权)
  • 检查测试类型是否匹配业务目标
  • 缺失信息标记为「假设」并给出默认值

2. 脚本生成

基于输入,复用 scripts/ 框架生成测试文件:

scripts/
├── config.js          # 已有:baseURL、阈值、示例数据(按需修改)
├── helpers.js         # 已有:get/post/assertOk/think 工具函数
├── tests/
│   ├── load.js        # 已有模板:按需生成新场景文件
│   ├── stress.js
│   ├── spike.js
│   ├── soak.js
│   └── api-smoke.js
└── tools/
    ├── summarize_k6.py    # 已有:汇总报告
    ├── compare_k6.py      # 已有:对比历史结果
    └── local_mock_server.py  # 已有:本地 mock

生成规则:

  • 新测试文件放在 tests/ 目录,命名 <场景>.js
  • 复用 helpers.js 的 get/post/assertOk/think 函数
  • 复用 config.js 的 common/thresholds/tags
  • 若用户场景与已有模板(load/stress/spike/soak/smoke)匹配,基于模板修改而非从零写

3. 脚本校验

生成后必须执行以下校验:

  • JS 语法正确(无未闭合括号、无 import 路径错误)
  • options 对象包含 scenarios 和 thresholds
  • 使用 helpers.js 的函数而非直接调用 http.*
  • 环境变量通过 __ENV 读取,无硬编码密钥
  • tags() 函数调用包含 testType 和 module 参数
  • threshold 阈值与用户要求一致(或标明默认值)

4. 输出交付物

文件内容
tests/<场景>.js可执行的 k6 测试脚本
run-test.sh一键执行命令
README.md脚本说明:场景、参数、执行方式

执行命令(自动写入 run-test.sh):

bash
# 基础执行
k6 run tests/<场景>.js

# 指定环境
BASE_URL=https://api.example.com ENV=staging k6 run tests/<场景>.js

# 导出汇总 JSON
K6_SUMMARY_EXPORT=summary.json k6 run tests/<场景>.js

5. 自检清单

  • 覆盖用户指定的测试类型(load/stress/spike/soak/smoke)
  • 每个接口有独立的 check 断言
  • 阈值设置合理(有默认值或用户指定)
  • 测试数据可获取(非硬编码)
  • 脚本可直接 k6 run 执行

核心约束

  • 输出必须是可执行的 .js 脚本,不是文档或方案。
  • 复用已有框架(config.js / helpers.js),不重写基础函数。
  • 默认只选最关键的 1~2 类场景,不要全做。
  • 密钥、Token 只用 __ENV 占位,禁止真实值。

参考文件

  • prompts/performance-test-k6.md:详细执行规范。
  • references/framework-spec.md:k6 框架结构说明。
  • scripts/:完整可复用的脚本框架。

常见误区

  • 只给方案不给脚本 → 必须输出可执行 .js。
  • 每次从零写全部脚本 → 复用已有模板和工具函数。
  • 默认全做基线/负载/压力/尖峰/稳定性 → 按优先级选 1~2 类。
  • 硬编码密钥 → 用 __ENV 占位。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Performance Test K6 AI skill do?

Use this skill when you need to generate executable k6 load/stress/spike/soak test scripts from API specs or business scenarios; triggers include k6, k6 性能测试, 生成k6脚本, k6脚本, and k6 performance testing.

Why use Performance Test K6 on TypingMind?

Because you install it once and use it with any model. Performance Test K6 is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Performance Test K6 in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/joe-qai/qa-skills/tree/main/performance-test-k6. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Performance Test K6?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Performance Test K6?

As many as you like. As long as a model supports skills, you can use Performance Test K6 with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Performance Test K6 AI skill free?

It is published on GitHub by joe-qai. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇