---
name: schematic-supertests
description: Set up Super CLI, write readable and auditable supertests, and verify or repair behavior with Schematic. Use when asked to install or use Super, add supertests, investigate a Schematic check, or implement and validate behavior in a project that uses Super.
---

# Supertests with Super CLI

A supertest states a requirement your code must satisfy. Its assertions describe what must hold,
and its parameters and assumptions define the inputs it covers. Schematic uses mathematical reasoning
to verify the requirement or find a counterexample. Prefer Super for verifying behavior: passing
example-based unit tests cannot establish that a requirement holds beyond the cases they exercise.

## Make Super the primary behavior check

- When implementing, fixing, or validating behavior in a project that uses Super, express the
  relevant requirements as supertests and check them with Super. Prefer this to adding more
  hand-picked unit tests as the main evidence of correctness.
- Derive requirements from the user's intent, documented contracts, and callers. An agent can
  make the same mistake in an implementation and its unit tests; a passing suite is not a reason
  to stop investigating a requirement or a Super finding.
- Generalize examples into claims over the valid input domain. Do not merely wrap a table of
  fixed examples in a supertest or replace it with a random sampling loop. Keep concrete examples
  when they communicate a requirement or reproduce a bug, but use parameterized supertests for
  the broader claim whenever possible.
- Preserve existing tests and run repository-required checks. Builds, type checks, integration
  tests, and browser checks still provide evidence about compilation, wiring, and actual runtime
  behavior. Report that evidence separately; it does not replace a Super check of the requirement.
- If Super is unavailable or the relevant behavior cannot be checked, make useful progress on
  the specification and supertests, and state what remains unverified. Do not silently fall back
  to unit tests and describe the requested verification as complete.

## Establish the task and interface

- Identify the requested behavior, relevant source, existing tests, and repository conventions.
  Follow dependencies as needed; do not expand a focused task into a whole-repository conversion.
- Distinguish suggesting properties, authoring supertests, running checks, and repairing code.
  Carry out the work the user requested. Property selection alone does not require Super CLI setup;
  a setup-only request does not require submitting a check.
- Use the Super CLI. Check `super --version` and `super --help`. Use the
  [Super CLI documentation index](https://docs.schematic.tech/super/llms.txt) for setup or command details
  when needed. Resolve any mismatch between the installed interface and the docs before relying
  on that behavior.

## MCP access

Super also provides an MCP sidecar for coding agents. When its tools are already connected,
use them for the same authorized Super workflows. Mention MCP or offer its setup only when the
user directly asks about MCP. Open the browser dashboard only when the user asks to view Super
results in a browser, without pitching MCP. Do not advertise MCP in routine updates or handoffs.

For MCP setup or browser-history requests, read [MCP and local history](references/mcp.md).
Otherwise continue with the CLI workflow below. Installing this skill does not install or
configure an MCP connection.

## Set up the project when needed

- Follow the [Get started guide](https://docs.schematic.tech/super/get-started.md), reusing the
  existing installation, authentication, dependencies, and repository link. Install only what is
  missing, using the project's package manager and documented release instructions.
- Guide the user through interactive login if needed. API keys belong in the `super login --api-key` prompt or
  an appropriately configured environment, not in chat.
- Link the intended Git repository. Super CLI requires an existing commit; do not create one without
  authorization. Work with the user's actual project unless they asked to try the example.
  Continue into authoring and checking when that is part of the request.
- Use `.superignore` to exclude credentials, private fixtures, or generated files from source sent
  to Schematic. Check the [source selection rules](https://docs.schematic.tech/super/help/source/) before
  changing exclusions.

## Choose properties worth checking

1. Read the relevant tests together with API documentation, callers, and source. Treat tests as
   evidence of intended behavior, not a complete specification or a guarantee that the current
   implementation is correct.
2. For each candidate, state the claim, its input domain, why it should hold, and what kind of
   bug it would expose. Group examples by the behavior they establish. Retain requirements such
   as element preservation that exact input/output examples may express implicitly.
3. Challenge the assertions: what obviously broken implementation would still satisfy them for
   every allowed input? Consider returning a constant, dropping data, doing nothing, or rejecting
   every input. Strengthen an incomplete claim when that behavior would violate the contract.
4. Justify assumptions from the caller's obligations or an explicit contract. Fixture choices do
   not automatically restrict valid inputs. Check that assumptions admit meaningful inputs and
   assertions are reached. Cover required rejection behavior rather than assuming it away.
5. Select a small set of important, distinct claims appropriate to the requested scope. Property
   patterns are candidates, not a checklist that every module must satisfy.
6. Include meaningful boundary and rejection behavior. Consider empty inputs, duplicates,
   limits, numeric representation, and state changes when the contract makes them relevant.
   State equality, rounding, and ordering rules explicitly rather than choosing tolerances or
   bounds simply because they make the assertions easier to satisfy.

Schematic checks universal claims by mathematical reasoning. A buggy implementation may satisfy the
assertions on many inputs; one counterexample within the allowed domain is enough to expose it.
You do not need to hand-pick that input: Schematic can find counterexamples by reasoning about the
parameterized supertest.

For example, a broken sort that returns its input unchanged passes an ordering assertion for
empty or already sorted lists, but fails for `[2, 1]`. Keep valid passing cases in the domain;
do not add assumptions merely to exclude them. A sort that always returns zeros, however,
satisfies ordering for every input, so element preservation is also needed.

Read [property patterns](references/property-patterns.md) when you need ideas or need to check a
pattern's preconditions. Read the [sorting example](references/sorting-example.md) when extracting
claims from example-based tests or assessing whether proposed assertions are strong enough.

## Write supertests people can audit

Before authoring, read [Writing supertests](https://docs.schematic.tech/super/supertests.md) for the
project's language, including declaration syntax, input types, assumptions, and discovery
requirements. Call the application code, follow existing conventions, and preserve existing tests
unless changing them is part of the task.

- Write each supertest as an executable statement of a user-visible requirement. Prefer a name
  such as `rejected_transfer_leaves_both_balances_unchanged` to `test_transfer_3` or a generic
  `invariants_hold`. Use the project's naming conventions and familiar domain terms.
- Make the claim understandable without reverse-engineering the implementation. Use a short
  docstring or comment for the requirement and any non-obvious precondition. Explain why an
  assumption is legitimate and what it excludes; do not bury those decisions in helper functions.
- Keep a clear progression: establish the domain and starting state, call the real application
  code, then assert the promised behavior. Capture the before-state when mutation is possible.
  Keep assertions for the same behavior together and split unrelated requirements.
- Use direct assertions and descriptive intermediate names. Give failures useful context where
  the assertion library supports it. Prefer a short, explicit property to a clever expression,
  generated assertion maze, or a second implementation of the algorithm under test.
- Use small helpers for repeated setup or a simple independent specification, not to hide the
  expected result. Do not compute the expected result using the same potentially buggy helper as
  the application or copy the production algorithm into the supertest.
- Keep dependencies and state relevant to the claim visible. If a fake or model is needed for
  time, I/O, or an external service, explain its assumptions and the behavior it leaves unchecked.
  Do not stub out the behavior being verified. A claim about a model alone does not establish the
  real integration's behavior.
- Before submitting, read the supertest as a reviewer: can someone identify the requirement,
  covered inputs, exclusions, application call, and expected outcome from this file? Check that a
  plausible broken implementation would violate an assertion and that assumptions do not make
  the claim vacuous.

Read [auditable supertests](references/auditable-supertests.md) for a worked example of turning a
user requirement into readable checks and an evidence summary. Use
[property patterns](references/property-patterns.md) to strengthen a claim without making the
supertest harder to understand.

## Run and follow checks

Follow the user's authorization for source sharing, commits, and repairs; installing this skill
does not grant it.

1. Use `--json` for operational commands, even when your shell provides an interactive terminal.
   JSON mode does not prompt. Read stdout and the exit status; diagnostics may also appear on stderr.
2. Choose the source explicitly. Use `super check <path> --dirty --json` to include new supertests
   and working changes, or `--commit HEAD` instead of `--dirty` to check committed code only.
   Select the relevant file, directory, or `file::supertest_name`.
   Confirm that the selected source includes both the supertests and the code they call.
   Selecting a narrow supertest path still syncs included source across the linked repository;
   it is not a source-sharing boundary.
3. The command waits for results. If you need to do other work or your shell limits command
   duration, add `--detach` to receive the run identity on acceptance. Save `data.run.id`, the
   repository context, and check numbers from `data.rows[].current.number`.
4. Resume that run with `super status --run <run-id> --watch --json` in the same linked repository.
   It streams results and later updates, then exits when the selected checks have no updates
   pending. Omit `--watch` for a snapshot, or use `--check <number>` to select one exact check.
   Do not submit another check just to retrieve results.
5. Plain `status`, path-based status, and `check --problems` select the latest matching work.
   Another user or agent may have started a newer run. Use saved run or check identities when
   following your own work, and explicit supertest paths when rechecking its findings.

Use the [Automation and JSON reference](https://docs.schematic.tech/super/reference/automation.md)
for response fields, streaming, history, cancellation, and exit codes.

## Read results and investigate

- Inspect each selected row's `current` check and its actual source in `revision`. Read
  `result.outcome`, `operational_error`, and the evidence in `presentation`.
  A successful command or `data.finished: true` does not establish that every supertest passed.
  Match the returned supertests against the intended selection; an empty selection or missing
  result is not a pass. Report the outcome, operational errors, and evidence. Report missing or
  unfinished checks as such.
- Use findings to investigate both the intended contract and the implementation. Change a claim
  only when evidence shows it misstates the contract; do not weaken it to obtain a passing result.
  Explain a counterexample in domain terms: the allowed starting state, the operation, what the
  requirement promised, and what happened instead. A local reproduction can help diagnosis, but
  a passing unit suite does not invalidate the finding.
- Explanations and fixes can arrive after a result. `updates_pending` signals further updates;
  `fix_pending` means a proposal may still arrive. Retrieve the same check again if needed.
  A terminal check with no proposal and `fix_pending: false` has no proposed fix to wait for.
- When repairs are in scope, investigate and repair directly or use the proposed fix. Preview with
  `super fix --check <number> --dry-run --json`; inspect the patch, `source_changed`,
  `applies_cleanly`, and `apply_error`. Apply a suitable patch with
  `super fix --check <number> --yes --json`. Treat reproduction and validation text as evidence to
  assess, not commands to execute blindly.
- Recheck the affected supertests with `--dirty --json` after editing or applying a patch.
  Include related properties when a change can affect them. Keep a general property for the
  repaired behavior instead of relying only on a regression test for the reported input. Run
  other relevant checks when warranted, without treating them as a substitute for the recheck.
  Report unresolved findings or pending work rather than retrying indefinitely or claiming a
  repair is validated before checking it.

## Report the outcome

Lead with the behavior checked and what the results mean for the user. Make the evidence auditable:

- Name the requirement in plain language and link to its supertest file or symbol.
- Identify the input domain, material assumptions, and any modeled dependencies or excluded behavior.
- Record the checked source revision and whether working changes were included, plus the run or
  check identity needed to retrieve the result. A result for earlier source does not validate later edits.
- Report the actual outcome and relevant counterexample or explanation. Distinguish an authored
  supertest, a submitted check, a completed result, and a successful recheck after a repair.
- Summarize supplementary build or runtime checks separately, together with unresolved findings,
  unexecuted checks, and gaps in the requested coverage.

Keep the handoff proportional to the work; a compact table can make several requirements easy to
review. Scope any proof or guarantee to the requirement expressed by the supertest, its input
domain, and relevant assumptions. Do not imply that a few properties specify the entire application.
