create-missing-tests-in-pr

create-missing-tests-in-pr is a skill for Claude Code, Codex from pekral/cursor-rules. It costs 59 tokens per session (2,326 once invoked), scanned A, original, MIT.

A procedure for reading an existing pull request review and adding tests for every testing recommendation related to its current changes. It follows the project's testing rules and limits production-code changes to cases strictly required by the testing process.

In plain words
What is it for?
Use it after a pull request review when recommended test coverage is still missing. It is intended to add or update tests for the current changes, including Laravel-specific code when applicable.
Why use it?
It helps close test gaps identified during code review without expanding the assignment. It first checks the code, dependencies, existing tests, and change scope before writing anything.

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/pekral/cursor-rules/create-missing-tests-in-pr
Any agent
npx skills add pekral/cursor-rules --skill create-missing-tests-in-pr
Clone the repo
git clone --depth 1 https://github.com/pekral/cursor-rules

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 create-missing-tests-in-pr

README.md
[![agentmods](https://agentmods.dev/badge/skills/pekral/cursor-rules/create-missing-tests-in-pr.svg)](https://agentmods.dev/skills/pekral/cursor-rules/create-missing-tests-in-pr)
Your own site
<a href="https://agentmods.dev/skills/pekral/cursor-rules/create-missing-tests-in-pr"><img src="https://agentmods.dev/badge/skills/pekral/cursor-rules/create-missing-tests-in-pr.svg" alt="Measured on agentmods" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,326 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00059 $0.02326
Opus 5 $0.00030 $0.01163
Sonnet 5 $0.00012 $0.00465
Haiku 4.5 $0.00006 $0.00233

Measured 3d ago against content hash 06f88137673f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

create-missing-tests-in-pr scanned grade A with 0 findings 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 3d ago.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/create-missing-tests-in-pr/SKILL.md · 131 lines

How it starts

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

Constraint:

  • Apply @rules/php/core-standards.mdc
  • Apply @rules/git/general.mdc
  • Apply @rules/code-testing/general.mdc
  • If the current project uses Laravel, also apply @rules/laravel/laravel.mdc, @rules/laravel/architecture.mdc, @rules/laravel/filament.mdc, and @rules/laravel/livewire.mdc
  • If you are not on the main git branch in the project, switch to it.
  • This task is based on the existing pull request review.
  • First read your existing code review for the current pull request and identify all testing recommendations related to current changes.
  • Never change the assignment scope.
  • Only add or modify tests when needed.
  • Production code may only be changed if it is strictly required by the existing create-test skill or test infrastructure, otherwise do not modify it — the only exception is the Pre-existing issue handling workflow below, which lands its production-code fixes in their own separate commits.
  • Use @skills/create-test/SKILL.md for all test-writing work.

Read, Map & Verify before writing tests (mandatory pre-flight):

Reading, mapping, and verifying come first; writing tests comes last. This pre-flight is blocking — do not add or modify a single line until all three steps pass, and never act on an assumption you have not confirmed by reading the code.

  1. Read — open and read the actual changed code and the code it depends on (callers, called methods, related existing tests, configuration). Confirm what the code does by reading it, not by guessing from the review text or names.
  2. Map — map the change's blast radius: every uncovered code path the review flagged, its call sites, the branches a test must exercise, and the existing test conventions, helpers, and fixtures to reuse instead of reinventing.
  3. Verify — check your assumptions against the real code and its observed behavior, and confirm each recommended test does not already exist before adding it. If what you read contradicts the review recommendation, surface the discrepancy instead of writing tests on a wrong premise.

Only after Read, Map, and Verify are complete may test-writing begin.

Steps:

  • Load the current pull request context using GitHub CLI (gh) first. If gh is not available, use a GitHub MCP server. If neither is available, stop and return a failed result about missing GitHub tools.
  • Read your existing code review for the pull request.
  • Extract all recommendations related to missing tests, missing scenarios, edge cases, regression coverage, and coverage gaps.
  • Analyze the current branch changes against the review findings.
  • Verify whether the recommended tests already exist in the codebase.
  • Check whether current changes have 100% coverage for the changed files only, using the project's available coverage tooling (per the Coverage gate in @skills/code-review/SKILL.md). Do not gate on the project-wide coverage percentage — if the project ships no coverage tooling at all, stop and report it as a blocker, and do not add a new bespoke coverage script to the consuming project.
  • If coverage is incomplete or recommended test scenarios are missing, use @skills/create-test/SKILL.md.
  • Follow existing project test conventions, helpers, patterns, and abstractions.
  • Prefer updating existing tests first. Create new tests only if required.
  • Create deterministic every time!
  • Make sure tests are deterministic and not flaky.
  • In tests, avoid reflection; use mocks instead (even partial ones, if they are effective and easy to read).
  • Tests must not contain conditions (e.g., if, switch); split conditional logic into separate test cases instead.
  • Use data providers where they improve readability and simplify repeated test cases.
  • After adding or updating tests, run only the necessary tests for the current changes.
  • If coverage tooling exists, verify that current changes are covered with 100% coverage for the changed files only, using the project's available coverage tooling (per the Coverage gate in @skills/code-review/SKILL.md) — do not gate on the full-suite coverage percentage. Delete any generated coverage report file once read so it is not accidentally committed.
  • If fixers or test-related wrappers exist in the project, use them (prefer Phing targets from build.xml/phing.xml; fall back to Composer scripts in composer.json).
  • Do not run the whole test suite unless it is required for the changed files workflow.
  • If the review recommendation is already satisfied by existing tests, do not duplicate test coverage.
  • Place new test files per @rules/code-testing/general.mdc Test Organization — the test file path mirrors the namespace of the SUT (e.g. App\Service\Billing\InvoiceCalculatortests/Service/Billing/InvoiceCalculatorTest.php), the file name is {ClassName}Test.php (or {ClassName}{Scenario}Test.php for an extracted scenario file of the same SUT), and cross-cutting tests sit under an intent-named directory (tests/Feature/<flow>, tests/Contract/<vendor>, tests/Integration/<area>).
  • Name every it() / test() block to match the scenario the body asserts — plain-language descriptions such as it('returns zero for an empty cart') or test('throws InvalidArgumentException when the discount is negative'). Never use placeholders (it('it works'), test('test1'), test('happy path')), method names (test('calculate'), it('handles getUser')), or descriptions that contradict the assertions, so the code-review test-organization gate passes when the PR is re-reviewed.

Read the full file on GitHub · 131 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. 3d ago First seen · 131 lines · 59 tokens per session scan A 06f88137673f

Subscribe to this mod's changes

create-missing-tests-in-pr is a skill published in the GitHub repository pekral/cursor-rules (6 stars, last pushed 3d ago), licensed MIT. It adds 59 tokens to every session and 2,326 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

browse-and-evaluate

Use when exploring the ai-agent-skills catalog to find, compare, and evaluate skills before installing. Always use --fields to limit output size and --dry-run before committing to an install.

MoizIbnYousaf/Ai-Agent-Skills · 43 tokens

loop-engineering

Shared loop-engineering reference for COG skills - the agent loop, deterministic verifiers, termination conditions, in-loop context management, and named patterns. Invoke when designing or debugging a skill that iterates (search-verify-retry, scan-until-dry, fetch-retry-gate).

huytieu/COG-second-brain · 63 tokens

render-airdrop-carousel

Assemble a viral iOS "AirDrop" notification-carousel video ad (≈6–8s, 9:16) from a brand line plus 6–16 real product photos — a native AirDrop share-sheet card ("Brand would like to share a · Decline / Accept") springs up and its preview window CYCLES through the products, landing on a range/lineup payoff with an…

gooseworks-ai/goose-skills · 207 tokens

render-3d-product-showcase

Assemble a premium 3D product-showcase ad from a config — four beat clips (an orbiting hero rotation, a macro push-in, a physics reveal, a typographic close) normalized to the brand-color canvas, hard-concatenated in order, closed on a deterministic Playwright brand end card, and mixed under one instrumental bed at…

gooseworks-ai/goose-skills · 159 tokens

vfx-text-cursor

Cursor light trail, chromatic rays, and directional flares for word-by-word quote reveals in video intros.

nexu-io/html-video · 28 tokens

music

Generate, remix, extend, edit, and analyze AI music (Mureka). Triggers on: "音乐", "music", "生成音乐", "generate music", "翻唱", "cover", "混音", "remix", "续写", "extend", "纯音乐", "instrumental", "配乐", "soundtrack", "分轨", "stem", "识别歌词", "recognize lyrics", "作曲", "compose", "create a song", "做一首歌".

marswaveai/skills · 109 tokens