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.
npx agentmods add commands/solanabr/solana-ai-kit/explain-codegit clone --depth 1 https://github.com/solanabr/solana-ai-kitWhat 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 | $0.00016 | $0.00552 |
| Opus 5 | $0.00008 | $0.00276 |
| Sonnet 5 | $0.00003 | $0.00110 |
| Haiku 4.5 | $0.00002 | $0.00055 |
Grade A, and why
explain-code 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 2d 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:
- explain-code — 100% identical, 0 lines differ
- explain-code — 100% identical, 0 lines differ
How it starts
The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Explain complex Solana blockchain code through clear narratives, visual diagrams, and step-by-step breakdowns.
Code to Explain
$ARGUMENTS
Related Context
- Solana Concepts: See SKILL.md for concept references
- Anchor Patterns: See programs/anchor.md
- Learning Approach: See solana-guide agent for educational patterns
Explanation Framework
1. Initial Assessment
Determine:
- Code type: Program instruction, client code, account structure, test
- Complexity level: Beginner, intermediate, advanced
- Key concepts: What Solana/blockchain concepts are used
- Target audience: Adjust depth accordingly
2. Explanation Structure
High-Level Overview
- What does this code do? (1-2 sentences)
- What problem does it solve?
- Key concepts used
Visual Diagram
- Use Mermaid flowcharts for control flow
- Use relationship diagrams for account structures
- Use ASCII art for simple data flows
Step-by-Step Breakdown
- Walk through each significant section
- Explain what's happening AND why it matters
- Highlight non-obvious decisions
Concept Deep Dives For Solana concepts encountered (PDAs, CPIs, etc.):
- Brief explanation of the concept
- How it's used in this code
- Common pitfalls to avoid
Security Analysis
- Access control checks
- Validation patterns
- Potential issues or considerations
Patterns Identified
- Design patterns used (state machine, authority, escrow, etc.)
- Why the pattern fits this use case
3. Interactive Elements
Include comprehension checks:
- "What would happen if...?"
- "How would you modify this to...?"
- Links to related concepts for further learning
Output Format
- Overview - What does this code do? (2-3 sentences)
- Visual Diagram - Flow chart or relationship diagram (Mermaid)
- Step-by-Step - Walk through significant sections
- Deep Dives - Explain Solana-specific concepts encountered
- Security - Highlight security considerations
- Patterns - Identify design patterns used
- Questions - Comprehension checks
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.
- 2d ago First seen · 79 lines · 16 tokens per session scan A 18151a79f59e
explain-code is a command published in the GitHub repository solanabr/solana-ai-kit (98 stars, last pushed 12d ago), licensed MIT. It adds 16 tokens to every session and 552 once invoked, about $0.0001 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
create-hook
Create hooks with brainstorming and security-first design.
doc-generate
You are a documentation expert specializing in creating comprehensive, maintainable documentation from code. Generate API docs, architecture diagrams, user guides, and technical references using AI-powered analysis and industry best practices.
brainblast-firewall
Inspect a serialized Solana transaction before signing it — the AI-agent transaction firewall.
brainblast-score
A 0–100 trust score and A–F grade for any deployed Solana program: upgrade authority (renounced > DAO > multisig > single-key), verified build, audits, directory curation, and cross-cluster parity — with a transparent factor breakdown.
pr
Prepare GitHub Pull Request with essential details.
research
Enter RESEARCH mode for information gathering.