
Testing Quality Standards
- 102 installs
- 325 repo stars
- Updated August 2, 2026
- athola/claude-night-market
Steer agents away from common testing mistakes with concrete before-and-after examples when writing or reviewing tests.
About
testing-quality-standards (packaged here as anti-patterns content under claude-night-market) gives solo builders a compact guardrail set for test code agents generate. Instead of abstract advice, it shows bad pytest snippets beside fixes: stop asserting on private methods, do not mock arithmetic you can run for real, always assert outcomes, and isolate tests from shared mutable fixtures. The frontmatter ties it to a parent testing-quality-standards skill and notes reuse by test-review and python-testing workflows, so it fits a larger Leyline-style quality stack. Invoke it when an agent drafts tests that look verbose but prove nothing, or when you want review comments grounded in recognizable smells. It is strongest for Python pytest services but the principles transfer to other frameworks. Complexity is beginner-friendly because examples are short; confidence is slightly lower where the ingested readme truncated mid-example. Pair with a test generator or TDD skill for green-field suites, and with code review skills when auditing an existing module before ship.
- Before/after pairs for testing private methods versus public behavior
- Over-mocking callout with a simple calculate_total example
- Missing-assertions anti-pattern with corrected explicit asserts
- Shared mutable state warning between tests
- Reusable by test-review and python-testing related skills per frontmatter
Testing Quality Standards by the numbers
- 102 all-time installs (skills.sh)
- Ranked #996 of 2,153 Testing & QA skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/athola/claude-night-market --skill testing-quality-standardsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 102 |
|---|---|
| repo stars | ★ 325 |
| Security audit | 3 / 3 scanners passed |
| Last updated | August 2, 2026 |
| Repository | athola/claude-night-market ↗ |
What it does
Steer agents away from common testing mistakes with concrete before-and-after examples when writing or reviewing tests.
Files
Testing Quality Standards
Shared quality standards and metrics for testing across all plugins in the Claude Night Market ecosystem.
When To Use
- Establishing test quality gates and coverage targets
- Validating test suite against quality standards
When NOT To Use
- Exploratory testing or spike work
- Projects with established quality gates that meet requirements
Table of Contents
1. Coverage Thresholds 2. Quality Metrics 3. Detailed Topics
Coverage Thresholds
| Level | Coverage | Use Case |
|---|---|---|
| Minimum | 60% | Legacy code |
| Standard | 80% | Normal development |
| High | 90% | Critical systems |
| detailed | 95%+ | Safety-critical |
Quality Metrics
Structure
- [ ] Clear test organization
- [ ] Meaningful test names
- [ ] Proper setup/teardown
- [ ] Isolated test cases
Coverage
- [ ] Critical paths covered
- [ ] Edge cases tested
- [ ] Error conditions handled
- [ ] Integration points verified
Maintainability
- [ ] DRY test code
- [ ] Reusable fixtures
- [ ] Clear assertions
- [ ] Minimal mocking
Reliability
- [ ] No flaky tests
- [ ] Deterministic execution
- [ ] No order dependencies
- [ ] Fast feedback loop
Detailed Topics
For implementation patterns and examples:
- [Anti-Patterns](modules/anti-patterns.md) - Common testing mistakes with before/after examples
- [Best Practices](modules/best-practices.md) - Core testing principles and exit criteria
- [Content Assertion Levels](modules/content-assertion-levels.md) - L1/L2/L3 taxonomy for testing LLM-interpreted markdown files
Integration with Plugin Testing
This skill provides foundational standards referenced by:
pensive:test-review- Uses coverage thresholds and quality metricsparseltongue:python-testing- Uses anti-patterns and best practicessanctum:test-*- Uses quality checklist and content assertion levels for test validationimbue:proof-of-work- Uses content assertion levels to enforce Iron Law on execution markdown
Reference in your skill's frontmatter:
dependencies: [leyline:testing-quality-standards]Verification: Run pytest -v to verify tests pass.
Troubleshooting
Common Issues
Tests not discovered Ensure test files match pattern test_*.py or *_test.py. Run pytest --collect-only to verify.
Import errors Check that the module being tested is in PYTHONPATH or install with pip install -e .
Async tests failing Install pytest-asyncio and decorate test functions with @pytest.mark.asyncio
Testing Anti-Patterns
Testing Implementation Details
# Bad: Testing private methods
def test_internal_method():
service = UserService()
result = service._validate_email("test@example.com") # Testing private method
assert result is True
# Good: Testing public behavior
def test_user_creation_validates_email():
service = UserService()
with pytest.raises(ValidationError):
service.create_user("Alice", "invalid-email")Over-Mocking
# Bad: Mocking simple calculations
@patch("calculator.add")
def test_total(mock_add):
mock_add.return_value = 5
assert calculate_total(2, 3) == 5
# Good: Test the actual logic
def test_total():
assert calculate_total(2, 3) == 5Missing Assertions
# Bad: No assertions
def test_user_creation():
user = create_user("Alice", "alice@example.com")
print(f"Created user: {user}") # No assertions
# Good: Clear assertions
def test_user_creation():
user = create_user("Alice", "alice@example.com")
assert user.name == "Alice"
assert user.email == "alice@example.com"
assert user.is_active is TrueShared Mutable State
# Bad: Shared mutable state between tests
shared_data = []
def test_append():
shared_data.append(1)
assert len(shared_data) == 1
def test_another():
shared_data.append(2)
assert len(shared_data) == 1 # Fails due to shared state
# Good: Use fixtures for isolation
@pytest.fixture
def data():
return []
def test_append(data):
data.append(1)
assert len(data) == 1Test Order Dependencies
# Bad: Tests depend on execution order
def test_step_1():
global user
user = create_user("Alice")
def test_step_2():
# Depends on test_step_1 running first
assert user.name == "Alice"
# Good: Independent tests with fixtures
@pytest.fixture
def user():
return create_user("Alice")
def test_user_creation(user):
assert user.name == "Alice"Dead Waits
# Bad: Arbitrary sleeps
def test_async_operation():
start_operation()
time.sleep(5) # Arbitrary wait
assert operation_complete()
# Good: Wait for condition
def test_async_operation():
start_operation()
wait_for_condition(lambda: operation_complete(), timeout=5)
assert operation_complete()Testing Best Practices
Core Principles
1. Test behavior, not implementation - Focus on what, not how 2. One concept per test - Keep tests focused 3. Arrange-Act-Assert - Consistent structure 4. BDD language - Given/When/Then for clarity 5. Fast feedback - Tests should run quickly
Naming and Structure
6. Descriptive names - test_user_creation_with_invalid_email_raises_error 7. Independent tests - No shared state between tests 8. Use fixtures - Avoid setup duplication
Boundaries and Coverage
9. Mock at boundaries - Only mock external dependencies 10. Measure coverage - Aim for meaningful, not just high
Exit Criteria
- Coverage thresholds documented and understood
- Quality metrics defined and measurable
- Anti-patterns identified and avoided
- Best practices applied consistently
Content Assertion Levels
Why Content Assertions Exist
Markdown files under skills/, agents/, modules/, and commands/ are execution markdown: Claude Code interprets them as behavioral instructions, not static documentation. When these files contain broken JSON schemas, stale version references, or manipulative language, Claude produces broken outputs or harmful behaviors.
Content assertions catch these problems before users encounter them. The guiding question: "If this content were wrong, what would Claude do incorrectly?"
The Three Levels
Level 1: Keyword Presence
Validates that required sections, terminology, and module references exist.
assert "## When To Use" in skill_content
assert "pre-invocation" in module_content.lower()Cheapest to write. Catches structural regressions (missing sections, dropped references) but not semantic errors (wrong JSON schema, stale version).
Level 2: Code Example Validity
Parses embedded code examples and validates structure. Catches broken examples that Claude would copy verbatim into user configurations.
# Extract and validate all JSON code blocks
blocks = re.findall(r"```json\n(.*?)```", content, re.DOTALL)
for block in blocks:
parsed = json.loads(block) # Must parse without error
# Validate schema structure
assert "matcher" in hook_def
assert hook_def["type"] in ("command", "http")Also covers: YAML frontmatter parsing, version string extraction with regex, section extraction for targeted validation.
Level 3: Behavioral Contracts
Validates semantic correctness across documents and ensures the content teaches Claude correct behavior.
Cross-reference validation: Version strings referenced in one document must exist in compatibility docs.
versions = re.findall(r"2\.1\.(\d+)", module_content)
compat_texts = [p.read_text() for p in compat_dir.glob("compatibility-features*.md")]
compat_content = "\n".join(compat_texts)
for v in versions:
assert f"2.1.{v}" in compat_contentAnti-pattern detection: Forbidden language that causes Claude to ignore user intent.
forbidden = ["MANDATORY AUTO-CONTINUATION", "YOU MUST EXECUTE THIS NOW"]
for phrase in forbidden:
assert phrase not in skill_contentDecision framework completeness: Skills must offer multiple strategies, not force one path.
strategies = ["/clear", "/catchup", "auto-compact", "continuation"]
found = [s for s in strategies if s.lower() in content.lower()]
assert len(found) >= 3When to Apply Each Level
| Content Type | Minimum Level | L3 Required When |
|---|---|---|
| Skill SKILL.md (simple) | L1 | Cross-references other docs |
| Skill with code examples | L2 | Code examples are templates Claude copies |
| Skill with decision frameworks | L2 | Always: decisions affect user outcomes |
| Module with version gates | L2 | Always: wrong versions break features |
| Agent definitions | L1 | Defines forbidden or required behaviors |
Test Class Conventions
- Name content assertion classes with a
Contentsuffix:TestSubagentCoordinationModuleContent - State the level in the class docstring:
Level 2: Version references are internally consistent. - Use
@pytest.mark.bddand@pytest.mark.unitmarkers - Use
Path(__file__).parents[N]for relative path resolution to skill files - Fixtures:
skill_pathreturns thePath,skill_contentcalls.read_text()
What NOT to Test with Content Assertions
- Prose style or word choice (use
scribe:slop-detectorinstead) - Exact wording that makes tests brittle to rewording
- Line counts or file sizes (not behavioral)
- Formatting or whitespace
Exemplars
Three test classes established the taxonomy in practice:
| Test Class | Plugin | Levels | Key Patterns |
|---|---|---|---|
TestHookAuthoringHttpHooks | abstract | L2+L3 | JSON schema validation, version cross-reference to compatibility docs |
TestClearContextSkillContent | conserve | L1+L3 | Forbidden manipulative language, multiple recovery strategies |
TestSubagentCoordinationModuleContent | conserve | L2+L3 | Section extraction via regex, delegation framework contracts |
File locations:
plugins/abstract/tests/test_skill_structure.pyplugins/conserve/tests/unit/skills/test_clear_context.pyplugins/conserve/tests/unit/skills/test_context_optimization.py
Related skills
FAQ
Is Testing Quality Standards safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.