nemo-relay-instrument-context-isolation — скилл для Claude Code
Скилл nemo-relay-instrument-context-isolation разделяет стеки контекста NeMo Relay между параллельными задачами и сохраняет правильную иерархию scope.
Apache-2.0 211 установок ★ 4 106 обновлён 2026-10-23
npx skills add NVIDIA/skills --skill nemo-relay-instrument-context-isolation -a claude-codeЧто делает nemo-relay-instrument-context-isolation
Скилл задаёт отдельный scope stack для каждого запроса, агента или рабочего процесса. Вложенные scope образуют дерево: его структура определяет родителя события, границы времени жизни и видимость локальных middleware и подписчиков. Scope могут передавать семантические input и output, а mark-события подходят для повторов, чекпоинтов и прерываний.
Правила учитывают разные модели выполнения. В Python используются get_scope_stack() и contextvars, в Rust — create_scope_stack() и set_thread_scope_stack(...), в Go — NewScopeStack() и ScopeStack.Run(...), в Node.js — createScopeStack() и setThreadScopeStack(...). Локальные регистрации исчезают после закрытия владельца. Переход через async-задачу, goroutine или JS worker без передачи контекста ломает ожидаемый активный scope.
Какие задачи решает
- разделить контексты параллельных запросов
- сохранить родословную событий NeMo Relay
- передать scope в async-задачу или worker
- изолировать локальные middleware между агентами
- отследить повторы и чекпоинты через mark-события
Примеры запросов агенту
- Раздели scope stack для параллельных запросов и сохрани родословную событий NeMo Relay.
- Проверь передачу контекста между goroutine с помощью
NewScopeStack()иScopeStack.Run(...). - Настрой изоляцию scope для Node.js через
createScopeStack()иsetThreadScopeStack(...).
Как установить nemo-relay-instrument-context-isolation
1Через Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill nemo-relay-instrument-context-isolation -a claude-code2Вручную: положить файлы
~/.claude/skills/nemo-relay-instrument-context-isolation/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/nemo-relay-instrument-context-isolation/
1Через Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill nemo-relay-instrument-context-isolation -a codex2Вручную: положить файлы
.agents/skills/nemo-relay-instrument-context-isolation/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill nemo-relay-instrument-context-isolation -a cursor2Вручную: положить файлы
.cursor/skills/nemo-relay-instrument-context-isolation/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install NVIDIA/skills skills/nemo-relay-instrument-context-isolation2Вручную: положить файлы
.github/skills/nemo-relay-instrument-context-isolation/SKILL.md1Через Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill nemo-relay-instrument-context-isolation -a gemini-cli2Командой платформы
gemini skills install https://github.com/NVIDIA/skills --path skills/nemo-relay-instrument-context-isolationВручную: положить файлы
.devin/skills/nemo-relay-instrument-context-isolation/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill nemo-relay-instrument-context-isolation -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о nemo-relay-instrument-context-isolation
Как установить nemo-relay-instrument-context-isolation в Claude Code?
Выполните npx skills add NVIDIA/skills --skill nemo-relay-instrument-context-isolation -a claude-code, затем проверьте файл ~/.claude/skills/nemo-relay-instrument-context-isolation/SKILL.md.
Что делает nemo-relay-instrument-context-isolation?
Скилл помогает назначать отдельный стек scope каждому запросу, агенту или workflow и сохранять parent-child связь событий. Он также описывает изоляцию локальных middleware и передачу контекста между параллельными задачами.
Как скилл работает с разными языками?
Для Python он опирается на contextvars, для Go предлагает NewScopeStack() и ScopeStack.Run(...), а для Node.js — явные createScopeStack() и setThreadScopeStack(...). Для Rust используются функции управления стеком.
Исходный текст
SKILL.md · Apache-2.0
--- name: nemo-relay-instrument-context-isolation description: Use this skill when concurrent requests, async tasks, threads, workers, goroutines, or agents need independent NeMo Relay scope stacks and correct ancestry propagation. license: Apache-2.0 metadata: author: NVIDIA Corporation and Affiliates --- # Use Context Isolation Use this skill when an application runs concurrent requests, worker pools, async tasks, goroutines, or multiple agents in the same process. Treat scope-stack ownership as part of the request boundary. ## Core Rule Each independent request, agent, or workflow needs its own scope stack. Do not share one mutable stack across unrelated concurrent work unless you want shared ancestry and shared scope-local middleware. ## Embedded Scope Model - A root scope is always present, and pushed scopes form a parent-child tree beneath it. - Scope hierarchy determines event parentage, lifetime boundaries, and visibility for scope-local middleware and subscribers. - Standard scope types include `Agent`, `Function`, `Tool`, `Llm`, `Retriever`, `Embedder`, `Reranker`, `Guardrail`, `Evaluator`, `Custom`, and `Unknown`. - Scope start and end events can carry semantic `input` and `output` payloads when the scope represents a request, task, or meaningful result boundary. - Scope-local registrations disappear when the owning scope closes; use them for behavior that should not outlive a request or agent run. - Mark events are useful for retries, checkpoints, interrupts, and important state transitions that are not full spans. ## Per-Language Defaults - **Python**: rely on task-local behavior via `get_scope_stack()` and `contextvars`, or explicitly propagate when work leaves the current execution context - **Rust core**: use runtime helpers such as `create_scope_stack()`, `current_scope_stack()`, and `set_thread_scope_stack(...)` when an integration needs explicit stack ownership - **Go**: use `NewScopeStack()` and `ScopeStack.Run(...)` for goroutine-safe usage - **Node.js**: create and set a scope stack explicitly for the current execution path with `createScopeStack()` and `setThreadScopeStack(...)` ## Common Failures - Events from different requests appear under one root UUID - Scope-local middleware leaks across requests - Worker-thread work runs without the expected active scope - Integrations activate NeMo Relay without an explicitly initialized stack - Relying on a thread-local stack after crossing async tasks, goroutines, or JS worker boundaries ## Related Skills - `nemo-relay-instrument-calls` - `nemo-relay-plugin-observability` - `nemo-relay-debug-runtime-integration`
© NVIDIA Corporation and Affiliates · Apache-2.0 · NVIDIA/skills