Borrowing it
Nothing to install: this file belongs to solanabr/solana-glossary. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/solanabr/solana-glossary/main/.claude/commands/test-and-fix.mdgit clone --depth 1 https://github.com/solanabr/solana-glossaryWrote 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.
[](https://agentmods.dev/commands/solanabr/solana-glossary/test-and-fix)<a href="https://agentmods.dev/commands/solanabr/solana-glossary/test-and-fix"><img src="https://agentmods.dev/badge/commands/solanabr/solana-glossary/test-and-fix/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.
<a href="https://agentmods.dev/commands/solanabr/solana-glossary/test-and-fix"><img src="https://agentmods.dev/badge/commands/solanabr/solana-glossary/test-and-fix.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00007 | $0.02069 |
| Opus 5 | $0.00003 | $0.01035 |
| Sonnet 5 | $0.00001 | $0.00414 |
| Haiku 4.5 | $0.00001 | $0.00207 |
Grade A, and why
test-and-fix 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.
This is a copy
91% identical to test-and-fix — 4 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 372 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are running tests and fixing any issues found. This command iteratively tests, diagnoses problems, fixes them, and retests.
Related Skills
- testing.md - Testing strategy details
- security.md - Security fix patterns
Overview
This command follows a test → diagnose → fix → retest loop until all tests pass or manual intervention is needed.
Step 1: Initial Test Run
echo "🧪 Running initial tests..."
# Determine project type and run appropriate tests
if [ -f "Anchor.toml" ]; then
# Anchor project
anchor build && anchor test --skip-deploy
TEST_STATUS=$?
elif grep -q "solana-program" Cargo.toml 2>/dev/null; then
# Native Solana program
cargo build-sbf && cargo test
TEST_STATUS=$?
else
# Standard Rust or backend
cargo test
TEST_STATUS=$?
fi
if [ $TEST_STATUS -eq 0 ]; then
echo "✅ All tests passed!"
exit 0
fi
echo "❌ Tests failed. Starting diagnosis..."
Step 2: Diagnose Issues
Analyze the test output to categorize failures:
Common Issue Categories
-
Format Issues
- Code not formatted
- Inconsistent style
-
Clippy Warnings
- Lints not satisfied
- Potential bugs
-
Compilation Errors
- Syntax errors
- Type mismatches
- Missing imports
-
Test Failures
- Failed assertions
- Logic errors
- Account validation failures (Solana)
-
Runtime Errors
- Panics
- Arithmetic overflow
- Account errors (Solana)
Step 3: Automatic Fixes
Fix Format Issues
# Always start with formatting
echo "📝 Fixing format issues..."
cargo fmt
# For TypeScript tests
if [ -d "tests" ] && ls tests/*.ts >/dev/null 2>&1; then
npx prettier --write "tests/**/*.ts"
fi
echo "✅ Format fixed"
Fix Clippy Warnings (Auto-fixable)
echo "🔧 Fixing clippy warnings..."
# Apply automatic clippy fixes
cargo clippy --fix --allow-dirty --allow-staged
# Note: Not all clippy warnings are auto-fixable
# Manual fixes may be needed for:
# - Logic issues
# - Unsafe code
# - Complex refactorings
echo "✅ Clippy auto-fixes applied"
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.
- 10d ago First seen · 372 lines · 7 tokens per session scan A f0c7546c6aee
test-and-fix is a command published in the GitHub repository solanabr/solana-glossary (18 stars, last pushed 1mo ago), licensed MIT. It adds 7 tokens to every session and 2,069 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. It is 91% identical to test-and-fix, differing in 4 lines, and is treated as a copy.
Other commands, from other repositories
api-aqa-flow-test-correction
Phase 7 Test Corrections of api-aqa-flow (USER APPROVAL REQUIRED).
ui-aqa-flow-test-correction
Phase 8 Test Correction of ui-aqa-flow.
ui-aqa-flow-test-report-analysis
Phase 7 Test Report Analysis of ui-aqa-flow.
api-aqa-flow-execution-and-report-analysis
Phase 6 Execution & Report Analysis of api-aqa-flow (USER INTERACTION REQUIRED).
verify-bug
Post-merge UAT verification workflow. Walks JIRA reproduce steps, performs comparative audits (Before/After), attaches evidence to JIRA, and transitions status on PASS.
timeout-fix
A procedure for diagnosing and fixing tests that exceed their time limit by finding causes such as slow processing, hanging network calls, deadlocks, heavy setup, or leaked resources.