debug-program

Diagnose and fix Solana program errors and transaction failures through a structured debugging workflow.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/RavitejaKarra24/dotfiles --skill debug-program-ravitejakarra24
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug-program
Source: https://github.com/RavitejaKarra24/dotfiles/tree/main/agents/.agents/skills/debug-program
Command: npx skills add https://github.com/RavitejaKarra24/dotfiles --skill debug-program-ravitejakarra24

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Solana developers often waste hours guessing why a program or transaction failed. This Skill replaces guesswork with a systematic debugging process: read the exact error, simulate the transaction, inspect account state, and trace CPI chains to find the real root cause. ## Core Features & Use Cases - Structured Debug Workflow: Follows a six-step process covering error parsing, transaction simulation, account state inspection, and CPI chain tracing. - Top 20 Pitfall Reference: Matches errors against the most common Solana mistakes (wrong PDA seeds, stale blockhash, missing ATA, rent exemption, compute budget) with exact fixes. - Error Code Decoding: Maps Anchor 6xxx custom errors, 2xxx constraint errors, and system error codes to concrete causes. - Use Case: A developer gets ConstraintSeeds (error 2003) on mainnet. The Skill simulates the transaction, compares client-side PDA derivation against program seeds, and provides the corrected TypeScript code. ## Quick Start Ask the assistant to debug your failing Solana transaction by providing the error message or transaction signature.

Frequently Asked Questions about debug-program

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug a failing Solana transaction?

Get the exact error from the transaction signature using solana confirm -v, then simulate the transaction with connection.simulateTransaction to see full program logs. Inspect account state for existence, ownership, and balance before applying a fix.

What do Anchor error codes 6000 and 2003 mean?

Error 6000 is the first custom error in your program's #[error_code] enum, with 6001, 6002 mapping to subsequent variants. Error 2003 is ConstraintSeeds, meaning client-side PDA derivation seeds do not match what the program expects.

How do I trace CPI errors in Solana program logs?

Read the invoke depth markers in transaction logs: invoke [1] is your program, invoke [2] is a CPI call, and deeper numbers are nested calls. The deepest failing invoke is usually the root cause, not your top-level program.

Why does my Solana transaction fail with BlockhashNotFound?

Recent blockhashes expire after roughly 60 seconds, so transactions that take too long to build or sign become invalid. Fetch a fresh blockhash with getLatestBlockhash right before sending and use lastValidBlockHeight for retry logic.

Can I replay a mainnet transaction locally for debugging?

Yes, use Surfpool with surfpool start --network mainnet to fork mainnet state and replay the failing transaction locally. This gives you execution traces, compute unit usage per instruction, and account state changes without spending real SOL.