agentleFS
ghuntleyghuntley/loom/.agents/skills/hegel-elixir-tests/SKILL.md

hegel-elixir-tests

Skill1.6k starsChanged todayMITView on GitHub

Create, migrate, run, and review Elixir property tests using the repository's Hegel engine; use for StreamData migration, generator design, stateful/concurrent BEAM verification, replay, and evidence reporting.

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 3 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when changing generated tests in an Overalls Mix application or when reviewing a Hegel property.

    line 10
  2. Very specific:

    Read the repository AGENTS.md, the target application's AGENTS.md, ancestor CONTRACTS files, and relevant ADRs.

    line 17
  3. Very specific:

    Keep Hegel development/test-only (runtime: false) and use the repository-pinned native engine.

    line 28
  4. Very specific:

    When changing the hegel_ex Git revision in any mix.exs or mix.lock, update the corresponding fixed-output Mix dependency hash in …

    line 30
  5. Distinctive:

    Prefer explicit typed generators and bounded values.

    line 36
  6. Very specific:

    Treat test_cases as a verification-strength setting, not a generic timeout workaround.

    line 55
  7. Very specific:

    Use one property runner with labelled draws.

    line 62
  8. Distinctive:

    Keep diagnostics redacted by default.

    line 76
  9. Very specific:

    When replacing StreamData, first inventory all property, check all, generator, fixture, and dependency usages.

    line 82
  10. Very specific:

    Run the smallest focused property or replay first, then the target application's Buck2 :check and :test (tools/precommit selects them).

    line 99
  11. Very specific:

    Never copy over a loaded .so in place: truncating its mapped inode can crash another BEAM, even when the replacement bytes are identical.

    line 107
  12. Very specific:

    Before recording execution, compare the dependency checkout with mix.lock and identify the loaded NIF and its ABI.

    line 111

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Hegel property tests for Elixir

Use this skill when changing generated tests in an Overalls Mix application or when reviewing a Hegel property. It applies to BEAM-level behavior and test tooling; it does not replace NixOS machine tests, native Rust tests, browser probes, or fixed ExUnit tests where those provide the required evidence.

Before editing

  1. Read the repository AGENTS.md, the target application's AGENTS.md, ancestor CONTRACTS files, and relevant ADRs.
  2. Find the application's reviewed Events catalog before adding diagnostics. Hegel failures and test telemetry must use catalogued metadata and must not expose credentials, tokens, terminal bytes, command arguments, or payloads.
  3. Identify the existing property runner, dependency pin, fixtures, sandbox ownership, and whether the property crosses a native, host, distributed, or machine boundary. Record architecture impact before implementation.

Write properties

  • Keep Hegel development/test-only (runtime: false) and use the repository-pinned native engine. Fail clearly when the NIF or ABI version is unavailable.
  • When changing the hegel_ex Git revision in any mix.exs or mix.lock, update the corresponding fixed-output Mix dependency hash in nix/domains/artifacts/dependency-hashes.json for every affected application. Rebuild the relevant Nix artifact (or run the repository's hash-refresh workflow) and record the resulting hash; a Mix lock update alone leaves offline Nix builds inconsistent.
  • Prefer explicit typed generators and bounded values. Give collections finite size; do not generate arbitrary atoms, PIDs, references, resources, secrets, or unbounded terms implicitly. Use assumptions only for genuinely unreachable combinations.
  • Draw values through the explicit test-case API (Hegel.draw/2 or /3) and label draws. Keep process-dictionary convenience APIs at the boundary rather than in domain helpers.
  • Set up and tear down every mutable fixture per generated case and replay: SQL sandboxes, processes, sockets, temporary files, registries, and distributed nodes. Cleanup errors are failures and must not be swallowed. Make setup idempotent so shrinking and replay cannot observe leftovers from a previous case.
  • For stateful behavior, model commands, preconditions, transitions, postconditions, and invariants separately. Use engine-managed pools for values produced by earlier commands; rejected commands should be distinguishable from failed assertions.
  • For concurrency, use controlled Hegel schedules and inspect the complete history against a reference model or linearizability oracle. Keep real multi-node, KVM, isolation, and recovery claims in their existing machine/integration suites.
  • Preserve refusal, malformed-input, stale-generation, duplicate, restart, and redaction assertions from the migrated property. A Hegel property may strengthen coverage but must not weaken an existing contract.
  • Treat test_cases as a verification-strength setting, not a generic timeout workaround. Never clamp an ordinary property to one generated case merely to make a suite finish. Preserve default exploration (currently 100 cases) and existing larger budgets, including for real sockets and fresh OTP processes. A small count is appropriate for a deliberate failing replay control, not for making a generated success property pass. Audit truncated mutation lists as well as runner counts. A fixed exhaustive matrix belongs in an ordinary test.
  • Use one property runner with labelled draws. Standalone check all runs its own engine, but nested check all at older pins silently ignores its options. max_runs and max_shrinking_steps are not supported Hegel settings. Inspect the exact pinned frontend before relying on compatibility syntax. The Elixir labelled convenience form is draw(label, generator); the explicit Erlang API is :hegel.draw(test_case, label, generator).
  • Diagnose slow cases before changing their budgets. Keep per-operation deadlines and assertions; size a finite aggregate ExUnit timeout from measured case duration and the full exploration budget. Use Astra for stalled BEAM/NIF diagnosis when authorized, inspecting progress, stacks, CPU and memory. Do not kill an owned run merely because it is quiet. ExUnit --trace disables aggregate timeouts, including explicit tags and --timeout; omit it when verifying finite test budgets. Profile names alone do not prove effective case counts, randomness, replay-database or health-check settings.
  • Keep diagnostics redacted by default. Include labels, locations, seeds, and bounded structural metadata; opt into values or replay blobs only when the test explicitly proves they are safe. Failure rendering must preserve the original exception.

Migration and review

When replacing StreamData, first inventory all property, check all, generator, fixture, and dependency usages. Convert mechanical syntax with an AST-assisted tool, then review every property for Hegel size, shrinking, assumptions, context setup, and replay cleanup. Remove stale StreamData/ExUnitProperties dependencies and lock entries only after all applications compile.

Review each property for:

  • a precise input/output type and bounded generator;
  • deterministic seed/replay behavior;
  • setup and teardown ownership on pass, failure, rejection, and timeout;
  • secret-safe diagnostics and catalogued events;
  • evidence limits (BEAM behavior versus native or deployment guarantees);
  • meaningful shrinking rather than filtering away the interesting state space.

Run and report

Run the smallest focused property or replay first, then the target application's Buck2 :check and :test (tools/precommit selects them). Shared protocol changes require both Marshall and Lilly consumer checks. Run contract, ADR, logging, and conflict-marker checks required by the repository. Record exact seeds/replay identifiers, test counts, and known skipped boundaries; do not describe a passing BEAM property as proof of physical isolation or production recovery.

The native installer must publish a complete sibling file with atomic rename. Never copy over a loaded .so in place: truncating its mapped inode can crash another BEAM, even when the replacement bytes are identical. Before b0dec2a, avoid concurrent Mix compilation and tests in the same application.

Before recording execution, compare the dependency checkout with mix.lock and identify the loaded NIF and its ABI. A stale deps/ checkout or an external NIF override does not verify the packaged current pin. Exercise both successful generation and a deliberate failure/replay through the native engine. For a full-suite request, inventory every Mix application and default exclusions; enable required distributed/host/capacity fixtures in an isolated environment. Report unfinished and excluded tests separately from passes.

For failures, retain the minimized replay and original exception, identify whether the cause is a generator, oracle, fixture cleanup, engine, or product defect, and add a regression property when appropriate. If the engine or NIF cannot load, report the pinned version and reproducible build command rather than silently falling back to a weaker runner.

References

  • Existing machine Hegel patterns and redaction rules: docs/development/testing-with-hegel.md
  • Contract scope and evidence limits: docs/development/code-contracts.md
  • Architecture review requirements: architecture-review
  • Contract discovery and enforcement: code-contracts

Download now (ZIP)

Trending

Quiet since January.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 14 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the ghuntley/loom repository that our weekly crawl found: only 14 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about ghuntley/loom

The biggest 5 of 14 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 14

Talked about on GitHub and Hacker News (14 times).

On GitHub · 13

8 more on GitHub

On Hacker News · 1

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.