Substreams Preflight
Preflight validation for AI-generated Substreams projects.
This is a Continuity extension of streamingfast/substreams-skills. It keeps the upstream skills and adds a small mechanical guard before build or deployment:
- rejects incomplete intent contracts and unsupported chains;
- detects critical The Graph
EntityChanges wire-tag mistakes that still pass substreams build and substreams graph.
Quick start
npm ci
npm run preflight -- \
--intent examples/graph-out-preflight.intent.json \
--project examples/T3.2-cross-dex-volume
Before generating a project, agents record confirmed requirements in substreams.intent.json:
{
"chain": "ethereum-mainnet",
"target": "ERC-721 contracts",
"data": "mint events",
"destination": "The Graph / graph_out",
"range": "18000000-18000100"
}
Run preflight before substreams build. It supports Ethereum/EVM and Solana; it rejects other chains rather than inventing a scaffold.
Published demo
The exact one-prompt demo is preserved in demo/usdc-transfers-graph-out/PROMPT.md, with its generated project beside it.
Demo video: https://youtu.be/fbZ5ezZKsOs
Published package:
[email protected]
Run the published graph_out module against live Ethereum data:
. ./.substreams.env
substreams run [email protected] graph_out \
-s 18000000 \
-t +1 \
-o jsonl
The published package resolves from the Substreams registry and emits canonical UsdcTransfer EntityChanges.
Upstream skills
What is this?
This is a Claude Code Plugin that provides AI assistants with expert knowledge about Substreams - a high-performance blockchain data indexing and transformation technology.
When installed, Claude gains deep expertise in:
- Building Substreams projects with
substreams.yaml manifests
- Writing Rust modules (map, store, index types)
- Creating protobuf schemas for blockchain data
- Performance optimization and debugging
Available Skills
✅ Substreams Development (substreams-dev)
Cross-cutting Substreams development for any chain:
- Creating and configuring
substreams.yaml manifests
- Module graphs (map, store, index)
- Protobuf schema design and code generation
- Performance optimization and avoiding excessive cloning
- Debugging and skill routing to chain-specific packs
✅ Substreams Ethereum (substreams-ethereum)
Develop Substreams for Ethereum and other EVM contracts:
- ABI codegen (
build.rs) and event decoding (match_and_decode)
- Raw topic0 / no-ABI decoding
eth_call / RpcBatch and token-metadata stores
- Uniswap-style pool indexing patterns
✅ Substreams Solana (substreams-solana)
Develop Substreams for Solana programs:
walk_instructions() (CPI-safe) vs top-level-only pitfalls
- Program filters with
b58!, SPL Token, Anchor discriminators
- Instruction data + account layout parsing with or without IDL
✅ Substreams SQL (substreams-sql)
Expert knowledge for building SQL database sinks from Substreams data. Covers both mapping modes:
- Database Changes (CDC) — row-level INSERT/UPDATE/UPSERT/DELETE + delta aggregations (PostgreSQL)
- From proto definition — proto annotations → generated tables, insert-only (PostgreSQL and ClickHouse)
- Choosing — mutable state and delta ops need PostgreSQL + Database Changes; everything else is from-proto
- ClickHouse — from-proto DDL, single-PK rule, ORDER BY prefix, cursor-on-disk, analytics MVs
- Schema design — primary keys, injected columns, and schema evolution against a live sink
✅ Substreams Sink (substreams-sink)
Expert knowledge for consuming Substreams data in custom applications. Use when integrating Substreams outputs directly into Go, JavaScript, Python, or Rust code:
- Go sink — cursor management, reorg handling, gRPC streaming
- JavaScript sink — Node.js integration and event handling
- Python / Rust — SDK usage and production patterns
✅ Substreams Sink Deployment — Self-Managed (substreams-sink-deploy-local)
Expert operational guide for running Substreams sink binaries yourself (on your own machine, server, or container). Covers:
- Sink selection — decision tree for SQL, Files, PubSub, Webhook, ProtoJSON, Subgraph
- SQL sink — DSN formats, schema setup, cursor management, reorg handling (Postgres + ClickHouse)
- Files sink — CSV/Parquet to S3, GCS, or local storage
- PubSub / Webhook — event streaming and HTTP delivery
- Production patterns — backfill + live tailing, monitoring, restart safety
- Common pitfalls — wrong proto type, missing domain tables/schema.sql, PK mismatch, batch flush tuning
For a StreamingFast-hosted sink (no infrastructure to manage), see substreams-hosted-sink.