generate-tests

generate-tests is a skill for Claude Code from aptos-labs/aptos-agent-skills. It costs 54 tokens per session (3,210 once invoked), scanned A, original, MIT.

A test-suite generator for Move smart contracts. It creates tests for normal behaviour, permissions, invalid inputs, edge cases, and required code coverage.

In plain words
What is it for?
Use it to add unit tests for a Move contract, check that unauthorised actions are rejected, test boundary conditions, and measure coverage.
Why use it?
It reduces the work of designing tests and helps reveal failures before a contract is deployed.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the aptos-agent-skills plugin — 16 skills shipped together

Good fit Use it to add unit tests for a Move contract, check that unauthorised actions are rejected, test boundary conditions, and measure coverage.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aptos-labs/aptos-agent-skills/generate-tests
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add aptos-labs/aptos-agent-skills --skill generate-tests
Clone the repo
git clone --depth 1 https://github.com/aptos-labs/aptos-agent-skills

Made for: Claude Code.

Or install aptos-agent-skills, the plugin that ships this one along with the rest of its 16 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for generate-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/aptos-labs/aptos-agent-skills/generate-tests/github.svg)](https://agentmods.dev/skills/aptos-labs/aptos-agent-skills/generate-tests)
Your own site
<a href="https://agentmods.dev/skills/aptos-labs/aptos-agent-skills/generate-tests"><img src="https://agentmods.dev/badge/skills/aptos-labs/aptos-agent-skills/generate-tests/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for generate-tests

Your own site · 80×15
<a href="https://agentmods.dev/skills/aptos-labs/aptos-agent-skills/generate-tests"><img src="https://agentmods.dev/badge/skills/aptos-labs/aptos-agent-skills/generate-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,210 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00054 $0.03210
Opus 5 $0.00027 $0.01605
Sonnet 5 $0.00011 $0.00642
Haiku 4.5 $0.00005 $0.00321

Measured 10d ago against content hash 83ea3165243f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

generate-tests scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/move/generate-tests/SKILL.md · 463 lines

How it starts

The opening of the file, as written. The whole thing — 463 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Generate Tests Skill

Overview

This skill generates comprehensive test suites for Move contracts with 100% line coverage requirement. Tests verify:

  • ✅ Happy paths (functionality works)
  • ✅ Access control (unauthorized users blocked)
  • ✅ Input validation (invalid inputs rejected)
  • ✅ Edge cases (boundaries, limits, empty states)

Critical Rule: NEVER deploy without 100% test coverage.

Core Workflow

Step 1: Create Test Module

#[test_only]
module my_addr::my_module_tests {
    use my_addr::my_module::{Self, MyObject};
    use aptos_framework::object::{Self, Object};
    use std::string;
    use std::signer;

    // Test constants
    const ADMIN_ADDR: address = @0x100;
    const USER_ADDR: address = @0x200;
    const ATTACKER_ADDR: address = @0x300;

    // ========== Setup Helpers ==========
    // (Reusable setup functions)

    // ========== Happy Path Tests ==========
    // (Basic functionality)

    // ========== Access Control Tests ==========
    // (Unauthorized access blocked)

    // ========== Input Validation Tests ==========
    // (Invalid inputs rejected)

    // ========== Edge Case Tests ==========
    // (Boundaries and limits)
}

Step 2: Write Happy Path Tests

Test basic functionality works correctly:

#[test(creator = @0x1)]
public fun test_create_object_succeeds(creator: &signer) {
    // Execute
    let obj = my_module::create_my_object(
        creator,
        string::utf8(b"Test Object")
    );

    // Verify
    assert!(object::owner(obj) == signer::address_of(creator), 0);
}

#[test(owner = @0x1)]
public fun test_update_object_succeeds(owner: &signer) {
    // Setup
    let obj = my_module::create_my_object(owner, string::utf8(b"Old Name"));

    // Execute
    let new_name = string::utf8(b"New Name");
    my_module::update_object(owner, obj, new_name);

    // Verify (if you have view functions)
    // assert!(my_module::get_object_name(obj) == new_name, 0);
}

#[test(owner = @0x1, recipient = @0x2)]
public fun test_transfer_object_succeeds(
    owner: &signer,
    recipient: &signer
) {
    let recipient_addr = signer::address_of(recipient);

    // Setup
    let obj = my_module::create_my_object(owner, string::utf8(b"Object"));
    assert!(object::owner(obj) == signer::address_of(owner), 0);

    // Execute
    my_module::transfer_object(owner, obj, recipient_addr);

    // Verify
    assert!(object::owner(obj) == recipient_addr, 1);
}

Read the full file on GitHub · 463 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 463 lines · 54 tokens per session scan A 83ea3165243f

Subscribe to this mod's changes

generate-tests is a skill published in the GitHub repository aptos-labs/aptos-agent-skills (19 stars, last pushed 2mo ago), licensed MIT. It adds 54 tokens to every session and 3,210 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

smart-contract-testing

Guide for testing smart contracts using Foundry and Hardhat, covering unit tests, fuzz testing, invariant testing, fork testing, and gas benchmarking.

nirholas/three.ws · 33 tokens

blockchain-testing

Use this skill when asked about testing smart contracts, Foundry tests, Hardhat tests, fuzz testing, invariant testing, property-based testing, formal verification, audit preparation, integration testing for dApps, and blockchain testing patterns. Covers Foundry cheatcodes, Echidna fuzzing, Certora verification…

j4flmao/agent-skills · 117 tokens

Smart Contract Testing

Smart contract testing with Hardhat, Foundry, and Brownie including unit tests, gas optimization, reentrancy checks, and fork testing.

PramodDutta/qaskills · 33 tokens

cadence-testing

Guide for writing, running, and debugging unit tests for Cadence smart contracts using the built-in Cadence Testing Framework and flow test. Covers test file structure (test.cdc, setup/beforeEach/tearDown), assertions and matchers, blockchain emulation (accounts, deployments, events, time manipulation), coverage…

onflow/flow-ai-tools · 264 tokens

web3-testing

Test smart contracts comprehensively using Hardhat and Foundry with unit tests, integration tests, and mainnet forking. Use when testing Solidity contracts, setting up blockchain test suites, or validating DeFi protocols.

wshobson/agents · 46 tokens

tevm

Build, simulate, test, fork, and debug EVM transactions in TypeScript with tevm 1.0.0-rc.151. Use for in-process EVM scripts, typed Solidity imports, lazy mainnet or OP-stack forks, direct account and storage setup, viem-compatible contract actions, Vitest EVM tests, traces, and transaction simulation.

evmts/tevm · 77 tokens