agentsclimarketplace

Unicorn testing

Skill andrey-learning-machines/swe-harness/plugins/swe-harness/skills/unicorn-testing

Portable SWE harness plugin for Codex and Claude Code

Install
npx -y skills add andrey-learning-machines/swe-harness --skill unicorn-testing

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Guides the user through test-first development and test strategy decisions. ALWAYS trigger on "write tests", "TDD", "test coverage", "mock", "test fails", "flaky test", "how to test", "unit test", "integration test", "e2e test", "test structure", "what to test", "test organization", "coverage report", "testing strategy", "arrange act assert". Use when writing new tests, choosing test types, setting up mocking, debugging flaky tests, improving coverage, or designing testable code. Different from qa-security agent which focuses on code review and security audits rather than test authoring.

SKILL.md

6.2 KB, as published. Nobody here has run it

Testing Domain Skill

TDD Cycle: RED -> GREEN -> REFACTOR

  1. RED - Write a failing test. Must fail for the right reason.
  2. GREEN - Write minimum code to pass. No gold plating.
  3. REFACTOR - Improve design. Tests stay green.
# RED
def test_user_full_name():
    user = User(first="Jane", last="Doe")
    assert user.full_name() == "Jane Doe"

# GREEN
class User:
    def __init__(self, first, last):
        self.first = first
        self.last = last
    def full_name(self):
        return f"{self.first} {self.last}"

# REFACTOR: tests pass, clean up if needed

See: references/tdd-deep-dive.md for advanced TDD techniques.

What to Test / What NOT to Test

DO test (behavior):

  • Public API contracts
  • Edge cases and boundaries
  • Error conditions
  • State transitions
  • Business logic

DON'T test (implementation):

  • Private methods (test through public API)
  • Language features
  • Third-party libraries (only verify integration)
  • Trivial getters/setters
  • Generated code, migrations, static config

Test Types

Unit Tests

  • Run in milliseconds, no I/O, no external dependencies
  • Deterministic, parallelizable
  • Test single units of behavior

Integration Tests

  • Seconds to run, may involve I/O
  • Test real component boundaries
  • Run sequentially if stateful

E2E Tests

  • Slowest (seconds to minutes)
  • Test complete user flows from user perspective
  • Run against staging/test environment

Characterization Tests

  • Capture existing behavior of legacy code before refactoring
  • Document current behavior (even if wrong), then refactor against it

See: references/test-patterns-by-language.md for language-specific frameworks and idioms.

Test Structure: Arrange-Act-Assert

def test_shopping_cart_total():
    # Arrange
    cart = ShoppingCart()
    cart.add_item(Item("Book", 10.00))

    # Act
    total = cart.calculate_total()

    # Assert
    assert total == 10.00

Prefer one assertion per test. Exception: related assertions on the same object.

Coverage Requirements

MetricThreshold
Line coverage80% minimum (CI-enforced)
Branch coverageMore important than line coverage
Critical paths100%

Coverage Commands

LanguageCommand
Pythonpytest --cov=myapp --cov-report=html --cov-fail-under=80
JavaScriptjest --coverage --coverageThreshold='{"global":{"lines":80}}'
Gogo test -cover -coverprofile=coverage.out && go tool cover -html=coverage.out
Rustcargo tarpaulin --out Html --output-dir coverage

See: references/coverage-strategies.md for branch coverage, mutation testing, and coverage-driven development.

Mocking Strategy

When to Mock

MockDon't Mock
Network calls (APIs, databases)Internal implementation details
Filesystem accessValue objects and data structures
Time/randomness dependenciesThe code under test
Slow or unreliable dependenciesSimple collaborators (prefer real objects)
Paid third-party APIs

Mock Types

  • Stub - Returns predefined values. Use for simple dependency replacement.
  • Spy - Records calls for verification. Use when you need to assert interactions.
  • Fake - Simplified working implementation (e.g., in-memory repository). Use for complex dependencies.

Cross-Language Mocking

LanguageToolVerify Call
Pythonunittest.mock.Mock()assert_called_once()
JavaScriptjest.fn()expect().toHaveBeenCalled()
GoInterfaces + mock structsTrack call state manually
RustTraits + mock implsRefCell for interior mutability

See: references/mocking-strategies.md for comprehensive patterns and anti-patterns.

Anti-Patterns

Anti-PatternProblemFix
Testing implementationBrittle tests that break on refactorTest WHAT (outputs/behavior), not HOW (internal calls)
Flaky testsNon-deterministic failuresInject time deps, isolate state, use wait conditions for async
Over-mockingTests verify mocks, not behaviorOnly mock external boundaries, use real objects internally

Test Organization

  • Structure: Separate unit/, integration/, e2e/ directories
  • Naming conventions: test_*.py, *.test.js, *_test.go, tests.rs
  • Function names: Descriptive -- test_user_login_with_invalid_password_returns_error() not test_case_1()

Quick Reference

TaskPythonJavaScriptGoRust
Run testspytest -xnpm test -- --watchgo test ./...cargo test
Coveragepytest --cov=. --cov-fail-under=80jest --coveragego test -covercargo tarpaulin

Remember

  1. RED -> GREEN -> REFACTOR is mandatory
  2. Test behavior, not implementation
  3. 80% coverage minimum, critical paths 100%
  4. Mock external boundaries only
  5. Fast, isolated, deterministic tests
  6. One clear assertion per test (when practical)
  7. Arrange-Act-Assert for clarity
  8. Descriptive test names document behavior
  9. Fix flaky tests immediately (never ignore)
  10. Tests are first-class code (refactor them too)

Additional Resources

  • references/tdd-deep-dive.md - Advanced TDD techniques and when to break rules
  • references/mocking-strategies.md - Comprehensive mocking patterns and anti-patterns
  • references/test-patterns-by-language.md - Language-specific testing patterns
  • references/coverage-strategies.md - Advanced coverage techniques and mutation testing
<!-- Last reviewed: 2026-03 -->

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.