Agent skill · software engineering · aiskillstore

direct-tests

Write and run fast direct mode tests for GenLayer intelligent contracts.

Why this skill is useful

Provides specific patterns and fixtures for testing intelligent contracts that the AI wouldn't reliably generate on its own.

What it needs

Requires genlayer-test, pytest installed locally. About 2k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

Direct Mode Tests Write fast, in-memory tests for intelligent contracts. No server, no Docker — tests run in ~30-50ms. Running Tests Fixtures Available from genlayer-test pytest plugin: All fixtures: directvm, directdeploy, directalice, directbob, directcharlie, directowner, directaccounts Basic Test Pattern Mocking Web Requests For contracts that call gl.nondet.web.get(): Full mock format (when you need headers/method control) Mocking LLM Responses For contracts that call gl.nondet.execprompt(): Clearing Mocks VMContext Cheatcodes Test Organization What to Test in Direct Mode Category Example ---------- --------- State transitions Create → read back → verify fields Validation / reverts Invalid inputs, unauthorized callers Access control Owner-only methods, role checks Edge cases Empty state, boundary values, overflow Web/LLM parsing Mock responses → verify extraction logic Common Patterns Testing access control Testing state transitions Reusable mock helpers (conftest.py) Tips Always directvm.sender = ... before calling write methods Use --json flag on genvm-lint check before writing tests to understand the contract's interface Direct mode runs leader function only — validator logic is not exercised. Use integration tests for full consensus validation.

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/direct-tests

View the source on GitHub

Browse the @skills marketplace