hsnsaboor/open-engineer/apollo-router
Claude Code and agent skill by hsnsaboor/open-engineer
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Version-aware guide for configuring and running Apollo Router for federated GraphQL supergraphs. Generates correct YAML for both Router v1.x and v2.x. Use this skill when: (1) setting up Apollo Router to run a supergraph, (2) configuring routing, headers, or CORS, (3) implementing custom plugins (Rhai scripts or coprocessors), (4) configuring telemetry (tracing, metrics, logging), (5) troubleshooting Router performance or connectivity issues.
Install
npx vskill@latest install hsnsaboor/open-engineer/apollo-routerSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as neversight/learn-skills.dev/apollo-router.
Apollo Router Config Generator
Apollo Router is a high-performance graph router written in Rust for running Apollo Federation 2 supergraphs. It sits in front of your subgraphs and handles query planning, execution, and response composition.
This skill generates version-correct configuration. Router v1 and v2 have incompatible config schemas in several critical sections (CORS, JWT auth, connectors). Always determine the target version before generating any config.
Step 1: Version Selection
Ask the user before generating any config:
If the user picks [3], display:
Store the selection as ROUTER_VERSION=v1|v2 to gate all subsequent template generation.
Step 2: Environment Selection
Ask: Production or Development?
- Production: security-hardened defaults (introspection off, sandbox off, homepage off, subgraph errors hidden, auth required, health check on)
- Development: open defaults (introspection on, sandbox on, errors exposed, text logging)
Load the appropriate base template from:
templates/{version}/production.yamltemplates/{version}/development.yaml
Step 3: Feature Selection
Ask which features to include:
- [ ] JWT Authentication
- [ ] CORS (almost always yes for browser clients)
- [ ] Operation Limits
- [ ] Traffic Shaping / Rate Limiting
- [ ] Telemetry (Prometheus, OTLP tracing, JSON logging)
- [ ] APQ (Automatic Persisted Queries)
- [ ] Connectors (REST API integration — Router v2 only; GA key is
connectors, early v2 preview key waspreview_connectors) - [ ] Subscriptions
- [ ] Header Propagation
Step 4: Gather Parameters
For each selected feature, collect required values.
- Use section templates from
templates/{version}/sections/forauth,cors,headers,limits,telemetry, andtraffic-shaping. - For Connectors in v2, use
templates/v2/sections/connectors.yamlas the source. - For APQ and subscriptions, copy the snippet from the selected base template (
templates/{version}/production.yamlortemplates/{version}/development.yaml) or from references. - Only offer Connectors when
ROUTER_VERSION=v2.
CORS
- List of allowed origins (never use
"*"for production)
JWT Authentication
- JWKS URL
- Issuer(s) — note: v1 uses singular
issuer, v2 uses pluralissuersarray
Connectors (v2 only)
- Subgraph name and source name (used as
connectors.sources.<subgraph>.<source>) - Optional
$configvalues for connector runtime configuration - If migrating old v2 preview config, rename
preview_connectorstoconnectors
Operation Limits
Present the tuning guidance:
The same principle applies to max_height, max_aliases, and max_root_fields.
Telemetry
- OTEL collector endpoint (default:
http://otel-collector:4317) - Prometheus listen port (default:
9090) - Trace sampling rate (default:
0.1= 10%)
Traffic Shaping
- Client-facing rate limit capacity (default: 1000 req/s)
- Router timeout (default: 60s)
- Subgraph timeout (default: 30s)
Step 5: Generate Config
- Load the correct version template from
templates/{version}/ - Assemble section templates for supported sectioned features, then merge base-template snippets for APQ/subscriptions as needed
- Inject user-provided parameters
- Add a comment block at the top stating the target version
Step 6: Validate
Run the post-generation checklist:
- [ ] All env vars referenced in config are documented
- [ ] CORS origins don't include wildcards (production)
- [ ] Rate limiting is on
router:(client-facing), not onlyall:(subgraph) - [ ] JWT uses
issuers(v2) notissuer(v1), or vice versa - [ ] If production: introspection=false, sandbox=false, subgraph_errors=false
- [ ] Health check is enabled
- [ ] Homepage is disabled (production)
- [ ] Run:
router config validate <file>if Router binary is available
Required Validation Gate (always run)
After generating or editing any router.yaml, you MUST:
- Run
validation/checklist.mdand report pass/fail for each checklist item. - Run
router config validate <path-to-router.yaml>if Router CLI is available. - If Router CLI is unavailable, state that explicitly and still complete the checklist.
- Do not present the configuration as final until validation is completed.
Step 7: Conditional Next Steps Handoff
After answering any Apollo Router request (config generation, edits, validation, or general Router guidance), decide whether the user already has runnable prerequisites:
- GraphOS-managed path:
APOLLO_KEY+APOLLO_GRAPH_REF, or - Local path: a composed
supergraph.graphqlplus reachable subgraphs
If prerequisites are already present, do not add extra handoff text.
If prerequisites are missing or unknown, end with a concise Next steps handoff (1-3 lines max) that is skill-first and command-free:
- Suggest the
roverskill to compose or fetch the supergraph schema. - Suggest continuing with
apollo-routeronce the supergraph is ready to validate and run with the generated config. - If subgraphs are missing, suggest
apollo-server,graphql-schema, andgraphql-operationsskills to scaffold and test.
Do not include raw shell commands in this handoff unless the user explicitly asks for commands.
Quick Start (skill-first)
- Use this
apollo-routerskill to generate or refinerouter.yamlfor your environment. - Choose a runtime path:
- GraphOS-managed path: provide
APOLLO_KEYandAPOLLO_GRAPH_REF(no local supergraph composition required). - Local supergraph path: use
graphql-schema+apollo-serverto define/run subgraphs, then usegraphql-operationsfor smoke tests, then use theroverskill to compose or fetchsupergraph.graphql.
- Use this
apollo-routerskill to validate readiness (validation/checklist.md) and walk through runtime startup inputs.
Default endpoint remains http://localhost:4000 when using standard Router listen defaults.
If the user asks for executable shell commands, provide them on request. Otherwise keep Quick Start guidance skill-oriented.
Running Modes
| Mode | Command | Use Case | |
|---|---|---|---|
| Local schema | router --supergraph ./schema.graphql | Development, CI/CD | |
| GraphOS managed | APOLLO_KEY=... APOLLO_GRAPH_REF=my-graph@prod router | Production with auto-updates | |
| Development | router --dev --supergraph ./schema.graphql | Local development | |
| Hot reload | router --hot-reload --supergraph ./schema.graphql | Schema changes without restart |
Environment Variables
| Variable | Description | |
|---|---|---|
APOLLO_KEY | API key for GraphOS | |
APOLLO_GRAPH_REF | Graph reference (graph-id@variant) | |
APOLLO_ROUTER_CONFIG_PATH | Path to router.yaml | |
APOLLO_ROUTER_SUPERGRAPH_PATH | Path to supergraph schema | |
APOLLO_ROUTER_LOG | Log level (off, error, warn, info, debug, trace) | |
APOLLO_ROUTER_LISTEN_ADDRESS | Override listen address |
Reference Files
- Configuration — YAML configuration reference
- Headers — Header propagation and manipulation
- Plugins — Rhai scripts and coprocessors
- Telemetry — Tracing, metrics, and logging
- Connectors — Router v2 connectors configuration
- Troubleshooting — Common issues and solutions
- Divergence Map — v1 ↔ v2 config differences
- Validation Checklist — Post-generation checks
CLI Reference
Ground Rules
- ALWAYS determine the target Router version (v1 or v2) before generating config
- DEFAULT to v2 for new projects
- ALWAYS include a comment block at top of generated config stating the target version
- ALWAYS use
--devmode for local development (enables introspection and sandbox) - ALWAYS disable introspection, sandbox, and homepage in production
- PREFER GraphOS managed mode for production (automatic updates, metrics)
- USE
--hot-reloadfor local development with file-based schemas - NEVER expose
APOLLO_KEYin logs or version control - USE environment variables (
${env.VAR}) for all secrets and sensitive config - PREFER YAML configuration over command-line arguments for complex setups
- TEST configuration changes locally before deploying to production
- WARN if user enables
allow_any_originor wildcard CORS in production - RECOMMEND
router config upgrade router.yamlfor v1 → v2 migration instead of regenerating from scratch - MUST run
validation/checklist.mdafter every router config generation or edit - MUST run
router config validate <file>when Router CLI is available - MUST report when CLI validation could not run (for example, Router binary missing)
- MUST append a brief conditional handoff when runtime prerequisites are missing or unknown
- MUST make this handoff skill-first and avoid raw shell commands unless the user explicitly requests commands
- MUST keep Quick Start guidance skill-first and command-free unless the user explicitly requests commands
- MUST state that Rover is required only for the local supergraph path; GraphOS-managed runtime does not require local Rover composition
- USE
max_depth: 50as the default starting point, not 15 (too aggressive) or 100 (too permissive) - RECOMMEND
warn_only: truefor initial limits rollout to observe real traffic before enforcing
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/skills/bundled/apollo-router/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/hsnsaboor/open-engineer/apollo-router)