Skip to content
Skills Library
Programming · Testing

test-authoring

/test-authoring

Use when writing, restructuring, or consolidating tests in the nexus repo, or choosing how to run its suite — dev-loop layer selection, scenario-vs-parametrize calls, contract-suite placement, and the guard/lint invariants protecting the fast loop.

Repository
nexus ↗
Licence
AGPL-3.0
Last repository change
26.10.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

AGPL-3.0, copyleft: przeróbki udostępniane innym muszą mieć tę samą licencję.

What it does and when to use it

Use when writing, restructuring, or consolidating tests in the nexus repo, or choosing how to run its suite — dev-loop layer selection, scenario-vs-parametrize calls, contract-suite placement, and the guard/lint invariants protecting the fast loop.

Original author description

Use when writing, restructuring, or consolidating tests in the nexus repo, or choosing how to run its suite — dev-loop layer selection, scenario-vs-parametrize calls, contract-suite placement, and the guard/lint invariants protecting the fast loop.

How it works

  1. Running the suite — pick the right layer
  2. Authoring decisions (the rules that keep the loop fast and honest)
Original SKILL.md headings · 52 lines, 485 words
SKILL.md preview
---
name: test-authoring
description: Use when writing, restructuring, or consolidating tests in the nexus repo, or choosing how to run its suite — dev-loop layer selection, scenario-vs-parametrize calls, contract-suite placement, and the guard/lint invariants protecting the fast loop.
effort: low
---

# Test Authoring (nexus)

Reference skill — no agent dispatch. Canonical doc surfaces: `tests/AGENTS.md`
(authoring directives) and root `AGENTS.md` Quick start; durable rationale in
T2 `nexus/directive-test-suite-architecture`. This skill is the routing card.

## Running the suite — pick the right layer

| Need | Command | Notes |
|------|---------|-------|
| Agent hand run | `lab-run -c lab-m -- python3 scripts/watched_pytest.py --stall 180 --status <f> -- uv run pytest <paths, -k or -m>` | Targeted, on chas. No tree gets two green full runs; once pushed, develop CI is the verdict; a hand full suite is announced with its change class, tree sha and "no green full run exists" (AGENTS.md rule 13). Engine: `scripts/mvnw-leased.sh --lab-run`. |
| Full Python suite | `uv run pytest -n auto` | Auto-capped to the box's shared-memory budget and, in a lab-run grant, to the grant's memory (AGENTS.md). The pre-push run a `src/nexus/` or `service/` change requires, once per tree (rule 13). |
| Debugging interleaving/isolation | `uv run pytest` (serial) | Only when parallelism masks the signal |
| Repo-structure invariants | `uv run pytest -m lint` | O(repo) meta-tests; PR-gated by CI `test-lint`; run when touching `conexus/`, RDR frontmatter, storage-boundary/hook invariants |
| Real-substrate depth | `uv run pytest -m integration` | Nightly local-service gate territory |
| System truths, in-process | `scenario` journeys (in default loop) | `tests/test_scenario_journeys.py` |

After ANY pull/rebase touching `service/`: `scripts/build-gate-jar.sh` first;
session start refuses (exit 75) on a missing or stale jar.
One full suite per box at a time (AGENTS.md rule 5).

## Authoring decisions (the rules that keep the loop fast and honest)

1. **Scenario-merge vs parametrize.** One journey/state progression → ONE
   scenario test, multi-assert with messages. Independent inputs/signals →
   parametrize table (each keeps its own failure id). NEVER chain independent
   signals into sequential asserts.
2. **Sort every set/frozenset fed to `parametrize`.** Hash randomization gives
   xdist workers different collection orders; the run aborts.
3. **Cross-store T2 contract behavior** goes in the case-binding suites
   (`tests/db/test_http_store_selfheal.py` SelfHealCase,
   `tests/db/test_t2_store_crud_contract.py` CrudCase/AuthCase,
   `test_t2_store_config_contract.py`) — never a new per-store copy. A store
   whose shape genuinely diverges stays out, with a docstring saying why.
4. **New system-truth coverage** (X → Y must hold end-to-end) goes in
   `tests/test_scenario_journeys.py`: one self-contained function-scoped test,
   `scenario`-marked, real substrate, ~1s budget. Never assert overall
   `nx doctor` health (ambient probe) — only storage-derived facts. The
   non-vacuity guard + `test_scenario_wiring_lint.py` protect the layer;
   retiring a journey means lowering that lint's floor in the same commit.
5. **Regression pins** keep their bead/incident name and rationale visible,
   standalone or folded. Never silently generalized.
6. **O(repo) census tests** are `pytest.mark.lint`. Expensive shared scans get
   `functools.cache`. A census that reads `session.items` is the exception
   (tests/AGENTS.md, Test-authoring directives).
7. **Consolidation proposals need assertion-level evidence.** Measured lesson
   (5 independent implementers, 2026-08-05 arc): no-coverage-loss
   consolidation yields ~1–2% collected-count reduction — structural
   similarity is not redundancy. An honest "left alone" beats a forced merge.
   Speed comes from parallelism, lint reclassification, and fixture fixes.

Versions

The database has no other skills named test-authoring.

Database snapshot: 13.11.2026 · package version ac99f4acd9aa (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100api-test-suite-builder
    Use when the user asks to generate API tests, create integration test suites, test REST endpoints, or build contract tests.
  • 100pre-push-review
    Use when about to push nexus work and deciding what to run first, reading a green or red test result before a push, fixing a lint or ruff finding, rebasing before a push, or briefing an implementer, concurrent runs and reviewers that share a tree.
  • 100api-docs-lint
    API docstring style guide for public endpoint handlers and external API types. Use when writing or reviewing doc comments in nexus/external-api or nexus/types/src/external_api.
  • 90proof-audit
    Audit test suite health — find flaky tests, slow tests, coverage gaps, and testing anti-patterns. Use when asked to "audit tests", "fix flaky tests", "why are tests slow", "test health", or "improve test suite".
  • 90proof-audit
    Audit test suite health — find flaky tests, slow tests, coverage gaps, and testing anti-patterns. Use when asked to "audit tests", "fix flaky tests", "why are tests slow", "test health", or "improve test suite".
  • 100test-audit
    Use when asked to audit unit tests, check test quality/health, find flaky or weak tests, or review the test suite for smells — repo-wide or on changed tests

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.