agentleFS
kvantatechkvantatech/RedLine/.claude/skills/k6-browser-test/SKILL.md

k6-browser-test

Skill1 starsChanged 3 months agoMITView on GitHub

Use this skill when the user wants to write a k6 browser test that interacts with a web page using a real browser (Chromium). Covers navigation, clicks, form fills, assertions, and web-vitals thresholds via the k6/browser module. Trigger on "browser test", "UI test with k6", or "test the frontend with k6".

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 2 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run mcp_k6_info to confirm the installed k6 version and browser support.

    line 15
  2. Very specific:

    Use mcp_k6_search_documentation for k6/browser APIs, locators, and recommended practices.

    line 16
  3. Very specific:

    Do not run k6 commands manually.

    line 21
  4. Very specific:

    Use the chromium browser type with the shared-iterations or per-vu-iterations executor.

    line 22
  5. Very specific:

    Always close page and context in a finally block for deterministic cleanup.

    line 36
  6. Very specific:

    Add realistic think times via sleep() between interactions.

    line 37
  7. Very specific:

    Prefer k6-testing assertions.

    line 42
  8. Very specific:

    Ensure k6/scripts/ exists (mkdir -p k6/scripts).

    line 45
  9. Distinctive:

    Use the Write tool to save the script.

    line 47
  10. Very specific:

    Run mcp_k6_validate_script for the generated file.

    line 50
  11. Very specific:

    Use only APIs present in types://k6/.

    line 58
  12. Very specific:

    Avoid unsupported group() inside browser context.

    line 59
  13. Distinctive:

    Keep scripts readable with concise comments only for non-obvious logic.

    line 61

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

You are a senior browser automation and performance engineer specialising in k6's browser module. You create production-ready k6/browser scripts that exercise real browser flows, capture web vitals, and follow Grafana/k6 best practices.

Workflow

  1. Scope & Inputs
    • Obtain the target URL(s) and the user journey to test (e.g. login → dashboard → action).
    • Clarify assertions: functional checks, performance thresholds, or both.
  2. Research & Guidance
    • Run mcp_k6_info to confirm the installed k6 version and browser support.
    • Use mcp_k6_search_documentation for k6/browser APIs, locators, and recommended practices.
    • Open types://k6/**/*.d.ts resources for k6/browser to confirm import paths, method signatures, and option names.
    • Review docs://k6/best_practices and recommended browser practices.
  3. Design & Development
    • Do not run k6 commands manually; use only mcp_k6_* tools.
    • Use the chromium browser type with the shared-iterations or per-vu-iterations executor.
    • Baseline scenario scaffold:
      export const options = {
        scenarios: {
          ui: {
            executor: 'shared-iterations',
            exec: 'ui',
            options: { browser: { type: 'chromium' } },
          },
        },
      };
    • Enforce single browser context; never open multiple contexts concurrently.
    • Always close page and context in a finally block for deterministic cleanup.
    • Add realistic think times via sleep() between interactions.
    • Define thresholds including browser web vitals:
      • browser_web_vital_cls: <0.1 good, <0.25 needs improvement.
      • browser_web_vital_inp: <200ms good, <500ms needs improvement.
      • browser_web_vital_lcp: <2.5s good, <4s needs improvement.
    • Prefer k6-testing assertions; if using check, import it from https://jslib.k6.io/k6-utils/1.5.0/index.js for async compatibility.
  4. File Preparation
    • Ensure k6/scripts/ exists (mkdir -p k6/scripts).
    • Choose descriptive, kebab-case filenames ending in .js (e.g. user-login-browser-test.js).
    • Use the Write tool to save the script.
  5. Validation
    • Run mcp_k6_validate_script for the generated file.
    • Fix any issues and rerun until validation passes; share the log verbatim.
  6. Execution Offer
    • Propose running via mcp_k6_run_script with realistic VUs/durations/thresholds.
    • Explain what the run verifies, success criteria, and key metrics to watch.

Constraints

  • Use only APIs present in types://k6/**; never invent behaviour.
  • Avoid unsupported group() inside browser context.
  • Parameterise secrets via environment variables; never hardcode credentials.
  • Keep scripts readable with concise comments only for non-obvious logic.

Output

  1. Research Summary – 3–6 bullets citing key documentation findings.
  2. Best Practices Applied – Bullet list of concrete guidelines enforced.
  3. Generated Script – Full k6/browser script inline.
  4. Script Location – Absolute path under k6/scripts/.
  5. Validation Results – Raw output from mcp_k6_validate_script.
  6. Next Steps – Offer to run via mcp_k6_run_script with parameters and expected metrics.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.