Xpersona
T

testing-quality-standards

CLAWHUB · Unverified

Defines testing quality metrics, coverage thresholds, and anti-patterns Skill: testing-quality-standards Owner: athola Summary: Defines testing quality metrics, coverage thresholds, and anti-patterns Tags: latest:1.9.19 Version history: v1.9.19 | 2026-08-26T13:16:14.708Z | user Release v1.9.19 v1.9.17 | 2026-07-30T05:36:53.210Z | user Release v1.9.17 v1.9.16 | 2026-07-14T19:53:41.036Z | user Release v1.9.16 v1.9.14 | 2026-06-30T18:02:25.741Z | user Release v1.9.14 v1.9.13 | 2026-06-27T16

62
Rank
84
Safety
1.7k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.7K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17emme0e2m3cpf7k2jvp3a84984b8z9:nm-leyline-testing-quality-standards
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-leyline-testing-quality-standards/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

137,177 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: testing-quality-standards
description: Defines testing quality metrics, coverage thresholds, and anti-patterns
version: 1.9.8
triggers:
  - testing
  - quality
  - standards
  - metrics
  - establishing test gates or validating a test suite's coverage targets
metadata: {"openclaw": {"homepage": "https://github.com/athola/claude-night-market/tree/master/plugins/leyline", "emoji": "\ud83e\udd9e"}}
source: claude-night-market
source_plugin: leyline
---

> **Night Market Skill** — ported from [claude-night-market/leyline](https://github.com/athola/claude-night-market/tree/master/plugins/leyline). For the full experience with agents, hooks, and commands, install the Claude Code plugin.


# 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](#coverage-thresholds)
2. [Quality Metrics](#quality-metrics)
3. [Detailed Topics](#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 metrics
- `parseltongue:python-testing` - Uses anti-patterns and best practices
- `sanctum:test-*` - Uses quality checklist and content assertion levels for test validation
- `imbue:proof-of-work` - Uses content assertion levels to enforce Iron Law on execution markdown

Reference in your skill's frontmatter:
```yaml
dependencies: [leyline:testing-quality-standards]
```
**Verification:** Run `pytest -v` to verify tests pass.
## Troubleshooting

### Common Issues

**Tests n

_meta.json

{
  "ownerId": "kn7d107jg9jv602h9ytsegydq184a42s",
  "slug": "nm-leyline-testing-quality-standards",
  "version": "1.9.19",
  "publishedAt": 1787750174708
}

modules/anti-patterns.md

---
name: anti-patterns
description: Testing anti-patterns to avoid with before/after code examples
parent_skill: leyline:testing-quality-standards
category: infrastructure
estimated_tokens: 600
reusable_by: [pensive:test-review, parseltongue:python-testing, sanctum skills]
---

# Testing Anti-Patterns

## Testing Implementation Details

```python
# 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

```python
# 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) == 5
```

## Missing Assertions

```python
# 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 True
```

## Shared Mutable State

```python
# 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) == 1
```

## Test Order Dependencies

```python
# 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

```python
# 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()
```

modules/best-practices.md

---
name: best-practices
description: Testing best practices and principles
parent_skill: leyline:testing-quality-standards
category: infrastructure
estimated_tokens: 200
reusable_by: [pensive:test-review, parseltongue:python-testing]
---

# 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

modules/content-assertion-levels.md

# 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.

```python
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.

```python
# 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.

```python
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_content
```

**Anti-pattern detection**: Forbidden language that causes Claude to ignore user intent.

```python
forbidden = ["MANDATORY AUTO-CONTINUATION", "YOU MUST EXECUTE THIS NOW"]
for phrase in forbidden:
    assert phrase not in skill_content
```

**Decision framework completeness**: Skills must offer multiple strategies, not force one path.

```python
strategies = ["/clear", "/catchup", "auto-compact", "continuation"]
found = [s for s in strategies if s.lower() in content.lower()]
assert len(found) >= 3
```

## When 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 requir

Sponsored

Ads related to testing-quality-standards and adjacent AI workflows.