/substreams-preflight:substreams-convertfrom substreams-preflight
Guides migration of blockchain indexing projects (subgraphs, Solana contracts) into Substreams pipelines. Walks through source, network, and destination choices before handing off to specialist skills.
Ships in substreams-preflight. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Expert assistant for converting existing blockchain indexing projects — subgraphs and Solana contracts — into high-performance Substreams pipelines.
Do not scaffold protos, Rust, or manifests until the user has answered (or already stated) these. One question per turn when anything is missing; always offer an "Other / custom" option.
| Order | Focus | Typical choices |
|---|---|---|
| 1 | Source | Subgraph (.yaml + GraphQL + AS) · Solana Anchor IDL · Solana Rust source · Other |
| 2 | Network / chain | Ethereum mainnet · Base · Solana · Other |
| 3 | Destination | substreams run only · SQL self-managed · SQL hosted · Graph Node / EntityChanges (legacy) · Other |
Then hand off decoding and sink detail to the specialist skills — do not re-implement full tutorials here:
| Concern | Skill |
|---|---|
EVM logs, Abigen, logs_with_calls, topic0 | substreams-ethereum |
Solana walk_instructions, IDL/Anchor, SPL | substreams-solana |
db_out, Postgres vs ClickHouse, DatabaseChanges | substreams-sql |
Self-managed substreams sink postgres/clickhouse | substreams-sink-deploy-local |
| StreamingFast-hosted SQL sink | substreams-hosted-sink |
EntityChanges / optional graph_out | substreams-sink (not the default greenfield path) |
Mutable balances / current-state entities → PostgreSQL + Database Changes. ClickHouse and from-proto are insert-only.
Substreams offers several advantages over traditional indexers:
This skill covers two main conversion paths:
| Input | Reference File | Description |
|---|---|---|
| Subgraph (The Graph) | references/subgraph.md | Convert a GraphQL-schema subgraph with AssemblyScript handlers to Substreams |
| Solana Contract | references/solana-contract.md | Build a Substreams pipeline from a Solana program — via substreams init (Anchor IDL) or manual conversion from Rust source |
Load this skill when the user wants to:
.yaml + schema.graphql + AssemblyScript mappings) to Substreamsdb_outsubstreams initComplete the Pre-flight table above. Do not skip destination: it drives whether you build db_out, stop at a domain map, or (rarely) keep EntityChanges.
Convert the source schema into Substreams protobuf types (.proto files).
Translate the source handlers (AssemblyScript or Anchor/native Rust) into Substreams map and store modules. Prefer the loop shapes in substreams-ethereum / substreams-solana rather than inventing new ones.
Wire modules together in substreams.yaml, referencing initialBlock from the original data source definition. For SQL: include standard imports: (database-changes + sql protodefs) and a sink: block — see the complete example in references/subgraph.md.
Also load
substreams-devfor Cargo.toml setup, build commands,initialBlockguidance, and general Rust module development patterns. Also loadsubstreams-sqlwhen the target output is a SQL sink (db_out→ Postgres or ClickHouse). Also loadsubstreams-sink-deploy-localwhen ready to run the converted substreams against a live sink (Postgres, ClickHouse, etc.) on your own infrastructure. For a StreamingFast-hosted sink, usesubstreams-hosted-sinkinstead. Also loadsubstreams-sinkonly if you must keep Graph Node / EntityChanges (optional/legacy).
substreams build
substreams run ./substreams.yaml <output_module> -s <start_block> -t +100 -o jsonl
| Concept | Subgraph / Traditional | Substreams |
|---|---|---|
| Language | AssemblyScript / JavaScript | Rust (compiled to WASM) |
| Schema | GraphQL SDL | Protobuf (internal) + SQL schema (persistence) |
| Handler trigger | Event / call template | Block-level map module |
| State persistence | Entity store (auto-managed) | SQL sink via db_out + Postgres / ClickHouse |
| Intermediate state | Entity store | Explicit store modules (dynamic contract tracking) |
| Output | GraphQL API | SQL database, Kafka, custom — any sink |
| Reorg handling | Automatic (graph-node) | Cursor-based, explicit |
| Backfill speed | Sequential | Parallel (up to 100×) |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub xuechunhhh/substreams-preflight --plugin substreams-preflight11 skills in this plugin
/substreams-bitcoinExpert knowledge for developing Bitcoin Substreams. Use when working with Bitcoin blockchain data, UTXO model, transaction parsing, address extraction, or Esplora API compatibility./substreams-devCross-cutting Substreams development — manifests, module graphs (map/store/index), protobuf, performance, debugging. For Ethereum/EVM contract decoding use substreams-ethereum; for Solana programs use substreams-solana; for SQL sinks use substreams-sql./substreams-ethereumDevelop Substreams for Ethereum and EVM contracts — ABI codegen (Abigen/build.rs), event decoding via match_and_decode, raw topic0 decoding without an ABI, eth_call / RpcBatch, and token-metadata stores. Always decode log data into typed structured protobuf objects (never raw bytes or JSON); one protobuf message type per event. Use when building EVM Substreams, decoding contract events, ERC-20/721/1155, Uniswap/DEX pools, or when the user mentions an Ethereum contract address, ABI, topic0, Solidity, or an EVM chain (Polygon, Arbitrum, Base, BSC, Optimism).
/substreams-hosted-sinkUse when the user wants StreamingFast to host and run a Substreams sink — deploy a .spkg to managed infrastructure (PostgreSQL or ClickHouse only) via the Portal API HostedService. HARD RULE: before any first-time hosted Deploy (or any "ready to deploy?" prompt), stop and offer a substreams run output-quality check as its own turn. For that check, give the user a ready-to-paste substreams run command only (stdout/jsonl) — never substreams sink postgres / any sink binary, never a local ClickHouse/Postgres sync. Building the module is not enough. SF hosts only the sink runner; the user supplies the database. Self-managed sinks: substreams-sink-deploy-local; modules: substreams-sql / substreams-dev.
/substreams-sinkExpert knowledge for consuming Substreams data in applications. Use when building sinks, real-time data pipelines, or integrating Substreams outputs into Go, JavaScript, Python, or Rust applications./substreams-sink-deploy-localUse when the user wants to run or operate a Substreams sink themselves — take a built .spkg and pipe its data into a destination (Postgres, ClickHouse, files, PubSub, webhook) on infrastructure they manage. Covers sink CLIs, schema setup, cursor management, reorg handling, and production operations. For StreamingFast-hosted sinks (managed via the Portal API) use substreams-hosted-sink instead. Distinct from substreams-sql (building the db_out Rust module) and substreams-sink (SDK-level app integration).2 plugins ship this exact skill · first indexed Aug 7, 2026