ProSkillsLibraryFreePassScan
Code Review

Code Review · agent skill

Test Writer

Tests that fail before the fix and pass after.

What it does

Loads when it is needed

Your agent loads it when the user needs tests for new code or a bug fix. It carries 5 rules and reads a profile.md with your details before it starts, so the output matches your brand and project.

Same prompt, with and without

Regression test for billing date bug

Prompt · I fixed the Jan 31 crash in next_billing_date. Write the regression tests.

Bug report: subscriptions that start on the 31st crash on renewal: ValueError: day is out of range for month.

billing/dates.py (before the fix)
def next_billing_date(start: date, months: int = 1) -> date:
    month = start.month + months
    year = start.year + (month - 1) // 12
    month = (month - 1) % 12 + 1
    return date(year, month, start.day)

billing/dates.py (the fix)
    ...
    return date(year, month, min(start.day, calendar.monthrange(year, month)[1]))

Profile used: Project: SaaS billing service; Stack: Python 3.12, pytest; Strictness: Standard; Conventions: tests/ folder, test_<module>.py, parametrize for tables

Without the skill
Here's a regression test file, `tests/test_dates.py`: ```python from datetime import date import pytest from billing.dates import next_billing_date @pytest.mark.parametrize( "start, months, expected", [ # the original bug: 31st into a shorter month (date(2025, 1, 31), 1, date(2025, 2, 28)), (date(2024, 1, 31), 1, date(2024, 2, 29)), # leap year (date(2025, 3, 31), 1, date(2025, 4, 30)), (date(2025, 8, 30), 6, date(2026, 2, 28)), (date(2025, 1, 29), 1, date(2025, 2, 28)), (date(2024, 1, 29), 1, date(2024, 2, 29)), # unchanged behavior (date(2025, 1, 15), 1, date(2025, 2, 15)), (date(2025, 1, 31), 2, date(2025, 3, 31)), # year rollover (date(2025, 12, 31), 1, date(2026, 1, 31)), (date(2025, 11, 30), 3, date(2026, 2, 28)), (date(2025, 1, 31), 12, date(2026, 1, 31)), ], ) def test_next_billing_date(start, months, expected): assert next_billing_date(start, months) == expected def test_default_months_is_one(): assert next_billing_date(date(2025, 1, 31)) == date(2025, 2, 28) ``` The first rows would have raised ValueError before the fix. Note the function doesn't remember the original day, so chaining renewals (Jan 31 -> Feb 28 -> Mar 28) drifts. Always compute from the original start date.
With the skill
tests/test_dates.py @pytest.mark.parametrize("start,months,expected", [ (date(2024, 1, 31), 1, date(2024, 2, 29)), # leap February (date(2023, 1, 31), 1, date(2023, 2, 28)), # non-leap February (date(2024, 3, 31), 1, date(2024, 4, 30)), # 30-day month (date(2024, 12, 15), 1, date(2025, 1, 15)), # year rollover (date(2024, 1, 31), 13, date(2025, 2, 28)), (date(2024, 2, 29), 12, date(2025, 2, 28)), # leap day into a common year (date(2024, 3, 31), -1, date(2024, 2, 29)), (date(2024, 5, 10), 0, date(2024, 5, 10)), ]) def test_next_billing_date(start, months, expected): assert next_billing_date(start, months) == expected Fail before, pass after: against the old code 6 of 8 rows raise `ValueError: day is out of range for month`, the reported crash; rows 4 and 8 pass because they never hit a short month. With the fix all 8 match. Expected dates are literals worked out by hand. Matrix: applied boundary, calendar (leap, month length, year end), sign and zero. Dropped unicode, injection, concurrency, permissions: a pure date function takes no strings or shared state. Not run: the full suite (`pytest -q`); run it before merging. Smell: `months` is unvalidated, so a float fails inside `date()` with an unhelpful TypeError.

Both answers from the same model (Claude sonnet), 2026-10-16. The one without the skill was written in a separate session that never saw it. Shortened where marked with …

Install

One command, in your project

It detects your agent; add --agent all for every agent.

npx proskills-cli add test-writer --order <order id from your receipt>

Or copy the skill folder (the one holding SKILL.md) into the directory your agent reads, then restart it or start a new session.

AgentThis projectEvery project
Claude Code.claude/skills/~/.claude/skills/
Cursor.agents/skills/ (or .cursor/skills/)~/.cursor/skills/
Codex.agents/skills/~/.agents/skills/
Gemini CLI.agents/skills/ (or .gemini/skills/)~/.gemini/skills/

Changelog

What changed

  • v1.0.0 · 2026-10-16
    • First versioned release: Tests that fail before the fix and pass after.
    • Scanned 100/100 before release.

Keep it current with npx proskills-cli update; your profile.md is never touched. Everyone who bought it gets the update free and an email when it lands.

Same collection

More from Code Review

The scan checks spec compliance, token cost, clarity and security patterns. A clean scan is not a guarantee: static scanners can be evaded. Scan any skill yourself.