MCPInstall

subgraph-doctor

Diagnose and fix broken Goldsky Subgraphs. Use this skill whenever a user has a subgraph that is failing, stalled, stuck syncing, not indexing, auto-paused, returning errors, or won't deploy. Triggers on: 'subgraph stopped syncing', 'subgraph stuck at block', 'subgraph stalled', 'subgraph failed to deploy', 'indexing error', 'SubgraphSyncingFailure', 'unexpected null in handler', 'no network found', 'deployment already exists', 'subgraph not returning data', 'subgraph endpoint 404', 'reached the subgraph limit', 'rate limited'. Also use when the user names a subgraph alongside a problem. Runs CLI commands directly to check status, read logs, identify root cause, and apply fixes. For building, authoring, deploying, endpoint/tag reference, or optimizing a healthy-but-slow subgraph (e.g. too many ethcalls), use /subgraph-builder instead. For migrating from The Graph, use /subgraph-migrate instead.

Installs
3.7K
Last 24h
+235
Trending rank
#1162
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/goldsky-io/goldsky-agent --skill subgraph-doctor
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads subgraph-doctor automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Subgraph Doctor

Diagnose and fix existing Goldsky Subgraph problems by running CLI commands, reading logs, identifying root causes, and executing fixes.

Boundaries

  • Diagnose and fix EXISTING subgraph problems.
  • Diagnose only subgraphs that are broken (failing, stalled, erroring, won't deploy). A healthy but slow subgraph is an optimization task — use /subgraph-builder (e.g. reducing/declaring eth_calls).
  • Do not build or scaffold new subgraphs — use /subgraph-builder for authoring/init/deploy.
  • Do not handle The Graph migrations — use /subgraph-migrate.
  • Do not serve as a command reference — use /subgraph-builder or goldsky subgraph <cmd> --help for CLI syntax and flag lookups.
  • Do not handle Turbo or Mirror pipelines — use /turbo-doctor or /mirror-doctor.
  • Customer-facing only. Use only 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).

Mode Detection

Before running anything, check if you have the Bash tool:

  • Bash available (CLI mode): Run commands directly and parse output.
  • Bash NOT available (reference mode): Give the user one command at a time, explain what to look for, and proceed based on what they paste back.

Diagnostic Workflow

Follow these steps in order. Each builds on the previous one.

Step 1: Verify Authentication

Run goldsky project list 2>&1 to confirm the user is logged in.

  • If logged in: Note the project name and continue.
  • If not logged in: Direct the user to /auth-setup. Do not proceed until auth works.

Step 2: Identify the Subgraph

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).

Step 3: Triage by Symptom

Subgraph problems fall into a few families. Pick the path that matches the symptom:

SymptomLikely familyGo to
Deploy command failed (never created)Deploy-time errorStep 4 → "Deploy-time failures"
Stuck at a block / head not moving / stalled / auto-pausedIndexing stalledStep 4 → logs + _meta
Error / failed health, indexing haltedHandler/mapping errorStep 4 → logs
Stuck at low % during a migrationSync-from-scratch (slow), or handler errorStep 4 → logs + _meta
Endpoint 404 / no data / can't queryEndpoint or not-yet-syncedStep 4 → _meta + endpoint check
reached the subgraph limit, database unavailable, frozen with no log errorsOperational/quota (Goldsky-side)Step 6 (escalate)

Step 4: Gather Diagnostic Data

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/debug level — running goldsky subgraph log without --filter error is 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 _meta query 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).

Step 5: Match Error Patterns

Wrong network / contract on the wrong chain

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.

Deploy-time failures

The deploy command errors out and nothing gets created. Common cases:

Error / symptomCauseFix
no network <slug> foundWrong/unknown chain slug in subgraph.yamlUse the correct slug from supported networks.
YAML parse error from subgraph initIllegal 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.9Mixed apiVersion across dataSources/templatesUnify apiVersion across the whole manifest.
Interface '<X>' not definedSchema references an undefined interfaceDefine 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 versionFix the id type to Int8, add @unique, or remove aggregations.
A deployment with this name & version already existsRe-deploying the same name/versionBump the version, or goldsky subgraph delete <name/version> then redeploy.
Windows CLI install failsThe installer runs in WSL, not native WindowsUse auth-setup scripts/install.ps1. It installs the pinned CLI with npm inside WSL. Do not pipe a remote installer.

Handler / mapping errors (indexing halts)

Symptoms: hasIndexingErrors: true; logs show things like:

  • Mapping aborted at src/mappings/...: unexpected null in handler '<handler>' at block #<n>
  • Subgraph error ... code: SubgraphSyncingFailure
  • Token.load failures / Heap (out-of-memory) errors
  • WASM trap / "Handler skipped due to execution failure" (when nonFatalErrors 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:

  1. Identify the handler and block from the error.
  2. Patch the mapping so it doesn't skip .save() on the null path (e.g. default decimals to a sentinel like 18, persist the entity, skip downstream pricing).
  3. Redeploy a new version and rewind to the first affected block so the missing entities re-initialize.
  4. As a stopgap to keep the endpoint serving (incomplete) data while you fix it, subgraphError: allow lets queries return partial results.

Goldsky-side caveat: a deterministic error with nonFatalErrors enabled may not auto-clear even after the underlying cause is resolved. If a subgraph stays errored after a correct redeploy, escalate (Step 6).

Stalled / auto-paused subgraph

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:

  1. Check logs and _meta for errors first.
  2. If it's a code bug, fix and redeploy. If it was transient, resume: goldsky subgraph start <name/version>.
  3. If the source chain itself is stale (no new blocks on the explorer either), there's nothing to index — wait for the chain.

Upstream RPC errors

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.

Endpoint / query problems

Symptoms: 404 on the GraphQL endpoint, "no data", or rate-limit errors.

  • 404 / no data: The subgraph may not be synced yet (check _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.
  • Public vs private: If queries fail auth, the endpoint may be private. Toggle with goldsky subgraph update <name/version> --public-endpoint enabled (see /subgraph-builder).
  • Rate limits: Default is ~50 requests / 10 seconds. Higher limits are sales/support-gated — escalate (Step 6); don't promise a specific new limit.

Step 6: Present Diagnosis

## 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 support@goldsky.com (don't burn cycles guessing):

  • Operational/quota issues not visible via CLI: reached the subgraph limit (especially if the count looks wrong), database unavailable, frozen head with no log errors.
  • Upstream RPC bugs (eth_getLogs does not exist, log/block mismatches).
  • A subgraph that stays errored after a verified-correct redeploy.

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.

Step 7: Execute Fix

Offer to run fixes, and confirm before anything destructive:

  • Resume a paused subgraph: goldsky subgraph start <name/version>
  • Pause for maintenance: goldsky subgraph pause <name/version>
  • Redeploy a fixed version: goldsky subgraph deploy <name/new-version> --path .
  • Redeploy with a rewind: goldsky subgraph deploy <name/version> --start-block <firstAffectedBlock>
  • Delete and recreate (last resort, reindexes from scratch — warn the user): 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.

Common mapping-code root causes (catch before redeploy)

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 causeSymptom it producesFix
Unchecked Entity.load(id)! force-unwrapunexpected null in handler panic when the entity is missingUse 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 errorsUse try_ calls, default the value, persist the entity, skip only downstream pricing.
Division without a zero guardmath abort / unexpected nullWrap in a safeDiv (return 0 when denominator is 0).
Stale .save() after a helper already mutated the entityoverwritten/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 undeclaredslow indexing or unexpected nullMake 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.

Important Rules

  • Always gather data (logs + _meta) before diagnosing. Never guess.
  • "The product is solid — most issues are customer-side." Check the obvious customer causes first (wrong network, mapping bug, schema/manifest error) before assuming a Goldsky-side problem.
  • Never recommend graphman/kubectl/Datadog/database access to a customer. Escalate instead.
  • Confirm before destructive commands (delete, reindex from scratch).
  • Redeploying creates a new immutable version. Use tags so the frontend URL doesn't change (see /subgraph-builder).

When Bash Is Not Available

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.

Related

  • /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) diagnosis

FAQ

What does the subgraph-doctor skill do?

Diagnose and fix broken Goldsky Subgraphs. Use this skill whenever a user has a subgraph that is failing, stalled, stuck syncing, not indexing, auto-paused, returning errors, or won't deploy. Triggers on: 'subgraph stopped syncing', 'subgraph stuck at block', 'subgraph stalled', 'subgraph failed to deploy', 'indexing error', 'SubgraphSyncingFailure', 'unexpected null in handler', 'no network found', 'deployment already exists', 'subgraph not returning data', 'subgraph endpoint 404', 'reached the subgraph limit', 'rate limited'. Also use when the user names a subgraph alongside a problem. Runs CLI commands directly to check status, read logs, identify root cause, and apply fixes. For building, authoring, deploying, endpoint/tag reference, or optimizing a healthy-but-slow subgraph (e.g. too many ethcalls), use /subgraph-builder instead. For migrating from The Graph, use /subgraph-migrate instead.

How do I install subgraph-doctor?

Run npx skills add https://github.com/goldsky-io/goldsky-agent --skill subgraph-doctor in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/subgraph-doctor/ (personal) or .claude/skills/subgraph-doctor/ (project).

Which AI agents can use subgraph-doctor?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is subgraph-doctor safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains subgraph-doctor?

It is published by goldsky-io in goldsky-io/goldsky-agent. It has 3,708 recorded installs.

More from goldsky-io/goldsky-agent

View all →

turbo-pipelines

goldsky-io/goldsky-agent

Turbo pipeline YAML reference and architecture guide. Covers: YAML field syntax (startat, from, version, primarykey), source/transform/sink configuration, validation errors, resource sizing (xs–xxl), architecture decisions (dataset vs kafka, streaming vs job, fan-out vs fan-in, sink selection, pipeline splitting). Triggers on: 'what does field X do', 'what fields does a postgres sink need', 'what resource size', 'should I use kafka or dataset', 'how to structure my pipeline'. For writing transforms, use /turbo-transforms. For end-to-end building, use /turbo-builder.

Data & Databases3.8K installs

turbo-transforms

goldsky-io/goldsky-agent

Write SQL, TypeScript, and dynamic table transforms for Turbo pipelines. Covers: decoding EVM logs with gslogdecode, filtering/casting blockchain data, UNION ALL for combining events, TypeScript/WASM transforms (invoke function), dynamic lookup tables (dynamictablecheck), transform chaining, and Solana decoding. Triggers on: 'decode Transfer events', 'write a SQL transform', 'filter by contract', 'TypeScript transform', 'dynamic table', 'UNION ALL'. For pipeline YAML structure, use /turbo-pipelines. For end-to-end building, use /turbo-builder.

turbo-doctor

goldsky-io/goldsky-agent

Diagnose and fix broken Goldsky Turbo pipelines interactively. Triggers on: pipeline in error state, stuck starting, connection refused, not getting data, duplicate rows, missing fields, slow backfill, or any named pipeline misbehaving. Runs logs/status commands, identifies root cause, and offers fixes. For CLI syntax or error pattern lookup without an active problem, use /turbo-operations instead.

3.8K installs

turbo-builder

goldsky-io/goldsky-agent

Build and deploy new Goldsky Turbo pipelines: requirements, dataset selection, YAML, validation, and deployment. Use for 'build a pipeline', 'index X on Y chain', or moving chain/contract data into Postgres, MySQL, ClickHouse, Kafka, Pub/Sub, S3, SQS, or webhooks. Also use for data goals such as Polymarket fills/positions/PnL, prediction markets, stablecoin or circulating supply, proof of reserves, sanctions/AML transfer monitoring, deposit detection, CCTP burns/mints, cross-chain settlement, payment reconciliation, wallet history streamed into the user's own database, token holder registries, tokenized equities/RWA, and wash-trading detection. A REST lookup of one wallet's balances or transfers is /feeds, not a pipeline, and so is a read of Polymarket activity, positions or balances. Debug existing pipelines with /turbo-doctor; look up syntax with /turbo-pipelines.

Data & Databases3.8K installs

datasets

goldsky-io/goldsky-agent

Use 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. Wallet Feeds API queries are /

Data & Databases3.8K installs

auth-setup

goldsky-io/goldsky-agent

Set 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.

Backend & APIs3.8K installs

Popular devops & cloud skills

View category →

microsoft-foundry

microsoft/azure-skills

Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, managed harness agent create, GitHub Copilot harness agent, create agent, update agent, add tool to agent, invoke agent, agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure

OfficialDevOps & Cloud579.1K installs

azure-diagnostics

microsoft/azure-skills

Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.

OfficialDevOps & Cloud569.8K installs

azure-prepare

microsoft/azure-skills

Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azd infrastructure, modernize app for Azure with azd, deploy with azd, function app, timer trigger, service bus trigger, event-driven function, managed identity, generate Bicep, generate Terraform, create and deploy to Azure.

OfficialDevOps & Cloud569K installs

azure-ai

microsoft/azure-skills

Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.

OfficialDevOps & Cloud568.8K installs

azure-deploy

microsoft/azure-skills

Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment", "push to production", "push to cloud", "go live", "ship it", "bicep deploy", "terraform apply", "publish to Azure", "launch on Azure". DO NOT USE WHEN: "create and deploy", "build and deploy", "create a new app", "set up infrastructure", "create and deploy to Azure using Terraform" — use azure-prepare for these.

OfficialDevOps & Cloud568.6K installs

azure-validate

microsoft/azure-skills

Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.

OfficialDevOps & Cloud568K installs