Agent Skill
2/7/2026

brane-research

Research EVM SDK patterns from viem (TypeScript) and alloy (Rust) when designing Brane features. Use when implementing new functionality, designing APIs, or solving problems that other SDKs have already addressed.

N
noise
7GitHub Stars
1Views
npx skills add noise-xyz/brane

SKILL.md

Namebrane-research
DescriptionResearch EVM SDK patterns from viem (TypeScript) and alloy (Rust) when designing Brane features. Use when implementing new functionality, designing APIs, or solving problems that other SDKs have already addressed.

name: brane-research description: Research EVM SDK patterns from viem (TypeScript) and alloy (Rust) when designing Brane features. Use when implementing new functionality, designing APIs, or solving problems that other SDKs have already addressed.

Brane SDK Research

Purpose

When implementing Brane features, reference how mature EVM SDKs solve the same problems:

  • viem (TypeScript) - Modern, type-safe, excellent documentation
  • alloy (Rust) - Performance-focused, similar design philosophy to Brane

These SDKs have solved many of the same problems. Learn from their API design, naming conventions, and implementation patterns.


Reference Sources

viem (TypeScript)

alloy (Rust)


When to Research

Use this skill when:

  1. Designing new APIs - How do viem/alloy name this? What parameters do they use?
  2. Implementing features - What edge cases did they handle?
  3. Solving problems - Has this been solved before? How?
  4. Naming things - What's the conventional name for this concept?

Research Workflow

Step 1: Identify the Feature Area

Map your Brane feature to the equivalent concept:

Brane Areaviem Equivalentalloy Equivalent
Brane.ReaderpublicClient / PublicActionsProvider
Brane.SignerwalletClient / WalletActionsSigner + Provider
BraneContract.bind()getContract()ContractInstance
TransactionRequestTransactionRequestTransactionRequest
Address, Hash, HexDataBranded typesAddress, B256, Bytes
ABI encodingencodeFunctionDataSolCall::abi_encode
ABI decodingdecodeFunctionResultSolCall::abi_decode
Gas estimationestimateGasestimate_gas
Transaction receiptwaitForTransactionReceiptget_transaction_receipt

Step 2: Fetch Documentation

Use WebFetch to read the relevant documentation:

# viem examples
https://viem.sh/docs/actions/public/getBalance
https://viem.sh/docs/contract/readContract
https://viem.sh/docs/actions/wallet/sendTransaction

# alloy examples
https://alloy.rs/examples/providers/builder.html
https://alloy.rs/examples/contracts/deploy.html

Step 3: Compare and Adapt

When adapting patterns to Java/Brane:

viem/alloy PatternBrane Adaptation
Async/awaitBlocking calls (Java's virtual threads handle concurrency)
Generic type parametersJava generics or method overloads
Builder patternSame (Java builders work well)
Result/Option typesExceptions + Optional
Branded typesRecord types with validation

Common Research Scenarios

Scenario: Implementing a new RPC method

  1. Check viem docs for the action: https://viem.sh/docs/actions/public/{methodName}
  2. Note the parameters, return type, and edge cases
  3. Check if alloy has additional insights in their examples

Scenario: Designing a new type

  1. Look at viem's type definitions in their TypeScript source
  2. Look at alloy's type definitions (usually in alloy-primitives or alloy-rpc-types)
  3. Adapt to Java records with validation

Scenario: Handling errors

  1. Check viem's error types: https://viem.sh/docs/glossary/errors
  2. See how they categorize and present errors
  3. Map to Brane's exception hierarchy

Scenario: Gas estimation strategy

  1. viem: https://viem.sh/docs/actions/public/estimateGas
  2. alloy: Check their provider examples
  3. Note buffer strategies, EIP-1559 handling

API Naming Conventions

Learn from viem/alloy naming patterns:

ConceptviemalloyBrane (adopt)
Read contractreadContractcallcall or read
Write contractwriteContractsend_transactionsendTransaction
Get balancegetBalanceget_balancegetBalance
Get blockgetBlockget_blockgetBlock
Wait for receiptwaitForTransactionReceiptwatch_pending_transactionsendTransactionAndWait

Key Documentation Pages

viem - Bookmark These

alloy - Bookmark These


Example Research Session

Task: Implement eth_getLogs with filter support

Research steps:

  1. viem docs: Fetch https://viem.sh/docs/actions/public/getLogs

    • Note: filter parameters, block range handling, topics array format
    • Note: How they handle "block range too large" errors
  2. alloy examples: Check their filtering examples

    • Note: Type definitions for LogFilter
  3. Adapt to Brane:

    • Create LogFilter record with builder
    • Return List<LogEntry>
    • Handle block range errors with RpcException.isBlockRangeTooLarge()

Things viem/alloy Do Well (Learn From)

  1. Type safety - Both have strong typing; Brane should too
  2. Ergonomic APIs - Easy common cases, flexible advanced cases
  3. Good defaults - Sensible defaults, explicit overrides
  4. Error messages - Clear, actionable error messages
  5. Documentation - Examples for every feature

Things to Adapt (Not Copy Directly)

PatternWhy Adapt
Async everywhereJava uses blocking + virtual threads
Function overloading via typesJava uses method overloading
Optional chainingJava uses Optional or null checks
DestructuringJava uses record accessors
Skills Info
Original Name:brane-researchAuthor:noise