rewrite-tests-pest — rewrite-tests-pest install rewrite-tests-pest, pint-rules, community, rewrite-tests-pest install, ide skills, PEST syntax conversion, PHPUnit test conversion, Claude Code, Cursor, Windsurf

v1.0.0
GitHub

About this Skill

Ideal for PHP-centric AI Agents requiring automated test conversion and validation, such as Cursor or AutoGPT, to streamline PHPUnit to PEST syntax transitions. rewrite-tests-pest is a specialist skill for converting PHPUnit test classes to PEST syntax, following specific testing rules and constraints.

Features

Converts PHPUnit test classes to PEST syntax
Applies testing rules from .cursor/rules/php/standards.mdc and .cursor/rules/php-testing.mdc
Ensures 100% coverage for changed code
Adds missing tests if needed
Loads rules from .cursor/rules/php/standard

# Core Topics

pekral pekral
[0]
[0]
Updated: 3/8/2026

Agent Capability Analysis

The rewrite-tests-pest skill by pekral is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance. Optimized for rewrite-tests-pest install, PEST syntax conversion, PHPUnit test conversion.

Ideal Agent Persona

Ideal for PHP-centric AI Agents requiring automated test conversion and validation, such as Cursor or AutoGPT, to streamline PHPUnit to PEST syntax transitions.

Core Value

Empowers agents to convert PHPUnit test classes to PEST syntax seamlessly, applying standards from .cursor/rules/php/standards.mdc and .cursor/rules/php-testing.mdc, ensuring 100% coverage for changed code without altering production code, leveraging PHP and PHPUnit expertise.

Capabilities Granted for rewrite-tests-pest

Converting legacy PHPUnit tests to PEST for improved maintainability
Automating test validation against project-specific testing rules
Ensuring 100% test coverage for modified codebases

! Prerequisites & Limits

  • Limited to PHPUnit test classes
  • Requires access to .cursor/rules/php/standards.mdc and .cursor/rules/php-testing.mdc
  • Does not modify production code
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

rewrite-tests-pest

Install rewrite-tests-pest, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly

Rewrite Tests to PEST Syntax

Specialist for converting PHPUnit test classes to PEST syntax. Apply testing rules from .cursor/rules/php/standards.mdc (Testing section) and .cursor/rules/php-testing.mdc. Never modify production code. After rewrite, coverage must be 100% for changed code; add missing tests if needed.

Role: Rewrite tests only. Apply all project test rules. Constraint: Tests only. Never modify production code.


1. Load Rules

  • Read .cursor/rules/php/standards.mdc (focus: Testing, Bug-Fix Workflow, Naming, Structure).
  • Read .cursor/rules/php-testing.mdc (analysis, mocking, asserts, coverage, running tests).

2. Prerequisites

  • Run only if Pest is installed (pestphp/pest in composer.json or vendor/bin/pest exists).
  • If Pest is not installed, do not rewrite; inform the user.

3. PHPUnit → PEST Mapping

PHPUnitPEST
final class FooTest extends TestCaseRemove class; use one or more test files (e.g. tests/FooTest.php or feature-based files).
public function testSomething(): voidtest('something does something', function (): void { ... }); or it('does something', function (): void { ... });
$this->assertSame($a, $b)expect($a)->toBe($b) (or toEqual for loose comparison)
$this->assertTrue($x)expect($x)->toBeTrue()
$this->assertFalse($x)expect($x)->toBeFalse()
$this->assertInstanceOf(Class::class, $x)expect($x)->toBeInstanceOf(Class::class)
$this->assertCount($n, $iterable)expect($iterable)->toHaveCount($n)
$this->assertContains($needle, $haystack)expect($haystack)->toContain($needle)
$this->assertEmpty($x)expect($x)->toBeEmpty()
$this->expectException(Ex::class)expect(fn () => ...)->toThrow(Ex::class) or catch in test and assert
Data provider @dataProvider footest('...', function (mixed $a, mixed $b): void { ... })->with([...]) or dataset('name', [...])
  • Test description: first argument of test('...') or it('...') — human-readable, describes behavior.
  • Use local variables only; no test class properties.
  • Shared setup: use beforeEach() in the same file or in tests/Pest.php if project uses it.
  • Keep helpers in same file or in tests/Pest.php as plain functions if already used elsewhere.

4. Workflow

  1. Identify scope
    Target file(s): PHPUnit test classes (e.g. *Test.php extending TestCase). Optionally one PEST file per original class or one file per feature.

  2. Analyse

    • List all test methods and assertions.
    • Note data providers, setUp/tearDown, and shared state.
    • Check which code is covered (existing coverage report or run coverage for that file).
  3. Rewrite

    • Replace class with test() / it() calls.
    • Convert $this->assert* to expect()->....
    • Convert data providers to ->with() or dataset().
    • Move setUp logic into beforeEach() or into each test; avoid class state.
    • Keep test data in English; keep names descriptive.
  4. Coverage

    • Run tests for changed files.
    • Run coverage (e.g. Clover XML) for the code exercised by those tests.
    • If coverage for changed production code is below 100%, add or adjust tests until 100%.
  5. Cleanup

    • Remove generated coverage artifacts when done.
    • Run project fixers (e.g. composer scripts, PHP CS) if available.
    • Delete obsolete PHPUnit-only boilerplate (e.g. empty class) if the file is now fully PEST.

5. Conventions (from project rules)

  • Arrange–act–assert; error cases first, success last.
  • Mock only external services (e.g. HTTP); use Mockery or framework fakes (e.g. Http::fake()).
  • No tests for abstract/private/protected implementation details; test public behaviour.
  • Final test classes: in PEST there is no class; keep test file and descriptions clear.
  • Data providers via argument (e.g. ->with([...])), not PHPDoc.
  • Run tests only for changed files; check coverage only for changed code.

6. After Rewrite

  • Run tests for the rewritten files.
  • Ensure 100% coverage for any changed production code; add tests if needed.
  • Remove coverage output files.
  • Run fixers if the project defines them.

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is rewrite-tests-pest?

Ideal for PHP-centric AI Agents requiring automated test conversion and validation, such as Cursor or AutoGPT, to streamline PHPUnit to PEST syntax transitions. rewrite-tests-pest is a specialist skill for converting PHPUnit test classes to PEST syntax, following specific testing rules and constraints.

How do I install rewrite-tests-pest?

Run the command: npx killer-skills add pekral/pint-rules/rewrite-tests-pest. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for rewrite-tests-pest?

Key use cases include: Converting legacy PHPUnit tests to PEST for improved maintainability, Automating test validation against project-specific testing rules, Ensuring 100% test coverage for modified codebases.

Which IDEs are compatible with rewrite-tests-pest?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for rewrite-tests-pest?

Limited to PHPUnit test classes. Requires access to .cursor/rules/php/standards.mdc and .cursor/rules/php-testing.mdc. Does not modify production code.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add pekral/pint-rules/rewrite-tests-pest. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use rewrite-tests-pest immediately in the current project.

Related Skills

Looking for an alternative to rewrite-tests-pest or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI