Source profileQuality 89/100

event4u-app/agent-config/src/skills/test-performance/SKILL.md

test-performance

Use when optimizing test suite performance — database setup, seeder optimization, parallel testing, CI pipeline efficiency, or RefreshDatabase alternatives.

Source repository stars
7
Declared platforms
0
Static risk flags
0
Last source update
2026-07-28
Source checked
2026-07-28

Decision brief

What it does—and where it fits

Use when optimizing test suite performance — database setup, seeder optimization, parallel testing, CI pipeline efficiency, or RefreshDatabase alternatives.

Best for

  • Tests are running too slowly (locally or in CI)
  • Database setup/teardown is a bottleneck
  • Parallel testing needs optimization

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/test-performance"
Safe inspection promptEditorial

Inspect the Agent Skill "test-performance" from https://github.com/event4u-app/agent-config/blob/0adf49a8ae84b0ff6e2de8759eea43257e020eff/src/skills/test-performance/SKILL.md at commit 0adf49a8ae84b0ff6e2de8759eea43257e020eff. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Procedure: Analyze test performance

    Before optimizing, always measure:

    Before optimizing, always measure:
  2. 02

    When to use

    Tests are running too slowly (locally or in CI)

    Tests are running too slowly (locally or in CI)Database setup/teardown is a bottleneckParallel testing needs optimization
  3. 03

    1. Measure baseline

    Before optimizing, always measure:

    Before optimizing, always measure:
  4. 04

    Count tests per suite

    find tests/ app/Modules//Tests/ -name ".php" | xargs grep -l "it(" | wc -l

    find tests/ app/Modules//Tests/ -name ".php" | xargs grep -l "it(" | wc -l
  5. 05

    Count by suite type

    grep -rh "it(" tests/Unit/ app/Modules//Tests/Unit/ --include=".php" | wc -l grep -rh "it(" tests/Component/ app/Modules//Tests/Component/ --include=".php" | wc -l grep -rh "it(" tests/Integration/ app/Modules//Tests/Integration/ --include=".php" | wc -l

    grep -rh "it(" tests/Unit/ app/Modules//Tests/Unit/ --include=".php" | wc -l grep -rh "it(" tests/Component/ app/Modules//Tests/Component/ --include=".php" | wc -l grep -rh "it(" tests/Integration/ app/Modules//Tests/In…

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score89/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars7SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
event4u-app/agent-config
Skill path
src/skills/test-performance/SKILL.md
Commit
0adf49a8ae84b0ff6e2de8759eea43257e020eff
License
MIT
Collected
2026-07-28
Default branch
main
View the original SKILL.md

test-performance

When to use

Use this skill when:

  • Tests are running too slowly (locally or in CI)
  • Database setup/teardown is a bottleneck
  • Parallel testing needs optimization
  • Seeders need performance analysis
  • CI pipeline test jobs need to be faster
  • Investigating flaky tests caused by database state

Procedure: Analyze test performance

1. Measure baseline

Before optimizing, always measure:

# Count tests per suite
find tests/ app/Modules/*/Tests/ -name "*.php" | xargs grep -l "it(" | wc -l

# Count by suite type
grep -rh "it(" tests/Unit/ app/Modules/*/Tests/Unit/ --include="*.php" | wc -l
grep -rh "it(" tests/Component/ app/Modules/*/Tests/Component/ --include="*.php" | wc -l
grep -rh "it(" tests/Integration/ app/Modules/*/Tests/Integration/ --include="*.php" | wc -l

# Count migrations
ls database/migrations/*.php | wc -l

# Count seeders
find database/seeders database/seeder-data -name "*.php" -path "*/data/*" | wc -l

2. Identify bottlenecks

The typical test lifecycle is:

Process Start → Migrate → Seed → [Test → Rollback] × N → Process End
                 ↑ expensive (once per worker)

Check these areas in order of typical impact:

AreaWhat to checkTypical impact
Migration countHow many CREATE TABLE statements?High if >20
Schema dumpIs database/schema/ used?High if missing
Seeder INSERT methodIndividual save() vs bulk insert?Medium
TruncationPer-seeder truncate vs centralized?Low (but causes correctness issues)
Connection discoveryDynamic getPdo() probing?Low
Parallel worker setupDoes each worker re-migrate?High

3. Optimization strategies (ordered by ROI)

A. Schema Dump (highest ROI)

Laravel's schema:dump consolidates all migrations into one SQL file. Instead of running N individual CREATE TABLE migrations, it loads one SQL dump.

php artisan schema:dump --database=api_database
# Generates database/schema/api_database-schema.sql

Savings: 58 migrations → 1 SQL load = ~10-25s per worker.

B. Template DB Cloning (high ROI for parallel tests)

Instead of each parallel worker running migrate+seed independently:

  1. Prepare ONE template database (migrate + seed)
  2. Clone template for each worker via mysqldump
# Prepare template
php artisan migrate:fresh --database=template_db
php artisan db:seed --database=template_db

# Clone per worker
mysqldump template_db | mysql worker_db_test_1

Savings: Eliminate per-worker migrate+seed entirely.

C. Skip Migrate+Seed Flag (high ROI for local dev)

Add a config flag to skip database setup when DB is already prepared:

// config/testing.php
'skip_migrate_seed' => EnvHelper::boolean('TESTING_SKIP_MIGRATE_SEED', false),

Developer workflow: make migrate-testing once, then make test-quick repeatedly.

D. Bulk Inserts in Seeders (medium ROI)

Replace individual $model->save() with bulk insert:

// Before: N INSERT statements
foreach ($data as $row) {
    $model = new MyModel($row);
    $model->save();
}

// After: 1 INSERT statement
MyModel::insert($data);
$models = MyModel::whereIn('id', $ids)->get();

E. Centralize Truncation (correctness fix)

Per-seeder truncation is redundant after migrate:fresh and causes:

  • Non-deterministic ordering (lazy init triggers truncate)
  • Ghost data bugs (locally passes, CI fails)

Make truncation configurable, default off:

// config/testing.php
'seed_truncate' => EnvHelper::boolean('DB_SEED_TRUNCATE', false),

F. Static Connection Discovery (cleanup)

Replace dynamic getPdo() probing with explicit config:

// config/testing.php
'connections_to_transact' => ['api_database', 'customer_database'],

4. CI-specific optimizations

  • MariaDB tmpfs: Mount data dir on RAM disk for zero I/O latency
  • Shared DB prep: One CI job prepares DB, test jobs clone from it
  • Cache test DBs: Skip re-migration if migration files haven't changed
  • Separate suites: Run no-DB tests (Unit) on cheaper runners

Related project docs

  • agents/reference/docs/seeders.md — seeder conventions (if exists)

Output format

  1. Optimized test configuration or seeder with timing comparison
  2. Parallelization or caching improvements applied

Gotcha

  • Don't use RefreshDatabase when DatabaseTransactions suffices — full refresh is 10x slower.
  • The model forgets that parallel tests share the database — use unique identifiers in test data.
  • Seeder optimization has the highest ROI — a 2s seeder running 100 times = 200s wasted.
  • Don't add indexes to test databases just for test performance — the real fix is better test design.

Do NOT

  • Do NOT use RefreshDatabase when DatabaseTransactions works — 10x slower.
  • Do NOT run full test suite on every code change — use --filter.
  • Do NOT add test-only indexes — fix test design instead.
  • Do NOT disable parallel testing to "fix" flaky tests — fix the root cause.

Alternatives

Compare before choosing

Computed 7338,313

wshobson/agents

dbt-transformation-patterns

Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.

Computed 9031,966

K-Dense-AI/scientific-agent-skills

astropy

Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.

Computed 8610,762

Jeffallan/claude-skills

code-reviewer

Analyzes code diffs and files to identify bugs, security vulnerabilities (SQL injection, XSS, insecure deserialization), code smells, N+1 queries, naming issues, and architectural concerns, then produces a structured review report with prioritized, actionable feedback. Use when reviewing pull requests, conducting code quality audits, identifying refactoring opportunities, or checking for security issues. Invoke for PR reviews, code quality checks, refactoring suggestions, review code, code quali

Computed 85234,327

affaan-m/ECC

dmux-workflows

Multi-agent orchestration using dmux (tmux pane manager for AI agents). Patterns for parallel agent workflows across Claude Code, Codex, OpenCode, and other harnesses. Use when running multiple agent sessions in parallel or coordinating multi-agent development workflows.