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.
git clone --depth 1 https://github.com/solanabr/solana-ai-kitWrote 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-ai-kit/test-and-fix)<a href="https://agentmods.dev/commands/solanabr/solana-ai-kit/test-and-fix"><img src="https://agentmods.dev/badge/commands/solanabr/solana-ai-kit/test-and-fix.svg" alt="Measured on agentmods" 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.02087 |
| Opus 5 | $0.00003 | $0.01043 |
| Sonnet 5 | $0.00001 | $0.00417 |
| Haiku 4.5 | $0.00001 | $0.00209 |
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 8d 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.
Copies of this mod
2 near-identical copies found in the catalogue:
- test-and-fix — 91% identical, 4 lines differ
- test-and-fix — 91% identical, 4 lines differ
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.
- 8d ago First seen · 372 lines · 7 tokens per session scan A 9894c58e358f
test-and-fix is a command published in the GitHub repository solanabr/solana-ai-kit (101 stars, last pushed 18d ago), licensed MIT. It adds 7 tokens to every session and 2,087 once invoked, about $0.0000 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.
Other commands, from other repositories
apex
APEX Methodology - The systematic Analyze-Plan-Execute-eLicit-eXamine approach for intelligent development. Reduces hallucination and defect risk through mandatory parallel research, self-review, and validation gates.
deep-code-analysis
Comprehensive codebase investigation using research-expert for documentation, explore-codebase for structure, and deep analysis. Perfect for understanding complex systems.
watch
Check for Claude Code updates, detect breaking changes, analyze plugin compatibility, and optionally gather community pulse via Exa.
plan-feature
Production-grade feature planning with dual-AI validation (Claude + Antigravity/Gemini 3 via agy).
fix
Quick bugfix commit. Use for fix bug, bugfix, patch, hotfix, correct error.
test
Test commit. Use for add tests, update tests, test coverage, unit test, spec.