refine-tests/SKILL.md
Critically review and refine tests generated during a coding session. Use this skill when the user asks to review tests, clean up tests, refine tests, prune tests, improve test quality, or remove useless/low-value tests. Also use when the user says 'review my tests', 'clean up tests', or mentions test quality after a coding session.
npx skillsauth add figlabhq/agent-skills refine-testsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Review all tests generated in the current session and eliminate low-value ones while strengthening the rest. The goal is a lean, high-confidence test suite — not maximum test count.
Look at the git diff or recent file changes to find all test files created or modified in this session. Read each one fully before making judgments.
Remove tests that fall into these categories:
Trivial tests — Tests that only verify getters, setters, or basic constructors without exercising meaningful logic. If the test would pass even with a broken implementation, it's not testing anything useful.
Weak assertions — Tests whose assertions only check for non-null values, basic type existence, or that "no exception was thrown" without validating actual functional outcomes. A test that asserts $result !== null when the interesting question is what $result contains is wasting space.
Improbable edge cases — Tests for scenarios that don't impact core functionality or risk areas. Testing that a method handles a 10,000-character input when the UI caps it at 255 characters adds maintenance cost without meaningful protection.
Brittle implementation tests — Tests that are tightly coupled to internal details (exact method call counts, specific query structures, internal state). These break on every refactor and create false failures that erode trust in the test suite.
For each test that survives pruning, check and improve:
assertEquals over assertTrue, assertDatabaseHas over checking a return value)it_rejects_enrollment_when_course_is_full)setUp()TenantTestCase, inline factories)$this->faker or fake() consistently with the rest of the codebaseAfter pruning, if important behaviors are left untested, suggest or write high-value tests for:
Run the refined tests to confirm they pass:
php artisan test --compact <test-file>
If any test fails, fix it. A refined test suite that doesn't pass is worse than the original.
Summarize what you did:
development
Use when reviewing code for security vulnerabilities, implementing authentication/authorization, handling user input, or discussing web application security. Covers OWASP Top 10:2025, ASVS 5.0, and Agentic AI security (2026).
development
Apply battle-tested code conventions when writing or modifying code in Laravel/PHP projects (with React/TypeScript frontend support). Use this skill whenever the user is writing a new feature, refactoring existing code, creating a controller/action/migration/model/test, or asks 'how should I structure this', 'what's the convention for X', 'is this the right pattern'. Also use proactively before producing non-trivial code so the output follows conventions the first time instead of needing rewrites.
development
Deep research before planning. Launches parallel agents to search docs, web, and codebase, then synthesizes findings into actionable context.
development
Fix PHP coding style issues using PHPCS and PHPCBF. Use this skill whenever the user mentions PHPCS, code style, coding standard, cs:fix, cs:check, PHP formatting, or asks to fix/check PHP code style. Also activate when you notice PHP files have been modified and need style compliance, or when a CI PHPCS check has failed.