Ultrathink blockchain

From x402agent/solana-clawd · View interactive version

Ultrathink blockchain is an AI agent skill from the GitHub repository x402agent/solana-clawd. Deep-reasoning Solana and blockchain engineering skill. Use for production blockchain development, on-chain programs, Solana transaction flows, DeFi integrations, token bots, swaps, Anchor/Rust programs, RPC handling, Helius/Jito execution, MEV analysis, PDA/account validation, retry logic, simulati

How to use this skill

Skill file

Ultrathink Blockchain

A Claude Code skill for building production Solana systems with deep reasoning.

Activation

This skill activates when the user is working on blockchain development — specifically Solana — and needs production-quality code with proper transaction handling, MEV protection, and failure resilience.

Trigger phrases: blockchain, solana, on-chain, web3, defi, token, swap, sniper, anchor, program, transaction, RPC, Helius, Jito, MEV, PDA

Protocol

When this skill is active, follow the Ultrathink Blockchain Formula:

Phase 1: Context Dump

Before writing any blockchain code, establish the environment:

Context: [chain] [network: mainnet/devnet/testnet]

Stack:
- Runtime: [Node.js/Bun + TypeScript | Rust/Anchor]
- RPC: [Helius/Quicknode/Triton + features used]
- Data: [Birdeye/Jupiter/on-chain reads]
- Execution: [Jito bundles / standard RPC / both]
- Wallet: [Keypair from env / browser wallet / multisig]

Constraints:
- Transactions must land in 1-2 slots or fail fast
- All RPC calls need retry logic with exponential backoff
- Assume network is adversarial (MEV, failed txs, RPC lag)
- Compute units are precious — simulate before send
- Every transaction needs priority fee estimation

If the user hasn't provided this context, ask for it before writing code. This prevents generic web2 patterns from leaking in.

Phase 2: Intent Declaration

Ensure the goal is dimensional, not vague:

If the user's intent is vague, help them make it specific by asking about success criteria, latency requirements, and failure tolerance.

Phase 3: Extraction Interview

Before writing code, extract requirements through structured questioning. Ask 3-5 questions at a time covering:

Architecture:

Execution:

Data:

Risk:

Existing code:

Reflect requirements back for confirmation before proceeding.

Phase 4: Ultrathink

Activate deep reasoning on the critical areas. Focus ultrathink — don't waste tokens on obvious code.

Always ultrathink about:

  1. Transaction Structure
  1. MEV Exposure
  1. State Race Conditions
  1. Security
  1. Failure Modes

Phase 5: Plan Mode

Present the architecture before writing code:

  1. Account Schema — all accounts, PDA derivations, sizes, rent
  2. Instruction Flow — ordered instructions, batching strategy, CU estimates
  3. Error Taxonomy — program errors, RPC errors, state errors, retry strategies
  4. Testing Strategy — localnet/devnet plan, mainnet dry-run, simulation vs execution
  5. Monitoring — logs, metrics, alert conditions

Wait for user approval before proceeding to implementation.

Phase 6: Constraints (Non-Negotiable)

Every blockchain implementation must include:

Phase 7: Execute

Write full, production-quality files:

Phase 8: Iterate

After initial implementation, prompt for review:

Antipatterns to Prevent

See references/antipatterns.md for the full list. Key ones:

  1. No retry logic — never call RPC directly, always through retry wrapper
  2. No simulation — never send a transaction without simulating first
  3. Blocking confirmation — never block indefinitely on tx confirmation
  4. Hardcoded fees — never hardcode priority fees
  5. Public mempool for swaps — value transactions go through Jito

Templates

See references/templates.md for production prompt templates:

Code Style

// GOOD — production pattern
const balance = await withRetry(
  () => connection.getBalance(pubkey),
  { maxRetries: 3, backoffMs: 200 }
);

// GOOD — simulate before send
const sim = await connection.simulateTransaction(tx);
if (sim.value.err) {
  throw new SimulationError(sim.value.err, sim.value.logs);
}

// GOOD — dynamic priority fees
const priorityFee = await helius.getPriorityFeeEstimate(tx);
tx.add(ComputeBudgetProgram.setComputeUnitPrice({
  microLamports: priorityFee.high
}));

// GOOD — Jito for value transactions
await jito.sendBundle([swapTx], { tip: 10000 });
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.