specx-tests

specx-tests is a skill for Codex from maksimzayats/specx. It costs 58 tokens per session (1,621 once invoked), scanned A, original, MIT.

A testing guide for specx Python services, including application logic, web endpoints, database adapters, and full-app checks.

In plain words
What is it for?
It helps create unit, integration, end-to-end, architecture, dependency-injection, coverage, and boundary tests with pytest.
Why use it?
It gives each kind of test a defined place and checks both behavior and the boundaries between parts of the application.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: installed under .agents/ (shared by several agents); mentions AGENTS.md.

Good fit It helps create unit, integration, end-to-end, architecture, dependency-injection, coverage, and boundary tests with pytest.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/maksimzayats/specx/specx-tests
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add maksimzayats/specx --skill specx-tests
Clone the repo
git clone --depth 1 https://github.com/maksimzayats/specx

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for specx-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/maksimzayats/specx/specx-tests/github.svg)](https://agentmods.dev/skills/maksimzayats/specx/specx-tests)
Your own site
<a href="https://agentmods.dev/skills/maksimzayats/specx/specx-tests"><img src="https://agentmods.dev/badge/skills/maksimzayats/specx/specx-tests/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for specx-tests

Your own site · 80×15
<a href="https://agentmods.dev/skills/maksimzayats/specx/specx-tests"><img src="https://agentmods.dev/badge/skills/maksimzayats/specx/specx-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,621 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00058 $0.01621
Opus 5 $0.00029 $0.00811
Sonnet 5 $0.00012 $0.00324
Haiku 4.5 $0.00006 $0.00162

Measured 9d ago against content hash 1d83c4db3a3c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

specx-tests scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (references/render_architecture_guardrails.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/specx-tests/SKILL.md · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.

specx Tests

Use this skill when behavior, wiring, or architecture boundaries need tests. Read references/testing.md before creating test files.

Test Layers

  • tests/_support/: generic clients, DB helpers, and shared integration helpers only. This is not a test suite and does not hold project-specific doubles.
  • tests/unit/: core services, use cases, and capabilities resolved from a fresh application container returned by the project's get_container().
  • tests/integration/: real internal graph tests. Core use-case integration tests call resolved use cases against the transactional DB; delivery integration tests exercise HTTP mapping; migrations prove Alembic behavior.
  • tests/e2e/: optional whole-app smoke flows.
  • tests/guardrails/: optional programmatic specx.testing.architecture.assert_specx_architecture wrappers for genuinely project-specific extra rules. Standard packaged rules run through uv run specx check.

Rules

  • Test behavior and boundaries, not implementation ceremony.
  • Required generated coverage is currently scoped to core services, use cases, and capabilities.
  • Mirror source module paths directly with flat test files, for example tests/unit/core/tasks/services/test_title_service.py.
  • Do not create per-target test folders, harness.py, target factories, or target harnesses.
  • tests/unit/conftest.py owns the fresh real-app Container fixture for unit tests and any project-wide test overrides. tests/integration/conftest.py owns the transactional DB-backed container fixture for integration tests.
  • Test functions receive container, register any scenario-specific overrides before resolution, then call container.resolve(Target).
  • If a complete replacement is needed by every test in one module, a module-local container fixture may register it before returning the container.
  • Keep one-off class-based test doubles in the test_*.py module that uses them. When the same double is reused by multiple unit modules, put it in a mirrored tests/unit/core/<scope>/{capabilities,gateways,repositories}/fake_<source_module>.py file.
  • Do not create tests/_support/fakes, tests/**/_fakes.py, generic _scenarios.py, fake modules outside those mirrored unit port/capability packages, or double classes in conftest.py.
  • Use MagicMock or AsyncMock inline in the test function when only one behavior needs to be changed for that scenario. Prefer autospeccing when call signatures matter and spec_set when unexpected attributes must fail.
  • Unit tests replace external IO, time, randomness, network, Redis, database, and framework resources with local doubles or inline mocks.
  • Integration tests use the real internal app graph. Do not mock internal use cases, services, or capabilities; stub only external systems when needed.
  • Add core use-case integration tests under tests/integration/core/... for use cases that inject a UoW manager; delivery tests should own HTTP mapping, not be the only persistence proof.
  • Persistence integration tests use the production database family when dialect behavior matters. A rollback harness may not replace isolated commit-visible tests for locking, concurrency, isolation, or after-commit behavior.
  • Core health tests cover required-dependency readiness and any reusable probe services and use cases. Delivery probe tests cover /healthz and /readyz as operational endpoints, not versioned business API routes. /healthz must prove a lightweight process response only; /readyz must prove required infrastructure readiness, including a real bounded DB check for SQLAlchemy services.
  • Probe route tests assert Cache-Control: no-store, readiness failure returns 503, probe routes are excluded from OpenAPI, and legacy /api/v1/health is absent when replacing old generated health endpoints.
  • Unit-test logging configurators by overriding logging settings, monkeypatching logging.config.dictConfig, and asserting the generated stdlib config. Use caplog only when a log record is meaningful behavior.
  • Unit-test FastAPI lifecycle managers by overriding closeable infrastructure resources and asserting shutdown order. Route integration helpers must run ASGI lifespan explicitly.
  • Use httpx2, not legacy httpx, for generated HTTP client and ASGI transport tests. Enter LifespanManager, then pass the yielded manager's manager.app to ASGITransport so request scopes receive lifespan state.
  • FastAPI route tests compare response status codes with fastapi.status constants, not raw integer literals.
  • Use container.resolve(...) for normal synchronous graph construction, even when the resolved use case has an async execute(...); use await container.aresolve(...) only when DI construction itself has async providers.
  • Mock fixtures should register one external collaborator for the behavior under test. Do not bundle unrelated mocks in a dict or class-keyed fixture.
  • Use native pytest fixtures for test dependencies. Do not enable diwire.integrations.pytest_plugin, and do not use Injected[...] parameters in tests.
  • AnyIO runs tests on every installed supported backend by default. If the app graph is asyncio-specific, override the top-level anyio_backend fixture to return "asyncio"; leave it unpinned only when the suite intentionally supports every installed backend.
  • Do not add filler smoke tests that only assert container.resolve(...) returns an instance.
  • Do not hand-build application graphs in test bodies. Resolve project classes from the container; local test doubles may be instantiated in the test module before registration.
  • Keep unit tests free from FastAPI request objects and real external IO.
  • Every test directory must include an empty __init__.py file.
  • Use uv run specx check as the default guardrail mechanism for specx boundaries such as docstrings, use-case inputs, UoW injection, route paths, direct persistence dependency rejection in use cases, container imports, and AGENTS.md command coverage.
  • Disable built-in guardrails only with exact semantic IDs under [tool.specx].ignore and a project reason recorded beside the configuration.
  • Generated projects use [tool.specx].select = ["ALL"]. Narrower projects enable technology-specific families explicitly with [tool.specx].extend-select; FastAPI projects select fastapi.
  • Add extra_rules only for project-specific checks that are not covered by a built-in SpecxRuleId; use the programmatic wrapper for those projects.
  • Existing workflows and projects with custom rules may use references/render_architecture_guardrails.py to render the tiny wrapper.

Read the full file on GitHub · 132 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 132 lines · 58 tokens per session scan A 1d83c4db3a3c

Subscribe to this mod's changes

specx-tests is a skill published in the GitHub repository maksimzayats/specx (201 stars, last pushed 1mo ago), licensed MIT. It adds 58 tokens to every session and 1,621 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.