clean-tests SKILL.md skillA

clean-tests from omarsaleh506/skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.

Install it, pinned
mdr add omarsaleh506/skills/clean-tests@git:20261006.008e80e

Pins git:20261006.008e80e in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 17 of 17 checks passed
Kind
SKILL.md skill
Repository
omarsaleh506/skills
Path
skills/ai-os-init/templates/.claude/skills/clean-tests/SKILL.md
Versions recorded
2
Latest version
git:20261006.008e80e, committed Oct 6, 2026
First version recorded
Jun 28, 2026
Size
2,607 bytes
Repository stars
3
License
MIT

Audits and refactors existing test files for quality — removes brittle assertions, fixes implementation coupling (mocking internals), improves test names, eliminates duplication, and enforces behavior-over-implementation testing. Does NOT write new tests — use a TDD workflow for that. Use when asked to "clean up the tests", "improve test quality", "fix brittle tests", "refactor the test suite", "tests keep breaking on refactor", "tests are a mess", or "make the tests better".

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# clean-tests

Audits and refactors existing tests without removing coverage.

## What Gets Fixed

| Issue | Symptom | Fix |
|---|---|---|
| **Implementation coupling** | Mocking internal modules, testing private methods, asserting on internal state | Rewrite to test through public API only |
| **Brittle assertions** | Exact error message strings, hardcoded IDs, timestamp comparisons | Use flexible matchers, freeze time, assert structure not exact value |
| **Poor test names** | `test_1`, `test_user`, `testGetUser` | Rewrite as sentences: `returns_404_when_user_not_found` |
| **Multi-assertion tests** | One test checks 5 things — failure is ambiguous | Split into focused single-assertion tests |
| **Duplicated setup** | Same 15-line setup repeated across every test | Extract to fixture/factory/helper |
| **False confidence** | `assert True`, `assert result is not None`, empty tests | Add meaningful behavioral assertions |
| **Order dependence** | Tests pass together but fail in isolation | Make each test fully self-contained |
| **Flaky time/random** | `datetime.now()` or `random()` in assertions | Freeze time, seed random, or use matchers |

## Process

### 1. Discover test files
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add omarsaleh506/skills/clean-tests@sha256:6162ba7e2f5052af

The line at the top of this page pins the label git:20261006.008e80e, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_7k7pjwgdbbqcj24r.svg)](https://markdownregistry.com/a/art_7k7pjwgdbbqcj24r)

3 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 2 versions of this file, between Jun 28, 2026 and Oct 6, 2026, about one every 101 days.

versioncommittedcommitsizeaudit
git:20261006.008e80e latest2026-10-06 008e80e 2,607 BA view · diff
git:20260628.cd7722f2026-06-28 cd7722f 2,595 BA view

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (2607 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

omarsaleh506/skills · 3 stars · license MIT · pushed 2026-10-07 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_7k7pjwgdbbqcj24r
GET https://markdownregistry.com/api/v1/resolve?ref=omarsaleh506/skills/clean-tests
GET https://markdownregistry.com/api/v1/blob/6162ba7e2f5052af4a0c9d04c3c618dc6ffb5047b707d0981a62dbdac151b2b0

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.

More from omarsaleh506/skills

CLAUDE.md CLAUDE.md file
omarsaleh506/skills · CLAUDE.md
git:20260629.2d500d5 · audit A · 3 stars
ai-os-init SKILL.md skill
omarsaleh506/skills · skills/ai-os-init/SKILL.md · Scaffolds an "AI Operating System" project structure into any project, non-destructively — adds only missing pieces…
git:20261006.008e80e · audit A · 3 stars
new-adr SKILL.md skill
omarsaleh506/skills · skills/ai-os-init/templates/.claude/skills/new-adr/SKILL.md · Creates a new Architecture Decision Record (ADR) in docs/decisions/. Auto-numbers the file based on the highest…
git:20260628.cd7722f · audit A · 3 stars
CLAUDE.md@skills/ai-os-init/templates CLAUDE.md file
omarsaleh506/skills · skills/ai-os-init/templates/CLAUDE.md
git:20260628.cd7722f · audit A · 3 stars
shop-scout SKILL.md skill
omarsaleh506/skills · skills/shop-scout/SKILL.md · Comparison-shops any product across many online stores, finds the genuinely cheapest option after discounts, surfaces…
git:20261007.0c6d22c · audit A · 3 stars
sqlalchemy-patterns SKILL.md skill
omarsaleh506/skills · skills/sqlalchemy-patterns/SKILL.md · Comprehensive SQLAlchemy 2.0+ async + PostgreSQL patterns — declarative models, relationships, type-safe Mapped[…
git:20261006.98751eb · audit A · 3 stars
system-flow-mapper SKILL.md skill
omarsaleh506/skills · skills/system-flow-mapper/SKILL.md · Produces three grounded deliverables for ANY codebase by reading it (source unchanged), written into the project under…
git:20261006.1f9c93b · audit B · 3 stars

Every file in omarsaleh506/skills

Browse by kind, by grade A, or by owner.