test-coverage
Domain knowledge for test coverage in citum-core. Use this skill whenever you're implementing a feature, fixing a bug, writing tests, or claiming something is…
от citum★ 36 звёзд на GitHub
Установить test-coverage в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Citum Test Coverage
The core problem
500+ tests pass, but behaviors still slip through. The reason is almost always one of two things:
- The fixture data doesn't have the right shape to exercise the code path
(e.g., testing "no-date" rendering but every reference has an
issuedfield) - Citation scenarios only reference
article-journal/bookitems, so citation rendering ofchapter,report,thesis, etc. is untested
Use the audit script and this checklist before declaring something tested.
Anti-overfitting rule
Passing tests are not enough. A new or changed test must make an independent claim about behavior:
- Prefer expected values from a fixture, citeproc oracle output, a spec, a registered divergence, or a literal behavior contract.
- Do not derive
expectedfromactual,result,rendered, or other output produced by the code under test. - For behavior fixes, confirm the test would fail on the old behavior when practical. If that is not practical, say why in the PR or final report.
- Avoid changing exact assertions into
containsassertions unless the behavior is intentionally partial, order-insensitive, or format-agnostic. - If a fixture changes, state which missing shape it adds and which scenario exercises that shape.
The full shared bar — including when a test counts as redundant and should be
deleted rather than kept — lives in docs/guides/CODING_STANDARDS.md
§ "What makes a test worth keeping". Per-spec soundness state is tracked in
docs/architecture/TEST_SOUNDNESS_STATUS.md.
Test Style
Before writing a test, pick the right style (full rule in
docs/guides/CODING_STANDARDS.md § "Test Style"):
| Scenario | Location | Style |
|---|---|---|
| Single-function / pure logic | Inline #[cfg(test)] |
Plain #[test] |
| Single-scenario integration | tests/ |
Plain #[test] |
| Parameterised cross-module behavior | tests/ |
#[rstest] + given_…_when_…_then_… |
BDD naming (given_…_when_…_then_…) is only for #[rstest] integration
tests with 2+ parameterised cases. Do not apply it to unit tests or
single-scenario integration tests.
Quick audit
python scripts/audit-coverage.py # text report
python scripts/audit-coverage.py --json # machine-readable
python3 scripts/audit-rust-review-smells.py --changed
Pre-test checklist
Before implementing or claiming a feature is tested, answer these questions:
- What reference types does this feature affect?
- For each type: does the fixture have an item of that type?
- What field shapes trigger the code path? (see matrix below)
- Does the fixture have an item with those fields populated?
- If testing citation rendering: does
citations-expanded.jsonreference an item of the relevant type? - What independent source defines the expected result: fixture, oracle, spec, divergence register, or literal behavior contract?
- Run
cargo nextest run— do the tests actually exercise the path?
Post-test checklist
After writing tests:
- Would the test fail against the old behavior, or is the exception documented?
- Are expected values independent of the actual output under test?
- Did you add fixture items if shapes were missing?
- Did you add citation scenarios if types were missing from
citations-expanded.json? - Did
python3 scripts/audit-rust-review-smells.py --changedproduce only reviewed advisory findings? - Does
cargo nextest runpass cleanly? - If the feature touches oracle-level behavior: run
./scripts/workflow-test.sh styles-legacy/apa.cslto sanity-check
Feature → Required Reference Shapes
This is the core domain knowledge. For each feature, here are the fixture shapes you must have to test it properly.
Date rendering
| Shape needed | How to create it | Example item |
|---|---|---|
| Year-only | "issued": {"date-parts": 2020} |
ITEM-1, ITEM-2 |
| Year + month | "issued": {"date-parts": 2023, 6} |
ITEM-17 |
| Full date (Y-M-D) | "issued": {"date-parts": 1964, 7, 2} |
ITEM-16 |
| No date ("n.d.") | Omit issued entirely |
ITEM-33 |
| Accessed date | Add "accessed": {"date-parts": ...} |
ITEM-13 |
Watch out: "n.d." rendering is the most commonly missed. If you're touching date logic, always verify ITEM-33 (no
issued) is in your test path.
Contributor rendering
| Shape needed | How to create it | Example item |
|---|---|---|
| Single author | One entry in author array |
ITEM-1 |
| Two authors | Two entries | ITEM-6, ITEM-9 |
| Three authors | Three entries | ITEM-3 |
| 6+ authors (et-al) | Six or more | ITEM-7 |
| Corporate / institutional | {"literal": "Org Name"} |
ITEM-5 |
| No author (anonymous) | Omit author |
ITEM-15 |
| Editor only (no author) | editor array, no author |
ITEM-14 |
| Author + editor | Both arrays populated | ITEM-4, ITEM-27 |
| Translator | `tr |
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл test-coverage?
Domain knowledge for test coverage in citum-core. Use this skill whenever you're implementing a feature, fixing a bug, writing tests, or claiming something is "tested" in citum-core. Trigger on any task involving: adding fixture data, writing Rust tests, running the oracle, validating style behavior, or checking whether a code path is exercised. This skill tells you what reference shapes are required to test each behavior, and provides a pre/post checklist so nothing slips through.
Как установить скилл test-coverage?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл test-coverage запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…