Use when editing a boundary-safe shared header meant to be included by both in-tree and shared-provider/plugin-bridge code (e.g. include/onnxruntime/core/framework/workspace_requirement.h, or any future header supporting OrtKernelWorkspaceEstimateFunc / DeclareWorkspaceRequirements per issue #29775's Phase-A workspace-estimation roadmap), or when a workspace-estimation math helper needs to be callable from a future plugin EP DLL. Covers a Node forward-declaration ODR trap and the math-helper vs. graph-parsing-wrapper reuse boundary discovered while implementing PR #29811 (MatMulNBits pilot).
npx skills add https://github.com/microsoft/onnxruntime --skill workspace-estimation-shared-header
Lessons from implementing the two-level (EstimateWorkspace / DeclareWorkspaceRequirements)
workspace-size estimation pilot for MatMulNBits (issue #29775 Phase-A, PR #29811). The
WorkspaceRequirement struct in include/onnxruntime/core/framework/workspace_requirement.h is
designed to be included by both in-tree kernel code and future plugin-EP adapter code — this is exactly
the kind of dual-included, DLL-boundary-crossing header where these gotchas apply.
Node in a header included from both worldsSymptom: a compile failure or, worse, a silent type mismatch that depends on include order —
because onnxruntime::Node is not one type across the whole codebase. In-tree code sees class Node
from core/graph/graph.h. Shared-provider/plugin-bridge code (anything reachable from a plugin DLL)
sees a *different* Node type from a provider-bridge header (e.g. struct Node final). These are two
distinct types that happen to share a name — different "ODR worlds."
The trap: writing class Node; (or any forward-declaration of Node) in a header that might be
#included from both worlds. Whichever world's real definition gets included later in the same
translation unit can clash with your forward-declaration's class-key (class vs struct), or — worse
— the header can compile fine in isolation and only fail (or silently pick the wrong type) once combined
with a specific set of other includes.
The fix: omit the forward-declaration entirely. Don't try to avoid the #include of the real Node
header for compile-time savings in a shared, dual-included header — let each translation unit's own
real includes provide whatever Node type it needs. If you only need a pointer/reference and think a
forward-declare is a safe optimization, it is not safe here specifically because the two worlds disagree
on the underlying type.
How to confirm you're clear: the header must build cleanly when included from an in-tree-only
translation unit AND (once such a target exists) from a plugin-DLL translation unit, without relying on
which one happens to be included first.
When a kernel's workspace-size computation needs to be callable from both in-tree and (eventually)
plugin code, split it into two pieces:
ComputeFpAIntBGemmWorkspaceSize(int m, int n, int k, int sm, int multiProcessorCount)). No
Node&, no NodeArg, no TensorShape parsing, no ORT graph types at all. This is the part a future
plugin implementation can call *verbatim* — plugin kernels don't have Node& access, only the C-ABI
shape representation (OrtNode, Node_GetInputShape).
const Node&/NodeArg/TensorShape (orfrom the plugin's C-ABI shape accessors). This half is inherently different per build configuration and
is NOT reusable across the DLL boundary; it must be reimplemented against whichever shape
representation the caller has.
Why this matters concretely: if you accidentally let the pure-math core accept or touch an in-tree
graph type (even just to read one field), you've made it impossible to reuse from the plugin path without
either (a) linking in-tree graph headers into the plugin DLL (defeats the purpose of a plugin boundary) or
(b) duplicating the whole function. Keep the split clean from the start.
How to confirm you're clear: grep the pure-math function's signature and body for any ORT graph type
(Node, NodeArg, TensorShape, GraphViewer, etc.) — it should only ever see plain scalars
(int/int64_t/size_t) and, at most, opaque device-property values already extracted by the caller.
If you find a graph type anywhere in that function, the split has leaked and needs to be pulled apart
before a plugin implementation can reuse it.
Related, not yet built: docs/annotated_partitioning/future_directions_constrained_env.md (Phase A /
plugin-ABI sections) describes the intended plugin-side C ABI surface for DeclareWorkspaceRequirements,
but as of PR #29811 no plugin-side implementation exists yet — see that doc's "Cost of a Real
Plugin-Side Override (Deferred)" note for what's still missing beyond just following this split.
Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.
Use when the user asks to run Codex CLI (codex exec, codex resume) or references OpenAI Codex for code analysis, refactoring, or automated editing. Uses GPT-5.2 by default for state-of-the-art software engineering.
Implement memory-safe programming with RAII, ownership, smart pointers, and resource management across Rust, C++, and C. Use when writing safe systems code, managing resources, or preventing memory bugs.
Python/HTSlib workflows for genomic files. Use when reading, querying, filtering, or writing SAM/BAM/CRAM, VCF/BCF, FASTA/FASTQ, or tabix data with pysam, including pileup, coverage, indexing, and CRAM references.
Evaluate scientific claims and evidence quality. Use for assessing experimental design validity, identifying biases and confounders, applying evidence grading frameworks (GRADE, Cochrane Risk of Bias), or teaching critical analysis. Best for understanding evidence quality, identifying flaws. For formal peer review writing use peer-review.
Use when a user asks to debug or fix failing GitHub PR checks that run in GitHub Actions; use `gh` to inspect checks and logs, summarize failure context, draft a fix plan, and implement only after explicit approval. Treat external providers (for example Buildkite) as out of scope and report only the details URL.
Documentation generation workflow covering API docs, architecture docs, README files, code comments, and technical writing.
Use when the user wants to translate a repository README, make a repo multilingual, localize docs, add a language switcher, internationalize the README, or update localized README variants in a GitHub-style repository.
Take microsoft/workspace-estimation-shared-header from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.