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.zipInstalls 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.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
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 annotationsin 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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| testing (this skill) | 0 | 3mo | No flags | Intermediate |
| python-testing-patterns | 77 | 2mo | Review | Intermediate |
| backtesting-frameworks | 17 | 2mo | No flags | Advanced |
| temporal-python-testing | 8 | 3mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
python-testing-patterns
wshobson
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.
backtesting-frameworks
wshobson
Build robust backtesting systems for trading strategies with proper handling of look-ahead bias, survivorship bias, and transaction costs. Use when developing trading algorithms, validating strategies, or building backtesting infrastructure.
temporal-python-testing
wshobson
Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.
home-assistant-integration-knowledge
home-assistant
Everything you need to know to build, test and review Home Assistant Integrations. If you're looking at an integration, you must use this as your primary reference.
testing-python
jlowin
Write and evaluate effective Python tests using pytest. Use when writing tests, reviewing test code, debugging test failures, or improving test coverage. Covers test design, fixtures, parameterization, mocking, and async testing.
pr-review
pytorch
Review PyTorch pull requests for code quality, test coverage, security, and backward compatibility. Use when reviewing PRs, when asked to review code changes, or when the user mentions "review PR", "code review", or "check this PR".