/nsolid-plugin:ns-benchmark-runfrom N|Solid Plugin
Benchmarks a single Node.js function, reporting throughput and statistics. Activated when the user asks to measure ops/sec, compare input sizes, or time a function.
Ships in N|Solid Plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill is triggered from a code-lens interaction inside the user's workspace, so the codebase is always available.
functionDataEvery benchmark call requires a functionData object. Build it carefully:
type — code structure type"function" — function declaration or expression"class" — class-based implementation"snippet" — multiple functions, classes, or code elements together"anonymous_function" — anonymous functioncode — the JavaScript source stringmodule.exportsexplanation — describe what the function doesentryPoint — the name of the function or method to callargs — arguments to pass when benchmarkingFollow these steps to build args correctly:
args: [5, "test", true]argSetupCodeargsargSetupCode — mock definitions for complex dependenciesargsbenchmarkConfig — benchmark engine configurationrepeatSuite: 15 (number of suite runs — higher values improve statistical accuracy but take longer)minSamples: 10 (minimum samples required per run)minTime: 0.05 (minimum time per sample in seconds)maxTime: 0.5 (maximum time per sample in seconds)Before calling any benchmark tools, present the proposed functionData and benchmarkConfig to the user for review.
Your confirmation message must include:
entryPointargsargSetupCode if presentbenchmarkConfig values (repeatSuite, minSamples, minTime, maxTime) with a brief explanation of eachIf you found relevant tests, mention which test file(s) or fixtures informed the argument shape.
After presenting, explicitly offer to:
benchmarkConfig (e.g. increase repeatSuite for more statistical accuracy, or decrease it for faster runs)For example, if repeatSuite is set to 15 but the function is very fast, suggest increasing it. If the function is slow, suggest decreasing it to get results faster.
Do NOT call run_benchmark, get_benchmark_result, or any result-saving step until the user explicitly confirms both the arguments and the configuration.
For complex external dependencies, add the dependency as an explicit parameter to the function signature, mock it in argSetupCode, and pass the parameter name (not the value) in args. Example (HTTP req/res):
// Original: function exampleFn(req, res) { arrExample.push(JSON.parse(resp)); res.end(); }
// Transformed: function exampleFn(req, res, arrExample) { arrExample.push(JSON.parse(resp)); res.end(); }
args: ["req", "res", "arrExample"]
argSetupCode:
const req = { url: '/test' };
const res = { writeHead: function() {}, write: function() {}, end: function() {} };
const arrExample = [];
For more patterns (DB, FS, event emitters, async/await, class instantiation), see reference/benchmark-inputs.md in this skill's directory.
Call run_benchmark with:
functionData: the object built in step 2 (type, code, explanation, entryPoint, args, and argSetupCode if needed)isOptimized: falsebenchmarkConfig only if the run_benchmark schema exposes that parameter (or functionData.benchmarkConfig). If not, record the desired config in the report and state that tool defaults were used.Note the returned jobId.
Run the wait script (use the absolute path of the directory where you read this SKILL.md):
node "<skill-dir>/wait.cjs" 20
Call get_benchmark_result with the jobId. If status is not yet "completed", run node "<skill-dir>/wait.cjs" 5 and poll again. Poll up to 12 times; if still not completed, report the jobId and incomplete status rather than looping indefinitely.
Extract the full result object from the response. It contains:
result.name — the benchmark nameresult.plugins — any plugins that ran (e.g., V8NeverOptimizePlugin)result.opsSec — average operations per secondresult.opsSecPerRun — per-run ops/sec valuesresult.iterations — total iterations executedresult.histogram — timing distribution with samples, min, max, and sampleDataresult.benchmarkConfig — the configuration used (repeatSuite, minSamples, minTime, maxTime)Keep the full result JSON available to present to the user.
Build a markdown report with these sections:
## Summary## Request## Results## Tool Execution LogFor ## Tool Execution Log, include the raw input/output pairs for the run_benchmark call and every get_benchmark_result poll for the same jobId, in chronological order.
Use the markdown report from step 7 as the final answer body. Present the benchmark results in a markdown table. Include all relevant metrics from the result object so the user can see the full performance picture at a glance.
The table must include:
Example table format:
| Metric | Value |
|---|---|
| Function | <entryPoint> |
| ops/sec | |
| Iterations | |
| Runs | 15 |
| Histogram min/max | ms / ms |
| Config | repeatSuite=15, minSamples=10, minTime=0.05s, maxTime=0.5s |
| Variance | High/Low (min/max spread is x) |
| Benchmark ID | <id> |
When variance is high (wide min/max spread), append a diagnostic line: note likely causes (V8 JIT tier transitions, GC pauses on allocating functions, system load/CPU throttling, or input sensitivity) and recommend increasing repeatSuite/minSamples or inspecting per-run ops/sec for outliers.
.md) under .nsolid/assets/ — for example .nsolid/assets/benchmark-<entryPoint>.md. Report the saved path to the user.wait.cjs, do not rely on estimating time.isOptimized: false — this is a baseline run, not a comparison.What SKILL.md sets; muted values are Claude Code's defaults
18 skills in this plugin
/ns-advanced-memory-leak-hunterPerforms an advanced N|Solid memory leak hunt comparing baseline vs peak heap evidence to isolate retained constructors, closures, and retainer paths. Use when the user reports recurring/staircase memory growth, elusive leaks, retained objects, closures holding references, or a standard heap sample/snapshot analysis was inconclusive. Prefer supplied baseline/peak assets; capture new samples only when needed./ns-analyze-assetAnalyzes an existing N|Solid diagnostic asset by asset ID or local asset path using asset-summary. Use when the user asks to inspect, review, summarize, or interpret an already-captured CPU profile, heap profile, heap sample, or heap snapshot, including assets just produced by ns-generate-asset. Do not use to capture new profiles/snapshots./ns-analyze-eventInvestigates an existing N|Solid event payload and correlates relevant MCP evidence. Use when the user provides or references an event such as process-blocked, new-vulnerability-found, agent-exit, uncaught exception, stack trace, span data. Routes follow-up to CPU, memory, vulnerability, or tracing workflows when needed./ns-analyze-tracingAnalyzes N|Solid/OpenTelemetry tracing evidence for request latency, HTTP errors, and service dependencies. Use when the user asks about slow endpoints, API timeouts, distributed traces/spans, N+1 queries, await chains, microservice latency, cascading failures, or trace IDs. Query N|Solid only when no trace data was provided. Builds the span waterfall with `tracing-detail` when the console offers it./ns-analyze-vulnerabilitiesAnalyzes live runtime vulnerabilities loaded by connected N|Solid Node.js processes. Use when the user wants to know which CVEs are actually present in running apps, active exploitable/live vulnerabilities, zero-day exposure, supply-chain risk in production, or production package risk. For static npm-audit-style project dependency scans, use ns-audit-dependencies instead./ns-audit-dependenciesAudits a local Node.js project dependency tree with NCM vulnerability data. Use when the user asks for an npm audit-style security review, package CVEs, direct/transitive vulnerability report, dependency risk assessment, or remediation plan before upgrading. For vulnerabilities actually loaded in running N|Solid processes, use ns-analyze-vulnerabilities instead.npx claudepluginhub nodesource/nsolid-plugin --plugin nsolid-plugin2 plugins ship this exact skill · first indexed Jul 15, 2026
Other plugins' skills for the same job