clarity-test-scaffold
Clarity test infrastructure generation — scaffold vitest configs, test stubs, Clarunit files, and Rendezvous fuzz tests for Clarinet projects.
What this skill does
# Clarity Test Scaffold Skill
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.
## Usage
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]
```
## Subcommands
### scaffold
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 files
Output:
```json
{
"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-fuzz
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 writing
Output:
```json
{
"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"]
}
```
### check
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 root
Output:
```json
{
"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
}
}
```
## Generated Test Structure
### Vitest Config
```javascript
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(),
},
},
});
```
### Test File Template
Generated test files follow these conventions:
- **Arrange-Act-Assert** structure in every test
- **Functions over arrow functions** for test helpers
- **Constants** for reusable values (deployer, wallets, contract name)
- **NO `beforeAll`/`beforeEach`** — simnet resets each session
- **`singleThread: true`** — required for simnet isolation
### Testing Pyramid
```
Stxer (Historical Simulation) — Pre-mainnet validation
RV (Property-Based Fuzzing) — Invariants, edge cases
Vitest + Clarinet SDK — Integration tests (default)
Clarunit — Unit tests in Clarity
```
## Notes
- Reads `Clarinet.toml` to discover contracts and generate appropriate test stubs
- Analyzes contract public functions to generate test method signatures
- Does not overwrite existing test files — only creates missing ones
- Use `--dry-run` first to preview what will be generated
- Generated tests are stubs — fill in assertions based on contract behavior
- For complete testing reference, see the `clarity-patterns` skill
Related in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.