solana-vault-standard: Command for Claude Code

.claude/commands/test-ts.md

test-ts is a command for Claude Code from solanabr/solana-vault-standard. It costs 12 tokens per session (2,432 once invoked), scanned A, original, MIT.

A command for running TypeScript tests for Solana frontends and Anchor programs. Anchor is a framework for building Solana smart contracts, while TypeScript tests can also cover frontend and browser behaviour.

In plain words
What is it for?
Use it to build and run Anchor tests, frontend component tests, integration tests, end-to-end tests, selected test files, or debug logging.
Why use it?
It detects the available test setup and documents the appropriate commands for Anchor, Vitest, Jest, and Playwright.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is solanabr/solana-vault-standard's own configuration. It tells Claude Code how to work on solana-vault-standard itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything solana-vault-standard configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { WalletButton } from '../WalletButton';.

Reuse

Borrowing it

Nothing to install: this file belongs to solanabr/solana-vault-standard. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/solanabr/solana-vault-standard/main/.claude/commands/test-ts.md
Clone the repo
git clone --depth 1 https://github.com/solanabr/solana-vault-standard

Made for: Claude Code.

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 test-ts

README.md
[![agentmods](https://agentmods.dev/badge/commands/solanabr/solana-vault-standard/test-ts/github.svg)](https://agentmods.dev/commands/solanabr/solana-vault-standard/test-ts)
Your own site
<a href="https://agentmods.dev/commands/solanabr/solana-vault-standard/test-ts"><img src="https://agentmods.dev/badge/commands/solanabr/solana-vault-standard/test-ts/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 test-ts

Your own site · 80×15
<a href="https://agentmods.dev/commands/solanabr/solana-vault-standard/test-ts"><img src="https://agentmods.dev/badge/commands/solanabr/solana-vault-standard/test-ts.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,432 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00012 $0.02432
Opus 5 $0.00006 $0.01216
Sonnet 5 $0.00002 $0.00486
Haiku 4.5 $0.00001 $0.00243

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

Security

Grade A, and why

test-ts scanned grade A with 1 finding 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 9d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const vault = await program.account.vault.fetch(vaultPda);
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.claude/commands/test-ts.md · 405 lines

How it starts

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

You are running TypeScript tests. This command covers Anchor program tests, frontend component tests, and integration tests.

Step 1: Identify Test Type

echo "🔍 Detecting TypeScript test configuration..."

# Check for Anchor tests
if [ -f "Anchor.toml" ] && [ -d "tests" ]; then
    echo "⚓ Anchor TypeScript tests detected"
fi

# Check for Vitest
if grep -q "vitest" package.json 2>/dev/null; then
    echo "⚡ Vitest configured"
fi

# Check for Jest
if grep -q "jest" package.json 2>/dev/null; then
    echo "🃏 Jest configured"
fi

# Check for Playwright
if grep -q "playwright" package.json 2>/dev/null; then
    echo "🎭 Playwright E2E tests configured"
fi

Anchor Program Tests

Run Anchor Tests

echo "⚓ Running Anchor TypeScript tests..."

# Build first
anchor build

# Run all tests
anchor test

# Skip rebuild (faster iteration)
anchor test --skip-build

# Run specific test file
anchor test tests/vault.ts

# Run with logs
RUST_LOG=debug anchor test

Anchor Test Pattern

import * as anchor from "@coral-xyz/anchor";
import { Program } from "@coral-xyz/anchor";
import { MyProgram } from "../target/types/my_program";
import { expect } from "chai";

describe("my_program", () => {
  const provider = anchor.AnchorProvider.env();
  anchor.setProvider(provider);

  const program = anchor.workspace.MyProgram as Program<MyProgram>;

  it("initializes vault", async () => {
    const [vaultPda] = anchor.web3.PublicKey.findProgramAddressSync(
      [Buffer.from("vault"), provider.wallet.publicKey.toBuffer()],
      program.programId
    );

    await program.methods
      .initialize()
      .accounts({
        vault: vaultPda,
        authority: provider.wallet.publicKey,
        systemProgram: anchor.web3.SystemProgram.programId,
      })
      .rpc();

    const vault = await program.account.vault.fetch(vaultPda);
    expect(vault.authority.toString()).to.equal(
      provider.wallet.publicKey.toString()
    );
  });

  it("deposits funds", async () => {
    const [vaultPda] = anchor.web3.PublicKey.findProgramAddressSync(
      [Buffer.from("vault"), provider.wallet.publicKey.toBuffer()],
      program.programId
    );

    const depositAmount = new anchor.BN(1_000_000_000); // 1 SOL

    await program.methods
      .deposit(depositAmount)
      .accounts({
        vault: vaultPda,
        authority: provider.wallet.publicKey,
      })
      .rpc();

    const vault = await program.account.vault.fetch(vaultPda);
    expect(vault.balance.toNumber()).to.equal(depositAmount.toNumber());
  });

  it("fails with insufficient funds", async () => {
    const [vaultPda] = anchor.web3.PublicKey.findProgramAddressSync(
      [Buffer.from("vault"), provider.wallet.publicKey.toBuffer()],
      program.programId
    );

    try {
      await program.methods
        .withdraw(new anchor.BN(999_000_000_000)) // More than balance
        .accounts({
          vault: vaultPda,
          authority: provider.wallet.publicKey,
        })
        .rpc();
      expect.fail("Should have thrown");
    } catch (err) {
      expect(err.message).to.include("InsufficientFunds");
    }
  });
});

Read the full file on GitHub · 405 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. 9d ago First seen · 405 lines · 12 tokens per session scan A 20b8eb1a76f4

Subscribe to this mod's changes

test-ts is a command published in the GitHub repository solanabr/solana-vault-standard (24 stars, last pushed 5mo ago), licensed MIT. It adds 12 tokens to every session and 2,432 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.