/goldsky:subgraph-doctorfrom Goldsky
Diagnoses and fixes broken Goldsky Subgraphs by running CLI commands, reading logs, identifying root causes, and applying fixes. Use when a subgraph is failing, stalled, stuck syncing, or returning errors.
Ships in Goldsky. 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.
Diagnose and fix existing Goldsky Subgraph problems by running CLI commands, reading logs, identifying root causes, and executing fixes.
/subgraph-builder (e.g. reducing/declaring eth_calls)./subgraph-builder for authoring/init/deploy./subgraph-migrate./subgraph-builder or goldsky subgraph <cmd> --help for CLI syntax and flag lookups./turbo-doctor or /mirror-doctor.goldsky CLI commands, the dashboard, and GraphQL queries. Never suggest graphman, kubectl, Datadog, or direct database access — those are internal Goldsky tooling. When a problem needs them, escalate to support (see Step 6).Before running anything, check if you have the Bash tool:
Follow these steps in order. Each builds on the previous one.
Run goldsky project list 2>&1 to confirm the user is logged in.
/auth-setup. Do not proceed until auth works.Run goldsky subgraph list 2>&1 to list all subgraphs and their status.
If the user already named a subgraph (name/version), confirm it exists in the list. Otherwise show the list and ask which one to diagnose. Note its status and which network it indexes — a wrong network is one of the most common root causes (see Step 5).
Subgraph problems fall into a few families. Pick the path that matches the symptom:
| Symptom | Likely family | Go to |
|---|---|---|
| Deploy command failed (never created) | Deploy-time error | Step 4 → "Deploy-time failures" |
| Stuck at a block / head not moving / stalled / auto-paused | Indexing stalled | Step 4 → logs + _meta |
Error / failed health, indexing halted | Handler/mapping error | Step 4 → logs |
| Stuck at low % during a migration | Sync-from-scratch (slow), or handler error | Step 4 → logs + _meta |
| Endpoint 404 / no data / can't query | Endpoint or not-yet-synced | Step 4 → _meta + endpoint check |
reached the subgraph limit, database unavailable, frozen with no log errors | Operational/quota (Goldsky-side) | Step 6 (escalate) |
Run these and analyze before concluding:
# Errors only — START HERE. Widen the window (e.g. --since 24h) if nothing shows.
goldsky subgraph log <name/version> --since 1h --filter error 2>&1
# Subgraph + tag + deployment status
goldsky subgraph list <name/version> 2>&1
Do not pull unfiltered logs. Subgraphs emit a huge volume at
info/debuglevel — runninggoldsky subgraph logwithout--filter erroris slow and extremely token-hungry, and rarely adds signal over the error-filtered view. If you genuinely need non-error context, scope it tightly: a very short window (--since 5m) and, if possible, grep for a specific string. Lead with errors + the_metaquery below.
Then run the _meta query against the GraphQL endpoint — this is the single most useful check for "stuck" or "no data" subgraphs. It reports the latest indexed block:
{
_meta {
deployment
hasIndexingErrors
block { number hash timestamp }
}
}
hasIndexingErrors: true → a handler/mapping error halted indexing. Go to the error patterns below.block.number far behind the chain head → still syncing (or stalled). Compare against a block explorer.block.number ahead of / not yet on the chain → wrong network deployed (see below).Symptoms: Subgraph never produces data, or _meta shows a start/current block that doesn't exist yet on the target chain. Often the subgraph name hints at the intended chain.
Cause: The manifest's network/chain slug points at a different chain than intended, so the subgraph is waiting for blocks that haven't been mined.
Fix: Correct the network in subgraph.yaml (verify the exact chain slug against the supported-networks docs at docs.goldsky.com/chains/supported-networks — e.g. it's liteforge, not litvm-testnet) and redeploy a new version. Confirm the contract address actually exists on the target chain via a block explorer.
The deploy command errors out and nothing gets created. Common cases:
| Error / symptom | Cause | Fix |
|---|---|---|
no network <slug> found | Wrong/unknown chain slug in subgraph.yaml | Use the correct slug from supported networks. |
YAML parse error from subgraph init | Illegal characters in --contract-name (e.g. :, spaces from an explorer label) | Pass a clean name: --contract-name PolymarketUMACTFAdapter. |
subgraph must use a single apiVersion across its data sources. Found: 0.0.7, 0.0.9 | Mixed apiVersion across dataSources/templates | Unify apiVersion across the whole manifest. |
Interface '<X>' not defined | Schema references an undefined interface | Define the interface in schema.graphql. |
Timeseries/aggregation spec errors (must have id field of type Int8, @unique missing, aggregations not supported in spec version 1.0.0) | Schema uses timeseries/aggregations not valid for the spec version | Fix the id type to Int8, add @unique, or remove aggregations. |
A deployment with this name & version already exists | Re-deploying the same name/version | Bump the version, or goldsky subgraph delete <name/version> then redeploy. |
| Windows CLI install fails | The installer runs in WSL, not native Windows | Use auth-setup scripts/install.ps1. It installs the pinned CLI with npm inside WSL. Do not pipe a remote installer. |
Symptoms: hasIndexingErrors: true; logs show things like:
Mapping aborted at src/mappings/...: unexpected null in handler '<handler>' at block #<n>Subgraph error ... code: SubgraphSyncingFailureToken.load failures / Heap (out-of-memory) errorsnonFatalErrors is enabled)Cause: A bug in the customer's AssemblyScript mappings — most often a null dereference. Classic case: an entity is never .save()d because the handler early-returns when a token's decimals()/symbol() reverts (non-ERC-20 contract), then a later handler .load()s that missing entity and panics.
Fix:
.save() on the null path (e.g. default decimals to a sentinel like 18, persist the entity, skip downstream pricing).subgraphError: allow lets queries return partial results.Goldsky-side caveat: a deterministic error with
nonFatalErrorsenabled may not auto-clear even after the underlying cause is resolved. If a subgraph stays errored after a correct redeploy, escalate (Step 6).
Symptoms: Head stops advancing; Goldsky auto-pauses a stalled subgraph and emails you.
Cause: Often a handler error (above), sometimes a transient upstream RPC issue or a stale source chain.
Fix:
_meta for errors first.goldsky subgraph start <name/version>.Symptoms: eth_getLogs does not exist / method-not-supported, or Found no transaction for event / block-number mismatches.
Cause: The chain's RPC provider is misbehaving or missing methods — not the subgraph. (Real case: a node stamped every log with the request's fromBlock, so graph-node couldn't match logs to blocks and went fatal.)
Fix: This is Goldsky/RPC-side. Confirm it's not a manifest issue, then escalate (Step 6) with the exact error and block number.
Symptoms: 404 on the GraphQL endpoint, "no data", or rate-limit errors.
_meta), or the public endpoint is disabled. Verify the endpoint URL with goldsky subgraph list <name/version>. Don't assume an endpoint is live before the resource exists and has synced.goldsky subgraph update <name/version> --public-endpoint enabled (see /subgraph-builder).## Diagnosis
**Subgraph:** <name/version>
**Network:** <chain>
**Symptom:** <one-line>
**Root cause:**
<what's wrong and why>
**Evidence:**
- <log line / _meta block number / error string>
**Recommended fix:**
1. <step>
2. <step>
**Prevention:**
<how to avoid it next time, if applicable>
When to escalate to [email protected] (don't burn cycles guessing):
reached the subgraph limit (especially if the count looks wrong), database unavailable, frozen head with no log errors.eth_getLogs does not exist, log/block mismatches).Give the user the exact info to send: subgraph name/version, project ID, the GraphQL endpoint, the error string, and the affected block number. Mention they can reference using the AI/MCP for priority handling.
Offer to run fixes, and confirm before anything destructive:
goldsky subgraph start <name/version>goldsky subgraph pause <name/version>goldsky subgraph deploy <name/new-version> --path .goldsky subgraph deploy <name/version> --start-block <firstAffectedBlock>goldsky subgraph delete <name/version> then redeploy.After a fix, re-check goldsky subgraph list <name/version> and the _meta query to confirm the head is advancing again.
When indexing halted on a handler/mapping error, the underlying cause is almost always one of these AssemblyScript mistakes. Check the mapping for them before redeploying — and recommend the Subgraph Linter (static analysis) plus Matchstick tests so they never reach a deploy again (see /subgraph-builder → references/testing.md):
| Root cause | Symptom it produces | Fix |
|---|---|---|
Unchecked Entity.load(id)! force-unwrap | unexpected null in handler panic when the entity is missing | Use get-or-create; never !-unwrap a load. |
Early-return that skips .save() (often after a reverting decimals()/symbol() on a non-ERC-20) | later .load() panics; Token.load/Heap errors | Use try_ calls, default the value, persist the entity, skip only downstream pricing. |
| Division without a zero guard | math abort / unexpected null | Wrap in a safeDiv (return 0 when denominator is 0). |
Stale .save() after a helper already mutated the entity | overwritten/clobbered fields, wrong data (not always a crash) | Load once, mutate, save once; don't save a stale copy. |
Per-event eth_call that reverts or is undeclared | slow indexing or unexpected null | Make it revert-safe (try_) and declare it (specVersion 1.2.0+). |
These are the causes behind the reactive symptoms in Step 5's "Handler / mapping errors". Fixing the code and rewinding to the first affected block is the durable fix.
_meta) before diagnosing. Never guess.graphman/kubectl/Datadog/database access to a customer. Escalate instead./subgraph-builder).Give one command at a time, explain what to look for, and proceed based on the user's pasted output. Always prefer running commands directly when Bash is available.
/subgraph-builder — Build, author, and deploy subgraphs; schema/mapping/manifest authoring; endpoints, tags, webhooks/subgraph-migrate — Migrate a subgraph from The Graph/auth-setup — CLI installation and authentication/datasets — Chain prefixes and supported-network slugs/turbo-doctor, /mirror-doctor — Pipeline (not subgraph) diagnosisWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
16 skills in this plugin
/auth-setupSet up Goldsky CLI authentication and project configuration. Use this skill when the user needs to: install the goldsky CLI (what's the official install command?), run goldsky login (including when the browser opens but 'authentication failed'), run goldsky project list and see 'not logged in' or 'unauthorized', switch between Goldsky projects, check which project they're currently authenticated to, or fix 'unauthorized' errors when running goldsky turbo commands. Also use for 'walk me through setting up goldsky CLI from scratch for the first time', and when they just installed Goldsky and say 'Set it up and help me get started'. If any other Goldsky skill hits an auth error, redirect here first./boostConfigure and troubleshoot Goldsky Boost, the free RPC caching CDN in front of a provider the user already pays for. Use for cutting RPC bills without migrating, connecting Alchemy/QuickNode/Infura upstreams, goldsky boost, edge.goldsky.com/boost, verification, cache hit rates, eth_getLogs forwarding, and x-cache / x-edge-billable / x-edge-source headers. Boost keeps the existing provider and forwards uncached requests. To replace a provider with Goldsky's managed RPC, use /edge. Pipeline, Subgraph, and Compose tasks have separate skills./datasetsUse this skill when the user needs to look up or verify Goldsky blockchain dataset names, chain prefixes, dataset types, or versions. Triggers on questions like 'what\'s the dataset name for X?', 'what prefix does Goldsky use for chain Y?', 'what version should I use for Z?', or 'what datasets are available for Solana/Stellar/Arbitrum/etc?'. Also use for chain-specific dataset questions (e.g., polygon vs matic prefix, stellarnet balance datasets, solana token transfer dataset names), and to answer 'is there a dataset for X?' where X is a domain rather than a chain — decoded logs, token transfers and balances, mint/burn events for circulating supply, DEX or prediction-market activity (Polymarket), or the raw blocks, transactions and traces behind wallet history and reconciliation. Do NOT trigger for questions about CLI commands, pipeline setup, or general Goldsky architecture unless the core question is about finding the right dataset name or chain prefix. Feeds REST queries (Polymarket, blocks) are /feeds./edgeConfigure and troubleshoot Goldsky Edge, Goldsky's managed EVM RPC endpoint service. Use for Edge RPC, Goldsky RPC endpoints, edge.goldsky.com, slow eth_getLogs, rate limits, hedged requests, flashblocks, HyperEVM system transactions, x402 pay-per-request RPC, pricing, the Edge dashboard, gs_edge_ keys, rpc-edge, and errors -32005/-32012/-32014/-32015/-32016. Covers resilient low-latency EVM endpoints and provider comparisons. For self-hosted eRPC configuration, consult docs.erpc.cloud/llms.txt. To keep an existing provider and reduce its bill through caching, or for x-cache / x-edge-billable / goldsky boost, use /boost. REST reads under edge.goldsky.com/data (Feeds: wallets, tokens, Polymarket, blocks; formerly Edge Data / Data APIs) are /feeds. Pipeline and Subgraph questions have separate skills./feedsQuery Goldsky Feeds over HTTP: one wallet's balances and transfers; metadata and current USD price of up to 100 EVM tokens; Polymarket activity (a wallet's trades), positions, PnL and balances; block headers by number, hash or timestamp; and a chain's head block. Feeds absorbed Edge Data / Data APIs, with the same URLs and keys. Use for wallet holdings, portfolio value, transfer history, deposit checks, token prices or metadata, a wallet's Polymarket trades or positions, which block was at a timestamp, the latest indexed block, edge.goldsky.com/data, a Feeds API key, Feeds pricing, or paying per request with x402 instead of a key. Get the key with goldsky feeds key reveal, then call the feeds over HTTP. The CLI login token is not this key. For rows in the user's own database, use /turbo-builder. For a Turbo dataset name, use /datasets. For JSON-RPC, use /edge or /boost./mirrorUse this skill when the user asks about Goldsky Mirror pipelines — creating, deploying, operating, or troubleshooting Mirror. Triggers on: 'Mirror pipeline', 'goldsky pipeline apply', 'sync subgraph to database', 'mirror vs turbo', 'direct indexing', 'mirror pipeline YAML', 'mirror pipeline pause/stop/restart'. Also use this skill when the user wants to sync a Goldsky subgraph into a database or message queue — Mirror is the only pipeline product that supports subgraph sources. For new pipelines that don't need a subgraph source, the turbo-builder skill is usually a better fit. Do NOT trigger on 'goldsky turbo' commands or generic 'build a pipeline' requests without subgraph context — those belong to the turbo skills.npx claudepluginhub goldsky-io/goldsky-agent --plugin goldskyOther plugins' skills for the same job