[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KWBW38TP89FYJBW9ZZD0G7":3,"skill-same:01M6KWBW38TP89FYJBW9ZZD0G7":53},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":28,"linkOnly":29,"markdownContent":30,"markdownBody":30,"frontMatter":31,"refName":32,"commitSha":33,"skillDirectory":34,"forksCount":13,"repositoryHtmlUrl":35,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M6KWBW38TP89FYJBW9ZZD0G7","k6-performance-testing",null,"rafsanulhasan\u002FHypermediaEngine","rafsanulhasan","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2341142?v=4","01M6KW2HWPTZWK051N7B0HTBVG","Rafsanul Hasan","01M6KW2J0N3613382MF5DRN79H",0,"GPL-3.0","https:\u002F\u002Fgithub.com\u002Frafsanulhasan\u002FHypermediaEngine\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fk6-performance-testing\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[23,24,25,26,27],"testing","performance","performance testing","k6","k6 performance testing","2026-11-10 10:12:30",false,"# Skill: k6 Performance Testing\n\n## When to Use\nInvoke this skill when the task is to validate that a system meets its SLOs under **normal operating conditions** — expected concurrency and throughput levels. This is the baseline test type. It answers: \"Does the system perform acceptably at its typical production load?\"\n\nThis skill covers: average-load tests, smoke tests, and baseline performance validation. It does NOT cover stress or soak scenarios (use `k6-stress-testing` or `k6-load-testing` for those).\n\n## Prerequisites\n- k6 installed: `winget install Grafana.k6` (Windows) or `brew install k6` (macOS\u002FLinux)\n- Node.js not required — k6 uses its own JS runtime\n- System under test must be running and accessible\n\n## Test Script Structure\n\n### Mandatory Lifecycle Hooks\n```javascript\n\u002F\u002F ─── INIT (runs once per VU — no HTTP allowed) ───────────────────────────────\nimport http from 'k6\u002Fhttp';\nimport { check, sleep } from 'k6';\nimport { SharedArray } from 'k6\u002Fdata';\n\nexport const options = {\n  \u002F\u002F VU-based or scenario-based configuration goes here\n  thresholds: { \u002F* SLO pass\u002Ffail criteria *\u002F },\n};\n\n\u002F\u002F ─── SETUP (runs once before VUs start — HTTP allowed) ───────────────────────\nexport function setup() {\n  \u002F\u002F auth token retrieval, warm-up, etc.\n  return { \u002F* JSON-serializable data only *\u002F };\n}\n\n\u002F\u002F ─── VU CODE (loops per VU per iteration) ────────────────────────────────────\nexport default function (data) {\n  \u002F\u002F test logic here\n  sleep(1); \u002F\u002F ALWAYS include think time\n}\n\n\u002F\u002F ─── TEARDOWN (runs once after all VUs finish) ───────────────────────────────\nexport function teardown(data) { \u002F* cleanup *\u002F }\n```\n\n### Performance Test (Average-Load Pattern)\n```javascript\nimport http from 'k6\u002Fhttp';\nimport { check, sleep } from 'k6';\nimport { SharedArray } from 'k6\u002Fdata';\n\nconst users = new SharedArray('users', function () {\n  return JSON.parse(open('.\u002Ftest-data\u002Fusers.json'));\n});\n\nexport const options = {\n  stages: [\n    { duration: '5m',  target: 50  }, \u002F\u002F ramp-up to normal load\n    { duration: '20m', target: 50  }, \u002F\u002F hold at normal load\n    { duration: '5m',  target: 0   }, \u002F\u002F ramp-down\n  ],\n  thresholds: {\n    http_req_duration: [\n      'p(90)\u003C400',   \u002F\u002F 90th percentile under 400ms\n      'p(95)\u003C800',   \u002F\u002F 95th percentile under 800ms\n      'p(99)\u003C2000',  \u002F\u002F 99th percentile under 2s (handles .NET GC pauses)\n      { threshold: 'p(99)\u003C2000', abortOnFail: true, delayAbortEval: '30s' },\n    ],\n    http_req_failed: ['rate\u003C0.01'],  \u002F\u002F \u003C1% error rate\n    checks:          ['rate>0.99'],  \u002F\u002F >99% checks pass\n  },\n};\n\nexport default function () {\n  const user = users[Math.floor(Math.random() * users.length)];\n  const res = http.get(`${__ENV.BASE_URL}\u002Fapi\u002Fitems`, {\n    headers: { Authorization: `Bearer ${user.token}` },\n    tags: { endpoint: 'list-items' },\n  });\n  check(res, {\n    'status 200':      (r) => r.status === 200,\n    'response \u003C 500ms': (r) => r.timings.duration \u003C 500,\n  });\n  sleep(1 + Math.random() * 2); \u002F\u002F 1–3s realistic think time\n}\n```\n\n### Smoke Test (Script Validation)\n```javascript\nexport const options = {\n  vus: 1,\n  duration: '30s',\n  thresholds: {\n    http_req_failed: ['rate\u003C0.01'],\n    http_req_duration: ['p(95)\u003C500'],\n  },\n};\n```\n\n## Key Metrics to Evaluate\n\n| Metric | Type | Description | SLO Target |\n|--------|------|-------------|------------|\n| `http_req_duration` | Trend | Full round-trip latency (ms) | p(95) \u003C 800ms |\n| `http_req_waiting` | Trend | TTFB — server processing time | p(95) \u003C 600ms |\n| `http_req_failed` | Rate | Failed request rate | \u003C 1% |\n| `http_reqs` | Counter | Total requests \u002F throughput | ≥ target RPS |\n| `checks` | Rate | Functional assertion pass rate | > 99% |\n| `iteration_duration` | Trend | Full VU iteration time | Flat over test duration |\n\n## Defining SLOs as Thresholds\n\n```javascript\nthresholds: {\n  \u002F\u002F Latency SLOs\n  'http_req_duration': [\n    'p(90)\u003C400',\n    'p(95)\u003C800',\n    'p(99)\u003C2000',\n  ],\n  \u002F\u002F Per-endpoint thresholds (use tags)\n  'http_req_duration{endpoint:create-item}': ['p(95)\u003C500'],\n  'http_req_duration{endpoint:list-items}':  ['p(95)\u003C200'],\n  'http_req_duration{endpoint:health}':      ['p(99)\u003C50'],\n  \u002F\u002F Error budget\n  'http_req_failed': ['rate\u003C0.01'],\n  \u002F\u002F Functional correctness gate\n  'checks': ['rate>0.99'],\n}\n```\n\n**Rules**:\n- Never declare the same metric key twice — use an array for multiple expressions\n- Use tagged sub-metric thresholds for per-endpoint SLOs\n- `abortOnFail: true` + `delayAbortEval: '30s'` for CI fast-fail gates\n\n## CLI Usage\n\n```bash\n# Basic run\nk6 run script.js\n\n# Override from CLI\nk6 run --vus 10 --duration 30s script.js\n\n# With env vars and JSON output\nk6 run --env BASE_URL=https:\u002F\u002Fstaging.api.example.com \\\n        --out json=results\u002Fk6-output.json \\\n        --summary-trend-stats=\"avg,min,med,max,p(90),p(95),p(99)\" \\\n        --tag test-type=performance \\\n        script.js\n```\n\n**Key flags**: `--vus`, `--duration`, `--iterations`, `--env`, `--out`, `--tag`, `--no-setup`, `--no-teardown`, `--discard-response-bodies`, `--http-debug`\n\n**Exit codes**: `0` = all thresholds passed; `99` = threshold failed; `107` = test aborted.\n\n## Parameterization with SharedArray\n\n```javascript\nimport { SharedArray } from 'k6\u002Fdata';\n\n\u002F\u002F Parsed ONCE in init context — shared read-only across all VUs\nconst testData = new SharedArray('test-data', function () {\n  return JSON.parse(open('.\u002Ftest-data\u002Fpayloads.json'));\n});\n\nexport default function () {\n  const item = testData[Math.floor(Math.random() * testData.length)];\n  http.post(`${__ENV.BASE_URL}\u002Fapi\u002Fitems`, JSON.stringify(item), {\n    headers: { 'Content-Type': 'application\u002Fjson' },\n  });\n  sleep(1);\n}\n```\n\n**Anti-patterns to avoid**:\n- `JSON.parse(open('.\u002Fdata.json'))` inside `default()` — re-parses per iteration\n- HTTP calls in init context (outside lifecycle functions)\n- Non-serializable data returned from `setup()` (functions, classes, file handles)\n\n## Tags and Groups\n\n```javascript\n\u002F\u002F Per-request tags — enable per-endpoint threshold filtering\nhttp.get(url, { tags: { endpoint: 'list-items', version: 'v2' } });\n\n\u002F\u002F Logical groups — emit group_duration metric\nimport { group } from 'k6';\ngroup('create and retrieve', function () {\n  http.post('\u002Fapi\u002Fitems', payload);\n  http.get('\u002Fapi\u002Fitems');\n});\n\n\u002F\u002F URL grouping to prevent high-cardinality names\nhttp.get(http.url`\u002Fapi\u002Fitems\u002F${itemId}`); \u002F\u002F all grouped as \"\u002Fapi\u002Fitems\u002F${}\"\n```\n\n## Output Formats\n\n| Output | Flag | Use case |\n|--------|------|----------|\n| JSON (NDJSON) | `--out json=file.json` | CI artifact storage, jq analysis |\n| CSV | `--out csv=file.csv` | Spreadsheet analysis |\n| Grafana Cloud | `k6 cloud run script.js` | Run-over-run dashboards |\n| InfluxDB | `--out influxdb=http:\u002F\u002Flocalhost:8086\u002Fk6` | Self-hosted dashboards |\n| Prometheus | `--out experimental-prometheus-rw` | Prometheus\u002FGrafana stack |\n\n## Interpreting Results\n\n```\n█ THRESHOLDS\n  http_req_duration\n    ✓ 'p(95)\u003C800'     p(95)=148ms    ← PASSED\n    ✗ 'p(99)\u003C2000'    p(99)=2523ms   ← FAILED → non-zero exit code\n\n█ TOTAL RESULTS\n  http_req_duration...: avg=140ms  med=138ms  p(90)=180ms  p(95)=148ms  p(99)=2523ms\n  http_req_failed.....: 0.05%  ✓ 1 ✗ 1999\n  http_reqs...........: 2000 66.6\u002Fs\n```\n\n- `✓` = threshold passed; `✗` = threshold failed (non-zero exit)\n- Compare `avg` vs `med` — if `avg >> med`, high-latency outliers exist\n- `http_reqs N\u002Fs` is actual throughput — compare against target RPS\n- `http_req_duration{expected_response:true}` shows latency for 2xx\u002F3xx only\n\n## Sources\n- https:\u002F\u002Fgrafana.com\u002Fdocs\u002Fk6\u002Flatest\u002Ftesting-guides\u002Ftest-types\u002F\n- https:\u002F\u002Fgrafana.com\u002Fdocs\u002Fk6\u002Flatest\u002Fusing-k6\u002Ftest-lifecycle\u002F\n- https:\u002F\u002Fgrafana.com\u002Fdocs\u002Fk6\u002Flatest\u002Fusing-k6\u002Fthresholds\u002F\n- https:\u002F\u002Fgrafana.com\u002Fdocs\u002Fk6\u002Flatest\u002Fusing-k6\u002Fmetrics\u002Freference\u002F\n- https:\u002F\u002Fgrafana.com\u002Fdocs\u002Fk6\u002Flatest\u002Fjavascript-api\u002Fk6-http\u002F\n- https:\u002F\u002Fgrafana.com\u002Fdocs\u002Fk6\u002Flatest\u002Fjavascript-api\u002Fk6-data\u002Fsharedarray\u002F\n",{},"main","00b2c68281930728ee390bb16cec32b88d2caac7",".github\u002Fskills\u002Fk6-performance-testing","https:\u002F\u002Fgithub.com\u002Frafsanulhasan\u002FHypermediaEngine","https:\u002F\u002Fgithub.com\u002Frafsanulhasan","\r\n    MCSD || A-CSD || Software Architect\r\n\r\n","2026-06-06 07:47:06",{"source":7,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add rafsanulhasan\u002FHypermediaEngine --skill k6-performance-testing",{"tool":45,"command":46},"bunx","bunx skills add rafsanulhasan\u002FHypermediaEngine --skill k6-performance-testing",{"tool":48,"command":49},"pnpm","pnpm dlx skills add rafsanulhasan\u002FHypermediaEngine --skill k6-performance-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Frafsanulhasan\u002FHypermediaEngine\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fk6-performance-testing\u002FSKILL.md",true,[],[54,81,101,120,149,172],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":61,"publishedAt":28},"01M6KWEJD606FG3DBBRM0W4DKW","write-tests","Test implementation skill for HypermediaEngine. Takes a confirmed test plan from design-test-cases and produces compilable, runnable xUnit tests following project conventions. Validates coverage quality through mutation testing. Invoked by the sqa-engineer agent after the test plan is approved.","https:\u002F\u002Fgithub.com\u002Frafsanulhasan\u002FHypermediaEngine\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fwrite-tests\u002FSKILL.md",[60],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[62,63,64,23,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80],"write tests","write","tests","design","test","project conventions","test plan","Bash","plan","quality","xunit","read","edit","coverage","engineer","mutation testing","project","mutation","for",{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":28},"01M6KWEF2XQ00C1Y6QCK7YHZ1H","write-documentation","Structured documentation writing workflow for HypermediaEngine. Writes or updates README.md files at the repo root and in each project directory (src\u002F, tests\u002F, samples\u002F, etc.) based on current implementation, ADRs, and architecture decisions.","https:\u002F\u002Fgithub.com\u002Frafsanulhasan\u002FHypermediaEngine\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fwrite-documentation\u002FSKILL.md",[],[88,63,89,90,91,92,93,69,94,95,96,97,73,74,98,78,64,99,100,80],"documentation","write documentation","writing","directory","workflow","architecture","src","repo","decisions","README","files","updates","at",{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":28},"01M6KWEBDXTXAVPQ3BHS3YYYNT","write-adr","Writes a numbered Architecture Decision Record (ADR) for a significant architectural choice in the HypermediaEngine project. Invoked by the software-architect agent whenever a consequential design decision is made or ratified. Saves the ADR to docs\u002Farchitecture\u002Fdecisions\u002F.","https:\u002F\u002Fgithub.com\u002Frafsanulhasan\u002FHypermediaEngine\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fwrite-adr\u002FSKILL.md",[],[108,63,109,65,110,93,111,112,113,114,96,73,115,116,78,117,118,80,119],"adr","write adr","docs","architect","decision","choice","grep","architecture decision record","record","software","opus","architecture decision",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":132,"publishedAt":28},"01M6KWE76TM3QHGQ08PEB3KY6D","tunit-playwright-ui-testing","Comprehensive guidance for writing coded end-to-end UI tests in C# using TUnit.Playwright. Tests inherit from PageTest — the base class manages all browser lifecycle. Covers NuGet setup, PageTest inheritance, Page Object Model, browser configuration, parallelism limiting, and CI integration. Based on the official TUnit docs at https:\u002F\u002Ftunit.dev\u002Fdocs\u002Fexamples\u002Fplaywright.","https:\u002F\u002Fgithub.com\u002Frafsanulhasan\u002FHypermediaEngine\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftunit-playwright-ui-testing\u002FSKILL.md",[126,127],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":128,"categoryName":129,"taxonomyType":130,"taxonomyTypeDesc":131},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[23,133,134,135,136,137,138,90,139,140,141,142,143,144,145,146,64,147,148,80],"playwright","ui","playwright ui testing","ui testing","tunit","tunit playwright ui testing","official","dev","examples","ci","lifecycle","model","page","inheritance","end","object",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":158,"publishedAt":28},"01M6KWE44A738GDK65QS02XJBG","triage","Task classification, decomposition, dependency mapping, and routing skill. Invoked by the triage-agent to break any user request into discrete, independently-routable work items with assigned priorities and agent chains.","https:\u002F\u002Fgithub.com\u002Frafsanulhasan\u002FHypermediaEngine\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftriage\u002FSKILL.md",[155],{"categoryNo":156,"categoryName":157,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",[151,159,160,161,162,163,164,165,166,167,168,169,170,171],"routing","classification","work","user","dependency","task","priorities","decomposition","user request","mapping","with","break","request",{"skillNo":173,"name":174,"nameZh":6,"description":175,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":176,"categories":177,"keywords":182,"publishedAt":28},"01M6KWDZ3W9ZKPR7FTTTSX8H2K","system-design","Expert system design skill. Use PROACTIVELY to design systems, review architectures, and assist software engineers in learning design principles and implementing them in the code with design patterns.","https:\u002F\u002Fgithub.com\u002Frafsanulhasan\u002FHypermediaEngine\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fsystem-design\u002FSKILL.md",[178,181],{"categoryNo":179,"categoryName":180,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":128,"categoryName":129,"taxonomyType":130,"taxonomyTypeDesc":131},[65,183,184,185,186,187,188,114,73,189,190,191,192,193,194,117,195,196,169,197],"system","system design","web","design systems","learning","haiku","use","design patterns","design principles","expert","patterns","systems","architectures","principles","implementing"]