[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71ECKCGW7YV69B4JPA7GRMZ":3,"skill-same:01M71ECKCGW7YV69B4JPA7GRMZ":73},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":6,"ownerHtmlUrl":55,"ownerBlogUrl":56,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M71ECKCGW7YV69B4JPA7GRMZ","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\".","iDorgham\u002FWorkspace-Factory","iDorgham","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F136521493?v=4","01M6CNGBDAHE4ARW3YJEF4X2FD","Dorgham","01M71E8H3CXZ7DJX59MTM9JEB2",1,"MIT","https:\u002F\u002Fgithub.com\u002FiDorgham\u002FWorkspace-Factory\u002Fblob\u002Fmaster\u002F.ai\u002Fskills\u002Fofficial_apollographql_apollo_router_plugin_creator\u002Fskill.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"plugin creator","apollo router plugin creator","apollo router","apollo","plugin","creator","router","edit","write","read","request","support","native","create","add service","when","writing","new","hooks","rust","2026-11-10 10:12:30",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":44,"description":48,"allowed-tools":49},{"author":45,"version":46,"compatibility":47},"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","c2e410e11df4d80d885e0ecf0583ef3c926df736",".ai\u002Fskills\u002Fofficial_apollographql_apollo_router_plugin_creator",0,"https:\u002F\u002Fgithub.com\u002FiDorgham\u002FWorkspace-Factory","https:\u002F\u002Fgithub.com\u002FiDorgham","Dorgham.me","hey I'm Dorgham \r\nI code, I create, and AI codes back. \r\nMaybe we can give AI the chance!! now we begin. 🚀🤖\r\n... . . . git commit -m \"Hello, Future\" ","2026-05-04 18:39:09",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add iDorgham\u002FWorkspace-Factory --skill apollo-router-plugin-creator",{"tool":65,"command":66},"bunx","bunx skills add iDorgham\u002FWorkspace-Factory --skill apollo-router-plugin-creator",{"tool":68,"command":69},"pnpm","pnpm dlx skills add iDorgham\u002FWorkspace-Factory --skill apollo-router-plugin-creator","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FiDorgham\u002FWorkspace-Factory\u002Fblob\u002Fmaster\u002F.ai\u002Fskills\u002Fofficial_apollographql_apollo_router_plugin_creator\u002Fskill.md",true,[],[74,105,127,148,168,191],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":85,"publishedAt":104},"01M71P8WVBMB2X3D24R0YT0B0E","vercel-react-view-transitions","Guide for implementing smooth, native-feeling animations using React's View Transition API (`\u003CViewTransition>` component, `addTransitionType`, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter\u002Fexit of components, animate list reorder, implement directional (forward\u002Fback) navigation animations, or integrate view transitions in Next.js. Also use when the user mentions view transitions, `startViewTransition`, `ViewTransition`, transition types, or asks about animating between UI states in React without third-party animation libraries.","https:\u002F\u002Fgithub.com\u002FiDorgham\u002FWorkspace-Factory\u002Fblob\u002Fmaster\u002Ffactory\u002Flibrary\u002Fskills\u002Fofficial_vercel_labs_react_view_transitions\u002Fskill.md",[80],{"categoryNo":81,"categoryName":82,"taxonomyType":83,"taxonomyTypeDesc":84},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",[86,87,88,89,90,91,92,93,94,95,96,97,98,99,34,100,101,102,32,103],"react","vercel react view transitions","view","react view transitions","vercel","transitions","shared","back","Animation","css","types","states","element","implementing","components","api","route","libraries","2026-11-10 13:02:02",{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":112,"publishedAt":104},"01M71P8TDGHZ289TSAC5VTG2EW","vercel-react-native-skills","React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.","https:\u002F\u002Fgithub.com\u002FiDorgham\u002FWorkspace-Factory\u002Fblob\u002Fmaster\u002Ffactory\u002Flibrary\u002Fskills\u002Fofficial_vercel_labs_react_native_skills\u002Fskill.md",[111],{"categoryNo":81,"categoryName":82,"taxonomyType":83,"taxonomyTypeDesc":84},[86,113,31,90,114,115,116,117,99,118,34,119,100,120,121,122,123,124,125,126],"react native","vercel react native skills","react native skills","modules","performance","apps","tasks","mobile","expo","list","mobile performance","platform","animations","for",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":134,"publishedAt":104},"01M71P8QK4JF5BYRGYDDGPZQG9","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002FiDorgham\u002FWorkspace-Factory\u002Fblob\u002Fmaster\u002Ffactory\u002Flibrary\u002Fskills\u002Fofficial_vercel_labs_react_best_practices\u002Fskill.md",[133],{"categoryNo":81,"categoryName":82,"taxonomyType":83,"taxonomyTypeDesc":84},[86,135,136,90,137,117,35,34,138,119,100,139,140,141,142,143,144,145,146,147],"react best practices","vercel react best practices","best practices","code","data fetching","react components","next","refactoring","data","patterns","Optimization","guidelines","triggers",{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":155,"publishedAt":104},"01M71P8HVEA70K5N6ZVJCG2ED3","vercel-composition-patterns","React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.","https:\u002F\u002Fgithub.com\u002FiDorgham\u002FWorkspace-Factory\u002Fblob\u002Fmaster\u002Ffactory\u002Flibrary\u002Fskills\u002Fofficial_vercel_labs_composition_patterns\u002Fskill.md",[154],{"categoryNo":81,"categoryName":82,"taxonomyType":83,"taxonomyTypeDesc":84},[156,90,157,144,158,159,160,161,147,162,163,164,34,165,119,100,166,167,101,86],"Composition","composition patterns","vercel composition patterns","react composition patterns","react 19","render","boolean","component architecture","use","reusable","architecture","react composition",{"skillNo":169,"name":170,"nameZh":6,"description":171,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":172,"categories":173,"keywords":177,"publishedAt":104},"01M71P60XXKKP222ZFJRG7R373","supabase-postgres-best-practices","Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.","https:\u002F\u002Fgithub.com\u002FiDorgham\u002FWorkspace-Factory\u002Fblob\u002Fmaster\u002Ffactory\u002Flibrary\u002Fskills\u002Fofficial_supabase_supabase_postgres_best_practices\u002Fskill.md",[174],{"categoryNo":175,"categoryName":176,"taxonomyType":83,"taxonomyTypeDesc":84},"01JBSEEDCAT000000000000010","后端与接口",[178,179,180,181,137,182,183,184,126,145,117,185,186,35,187,164,188,189,190,34],"postgres best practices","supabase","postgres","supabase postgres best practices","categories","postgres performance","advanced","correct","schema","impact","Rules","critical","database",{"skillNo":192,"name":193,"nameZh":6,"description":194,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":195,"categories":196,"keywords":198,"publishedAt":214},"01M71P2ZCEJD0PKC458YTP1FJW","portable-text-serialization","Render and serialize Portable Text to React, Svelte, Vue, Astro, HTML, Markdown, and plain text. Use when implementing Portable Text rendering in any frontend framework, building custom serializers for non-standard block types, converting Portable Text to HTML strings server-side, converting Portable Text to Markdown, extracting plain text from Portable Text, or troubleshooting rendering issues with marks, blocks, lists, or custom types.","https:\u002F\u002Fgithub.com\u002FiDorgham\u002FWorkspace-Factory\u002Fblob\u002Fmaster\u002Ffactory\u002Flibrary\u002Fskills\u002Fofficial_sanity_io_portable_text_serialization\u002Fskill.md",[197],{"categoryNo":81,"categoryName":82,"taxonomyType":83,"taxonomyTypeDesc":84},[199,200,201,202,203,96,204,161,205,99,206,207,34,86,208,209,210,211,212,213],"text","portable text serialization","portable","serialization","extracting","strings","issues","frontend","svelte","sanity","astro","server","markdown","rendering","vue","2026-11-10 10:56:23"]