ai-nondeterministic

Design tests for LLM-assisted test generation and nondeterministic model outputs.

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/Hakkadaikon/hymme --skill ai-nondeterministic-hakkadaikon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-nondeterministic
Source: https://github.com/Hakkadaikon/hymme/tree/main/skills/ai-nondeterministic
Command: npx skills add https://github.com/Hakkadaikon/hymme --skill ai-nondeterministic-hakkadaikon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Testing systems that involve LLMs is hard in two ways: AI-generated test cases can silently lock in existing bugs as expected values, and nondeterministic model outputs cannot be verified with fixed-value assertions. This Skill provides structured procedures for both situations. ## Core Features & Use Cases - AI-assisted test generation with human review gates: Use LLMs to brainstorm test perspectives (normal, boundary, error cases), then filter false positives/negatives against the specification, register surviving perspectives as T-IDs in a ledger, and promote generalizable ones to property-based or combinatorial tests. - False-positive reduction for AI review: Apply negative prompts, severity thresholds, and formal-model translation to keep AI-generated review findings trustworthy. - Layered quality design for nondeterministic outputs: Split the system into deterministic entry/exit layers (tested with equivalence partitioning and boundary values) and a probabilistic core constrained by schema enforcement, metamorphic invariants, and multi-sampling consensus, with calibrated numeric thresholds and deterministic verdict oracles. - Use Case: When shipping a feature that embeds an LLM summarizer, use this Skill to separate prompt construction into a pure function, enforce JSON schema on outputs, define metamorphic properties, and set a calibrated similarity threshold instead of snapshot-testing flaky outputs. ## Quick Start Ask the AI to design a test strategy for a feature whose output comes from an LLM, separating deterministic layers from the probabilistic core.

Frequently Asked Questions about ai-nondeterministic

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test nondeterministic LLM outputs in production code?

Use layered quality design: keep input validation and prompt construction as deterministic pure functions tested with fixed assertions, and constrain the model output layer with schema enforcement, metamorphic invariants, and multi-sampling consensus instead of fixed-value assertions.

How do I use AI to generate test cases safely?

Have the LLM list candidate perspectives with rationale, then a human filters false positives and adds missed cases against the specification. Register accepted perspectives as T-IDs in a ledger and never let the LLM act as the correctness oracle.

Why should I avoid snapshot testing LLM outputs?

Fixing temperature to zero and snapshotting outputs only improves reproducibility; it does not verify the variability seen in production. Snapshots detect regressions but cannot catch bugs, so property-based checks are still required.

Can I use LLM-as-judge for final test verdicts?

No. Final pass/fail decisions must come from deterministic verifiers such as rules, regular expressions, or reference implementations. Delegating the verdict to the model under test makes the guarantee itself nondeterministic.

How do I reduce false positives in AI code review?

Apply three techniques in order of strength: add negative prompt examples defining what is not a defect, require severity scores and filter by threshold, and translate the target into a formal model before asking for findings.

When is layered quality design unnecessary for AI features?

When the component output is deterministic, standard output-based testing suffices and the layered approach is over-engineering. It applies only when the same input produces varying outputs, such as chat responses, summaries, or classifications.