Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add managedcode/dotnet-skills --skill use-js-interopgit clone --depth 1 https://github.com/managedcode/dotnet-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/managedcode/dotnet-skills/use-js-interop)<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/use-js-interop"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/use-js-interop/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/use-js-interop"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/use-js-interop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00114 | $0.02599 |
| Opus 5.5 | $0.00046 | $0.01040 |
| Sonnet 5.5 | $0.00023 | $0.00520 |
| Haiku 4.5 | $0.00011 | $0.00260 |
Grade A, and why
use-js-interop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
100% identical to use-js-interop — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 320 lines — stays where its author put it; the contents beside it link to each section on GitHub.
JS Interop in Blazor
1. Collocated JS Modules
Always use collocated .razor.js files with export — never global window.* functions or <script> tags.
// ChartPanel.razor.js — placed next to ChartPanel.razor
export function initialize(canvas, dotNetRef) { /* ... */ }
export function updateData(points) { /* ... */ }
export function dispose() { /* ... */ }
Import paths: same project = "./Components/ChartPanel.razor.js", RCL = "./_content/{AssemblyName}/...".
2. Lifecycle Timing
All JS interop must happen in OnAfterRenderAsync or event handlers — never in OnInitialized, OnParametersSet, or constructors. JS is not available during server prerendering.
Use a typed interop wrapper (see Section 4) — never call InvokeAsync/InvokeVoidAsync with raw string literals:
private ChartInterop? _chart;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
_chart = new ChartInterop(JS);
await _chart.InitializeAsync(_canvasRef);
}
}
Parameter changes: set a flag in OnParametersSet, apply in OnAfterRenderAsync:
private bool _dataChanged;
protected override void OnParametersSet() => _dataChanged = true;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender) { /* init */ }
else if (_dataChanged && _chart is not null)
{
_dataChanged = false;
await _chart.UpdateDataAsync(DataPoints);
}
}
3. Batch Related Operations
Each JS interop call crosses the .NET-to-JS boundary (and in Blazor Server, the SignalR circuit). Batching applies in both directions — .NET→JS and JS→.NET.
.NET → JS: merge consecutive calls
If the C# side makes two or more JS calls in a row, combine them into one JS function:
// ❌ Two round-trips — theme and locale are always applied together
await _module.InvokeVoidAsync("applyTheme", theme);
await _module.InvokeVoidAsync("applyLocale", locale);
// ❌ Result of one call feeds into another — both can stay in JS
var token = await _module.InvokeAsync<string>("createAccessToken");
await _module.InvokeVoidAsync("storeToken", token);
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 320 lines · 114 tokens per session scan A 6bf1227510ef
use-js-interop is a skill published in the GitHub repository managedcode/dotnet-skills (527 stars, last pushed 16d ago), licensed MIT. It adds 114 tokens to every session and 2,599 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to use-js-interop, differing in 0 lines, and is treated as a copy.
use-js-interop compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| use-js-interopmanagedcode/dotnet-skills | Skill | 527 | 16d ago | MIT | A | 114 | Claude Code, Codex |
| codegenAterDev/Perigon.CLI | Skill | 54 | 4d ago | Apache-2.0 | A | 53 | Claude Code, Codex |
| i18nextyildizberkay/skills | Skill | 2 | 8mo ago | Apache-2.0 | A | 162 | Claude Code, Codex |
| database-orm-expertroedyrustam/vibes-plug | Skill | 129 | 3d ago | MIT | A | 40 | Cursor |
| js-backend-expertroedyrustam/vibes-plug | Skill | 129 | 3d ago | MIT | A | 48 | Cursor |
| rust-developmentnavikt/copilot | Skill | 65 | yesterday | MIT | A | 27 | Claude Code, Codex |
| effect-tstenequm/skills | Skill | 39 | 2d ago | MIT | A | 57 | Claude Code, Codex |