cairo-testing

cairo-testing is a skill for Claude Code, Codex from keep-starknet-strange/starknet-agentic. It costs 54 tokens per session (2,193 once invoked), scanned A, original, MIT.

A testing guide for Cairo smart contracts using snforge, the Cairo testing tool. It covers unit, integration, fuzz, fork, and regression tests, including failure cases, permissions, events, and coverage.

In plain words
What is it for?
Use it to write and run Cairo contract tests, test negative cases and access control, check events, and improve coverage.
Why use it?
It provides a repeatable way to check contract behavior and find untested paths before relying on the code.

Skill for Claude CodeCodex

Written for Claude Code and Codex: allowed-tools in frontmatter, but also agents/openai.yaml present.

Part of the starknet-agentic-skills plugin — 19 skills, 2 commands, 1 plugin shipped together

Good fit Use it to write and run Cairo contract tests, test negative cases and access control, check events, and improve coverage.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/keep-starknet-strange/starknet-agentic/cairo-testing
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 keep-starknet-strange/starknet-agentic --skill cairo-testing
Clone the repo
git clone --depth 1 https://github.com/keep-starknet-strange/starknet-agentic

Made for: Claude Code, Codex.

Or install starknet-agentic-skills, the plugin that ships this one along with the rest of its 19 skills, 2 commands, 1 plugin.

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 cairo-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/keep-starknet-strange/starknet-agentic/cairo-testing.svg)](https://agentmods.dev/skills/keep-starknet-strange/starknet-agentic/cairo-testing)
Your own site
<a href="https://agentmods.dev/skills/keep-starknet-strange/starknet-agentic/cairo-testing"><img src="https://agentmods.dev/badge/skills/keep-starknet-strange/starknet-agentic/cairo-testing.svg" alt="Measured on agentmods" 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 2,193 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.02193
Opus 5 $0.00027 $0.01097
Sonnet 5 $0.00011 $0.00439
Haiku 4.5 $0.00005 $0.00219

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

Security

Grade A, and why

cairo-testing 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 8d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/snforge_smoke.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/cairo-testing/SKILL.md · 187 lines

How it starts

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

Cairo Testing

You are a Cairo testing assistant. Your job is to understand what the user needs tested, load the right references, write correct tests, verify they pass, and ensure adequate coverage.

When to Use

  • Writing unit, integration, fuzz, or fork tests for Cairo contracts.
  • Designing regression tests for known findings.
  • Validating event emission, failure semantics, or access control.
  • Improving test coverage on an existing contract.

When NOT to Use

  • Contract architecture decisions (cairo-contract-authoring).
  • Performance tuning (cairo-optimization).
  • Deployment operations (cairo-deploy).
  • Security audit of existing code (cairo-auditor).

Quick Start

  1. Classify what needs testing: new contract, specific function, regression, or coverage gap.
  2. Load references based on test type — see the table in Orchestration.
  3. Output a test plan (functions, positive/negative paths, invariants) and wait for confirmation.
  4. Implement tests following snforge patterns, then run snforge test.
  5. Verify coverage: every external tested? auth paths? negative cases? events?
  6. Emit a handoff block using ../references/skill-handoff.md (testing → optimization only for explicit performance work, then run optimization → auditor before merge; otherwise testing → auditor), then run the next skill.

Rationalizations to Reject

  • "We only need happy-path tests."
  • "Access control tests are unnecessary — the contract handles it."
  • "Fuzz tests are overkill for this contract."
  • "We'll add regression tests after the next audit."

Mode Selection

  • unit: Test individual functions using contract_state_for_testing(). No deployment needed.
  • integration: Test deployed contracts via dispatchers. Multi-contract interactions.
  • fuzz: Property-based tests with #[fuzzer] for arithmetic, bounds, invariants.
  • fork: Test against live Starknet state with #[fork].
  • regression: Turn a known finding into a failing-before/fixed-after test pair.

Read the full file on GitHub · 187 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 187 lines · 54 tokens per session scan A 8f76f2a141c1

Subscribe to this mod's changes

cairo-testing is a skill published in the GitHub repository keep-starknet-strange/starknet-agentic (80 stars, last pushed yesterday), licensed MIT. It adds 54 tokens to every session and 2,193 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

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

neuron-test-engineer

Write tests for Neuron AI agents, RAG systems, workflows, and tools using the built-in testing utilities. Use this skill when the user mentions testing agents, writing unit tests, mocking AI providers, testing tool execution, verifying RAG retrieval, testing workflow behavior, or creating test cases for Neuron AI…

neuron-core/neuron-ai · 94 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

verification-protocol

How to prove a hypothesis is TRUE or FALSE using Move unit tests.

PlamenTSV/plamen · 18 tokens

JUnit 5 Testing

Production-grade Java unit and integration testing with JUnit 5 covering assertions, parameterized tests, lifecycle hooks, Mockito mocking, nested tests, and extensions.

PramodDutta/qaskills · 36 tokens

test-fixtures

Use when setting up test environments for Solidity protocols. Covers mock contracts, fork-based fixtures, shared setUp, factory patterns, token deployments, and reusable test helpers.

ccashwell/evm-cortex · 37 tokens