skills/mirror-doctor/SKILL.md
Diagnose and fix broken Goldsky Mirror pipelines. Use this skill whenever a user has a Mirror pipeline that is failing, stuck, terminated, won't start, is in a restart loop, or is blocked by an in-flight request. Also use when the user mentions a specific Mirror pipeline name alongside a problem — even if they don't say 'mirror' explicitly, if they're using `goldsky pipeline` commands (not `goldsky turbo`), this is the right skill. Runs CLI commands directly to check status, read errors, identify root cause, and apply fixes. For YAML syntax or config reference, use /mirror instead. For turbo pipeline problems, use /turbo-doctor instead.
npx skillsauth add goldsky-io/goldsky-agent mirror-doctorInstall 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.
Diagnose and fix existing Mirror pipeline problems by running CLI commands, identifying root causes, and executing fixes.
/mirror for config reference or /turbo-builder for new Turbo pipelines./mirror for CLI syntax and flag lookups./turbo-doctor for goldsky turbo problems./secrets for credential management. But DO check whether secrets exist as part of diagnosis.Follow these steps in order. Each step 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 pipeline list --include-runtime-details 2>&1 to list all Mirror pipelines with their status.
If the user already named a pipeline, confirm it exists in the list. If not, show the list and ask which pipeline they want to diagnose.
Note both the desired status (ACTIVE, INACTIVE, PAUSED) and the runtime status (STARTING, RUNNING, FAILING, TERMINATED) — Mirror pipelines have both, and the combination tells the story.
The desired + runtime status combination determines the diagnostic path:
| Desired | Runtime | Meaning | Action |
|---------|---------|---------|--------|
| ACTIVE | RUNNING | Healthy — pipeline is processing data | Ask user what symptom they're seeing. Proceed to Step 4. |
| ACTIVE | STARTING | Pipeline is initializing | Ask how long. If >10 min, proceed to Step 4. |
| ACTIVE | FAILING | Pipeline is encountering errors but hasn't terminated yet | Proceed to Step 4 immediately — this is time-sensitive. |
| ACTIVE | TERMINATED | Most common failure. Pipeline wanted to run but crashed. | Proceed to Step 4. |
| PAUSED | TERMINATED | User paused the pipeline (snapshot was taken). | Ask if they want to resume: goldsky pipeline start <name> --from-snapshot last |
| INACTIVE | TERMINATED | User stopped the pipeline (no snapshot). | Ask if they want to start: goldsky pipeline start <name> |
ACTIVE + TERMINATED is the most common case. The pipeline's desired status is ACTIVE (it should be running) but the runtime has terminated due to an error. Focus the diagnosis here.
Run these commands to understand what went wrong:
# Get error details and runtime metrics
goldsky pipeline monitor <name> 2>&1
# Check for in-flight requests blocking operations
goldsky pipeline monitor <name> --update-request 2>&1
# Get the pipeline definition to check for misconfig
goldsky pipeline get <name> --definition 2>&1
# Get pipeline info including version
goldsky pipeline info <name> 2>&1
# Check available snapshots
goldsky pipeline snapshots list <name> 2>&1
Run these in sequence and analyze the output before proceeding. The monitor output is the most important — it shows error messages, records received/written metrics, and runtime status transitions.
Based on the diagnostic data, match against these known patterns:
Symptoms: Pipeline terminates shortly after starting. Monitor shows credential or authentication errors.
Verify: Run goldsky secret list 2>&1 and cross-reference with the secret_name values in the pipeline definition from Step 4.
Fix:
/secrets to create it.goldsky pipeline restart <name> --from-snapshot lastSymptoms: Connection timeout, connection refused, or network errors in the monitor output. Pipeline may cycle between FAILING and TERMINATED.
Common causes:
Fix:
goldsky pipeline restart <name> --from-snapshot lastSymptoms: Pipeline runs for a while then terminates. Monitor may show high record counts or slow processing. Common during large backfills or pipelines with many sources/JOINs.
Fix:
goldsky pipeline resize <name> <size> — sizes are s, m, l, xl, xxl.s handles most workloads (up to 300K records/sec, ~8 subgraph sources). Use l or larger for big chain backfills or heavy JOINs.Symptoms: User tries to update, delete, or restart the pipeline but gets "Cannot process request, found existing request in-flight."
Diagnose: goldsky pipeline monitor <name> --update-request — this shows what operation is in progress (usually a snapshot).
Fix:
goldsky pipeline cancel-update <name>Symptoms: Pipeline can't be paused, updated, or restarted because a snapshot creation is taking too long or failing. The --update-request monitor shows snapshot progress stuck at a percentage.
Fix:
goldsky pipeline cancel-update <name>goldsky pipeline restart <name> --from-snapshot lastgoldsky pipeline restart <name> --from-snapshot none (starts from scratch — warn the user this reprocesses data)Symptoms: Pipeline terminates with SQL-related error messages. Could be syntax errors, referencing a non-existent column, or type mismatches.
Diagnose: Check the pipeline definition (goldsky pipeline get <name> --definition) and look at the transforms section.
Fix:
goldsky pipeline validate <file.yaml>goldsky pipeline apply <file.yaml> --status ACTIVE --from-snapshot lastUse /mirror for SQL transform syntax reference if needed.
Symptoms: Pipeline repeatedly cycles through STARTING → FAILING → TERMINATED. Monitor shows the same error recurring.
This is usually a symptom of another root cause — bad secret, sink unreachable, or resource issues. The pipeline keeps trying to start but hits the same wall.
Fix:
goldsky pipeline restart <name> --from-snapshot lastSymptoms: Pipeline was running fine, then the sink (database) went down temporarily. Pipeline auto-retried, then restarted its writers, then eventually terminated.
This is expected behavior — Mirror handles transient sink errors automatically (retry batch → restart writers → fail after prolonged issues).
Fix:
goldsky pipeline restart <name> --from-snapshot lastAfter identifying the issue, present findings clearly:
## Diagnosis
**Pipeline:** <name>
**Status:** <desired> + <runtime>
**Issue:** <one-line summary>
**Root cause:**
<What's wrong and why>
**Evidence:**
- <Error message or observation from monitor>
- <Relevant detail from pipeline definition>
**Recommended fix:**
1. <Step 1>
2. <Step 2>
**Prevention:**
<How to avoid this in the future, if applicable>
Offer to run the fix commands directly. Always confirm with the user before executing:
goldsky pipeline restart <name> --from-snapshot lastgoldsky pipeline resize <name> <size>goldsky pipeline cancel-update <name>goldsky pipeline restart <name> --from-snapshot none (warn: reprocesses data)goldsky pipeline apply <file.yaml> --status ACTIVE --from-snapshot lastgoldsky pipeline delete <name> -f then goldsky pipeline apply <file.yaml> --status ACTIVE (last resort)After executing, verify recovery by running goldsky pipeline monitor <name> and watching for STARTING → RUNNING transition.
--from-snapshot last preserves progress. --from-snapshot none starts over. Default to last unless there's a reason not to.If you don't have the Bash tool, output the diagnostic commands for the user to run, but structure them clearly:
This is the fallback path — always prefer running commands directly when Bash is available.
/mirror — Pipeline YAML configuration, CLI flag reference, sink setup/secrets — Create and manage sink credentials/auth-setup — CLI installation and authentication/turbo-doctor — Diagnose Turbo pipeline problems (not Mirror)development
Turbo pipeline YAML reference and architecture guide. Covers: YAML field syntax (start_at, from, version, primary_key), 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.
tools
Build and deploy new Goldsky Turbo pipelines from scratch. Triggers on: 'build a pipeline', 'index X on Y chain', 'set up a pipeline', 'track transfers to postgres', or any request describing data to move from a chain/contract to a destination (postgres, mysql, clickhouse, kafka, pubsub, s3, sqs, webhook). Covers the full workflow: requirements → dataset selection → YAML generation → validation → deploy. Not for debugging (use /turbo-doctor) or syntax lookups (use /turbo-pipelines).
development
Write SQL, TypeScript, and dynamic table transforms for Turbo pipelines. Covers: decoding EVM logs with _gs_log_decode, filtering/casting blockchain data, UNION ALL for combining events, TypeScript/WASM transforms (invoke function), dynamic lookup tables (dynamic_table_check), 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.
tools
Use this skill when a user wants to store, manage, or work with Goldsky secrets — the named credential objects used by pipeline sinks. This includes: creating a new secret from a connection string or credentials, listing or inspecting existing secrets, updating or rotating credentials after a password change, and deleting secrets that are no longer needed. Trigger for any query where the user mentions 'goldsky secret', wants to securely store database credentials for a pipeline, or is working with sink authentication for PostgreSQL, Neon, Supabase, ClickHouse, Kafka, S3, Google Cloud Pub/Sub, Elasticsearch, DynamoDB, SQS, OpenSearch, or webhooks.