CI Test Sharding Parallelization

CI Test Sharding Parallelization is a skill for Claude Code, Codex from PramodDutta/qaskills. It costs 34 tokens per session (1,528 once invoked), scanned A, original, MIT.

A guide for splitting Playwright, Jest, and pytest test suites into parallel CI jobs, then combining their results.

In plain words
What is it for?
Use it to divide tests across CI workers, balance slow tests, merge reports, and identify which shard failed.
Why use it?
It reduces the time developers wait for tests while keeping results consistent and failures traceable.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/pramoddutta/qaskills/ci-test-sharding-parallelization
Any agent
npx skills add PramodDutta/qaskills --skill ci-test-sharding-parallelization
Clone the repo
git clone --depth 1 https://github.com/PramodDutta/qaskills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for CI Test Sharding Parallelization

README.md
[![agentmods](https://agentmods.dev/badge/skills/pramoddutta/qaskills/ci-test-sharding-parallelization.svg)](https://agentmods.dev/skills/pramoddutta/qaskills/ci-test-sharding-parallelization)
Your own site
<a href="https://agentmods.dev/skills/pramoddutta/qaskills/ci-test-sharding-parallelization"><img src="https://agentmods.dev/badge/skills/pramoddutta/qaskills/ci-test-sharding-parallelization.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,528 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00034 $0.01528
Opus 5 $0.00017 $0.00764
Sonnet 5 $0.00007 $0.00306
Haiku 4.5 $0.00003 $0.00153

Measured yesterday against content hash db910a1f8908, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

CI Test Sharding Parallelization scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

import { spawnSync } from 'node:child_process';
seed-skills/ci-test-sharding-parallelization/SKILL.md · 223 lines

How it starts

The opening of the file, as written. The whole thing — 223 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CI Test Sharding Parallelization Skill

You are a test infrastructure engineer who reduces CI wall-clock time by sharding and parallelizing test suites while preserving deterministic results, useful reports, and clear failure ownership.

Core Principles

  1. Optimize wall-clock, not only CPU: The goal is faster feedback for developers.
  2. Shard deterministically: The same commit and shard config should run the same test distribution unless balancing is intentional.
  3. Merge reports reliably: Parallel jobs must produce one readable result for humans and machines.
  4. Keep setup cost visible: Too many shards can waste time on repeated install and boot steps.
  5. Balance long tests: Historical timing can prevent one slow shard from dominating.
  6. Fail clearly: A failure should identify shard, test file, project, and artifact.
  7. Avoid hidden order dependencies: Sharding exposes tests that rely on shared state.
  8. Tune gradually: Increase shard count only after measuring queue time and overhead.

Setup

Create scripts for each framework.

npm install --save-dev @playwright/test jest jest-junit
python -m venv .venv
. .venv/bin/activate
pip install pytest pytest-xdist pytest-json-report
mkdir -p test-results merged-reports

Use consistent environment variables.

export SHARD_INDEX=1
export SHARD_TOTAL=4
export CI_NODE_INDEX=1
export CI_NODE_TOTAL=4

Project Structure

ci/
  sharding/
    playwright.yml
    jest.yml
    pytest.yml
scripts/
  run-playwright-shard.sh
  run-jest-shard.ts
  run-pytest-shard.sh
  merge-reports.sh
test-results/
merged-reports/

Playwright Sharding

Use the built-in Playwright shard flag.

#!/usr/bin/env bash
set -euo pipefail

: "${SHARD_INDEX:?SHARD_INDEX is required}"
: "${SHARD_TOTAL:?SHARD_TOTAL is required}"

npx playwright test \
  --shard="${SHARD_INDEX}/${SHARD_TOTAL}" \
  --reporter=blob \
  --output="test-results/playwright-${SHARD_INDEX}"

Merge Playwright blob reports after all shards finish.

Read the full file on GitHub · 223 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 223 lines · 34 tokens per session scan A db910a1f8908

Subscribe to this mod's changes

CI Test Sharding Parallelization is a skill published in the GitHub repository PramodDutta/qaskills (217 stars, last pushed 5d ago), licensed MIT. It adds 34 tokens to every session and 1,528 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

automacao-de-testes

Automação de testes: unitários (Jest, Pytest), integração (supertest, httpx) e E2E com Playwright. Inclui estratégia de pirâmide de testes, cobertura mínima, CI/CD integration e testes para contexto brasileiro (CPF, CNPJ, CEP, PIX).

ricneves-ai/flowgrammers-skills · 67 tokens

test-generation

Generate a test strategy and starter test stubs for given modules across unit, integration, and e2e layers (pytest/jest/playwright). Trigger on: generate tests, test plan, test strategy, coverage plan, test scaffolding.

sarveshtalele/mcp-skills-registry · 51 tokens

e2e-testing

Use when writing or stabilizing Playwright tests that drive a real browser through multi-step journeys — durable locators, web-first assertions, storageState auth, trace/retries, and flakes that only bite in CI. NOT in-process component tests (that is testing-web), NOT WCAG auditing (that is accessibility), NOT the…

ericrisco/rsc-harness · 79 tokens

test-case-to-katalon-studio

Convert Katalon True Platform/TestOps manual test cases into Katalon Studio automation inside a local Studio Test Project checkout. Use when you need to author or extend a .tc test case file and its paired Groovy script under Scripts/, keep test case variable GUIDs consistent with the .ts test suite bindings that read…

katalon-labs/true-skills · 204 tokens

true-platform-testing

End-to-end Katalon True Platform testing workflow and lifecycle router. Use when one request spans several stages and no single skill owns all of it, for example analyze a requirement, design and import the cases, build a suite, run it with AI, and report the outcome. Also use to route any testing request across the…

katalon-labs/true-skills · 224 tokens

template-shell

Shell helper scripts for the template research framework. Covers system health checks, local CI reproduction, uv bootstrap, and rsync backup/restore contracts under scripts/shell/.

docxology/template · 36 tokens