Download for MacApple silicon, macOS 14+
Skill

ns-optimize-function

@nodesource Updated 2026-09-16

Optimizes a specific local Node.js function selected by the user. Use when the user points to code and asks to make it faster, improve throughput, reduce CPU/memory cost, or fix a slow function. Requires workspace source; analyzes blast radius, proposes a behavior-preserving rewrite, and hands off to benchmark validation. Not for live N|Solid diagnostics alone.

Install

With your agent

Install OMGSkills skill "nodesource/nsolid-skills-plugin:skills/ns-optimize-function" into this agent's normal skills directory: call the OMGSkills MCP get_install_plan tool for your agent and run the script it returns (it installs only the pinned commit and verifies SKILL.md), and stop if MCP or the pin is unavailable. Do not overwrite or change existing skills without asking me.

Manual command

git clone https://github.com/nodesource/nsolid-skills-plugin /tmp/nsolid-skills-plugin && ln -s /tmp/nsolid-skills-plugin/skills/ns-optimize-function ~/.claude/skills/ns-optimize-function

From README

Acquire the Target Function The user selects a function via code-lens, names it, or pastes its code. Read it from the workspace. If they name it but don't point at a location, search the workspace for the definition and confirm the match before proceeding. Do not guess which definition they meant when multiple exist — ask. Record the exact file path, start/end lines, and the function signature. Analyze Context & Impact This is the grounding step. Do not write any optimization yet. Read the function body and everything it references (helpers, constants, external imports, closures). Search the workspace for call sites and tests to understand real and the actual input shapes callers pass in. Assess and state explicitly: What it does and its current complexity — the algorithmic shape (loops, nested iterations, recursion, allocations, serialization, I/O).