[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75FF0DYNDEK15316QYRZWYY":3,"skill-same:01M75FF0DYNDEK15316QYRZWYY":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":36,"ownerDescription":6,"updatedAt":37,"install":38,"resources":51},"01M75FF0DYNDEK15316QYRZWYY","apollo-router-plugin-creator",null,"Guide for writing Apollo Router native Rust plugins. Use this skill when: (1) users want to create a new router plugin, (2) users want to add service hooks (router_service, supergraph_service, execution_service, subgraph_service), (3) users want to modify an existing router plugin, (4) users need to understand router plugin patterns or the request lifecycle. (5) triggers on requests like \"create a new plugin\", \"add a router plugin\", \"modify the X plugin\", or \"add subgraph_service hook\".","stanfish06\u002Fskillquarium","stanfish06","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F93099613?v=4","01M75F1CK4ZW109ZK3T26VN52F","Zhiyuan","01M75F1CM53VH6F79DZ8GXKKES",12,"MIT","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fapollo-router-plugin-creator\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: apollo-router-plugin-creator\ndescription: >\n  Guide for writing Apollo Router native Rust plugins. Use this skill when:\n  (1) users want to create a new router plugin,\n  (2) users want to add service hooks (router_service, supergraph_service, execution_service, subgraph_service),\n  (3) users want to modify an existing router plugin,\n  (4) users need to understand router plugin patterns or the request lifecycle.\n  (5) triggers on requests like \"create a new plugin\", \"add a router plugin\", \"modify the X plugin\", or \"add subgraph_service hook\".\nlicense: MIT\nallowed-tools: Read Write Edit Glob Grep\nmetadata:\n  author: apollographql\n  version: \"1.0.0\"\n  compatibility: \"Requires Apollo Router with native plugin support\"\n---\n\n# Apollo Router Plugin Creator\n\nCreate native Rust plugins for Apollo Router.\n\n## Request Lifecycle\n\n```\n┌────────┐             ┌────────────────┐                                   ┌────────────────────┐               ┌───────────────────┐       ┌─────────────────────┐\n│ Client │             │ Router Service │                                   │ Supergraph Service │               │ Execution Service │       │ Subgraph Service(s) │\n└────┬───┘             └────────┬───────┘                                   └──────────┬─────────┘               └─────────┬─────────┘       └──────────┬──────────┘\n     │                          │                                                      │                                   │                            │\n     │      Sends request       │                                                      │                                   │                            │\n     │──────────────────────────▶                                                      │                                   │                            │\n     │                          │                                                      │                                   │                            │\n     │                          │  Converts raw HTTP request to GraphQL\u002FJSON request   │                                   │                            │\n     │                          │──────────────────────────────────────────────────────▶                                   │                            │\n     │                          │                                                      │                                   │                            │\n     │                          │                                                      │  Initiates query plan execution   │                            │\n     │                          │                                                      │───────────────────────────────────▶                            │\n     │                          │                                                      │                                   │                            │\n     │                          │                                                      │                               ┌par [Initiates sub-operation]───────┐\n     │                          │                                                      │                               │   │                            │   │\n     │                          │                                                      │                               │   │  Initiates sub-operation   │   │\n     │                          │                                                      │                               │   │────────────────────────────▶   │\n     │                          │                                                      │                               │   │                            │   │\n     │                          │                                                      │                               ├[Initiates sub-operation]╌╌╌╌╌╌╌╌╌╌╌┤\n     │                          │                                                      │                               │   │                            │   │\n     │                          │                                                      │                               │   │  Initiates sub-operation   │   │\n     │                          │                                                      │                               │   │────────────────────────────▶   │\n     │                          │                                                      │                               │   │                            │   │\n     │                          │                                                      │                               ├[Initiates sub-operation]╌╌╌╌╌╌╌╌╌╌╌┤\n     │                          │                                                      │                               │   │                            │   │\n     │                          │                                                      │                               │   │  Initiates sub-operation   │   │\n     │                          │                                                      │                               │   │────────────────────────────▶   │\n     │                          │                                                      │                               │   │                            │   │\n     │                          │                                                      │                               └────────────────────────────────────┘\n     │                          │                                                      │                                   │                            │\n     │                          │                                                      │  Assembles and returns response   │                            │\n     │                          │                                                      ◀╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌│                            │\n     │                          │                                                      │                                   │                            │\n     │                          │            Returns GraphQL\u002FJSON response             │                                   │                            │\n     │                          ◀╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌│                                   │                            │\n     │                          │                                                      │                                   │                            │\n     │  Returns HTTP response   │                                                      │                                   │                            │\n     ◀╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌│                                                      │                                   │                            │\n     │                          │                                                      │                                   │                            │\n┌────┴───┐             ┌────────┴───────┐                                   ┌──────────┴─────────┐               ┌─────────┴─────────┐       ┌──────────┴──────────┐\n│ Client │             │ Router Service │                                   │ Supergraph Service │               │ Execution Service │       │ Subgraph Service(s) │\n└────────┘             └────────────────┘                                   └────────────────────┘               └───────────────────┘       └─────────────────────┘\n```\n\n## Service Hooks\n\n### Service Overview\n\n| Service              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                           |\n|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `router_service`     | Runs at the very beginning and very end of the HTTP request lifecycle.For example, JWT authentication is performed within the RouterService.Define router_service if your customization needs to interact with HTTP context and headers. It doesn't support access to the body property                                                                                                                                                               |\n| `supergraph_service` | Runs at the very beginning and very end of the GraphQL request lifecycle.Define supergraph_service if your customization needs to interact with the GraphQL request or the GraphQL response. For example, you can add a check for anonymous queries.                                                                                                                                                                                                  |\n| `execution_service`  | Handles initiating the execution of a query plan after it's been generated.Define execution_service if your customization includes logic to govern execution (for example, if you want to block a particular query based on a policy decision).                                                                                                                                                                                                       |\n| `subgraph_service`   | Handles communication between the router and your subgraphs.Define subgraph_service to configure this communication (for example, to dynamically add HTTP headers to pass to a subgraph).Whereas other services are called once per client request, this service is called once per subgraph request that's required to resolve the client's request. Each call is passed a subgraph parameter that indicates the name of the corresponding subgraph. |\n\n**Signatures:**\n```rust\nfn router_service(&self, service: router::BoxService) -> router::BoxService\nfn supergraph_service(&self, service: supergraph::BoxService) -> supergraph::BoxService\nfn execution_service(&self, service: execution::BoxService) -> execution::BoxService\nfn subgraph_service(&self, name: &str, service: subgraph::BoxService) -> subgraph::BoxService\n```\n\n### Individual Hooks (Tower Layers)\n\nUse `ServiceBuilder` to compose these hooks within any service:\n\n| Hook                      | Purpose                                      | Sync\u002FAsync |\n|---------------------------|----------------------------------------------|------------|\n| `map_request(fn)`         | Transform request before proceeding          | Sync       |\n| `map_response(fn)`        | Transform response before returning          | Sync       |\n| `checkpoint(fn)`          | Validate\u002Ffilter, can short-circuit           | Sync       |\n| `checkpoint_async(fn)`    | Async validation, can short-circuit          | Async      |\n| `buffered()`              | Enable service cloning (needed for async)    | -          |\n| `instrument(span)`        | Add tracing span around service              | -          |\n| `rate_limit(num, period)` | Control request throughput                   | -          |\n| `timeout(duration)`       | Set operation time limit                     | -          |\n\n### Choosing a Service Hook\n\n**By data needed:**\n- HTTP headers only → `router_service`\n- GraphQL query\u002Fvariables → `supergraph_service`\n- Query plan → `execution_service`\n- Per-subgraph control → `subgraph_service`\n\n**By timing:**\n- Before GraphQL parsing → `router_service` request\n- After parsing, before planning → `supergraph_service` request\n- After planning, before execution → `execution_service` request\n- Before\u002Fafter each subgraph call → `subgraph_service`\n- Final response to client → `router_service` response\n\nSee [references\u002Fservice-hooks.md](references\u002Fservice-hooks.md) for implementation patterns.\n\n## Quick Start\n\n### Step 1: Create Plugin File\n\nCreate a new file `src\u002Fplugins\u002Fmy_plugin.rs` with required imports:\n\n```rust\nuse std::ops::ControlFlow;\nuse apollo_router::plugin::{Plugin, PluginInit};\nuse apollo_router::register_plugin;\nuse apollo_router::services::{router, subgraph, supergraph};\nuse schemars::JsonSchema;\nuse serde::Deserialize;\nuse tower::{BoxError, ServiceBuilder, ServiceExt};\n\nconst PLUGIN_NAME: &str = \"my_plugin\";\n```\n\n### Step 2: Define Configuration Struct\n\nEvery plugin needs a configuration struct with `Deserialize` and `JsonSchema` derives. The `JsonSchema` enables configuration validation in editors:\n\n```rust\n#[derive(Debug, Clone, Default, Deserialize, JsonSchema)]\nstruct MyPluginConfig {\n  \u002F\u002F\u002F Enable the plugin\n  enabled: bool,\n  \u002F\u002F Add other configuration fields as needed\n}\n```\n\n### Step 3: Define Plugin Struct\n\n```rust\n#[derive(Debug)]\nstruct MyPlugin {\n  configuration: MyPluginConfig,\n}\n```\n\n### Step 4: Implement Plugin Trait\n\nImplement the `Plugin` trait with the required `Config` type and `new` constructor:\n\n```rust\n#[async_trait::async_trait]\nimpl Plugin for MyPlugin {\n  type Config = MyPluginConfig;\n\n  async fn new(init: PluginInit\u003CSelf::Config>) -> Result\u003CSelf, BoxError> {\n    Ok(MyPlugin { configuration: init.config })\n  }\n\n  \u002F\u002F Add service hooks based on your needs (see \"Choosing a Service Hook\" section)\n}\n```\n\n### Step 5: Add Service Hooks\n\nChoose which service(s) to hook based on your requirements, see [Service Overview](#service-overview) for details.\n\nExample service hook:\n```rust\nfn supergraph_service(&self, service: supergraph::BoxService) -> supergraph::BoxService {\n  if !self.configuration.enabled {\n    return service;\n  }\n\n  ServiceBuilder::new()\n    .map_request(|req| { \u002F* transform request *\u002F req })\n    .map_response(|res| { \u002F* transform response *\u002F res })\n    .service(service)\n    .boxed()\n}\n```\n\n### Step 6: Register Plugin\n\nAt the bottom of your plugin file, register it with the router:\n\n```rust\nregister_plugin!(\"acme\", \"my_plugin\", MyPlugin);\n```\n\n### Step 7: Add Module to mod.rs\n\nIn `src\u002Fplugins\u002Fmod.rs`, add your module:\n\n```rust\npub mod my_plugin;\n```\n\n### Step 8: Configure in YAML\n\nEnable your plugin in the router configuration:\n\n```yaml\nplugins:\n  acme.my_plugin:\n    enabled: true\n```\n\n## Common Patterns\n\nFor implementation patterns and code examples, see [references\u002Fservice-hooks.md](references\u002Fservice-hooks.md):\n- Enable\u002Fdisable pattern\n- Request\u002Fresponse transformation (`map_request`, `map_response`)\n- Checkpoint (early return\u002Fshort-circuit)\n- Context passing between hooks\n- Async operations (`checkpoint_async`, `buffered`)\n- Error response builders\n\n## Examples\n\n### Apollo Router Examples\n\nLocated in the [Apollo Router plugins directory](https:\u002F\u002Fgithub.com\u002Fapollographql\u002Frouter\u002Ftree\u002Fdev\u002Fapollo-router\u002Fsrc\u002Fplugins):\n\n| Plugin                 | Service Hook           | Pattern           | Description                 |\n|------------------------|------------------------|-------------------|-----------------------------|\n| `forbid_mutations.rs`  | `execution_service`    | checkpoint        | Simple gate on query plan   |\n| `expose_query_plan.rs` | execution + supergraph | Context passing   | Multi-service coordination  |\n| `cors.rs`              | `router_service`       | HTTP layer        | CORS handling at HTTP level |\n| `headers\u002F`             | `subgraph_service`     | Layer composition | Complex header manipulation |\n\nFor full code examples and testing patterns, see [references\u002Fexamples.md](references\u002Fexamples.md).\n\n## Prerequisites\n\nIt is advised to have the [rust-best-practices](https:\u002F\u002Fskills.sh\u002Fapollographql\u002Fskills\u002Frust-best-practices) skill installed for writing idiomatic Rust code when developing router plugins. If installed, follow those best practices when generating or modifying plugin code.\n\n## Resources\n\n- [references\u002Fservice-hooks.md](references\u002Fservice-hooks.md) - Detailed service hook implementations\n- [references\u002Fexisting-plugins.md](references\u002Fexisting-plugins.md) - Index of existing plugins\n- [references\u002Fexamples.md](references\u002Fexamples.md) - Full code examples and testing patterns\n- Apollo Router plugins: https:\u002F\u002Fgithub.com\u002Fapollographql\u002Frouter\u002Ftree\u002Fdev\u002Fapollo-router\u002Fsrc\u002Fplugins","# Apollo Router Plugin Creator\n\nCreate native Rust plugins for Apollo Router.\n\n## Request Lifecycle\n\n```\n┌────────┐             ┌────────────────┐                                   ┌────────────────────┐               ┌───────────────────┐       ┌─────────────────────┐\n│ Client │             │ Router Service │                                   │ Supergraph Service │               │ Execution Service │       │ Subgraph Service(s) │\n└────┬───┘             └────────┬───────┘                                   └──────────┬─────────┘               └─────────┬─────────┘       └──────────┬──────────┘\n     │                          │                                                      │                                   │                            │\n     │      Sends request       │                                                      │                                   │                            │\n     │──────────────────────────▶                                                      │                                   │                            │\n     │                          │                                                      │                                   │                            │\n     │                          │  Converts raw HTTP request to GraphQL\u002FJSON request   │                                   │                            │\n     │                          │──────────────────────────────────────────────────────▶                                   │                            │\n     │                          │                                                      │                                   │                            │\n     │                          │                                                      │  Initiates query plan execution   │                            │\n     │                          │                                                      │───────────────────────────────────▶                            │\n     │                          │                                                      │                                   │                            │\n     │                          │                                                      │                               ┌par [Initiates sub-operation]───────┐\n     │                          │                                                      │                               │   │                            │   │\n     │                          │                                                      │                               │   │  Initiates sub-operation   │   │\n     │                          │                                                      │                               │   │────────────────────────────▶   │\n     │                          │                                                      │                               │   │                            │   │\n     │                          │                                                      │                               ├[Initiates sub-operation]╌╌╌╌╌╌╌╌╌╌╌┤\n     │                          │                                                      │                               │   │                            │   │\n     │                          │                                                      │                               │   │  Initiates sub-operation   │   │\n     │                          │                                                      │                               │   │────────────────────────────▶   │\n     │                          │                                                      │                               │   │                            │   │\n     │                          │                                                      │                               ├[Initiates sub-operation]╌╌╌╌╌╌╌╌╌╌╌┤\n     │                          │                                                      │                               │   │                            │   │\n     │                          │                                                      │                               │   │  Initiates sub-operation   │   │\n     │                          │                                                      │                               │   │────────────────────────────▶   │\n     │                          │                                                      │                               │   │                            │   │\n     │                          │                                                      │                               └────────────────────────────────────┘\n     │                          │                                                      │                                   │                            │\n     │                          │                                                      │  Assembles and returns response   │                            │\n     │                          │                                                      ◀╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌│                            │\n     │                          │                                                      │                                   │                            │\n     │                          │            Returns GraphQL\u002FJSON response             │                                   │                            │\n     │                          ◀╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌│                                   │                            │\n     │                          │                                                      │                                   │                            │\n     │  Returns HTTP response   │                                                      │                                   │                            │\n     ◀╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌│                                                      │                                   │                            │\n     │                          │                                                      │                                   │                            │\n┌────┴───┐             ┌────────┴───────┐                                   ┌──────────┴─────────┐               ┌─────────┴─────────┐       ┌──────────┴──────────┐\n│ Client │             │ Router Service │                                   │ Supergraph Service │               │ Execution Service │       │ Subgraph Service(s) │\n└────────┘             └────────────────┘                                   └────────────────────┘               └───────────────────┘       └─────────────────────┘\n```\n\n## Service Hooks\n\n### Service Overview\n\n| Service              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                           |\n|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `router_service`     | Runs at the very beginning and very end of the HTTP request lifecycle.For example, JWT authentication is performed within the RouterService.Define router_service if your customization needs to interact with HTTP context and headers. It doesn't support access to the body property                                                                                                                                                               |\n| `supergraph_service` | Runs at the very beginning and very end of the GraphQL request lifecycle.Define supergraph_service if your customization needs to interact with the GraphQL request or the GraphQL response. For example, you can add a check for anonymous queries.                                                                                                                                                                                                  |\n| `execution_service`  | Handles initiating the execution of a query plan after it's been generated.Define execution_service if your customization includes logic to govern execution (for example, if you want to block a particular query based on a policy decision).                                                                                                                                                                                                       |\n| `subgraph_service`   | Handles communication between the router and your subgraphs.Define subgraph_service to configure this communication (for example, to dynamically add HTTP headers to pass to a subgraph).Whereas other services are called once per client request, this service is called once per subgraph request that's required to resolve the client's request. Each call is passed a subgraph parameter that indicates the name of the corresponding subgraph. |\n\n**Signatures:**\n```rust\nfn router_service(&self, service: router::BoxService) -> router::BoxService\nfn supergraph_service(&self, service: supergraph::BoxService) -> supergraph::BoxService\nfn execution_service(&self, service: execution::BoxService) -> execution::BoxService\nfn subgraph_service(&self, name: &str, service: subgraph::BoxService) -> subgraph::BoxService\n```\n\n### Individual Hooks (Tower Layers)\n\nUse `ServiceBuilder` to compose these hooks within any service:\n\n| Hook                      | Purpose                                      | Sync\u002FAsync |\n|---------------------------|----------------------------------------------|------------|\n| `map_request(fn)`         | Transform request before proceeding          | Sync       |\n| `map_response(fn)`        | Transform response before returning          | Sync       |\n| `checkpoint(fn)`          | Validate\u002Ffilter, can short-circuit           | Sync       |\n| `checkpoint_async(fn)`    | Async validation, can short-circuit          | Async      |\n| `buffered()`              | Enable service cloning (needed for async)    | -          |\n| `instrument(span)`        | Add tracing span around service              | -          |\n| `rate_limit(num, period)` | Control request throughput                   | -          |\n| `timeout(duration)`       | Set operation time limit                     | -          |\n\n### Choosing a Service Hook\n\n**By data needed:**\n- HTTP headers only → `router_service`\n- GraphQL query\u002Fvariables → `supergraph_service`\n- Query plan → `execution_service`\n- Per-subgraph control → `subgraph_service`\n\n**By timing:**\n- Before GraphQL parsing → `router_service` request\n- After parsing, before planning → `supergraph_service` request\n- After planning, before execution → `execution_service` request\n- Before\u002Fafter each subgraph call → `subgraph_service`\n- Final response to client → `router_service` response\n\nSee [references\u002Fservice-hooks.md](references\u002Fservice-hooks.md) for implementation patterns.\n\n## Quick Start\n\n### Step 1: Create Plugin File\n\nCreate a new file `src\u002Fplugins\u002Fmy_plugin.rs` with required imports:\n\n```rust\nuse std::ops::ControlFlow;\nuse apollo_router::plugin::{Plugin, PluginInit};\nuse apollo_router::register_plugin;\nuse apollo_router::services::{router, subgraph, supergraph};\nuse schemars::JsonSchema;\nuse serde::Deserialize;\nuse tower::{BoxError, ServiceBuilder, ServiceExt};\n\nconst PLUGIN_NAME: &str = \"my_plugin\";\n```\n\n### Step 2: Define Configuration Struct\n\nEvery plugin needs a configuration struct with `Deserialize` and `JsonSchema` derives. The `JsonSchema` enables configuration validation in editors:\n\n```rust\n#[derive(Debug, Clone, Default, Deserialize, JsonSchema)]\nstruct MyPluginConfig {\n  \u002F\u002F\u002F Enable the plugin\n  enabled: bool,\n  \u002F\u002F Add other configuration fields as needed\n}\n```\n\n### Step 3: Define Plugin Struct\n\n```rust\n#[derive(Debug)]\nstruct MyPlugin {\n  configuration: MyPluginConfig,\n}\n```\n\n### Step 4: Implement Plugin Trait\n\nImplement the `Plugin` trait with the required `Config` type and `new` constructor:\n\n```rust\n#[async_trait::async_trait]\nimpl Plugin for MyPlugin {\n  type Config = MyPluginConfig;\n\n  async fn new(init: PluginInit\u003CSelf::Config>) -> Result\u003CSelf, BoxError> {\n    Ok(MyPlugin { configuration: init.config })\n  }\n\n  \u002F\u002F Add service hooks based on your needs (see \"Choosing a Service Hook\" section)\n}\n```\n\n### Step 5: Add Service Hooks\n\nChoose which service(s) to hook based on your requirements, see [Service Overview](#service-overview) for details.\n\nExample service hook:\n```rust\nfn supergraph_service(&self, service: supergraph::BoxService) -> supergraph::BoxService {\n  if !self.configuration.enabled {\n    return service;\n  }\n\n  ServiceBuilder::new()\n    .map_request(|req| { \u002F* transform request *\u002F req })\n    .map_response(|res| { \u002F* transform response *\u002F res })\n    .service(service)\n    .boxed()\n}\n```\n\n### Step 6: Register Plugin\n\nAt the bottom of your plugin file, register it with the router:\n\n```rust\nregister_plugin!(\"acme\", \"my_plugin\", MyPlugin);\n```\n\n### Step 7: Add Module to mod.rs\n\nIn `src\u002Fplugins\u002Fmod.rs`, add your module:\n\n```rust\npub mod my_plugin;\n```\n\n### Step 8: Configure in YAML\n\nEnable your plugin in the router configuration:\n\n```yaml\nplugins:\n  acme.my_plugin:\n    enabled: true\n```\n\n## Common Patterns\n\nFor implementation patterns and code examples, see [references\u002Fservice-hooks.md](references\u002Fservice-hooks.md):\n- Enable\u002Fdisable pattern\n- Request\u002Fresponse transformation (`map_request`, `map_response`)\n- Checkpoint (early return\u002Fshort-circuit)\n- Context passing between hooks\n- Async operations (`checkpoint_async`, `buffered`)\n- Error response builders\n\n## Examples\n\n### Apollo Router Examples\n\nLocated in the [Apollo Router plugins directory](https:\u002F\u002Fgithub.com\u002Fapollographql\u002Frouter\u002Ftree\u002Fdev\u002Fapollo-router\u002Fsrc\u002Fplugins):\n\n| Plugin                 | Service Hook           | Pattern           | Description                 |\n|------------------------|------------------------|-------------------|-----------------------------|\n| `forbid_mutations.rs`  | `execution_service`    | checkpoint        | Simple gate on query plan   |\n| `expose_query_plan.rs` | execution + supergraph | Context passing   | Multi-service coordination  |\n| `cors.rs`              | `router_service`       | HTTP layer        | CORS handling at HTTP level |\n| `headers\u002F`             | `subgraph_service`     | Layer composition | Complex header manipulation |\n\nFor full code examples and testing patterns, see [references\u002Fexamples.md](references\u002Fexamples.md).\n\n## Prerequisites\n\nIt is advised to have the [rust-best-practices](https:\u002F\u002Fskills.sh\u002Fapollographql\u002Fskills\u002Frust-best-practices) skill installed for writing idiomatic Rust code when developing router plugins. If installed, follow those best practices when generating or modifying plugin code.\n\n## Resources\n\n- [references\u002Fservice-hooks.md](references\u002Fservice-hooks.md) - Detailed service hook implementations\n- [references\u002Fexisting-plugins.md](references\u002Fexisting-plugins.md) - Index of existing plugins\n- [references\u002Fexamples.md](references\u002Fexamples.md) - Full code examples and testing patterns\n- Apollo Router plugins: https:\u002F\u002Fgithub.com\u002Fapollographql\u002Frouter\u002Ftree\u002Fdev\u002Fapollo-router\u002Fsrc\u002Fplugins",{"name":5,"license":15,"metadata":24,"description":28,"allowed-tools":29},{"author":25,"version":26,"compatibility":27},"apollographql","1.0.0","Requires Apollo Router with native plugin support","Guide for writing Apollo Router native Rust plugins. Use this skill when: (1) users want to create a new router plugin, (2) users want to add service hooks (router_service, supergraph_service, execution_service, subgraph_service), (3) users want to modify an existing router plugin, (4) users need to understand router plugin patterns or the request lifecycle. (5) triggers on requests like \"create a new plugin\", \"add a router plugin\", \"modify the X plugin\", or \"add subgraph_service hook\".\n","Read Write Edit Glob Grep","master","49e49abf2f670d429e0b7e2c0349739c3fdd5cbe","skills\u002Fapollo-router-plugin-creator",5,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium","https:\u002F\u002Fgithub.com\u002Fstanfish06","https:\u002F\u002Fwww.stanfish.dev\u002F","2026-11-14 21:31:37",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add stanfish06\u002Fskillquarium --skill apollo-router-plugin-creator",{"tool":44,"command":45},"bunx","bunx skills add stanfish06\u002Fskillquarium --skill apollo-router-plugin-creator",{"tool":47,"command":48},"pnpm","pnpm dlx skills add stanfish06\u002Fskillquarium --skill apollo-router-plugin-creator","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fapollo-router-plugin-creator\u002FSKILL.md",true,[52,58,62,66],{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"agents\u002Fopenai.yaml","REFERENCE","参考文档",192,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fapollo-router-plugin-creator\u002Fagents\u002Fopenai.yaml",{"path":59,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Fexamples.md",5023,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fapollo-router-plugin-creator\u002Freferences\u002Fexamples.md",{"path":63,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fexisting-plugins.md",1755,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fapollo-router-plugin-creator\u002Freferences\u002Fexisting-plugins.md",{"path":67,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fservice-hooks.md",7150,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fapollo-router-plugin-creator\u002Freferences\u002Fservice-hooks.md",[71,78,87,94,101,108],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M76ZJTRVA456GD7K8Y3EP82H","zarr-python","Stores and queries chunked N-D scientific arrays with Zarr-Python 3, including codecs, sharding, S3\u002FGCS storage, and NumPy\u002FDask\u002FXarray integration. Use for array layout, bounded I\u002FO, format migration, or scientific metadata preservation.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":83,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M76ZJQZ15Q1HKC5V85NHE325","yeet","Publish local changes to GitHub by confirming scope, committing intentionally, pushing the branch, and opening a draft PR through the GitHub app from this plugin, with `gh` used only as a fallback where connector coverage is insufficient.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M76ZJ8ASZ4QYQ70Y6SBA4Z4S","xarray","N-dimensional labeled arrays and datasets in Python. Built on top of NumPy and Dask. It introduces labels in the form of dimensions, coordinates, and attributes on top of raw NumPy-like arrays, making data analysis in physical sciences more intuitive and less error-prone. Use for working with multi-dimensional scientific data, NetCDF\u002FGRIB\u002FZarr files, climate\u002Fweather\u002Foceanographic datasets, remote sensing, geospatial imaging, large out-of-memory datasets with Dask, and labeled array operations.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fxarray\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M76ZHFBXD6VXPQ02VCEG202B","writing-mstest-tests","Use when asked to fix, rewrite, update, improve, modernize, show corrected code for, or explain existing MSTest tests or MSTest-specific configuration. Use for \"review\" when corrected code or edits are wanted, even for one pasted assertion or passing tests with bad failure output. Covers expected\u002Factual labels; generic Boolean, collection, string, numeric, null, identity, exception, hard-cast, and object[] checks; TestContext\u002Flifecycle; timeout\u002Fcancellation; OS\u002FCI conditions, retry, cleanup, parallelization, MSTest.Sdk project setup, and MSTESTxxxx. Honor the installed MSTest version. DO NOT USE to design new test cases (code-testing), perform report-only audits, create project files rather than explain MSTest setup, run tests, migrate frameworks, or handle non-MSTest\u002Fnon-.NET code.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwriting-mstest-tests\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M76ZDFDF4N88RH6HSYGS7GP2","wgs-prs","End-to-end WGS to polygenic risk score pipeline. Takes paired-end FASTQ files (or a pre-existing VCF) through nf-core\u002Fsarek for variant calling, applies VCF QC (normalisation, hard filtering, Ti\u002FTv and Het\u002FHom checks), then computes polygenic risk scores via the PGS Catalog. Fills the FASTQ to VCF gap upstream of the gwas-prs skill.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwgs-prs\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":112,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":19},"01M76ZCC1SC68J42QK4MDC8RCG","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[]]