[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BGVMWT0CS0XFP54D7GP3FK":3,"skill-same:01M7BGVMWT0CS0XFP54D7GP3FK":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":13,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7BGVMWT0CS0XFP54D7GP3FK","add-middleware",null,"Add a new guardrail or intercept type to the NeMo Relay middleware pipeline","dawsonblock\u002FNEMO","dawsonblock","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F56236740?v=4","01M72Y87EG0A5JP9CKS7EYX8VM","01M7BGVFAXJ69RPAJYQ1XB52MZ",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdawsonblock\u002FNEMO\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fadd-middleware\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: add-middleware\ndescription: Add a new guardrail or intercept type to the NeMo Relay middleware pipeline\nauthor: NVIDIA Corporation and Affiliates\nlicense: Apache-2.0\n---\n\n\n# Add a Middleware Type\n\n## Companion Guidance\n\nUse `karpathy-guidelines` alongside this skill for implementation or review\nwork. Keep changes scoped, surface assumptions, and define focused validation\nbefore editing.\n\nNeMo Relay supports guardrails (validate\u002Fgate) and intercepts (transform) at various\npipeline stages. Adding a new middleware type requires changes across all layers.\n\nUse this skill when introducing a new middleware registration surface or adding\nmiddleware behavior to a new pipeline stage.\n\n## Lock The Design First\n\nDecide these before editing code:\n\n- Is this for tools, LLMs, marks, scope events, or a combination?\n- Is it a conditional guardrail, sanitize guardrail, request intercept, or\n  execution intercept?\n- Does it run on request input, inner callable execution, stream chunks, or\n  final response output?\n- Is the callback fallible, and how should callback failures propagate?\n- Does it need both global and scope-local registration?\n- What should subscribers and exporters observe in the event payload after this\n  middleware runs?\n- If this is an event sanitizer, which of `data`, `category_profile`, and\n  `metadata` can change, and is the event used only as immutable context?\n\n## Pipeline Order\n\nRefer to `docs\u002Fabout-nemo-relay\u002Fconcepts\u002Fmiddleware.mdx` for the full diagrams.\n\n- **Tool execute**:\n  conditional guardrails -> request intercepts -> sanitize request (for events)\n  | execution intercept chain(callable) -> sanitize response\n- **LLM execute**:\n  conditional guardrails -> request intercepts -> sanitize request (for events)\n  | execution intercept chain(callable) -> sanitize response\n- **Mark and scope events**:\n  specialized tool or LLM sanitizer (when applicable) -> mark or scope event\n  sanitizer -> subscriber and exporter dispatch\n\nTool execution callbacks and each execution-intercept `next` continuation\nreturn the canonical `ToolExecutionResult { result, annotation }`. A forwarding\nintercept must preserve both fields in `ToolExecutionInterceptOutcome`; Relay\nretains `pending_marks` separately. Tool sanitize-response guardrails receive\nonly `result`. Scope-end event sanitizers govern the annotation after Relay\nprojects it to `category_profile.tool_result_annotation`.\n\n## Core Steps\n\n1. Define or reuse the callback type alias in\n   `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fruntime\u002Fcallbacks.rs`.\n\n```rust\npub type MyNewFn = Box\u003Cdyn Fn(&str, Json) -> Json + Send + Sync>;\n```\n\n2. Add the registry field to `NemoRelayContextState` in\n   `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fruntime\u002Fstate.rs`.\n\nAdd a `SortedRegistry\u003CGuardrailEntry\u003CMyNewFn>>` or `SortedRegistry\u003CIntercept\u003CMyNewFn>>`\nfield to the state struct.\n\n3. Add registration and deregistration APIs in `crates\u002Fcore\u002Fsrc\u002Fapi\u002F`.\n\nUse the existing `global_*_registry_api!` and `scope_*_registry_api!` macro\npatterns in `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fregistry.rs`. Both global and scope-local\nvariants are needed unless the design explicitly rules one out.\n\n4. Add chain execution helpers to `NemoRelayContextState` in\n   `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fruntime\u002Fstate.rs`.\n\nFollow the pattern of `tool_sanitize_request_chain` or `tool_request_intercepts_chain`.\n\n5. Wire the chain into the execute path.\n\nUpdate the relevant lifecycle owner to call the new chain method at the\nappropriate pipeline stage. Tool and LLM paths live in\n`crates\u002Fcore\u002Fsrc\u002Fapi\u002Ftool.rs` and `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fllm.rs`; shared mark and\nscope event sanitization lives in `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fshared.rs` and is called\nfrom `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fscope.rs`.\n\n6. Expose the new middleware surface in every affected binding.\n\nFollow the `add-binding-feature` skill for the cross-binding implementation checklist.\n\n## Required Tests\n\n- [ ] Registration and duplicate-name behavior\n- [ ] Deregistration and no-op missing-name behavior\n- [ ] Ordering by priority\n- [ ] Callback failure policy, including fail-open behavior when required\n- [ ] Scope-local registration, inheritance, and cleanup on pop\n- [ ] Event payload semantics after middleware mutation\n- [ ] Tool execution result and annotation preservation, replacement, and\n      removal when the middleware touches tool execution\n- [ ] Mark and scope event field semantics, including immutable identity fields\n- [ ] Parity coverage in every affected binding\n\n## Key References\n\n- Pipeline logic: `crates\u002Fcore\u002Fsrc\u002Fapi\u002Ftool.rs`, `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fllm.rs`\n- Type aliases: `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fruntime\u002Fcallbacks.rs`\n- Runtime state and chain builders: `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fruntime\u002Fstate.rs`\n- Scope-local registry merging: `crates\u002Fcore\u002Fsrc\u002Fcontext\u002Fregistries.rs`\n- Registry: `crates\u002Fcore\u002Fsrc\u002Fregistry.rs`\n- Pipeline docs: `docs\u002Fabout-nemo-relay\u002Fconcepts\u002Fmiddleware.mdx`\n- Architecture docs: `docs\u002Fabout-nemo-relay\u002Farchitecture.mdx`\n- Registration examples: `docs\u002Finstrument-applications\u002Fadvanced-guide.mdx`\n- Validation: `validate-change`\n","# Add a Middleware Type\n\n## Companion Guidance\n\nUse `karpathy-guidelines` alongside this skill for implementation or review\nwork. Keep changes scoped, surface assumptions, and define focused validation\nbefore editing.\n\nNeMo Relay supports guardrails (validate\u002Fgate) and intercepts (transform) at various\npipeline stages. Adding a new middleware type requires changes across all layers.\n\nUse this skill when introducing a new middleware registration surface or adding\nmiddleware behavior to a new pipeline stage.\n\n## Lock The Design First\n\nDecide these before editing code:\n\n- Is this for tools, LLMs, marks, scope events, or a combination?\n- Is it a conditional guardrail, sanitize guardrail, request intercept, or\n  execution intercept?\n- Does it run on request input, inner callable execution, stream chunks, or\n  final response output?\n- Is the callback fallible, and how should callback failures propagate?\n- Does it need both global and scope-local registration?\n- What should subscribers and exporters observe in the event payload after this\n  middleware runs?\n- If this is an event sanitizer, which of `data`, `category_profile`, and\n  `metadata` can change, and is the event used only as immutable context?\n\n## Pipeline Order\n\nRefer to `docs\u002Fabout-nemo-relay\u002Fconcepts\u002Fmiddleware.mdx` for the full diagrams.\n\n- **Tool execute**:\n  conditional guardrails -> request intercepts -> sanitize request (for events)\n  | execution intercept chain(callable) -> sanitize response\n- **LLM execute**:\n  conditional guardrails -> request intercepts -> sanitize request (for events)\n  | execution intercept chain(callable) -> sanitize response\n- **Mark and scope events**:\n  specialized tool or LLM sanitizer (when applicable) -> mark or scope event\n  sanitizer -> subscriber and exporter dispatch\n\nTool execution callbacks and each execution-intercept `next` continuation\nreturn the canonical `ToolExecutionResult { result, annotation }`. A forwarding\nintercept must preserve both fields in `ToolExecutionInterceptOutcome`; Relay\nretains `pending_marks` separately. Tool sanitize-response guardrails receive\nonly `result`. Scope-end event sanitizers govern the annotation after Relay\nprojects it to `category_profile.tool_result_annotation`.\n\n## Core Steps\n\n1. Define or reuse the callback type alias in\n   `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fruntime\u002Fcallbacks.rs`.\n\n```rust\npub type MyNewFn = Box\u003Cdyn Fn(&str, Json) -> Json + Send + Sync>;\n```\n\n2. Add the registry field to `NemoRelayContextState` in\n   `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fruntime\u002Fstate.rs`.\n\nAdd a `SortedRegistry\u003CGuardrailEntry\u003CMyNewFn>>` or `SortedRegistry\u003CIntercept\u003CMyNewFn>>`\nfield to the state struct.\n\n3. Add registration and deregistration APIs in `crates\u002Fcore\u002Fsrc\u002Fapi\u002F`.\n\nUse the existing `global_*_registry_api!` and `scope_*_registry_api!` macro\npatterns in `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fregistry.rs`. Both global and scope-local\nvariants are needed unless the design explicitly rules one out.\n\n4. Add chain execution helpers to `NemoRelayContextState` in\n   `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fruntime\u002Fstate.rs`.\n\nFollow the pattern of `tool_sanitize_request_chain` or `tool_request_intercepts_chain`.\n\n5. Wire the chain into the execute path.\n\nUpdate the relevant lifecycle owner to call the new chain method at the\nappropriate pipeline stage. Tool and LLM paths live in\n`crates\u002Fcore\u002Fsrc\u002Fapi\u002Ftool.rs` and `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fllm.rs`; shared mark and\nscope event sanitization lives in `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fshared.rs` and is called\nfrom `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fscope.rs`.\n\n6. Expose the new middleware surface in every affected binding.\n\nFollow the `add-binding-feature` skill for the cross-binding implementation checklist.\n\n## Required Tests\n\n- [ ] Registration and duplicate-name behavior\n- [ ] Deregistration and no-op missing-name behavior\n- [ ] Ordering by priority\n- [ ] Callback failure policy, including fail-open behavior when required\n- [ ] Scope-local registration, inheritance, and cleanup on pop\n- [ ] Event payload semantics after middleware mutation\n- [ ] Tool execution result and annotation preservation, replacement, and\n      removal when the middleware touches tool execution\n- [ ] Mark and scope event field semantics, including immutable identity fields\n- [ ] Parity coverage in every affected binding\n\n## Key References\n\n- Pipeline logic: `crates\u002Fcore\u002Fsrc\u002Fapi\u002Ftool.rs`, `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fllm.rs`\n- Type aliases: `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fruntime\u002Fcallbacks.rs`\n- Runtime state and chain builders: `crates\u002Fcore\u002Fsrc\u002Fapi\u002Fruntime\u002Fstate.rs`\n- Scope-local registry merging: `crates\u002Fcore\u002Fsrc\u002Fcontext\u002Fregistries.rs`\n- Registry: `crates\u002Fcore\u002Fsrc\u002Fregistry.rs`\n- Pipeline docs: `docs\u002Fabout-nemo-relay\u002Fconcepts\u002Fmiddleware.mdx`\n- Architecture docs: `docs\u002Fabout-nemo-relay\u002Farchitecture.mdx`\n- Registration examples: `docs\u002Finstrument-applications\u002Fadvanced-guide.mdx`\n- Validation: `validate-change`\n",{"name":5,"author":23,"license":14,"description":7},"NVIDIA Corporation and Affiliates","main","13944d7d2b1a4bc9aa91fa061bed6fe63fad7979",".agents\u002Fskills\u002Fadd-middleware","https:\u002F\u002Fgithub.com\u002Fdawsonblock\u002FNEMO","https:\u002F\u002Fgithub.com\u002Fdawsonblock","2026-09-30 06:03:35",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add dawsonblock\u002FNEMO --skill add-middleware",{"tool":36,"command":37},"bunx","bunx skills add dawsonblock\u002FNEMO --skill add-middleware",{"tool":39,"command":40},"pnpm","pnpm dlx skills add dawsonblock\u002FNEMO --skill add-middleware","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdawsonblock\u002FNEMO\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fadd-middleware\u002FSKILL.md",true,[],[45,52,59,66,73,80],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":18},"01M7BGZHFG0R2E7EN6JKK8A6XK","nemo-relay-plugin-observability","Use this skill when choosing or configuring NeMo Relay 0.6 or 0.7 observability through the built-in plugin, subscribers, or exporters, including raw ATOF events, ATIF trajectories, OpenTelemetry, OpenInference, or custom event handling.","https:\u002F\u002Fgithub.com\u002Fdawsonblock\u002FNEMO\u002Fblob\u002Fmain\u002Fskills\u002Fnemo-relay-plugin-observability\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":18},"01M7BGZDJ0YSBESTS38D9FDRNA","nemo-relay-plugin-build","Use this skill when building or packaging reusable NeMo Relay runtime behavior as an embedded configuration component or a manifest-backed `rust_dynamic` native or `worker` gRPC plugin, with deterministic validation and rollback-safe registration.","https:\u002F\u002Fgithub.com\u002Fdawsonblock\u002FNEMO\u002Fblob\u002Fmain\u002Fskills\u002Fnemo-relay-plugin-build\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":18},"01M7BGZ9KYD60WWHH6C5H9DKPM","nemo-relay-plugin-adaptive-tuning","Use this skill when baseline NeMo Relay instrumentation exists and the user wants to configure or evaluate adaptive plugin behavior, including telemetry, state, adaptive_hints, tool_parallelism, ACG, hint consumption, or measured rollout.","https:\u002F\u002Fgithub.com\u002Fdawsonblock\u002FNEMO\u002Fblob\u002Fmain\u002Fskills\u002Fnemo-relay-plugin-adaptive-tuning\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":18},"01M7BGZ3XE0H92KR4E3ENNXQNX","nemo-relay-migrate-from-flow","Use this skill when migrating applications, examples, integrations, documentation, manifests, or repository code from NeMo Flow to NeMo Relay across Python, Rust, Node.js, Go, C FFI, CLI, configuration, and observability surfaces.","https:\u002F\u002Fgithub.com\u002Fdawsonblock\u002FNEMO\u002Fblob\u002Fmain\u002Fskills\u002Fnemo-relay-migrate-from-flow\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M7BGYWESQ44Z80VBZ3B3WB30","nemo-relay-integrate-upstream","Use this skill when assessing, extending, or implementing NeMo Relay support in an agent harness or agent framework, including coding agents and orchestration runtimes, when the host lacks Relay support or an existing integration needs deeper coverage. It identifies the host's execution boundaries and extension points, selects an appropriate attachment method for each boundary, and verifies the resulting coverage.","https:\u002F\u002Fgithub.com\u002Fdawsonblock\u002FNEMO\u002Fblob\u002Fmain\u002Fskills\u002Fnemo-relay-integrate-upstream\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M7BGYRQ1PTFVVC8KGA8ZE4MN","nemo-relay-instrument-typed-wrappers","Use this skill when adding NeMo Relay typed wrappers, domain types, or provider codecs while preserving JSON middleware semantics and caller-visible behavior.","https:\u002F\u002Fgithub.com\u002Fdawsonblock\u002FNEMO\u002Fblob\u002Fmain\u002Fskills\u002Fnemo-relay-instrument-typed-wrappers\u002FSKILL.md",[],[]]