Skip to content
Development
Command

/explain-code

Explain Solana code with a diagram and a step-by-step walkthrough

From plugin
ai-kit
11154 skills15 agents54 commands4 MCP
> /plugin marketplace add solanabr/ai-kit
> /plugin install solana-ai-kit@stbr

Command definition

explain-code.md
description: "Explain Solana code with a diagram and a step-by-step walkthrough"

Explain the code in `$ARGUMENTS` (a path, symbol, or pasted snippet). Match depth to the code and the asker: a helper gets a paragraph; an instruction handler or a whole program gets the structure below.

For concept background, open the matching entry in the kit skill hub: `.claude/skills/SKILL.md`, or the `solana-ai-kit` skill in a plugin install. For tutorials or learning paths, hand off to the `solana-guide` agent.

Output

1. **Overview**: what it does and why it exists, in two or three sentences. 2. **Diagram**: Mermaid. A sequence diagram or flowchart for instruction and CPI flow, a graph for account and PDA relationships. 3. **Walkthrough**: the significant sections in order, with the reasons behind non-obvious choices (seed layout, account order, bump handling, `remaining_accounts`). 4. **Solana concepts used**: PDAs, CPIs and signer seeds, rent, account ownership, Token vs Token-2022; a sentence or two each on how this code uses them. 5. **Security notes**: the checks the code performs and any it appears to miss (signer, owner, PDA, CPI target, arithmetic). For a real review, suggest `/audit-solana`. 6. **Check questions** (for learners only): two or three "what happens if..." questions.

@solanabr
Ships withai-kit

Claude Code, set up to ship on Solana. Not programs alone — the whole lifecycle: validating the idea, building the program and the app around it, shipping it, and the launch and growth work that follows.

1113 skills15 agents4 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
111
Star history of solanabr/solana-ai-kit on GitHub, a chart by star-history.com

Other commands on ai-kit.

add-skill

add-skill

Command

Install a pinned skill extension on demand (/add-skill <id>), or list core packs and extensions

@solanabr@solanabrInstall Command
adv

adv

Command

Short for /adversarial: run every task through proposer and adversary pairs, no triage

@solanabr@solanabrInstall Command
adversarial

adversarial

Command

Put a task's load-bearing claims and key decisions through a proposer and an adversary, with proof

@solanabr@solanabrInstall Command
audit-solana

audit-solana

Command

Audit Solana program code for exploitable bugs and write a findings report

@solanabr@solanabrInstall Command
benchmark

benchmark

Command

Compare per-instruction CU with the stored baseline to catch regressions

@solanabr@solanabrInstall Command

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command