Skip to content
Back to skills

Payload

ASecurity

Scan a diff of test files for removed assertions, added skip or expected-failure marks, widened tolerances and deleted test functions, and report each with its location.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 26, 2026
ai-agentspythonbashgit

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned September 26, 2026

npx -y skills add alisonjieli-png/loop-engine --skill payload --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Payload?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Payload
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/alisonjieli-png-payload-1da09279/badge)](https://www.skillsdirectory.com/skills/alisonjieli-png-payload-1da09279)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "detect-weakened-test-assertions"
description: "Scan a diff of test files for removed assertions, added skip or expected-failure marks, widened tolerances and deleted test functions, and report each with its location."
license: MIT
compatibility: "Python 3.10 or later, standard library only. Reads a unified diff such as the output of git diff."
metadata:
  version: "0.1.0"
---
# Detect weakened test assertions

A change can make a test suite pass by making the tests ask for less. The bundled script reads the diff and lists every place where a test check was removed, switched off, loosened or rewritten, with its file and line. It judges only what the diff shows.

## When to use it

Use it on any change that touches test files, before a ticket is reported as fixed. It matters most when nobody watched the change being made.

## First action

From the repository root, run the script on the diff. SKILL_DIR is the folder that holds this file. If you do not know it, run `ls -d .*/skills/detect-weakened-test-assertions` and use the folder it prints.

```bash
git diff --no-ext-diff --no-textconv -U10 HEAD | python3 -I -B SKILL_DIR/scripts/detect_weakened_tests.py --diff -
```

## Steps

1. If the task names a base revision, use it instead of HEAD. If the task gives a saved diff file, pass its path to `--diff` instead. Keep `-U10`: ten lines of context let the script see checks that span several lines.
2. Run the command and read the JSON it prints.
3. Copy `verdict`, `warnings` and every item of `weakening` and `review` (kind, path, lines and texts) into your answer.
4. For each `review` item, quote the ticket sentence that asks for the new behavior, or write "no reason found".
5. Answer every item in [references/checklist.md](references/checklist.md).

## Checks

- Exit 0, verdict `pass`: no test check was removed, switched off, loosened or rewritten.
- Exit 1, verdict `fail`: at least one `weakening` item. [references/signals.md](references/signals.md) explains each kind.
- Exit 1, verdict `review`: checks, parameter cases or test names changed, and each change needs a stated reason.
- Exit 2, verdict `refused`: the diff could not be read; `reason` says why.
- A warning that a changed line sits inside a statement that starts above the diff context means the diff needs more context lines. Make it again with a larger `-U` value.

## Done when

The verdict and every finding with its location are in your answer, and each review item has a quoted reason or "no reason found".

## Stop and report when

- The verdict is `fail`. Do not restore, rewrite or delete tests yourself unless your task says so.
- A review item has no reason in the ticket.
- The warning says no test file changed, but you know the change touched tests. Run again with `--test-glob` for their folder.

## Known-wrong example

A test expects `order_total(rows) == 11`, the code returns 10, and a step changes the test to `== 10` so the suite passes. The script reports `assertion_rewritten` with both lines and exits 1, so the change cannot be reported as a plain fix.

Files in this skill

  • LICENSE1 KB
  • SKILL.md3 KB
  • examples/honest-test-change.diff712 B
  • examples/weakened-tests.diff860 B
  • references/checklist.md1 KB
  • references/signals.md3.8 KB
  • scripts/detect_weakened_tests.py47.5 KB
  • tests/test_detect_weakened_tests.py19.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.