Standardized pytest workflow for the Stellaris Overmind engine, including empire configuration fixtures and validator testing.

Install

mkdir -p .claude/skills/testing-dfintz && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16582" && unzip -o skill.zip -d .claude/skills/testing-dfintz && rm skill.zip

Installs to .claude/skills/testing-dfintz

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

> **Use when:** Writing or modifying tests for the Stellaris Overmind engine. > All tests use pytest and live in the `tests/` directory.
136 chars · catalog description✓ has a “when” trigger
Intermediate

Key capabilities

  • Write tests for the Stellaris Overmind engine
  • Use pytest fixtures for common empire configurations
  • Cover fog-of-war filtering explicitly
  • Cover validator rejection paths
  • Cover all origin types in ruleset generation
  • Verify each ethic produces correct base priorities

How it works

The skill guides the creation of pytest-based tests for the Stellaris Overmind engine, covering ruleset generation, decision engine, personality, and validator functionalities.

Inputs & outputs

You give it
Stellaris Overmind engine module or component
You get back
Pytest-based test files covering various functionalities

When to use testing

  • Write unit tests for ruleset generators
  • Create empire configuration fixtures for testing
  • Validate fog-of-war filtering logic
  • Test engine decision paths

About this skill

Testing

Use when: Writing or modifying tests for the Stellaris Overmind engine. All tests use pytest and live in the tests/ directory.

Your full coding standards are in .github/copilot-instructions.md and CLAUDE.md.


Quick Start Checklist

  • Test file name: tests/test_<module_name>.py
  • Use pytest fixtures for common empire configurations
  • Cover fog-of-war filtering explicitly
  • Cover validator rejection paths
  • Cover all origin types in ruleset generation

Test Structure

tests/
    test_ruleset_generator.py
    test_decision_engine.py
    test_personality_shards.py
    test_validator.py
    conftest.py              ← shared fixtures

Fixture Patterns

conftest.py — Shared Empire Fixtures

import pytest

@pytest.fixture
def une_empire() -> dict:
    """United Nations of Earth — standard democratic empire."""
    return {
        "ethics": ["Egalitarian", "Xenophile", "Militarist"],
        "civics": ["Beacon of Liberty", "Meritocracy"],
        "traits": ["Intelligent", "Thrifty"],
        "origin": "Prosperous Unification",
        "government": "Democracy",
    }

@pytest.fixture
def void_dwellers_empire() -> dict:
    """Void Dwellers — habitat-only colonization."""
    return {
        "ethics": ["Materialist", "Xenophobe"],
        "civics": ["Technocracy", "Citizen Service"],
        "traits": ["Intelligent", "Natural Engineers"],
        "origin": "Void Dwellers",
        "government": "Oligarchy",
    }

@pytest.fixture
def sample_state() -> dict:
    """Minimal valid game state snapshot."""
    return {
        "version": "4.3.4",
        "year": 2230,
        "month": 6,
        "colonies": ["Earth", "Mars"],
        "known_empires": [
            {"name": "Tzynn Empire", "attitude": "Hostile", "intel_level": "Low"}
        ],
        "economy": {"energy": 100, "minerals": 200, "alloys": 50},
        "fleets": [],
    }

Test Categories

1. Ruleset Generation Tests

  • Verify each ethic produces correct base priorities
  • Verify civic modifiers apply correctly
  • Verify trait micro-modifiers apply correctly
  • Verify origin overrides replace lower-layer values
  • Verify the hierarchy: origin override wins over ethic base

2. Decision Engine Tests

  • Verify prompt construction includes ruleset + state + event
  • Verify LLM response parsing extracts ACTION/TARGET/REASON
  • Verify invalid actions raise ValueError
  • Verify stub response when no LLM connected

3. Personality Tests

  • Verify government weighting (Imperial=80% ruler, Democracy=20% ruler, etc.)
  • Verify ethic influence on personality dimensions
  • Verify values are clamped to [0.0, 1.0]
  • Verify all government types have valid weights

4. Validator Tests (CRITICAL)

  • Fog-of-war: reject directive targeting unknown system
  • Action whitelist: reject invalid action names
  • Version lock: reject mismatched ruleset version
  • Origin constraints: Void Dwellers can't colonize non-habitats
  • Civic constraints: Inward Perfection blocks diplomacy
  • Civic constraints: Barbaric Despoilers only raiding wars
  • Reason required: reject empty reason field

5. Integration Tests

  • Full pipeline: generate ruleset → build personality → decide → validate
  • Verify end-to-end fog-of-war compliance

Rules

  • Use from __future__ import annotations in test files
  • Test names: test_<what>_<condition>_<expected> pattern
  • One assert per test where practical
  • Use parametrize for testing multiple ethics/civics/origins
  • Never mock the validator — always test real validation
  • Fog-of-war tests are mandatory for any state-handling code

When not to use it

  • When not writing or modifying tests for the Stellaris Overmind engine
  • When not using pytest
  • When not testing within the `tests/` directory

Limitations

  • All tests use pytest and live in the `tests/` directory.
  • One assert per test where practical.
  • Never mock the validator , always test real validation.

How it compares

This skill provides a structured and categorized approach to testing the Stellaris Overmind engine, ensuring complete coverage of specific game mechanics, unlike general Python testing practices.

Compared to similar skills

testing side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
testing (this skill)03moNo flagsIntermediate
python-testing-patterns772moReviewIntermediate
backtesting-frameworks172moNo flagsAdvanced
temporal-python-testing83moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

Search skills

Search the agent skills registry