test-conventions

Enforce standardized unit and integration test conventions across projects.

Updated Dec 20, 2025
One-click install
npx skills add https://github.com/kne6379/claude-code-template --skill test-conventions-kne6379
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-conventions
Source: https://github.com/kne6379/claude-code-template/tree/main/.claude/skills/test-conventions
Command: npx skills add https://github.com/kne6379/claude-code-template --skill test-conventions-kne6379

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures consistency and quality in your test suites by automatically applying established testing conventions and best practices.

Core Features & Use Cases

  • Enforces AAA Pattern: Guides tests into Arrange, Act, Assert phases for clarity.
  • Mandates Test Case Types: Ensures coverage of happy path, edge cases, and error scenarios.
  • Promotes Clear Naming: Encourages descriptive test names for better understanding.
  • Guides Mock Usage: Provides principles for effective mocking and when to avoid it.
  • Use Case: When writing a new test for a critical API endpoint, this Skill will remind you to cover all potential inputs, edge cases, and to name the test descriptively like "should return 404 when user not found".

Quick Start

Follow the AAA pattern (Arrange, Act, Assert) when writing new tests.

Frequently Asked Questions about test-conventions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are the best practices for structuring unit and integration tests?

Best practices for structuring unit and integration tests involve following the Arrange, Act, Assert pattern to separate test setup, execution, and verification phases for improved readability. This enforces clear structural conventions across your test suites.

How do I ensure my test suites cover edge cases and error scenarios?

To ensure test suites cover edge cases and error scenarios, mandate coverage of happy path, boundary inputs, and expected failures. Establishing standardized testing conventions guarantees essential test case types are consistently addressed across projects.

What naming conventions should I use for writing descriptive test cases?

Naming conventions for descriptive test cases should clearly state the expected behavior and conditions, such as "should return 404 when user not found". Promoting clear, descriptive test names enhances overall test readability and maintainability.

When should I use mocks in unit tests and when should I avoid them?

Use mocks in unit tests to isolate external dependencies, but avoid them when they obscure actual integration behavior. Guiding effective mock usage improves test reliability and maintainability without creating brittle, implementation-coupled tests.

Does applying test conventions work for both unit and integration tests?

Applying test conventions works for both unit and integration tests by standardizing structure, naming, and mock usage across all testing levels. This ensures consistent quality and readability regardless of the test scope.