packages/cli/templates/static/shared/.claude/skills/indexing-multichain/SKILL.md
Use when deploying an indexer across multiple chains. Entity ID namespacing to avoid collisions, chain-specific configuration patterns, and the context.chain runtime API.
npx skillsauth add enviodev/hyperindex indexing-multichainInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Always prefix entity IDs with chainId to avoid collisions across chains:
const id = `${event.chainId}-${event.params.tokenId}`;
context.Token.set({ id, ...tokenData });
Never hardcode chainId = 1 — always use event.chainId.
Chain-specific singleton IDs (e.g., Bundle): ${event.chainId}-1
Contract.Event.handler(async ({ event, context }) => {
const chainId = context.chain.id;
const config = {
1: { wrappedNative: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" },
137: { wrappedNative: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270" },
}[chainId];
// context.chain.isLive is true when processing real-time blocks
if (context.chain.isLive) {
// Live-only logic
}
});
Global contract definitions + chain-specific addresses:
contracts:
- name: ERC20
events:
- event: Transfer(indexed address from, indexed address to, uint256 value)
chains:
- id: 1
contracts:
- name: ERC20
address:
- 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
- id: 137
contracts:
- name: ERC20
address:
- 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
Full reference: https://docs.envio.dev/docs/HyperIndex-LLM/hyperindex-complete
development
Write and run tests for HyperIndex indexers using Vitest and createTestIndexer(). Covers test setup, processing block ranges, asserting entity changes with toMatchInlineSnapshot, and TDD workflow. Use when writing tests, debugging handler output, or verifying indexer behavior.
data-ai
Migrate a TheGraph subgraph to Envio HyperIndex using TDD. Covers schema conversion (remove @entity, Bytes->String, @derivedFrom), handler translation (save->set, store.get->context.get, templates->contractRegister), and verification against subgraph data.
data-ai
Use when indexing all instances of a contract across all addresses (e.g., all ERC-20 transfers on a chain). Config setup (no address), wildcard handler option, and event.srcAddress.
data-ai
Use when needing transaction-level data in handlers. Configure field_selection to include transaction fields on events, and access via event.transaction. No native transaction handler — access through event handlers.