clarity-test-scaffold/SKILL.md
Clarity test infrastructure generation — scaffold vitest configs, test stubs, Clarunit files, and Rendezvous fuzz tests for Clarinet projects.
npx skillsauth add aibtcdev/skills clarity-test-scaffoldInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generates test infrastructure for Clarinet projects. Creates vitest configs, package.json dependencies, test file stubs with arrange-act-assert structure, and optionally Rendezvous fuzz test files with property and invariant tests.
This is a doc-only skill. Agents read this file to understand available subcommands and invoke them through the skill framework. The CLI interface below documents the planned implementation.
bun run clarity-test-scaffold/clarity-test-scaffold.ts <subcommand> [options]
Generate full test infrastructure for a Clarinet project. Creates or updates vitest config, package.json, tsconfig, and test stubs for all contracts.
bun run clarity-test-scaffold/clarity-test-scaffold.ts scaffold --project-dir <path> [--include-clarunit] [--include-fuzz] [--dry-run]
Options:
--project-dir (required) — Path to the Clarinet project root (must contain Clarinet.toml)--include-clarunit (optional) — Also generate Clarunit test files (.clar test files)--include-fuzz (optional) — Also generate Rendezvous fuzz test files--dry-run (optional) — Show what would be generated without writing filesOutput:
{
"projectDir": "/path/to/project",
"contracts": ["my-contract", "helper-contract"],
"filesGenerated": [
{"path": "vitest.config.js", "action": "created"},
{"path": "package.json", "action": "updated"},
{"path": "tsconfig.json", "action": "created"},
{"path": "tests/my-contract.test.ts", "action": "created"},
{"path": "tests/helper-contract.test.ts", "action": "created"}
],
"dependencies": {
"@hirosystems/clarinet-sdk": "^2.0.0",
"vitest": "^1.0.0",
"vitest-environment-clarinet": "^2.0.0"
},
"scripts": {
"test": "vitest run",
"test:watch": "vitest"
}
}
Add Rendezvous property-based fuzz tests for a specific contract.
bun run clarity-test-scaffold/clarity-test-scaffold.ts add-fuzz --project-dir <path> --contract <contract-name> [--dry-run]
Options:
--project-dir (required) — Path to the Clarinet project root--contract (required) — Contract name to generate fuzz tests for--dry-run (optional) — Show what would be generated without writingOutput:
{
"contract": "my-contract",
"filesGenerated": [
{"path": "contracts/my-contract.tests.clar", "action": "created"}
],
"dependencies": {
"@stacks/rendezvous": "^1.0.0"
},
"scripts": {
"test:rv": "npx rv . my-contract test",
"test:rv:invariant": "npx rv . my-contract invariant"
},
"publicFunctions": ["transfer", "set-value"],
"propertyTests": ["test-transfer", "test-set-value"],
"invariantTests": ["invariant-supply-capped"]
}
Verify an existing test setup is complete and correct.
bun run clarity-test-scaffold/clarity-test-scaffold.ts check --project-dir <path>
Options:
--project-dir (required) — Path to the Clarinet project rootOutput:
{
"projectDir": "/path/to/project",
"complete": false,
"contracts": ["my-contract", "helper-contract"],
"findings": [
{"type": "missing", "description": "No test file for helper-contract"},
{"type": "config", "description": "vitest.config.js missing singleThread: true"},
{"type": "dependency", "description": "@hirosystems/clarinet-sdk not in package.json"}
],
"coverage": {
"contractsWithTests": 1,
"contractsTotal": 2,
"percentage": 50
}
}
import { defineConfig } from "vitest/config";
import { vitestSetupFilePath, getClarinetVitestsArgv } from "@hirosystems/clarinet-sdk/vitest";
export default defineConfig({
test: {
environment: "clarinet",
singleThread: true,
setupFiles: [vitestSetupFilePath],
environmentOptions: {
clarinet: getClarinetVitestsArgv(),
},
},
});
Generated test files follow these conventions:
beforeAll/beforeEach — simnet resets each sessionsingleThread: true — required for simnet isolationStxer (Historical Simulation) — Pre-mainnet validation
RV (Property-Based Fuzzing) — Invariants, edge cases
Vitest + Clarinet SDK — Integration tests (default)
Clarunit — Unit tests in Clarity
Clarinet.toml to discover contracts and generate appropriate test stubs--dry-run first to preview what will be generatedclarity-patterns skilldevelopment
Web of Trust operations for Nostr pubkeys — trust scoring, sybil detection, trust path analysis, neighbor discovery, follow recommendations, and network health. Free tier (wot.klabo.world, 50 req/day) with paid fallback (maximumsats.com, 100 sats via L402). Covers 52K+ pubkeys and 2.4M+ zap-weighted trust edges. Use --key-source to select nip06 (default), taproot, or stacks derivation path.
data-ai
BTC ordinals marketplace operations via Magic Eden — browse active listings, list inscriptions for sale via PSBT flow, submit signed listings, buy inscriptions, and cancel active listings. BTC ordinals only (not Solana). Mainnet-only.
testing
Pay-per-call access to LunarCrush social and market intelligence (Galaxy Score, AltRank, market cap rank, price, 24h change) via x402 on Stacks. USD-pegged pricing recomputed hourly from live STX/USD. Mainnet endpoint live; testnet supported.
devops
Detects HODLMM LP inventory drift (token-ratio imbalance from one-sided swap flow) and restores the target ratio via a corrective Bitflow swap plus a hodlmm-move-liquidity redeploy, gated by the 4h per-pool cooldown.