home / skills / jeremylongshore / claude-code-plugins-plus-skills / test-naming-enforcer

This skill helps enforce consistent test naming conventions by generating guidance, code templates, and validations for unit, integration, and mock tests.

npx playbooks add skill jeremylongshore/claude-code-plugins-plus-skills --skill test-naming-enforcer

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.1 KB
---
name: "test-naming-enforcer"
description: |
  Test Naming Enforcer - Auto-activating skill for Test Automation.
  Triggers on: test naming enforcer, test naming enforcer
  Part of the Test Automation skill category. Use when writing or running tests. Trigger with phrases like "test naming enforcer", "test enforcer", "test".
allowed-tools: "Read, Write, Edit, Bash(cmd:*), Grep"
version: 1.0.0
license: MIT
author: "Jeremy Longshore <[email protected]>"
---

# Test Naming Enforcer

## Overview

This skill provides automated assistance for test naming enforcer tasks within the Test Automation domain.

## When to Use

This skill activates automatically when you:
- Mention "test naming enforcer" in your request
- Ask about test naming enforcer patterns or best practices
- Need help with test automation skills covering unit testing, integration testing, mocking, and test framework configuration.

## Instructions

1. Provides step-by-step guidance for test naming enforcer
2. Follows industry best practices and patterns
3. Generates production-ready code and configurations
4. Validates outputs against common standards

## Examples

**Example: Basic Usage**
Request: "Help me with test naming enforcer"
Result: Provides step-by-step guidance and generates appropriate configurations


## Prerequisites

- Relevant development environment configured
- Access to necessary tools and services
- Basic understanding of test automation concepts


## Output

- Generated configurations and code
- Best practice recommendations
- Validation results


## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| Configuration invalid | Missing required fields | Check documentation for required parameters |
| Tool not found | Dependency not installed | Install required tools per prerequisites |
| Permission denied | Insufficient access | Verify credentials and permissions |


## Resources

- Official documentation for related tools
- Best practices guides
- Community examples and tutorials

## Related Skills

Part of the **Test Automation** skill category.
Tags: testing, jest, pytest, mocking, tdd

Overview

This skill enforces consistent, meaningful test names across your test suite to improve readability, discoverability, and maintainability. It auto-activates for test automation workflows and provides guidance, patterns, and configuration snippets you can apply instantly. Use it to standardize naming for unit, integration, and end-to-end tests.

How this skill works

The skill inspects test files and test metadata to detect naming patterns, anti-patterns, and deviations from chosen conventions. It suggests corrective renames, generates configuration for linters or test runners, and can produce example test names and templates aligned with common frameworks like pytest and Jest. Outputs include step-by-step change lists and sample code or configuration you can apply directly.

When to use it

  • When writing new tests and you want consistent, descriptive names
  • When reviewing a test suite to improve discoverability and reduce flaky-test ambiguity
  • When onboarding teams to a shared test naming convention
  • When configuring CI linting or pre-commit checks for test names
  • When migrating tests between frameworks or refactoring large test suites

Best practices

  • Prefer descriptive names that state behavior and expected outcome, not implementation details
  • Use a consistent structure: context_when_condition_expectedResult (or framework idioms like test_should_doX)
  • Include setup and important inputs only when they affect the test outcome
  • Keep names concise but specific; avoid duplicative folder or class-level information
  • Enforce naming via CI checks or pre-commit hooks to prevent drift

Example use cases

  • Scan a repository and produce a prioritized list of tests that violate naming rules with suggested replacements
  • Generate pytest and Jest configuration snippets to integrate test-name linting into CI
  • Create templates for unit and integration tests showing recommended naming patterns
  • Provide refactor steps for batch-renaming tests with minimal disruption to test history
  • Advise on naming for parameterized tests and data-driven scenarios to preserve clarity

FAQ

Can this skill rename tests automatically?

It generates safe, repeatable rename suggestions and change lists; you can apply them manually or via provided scripts to ensure review before committing.

Which frameworks does it support?

It targets common frameworks such as pytest and Jest and provides patterns and config examples applicable to most test runners.