/harness-claude:node-performance-profilingfrom harness-claude
Profiles Node.js applications using --prof, clinic.js, memory snapshots, and event loop lag to diagnose slow endpoints, high CPU, memory leaks, and event loop blocking.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /harness-claude:node-performance-profiling still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
Profile Node.js applications using --prof, clinic.js, memory snapshots, and event loop lag
--prof:node --prof app.js
# Generate human-readable output
node --prof-process isolate-*.log > profile.txt
node --inspect app.js
# Open chrome://inspect in Chrome
# Click "inspect" on the Node.js target
# Use the Performance and Memory tabs
import { monitorEventLoopDelay } from 'node:perf_hooks';
const histogram = monitorEventLoopDelay({ resolution: 20 });
histogram.enable();
setInterval(() => {
console.log({
min: histogram.min / 1e6, // ms
max: histogram.max / 1e6,
mean: histogram.mean / 1e6,
p99: histogram.percentile(99) / 1e6,
});
histogram.reset();
}, 5000);
import { performance, PerformanceObserver } from 'node:perf_hooks';
performance.mark('start');
await processData();
performance.mark('end');
performance.measure('processData', 'start', 'end');
const entries = performance.getEntriesByName('processData');
console.log(`Duration: ${entries[0].duration}ms`);
function logMemory() {
const { heapUsed, heapTotal, external, rss } = process.memoryUsage();
console.log({
heapUsed: `${(heapUsed / 1024 / 1024).toFixed(1)} MB`,
heapTotal: `${(heapTotal / 1024 / 1024).toFixed(1)} MB`,
rss: `${(rss / 1024 / 1024).toFixed(1)} MB`,
});
}
setInterval(logMemory, 10_000);
import v8 from 'node:v8';
import { writeFileSync } from 'node:fs';
function takeHeapSnapshot() {
const filename = `heap-${Date.now()}.heapsnapshot`;
const snapshotStream = v8.writeHeapSnapshot(filename);
console.log(`Heap snapshot written to ${snapshotStream}`);
}
// Take snapshots at intervals to compare in Chrome DevTools
npx clinic doctor -- node app.js
# Generates a flamechart visualization
npx clinic flame -- node app.js
# Generates a flamegraph for CPU profiling
npx clinic bubbleprof -- node app.js
# Visualizes async operations
// Cache expensive computations
const cache = new Map<string, Result>();
async function getCachedResult(key: string): Promise<Result> {
if (cache.has(key)) return cache.get(key)!;
const result = await expensiveComputation(key);
cache.set(key, result);
return result;
}
// Use setImmediate to yield the event loop during CPU work
async function processLargeArray(items: Item[]) {
for (let i = 0; i < items.length; i++) {
processItem(items[i]);
if (i % 1000 === 0) {
await new Promise((resolve) => setImmediate(resolve));
}
}
}
Node.js performance profiling identifies CPU bottlenecks, memory leaks, and event loop blocking that cause high latency or resource exhaustion.
Key metrics:
Flamegraphs: Visual representations of CPU time across call stacks. Wide bars indicate functions consuming significant CPU. Available through Chrome DevTools Performance tab or clinic flame.
Memory leak patterns:
setInterval without clearInterval)Trade-offs:
--prof is built-in — but produces hard-to-read output without processingclinic.js automates analysis — but is a development-only toolhttps://nodejs.org/en/docs/guides/simple-profiling
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeRead when SKILL.md points to them.
793 skills in this plugin
/a11y-aria-patternsARIA Patterns> Apply ARIA roles, states, and properties correctly to enhance assistive technology support for custom widgets/a11y-color-contrastColor Contrast and Color Independence> Ensure sufficient color contrast ratios and never use color as the sole means of conveying information/a11y-form-patternsAccessible Form Patterns> Build accessible forms with proper labeling, grouped controls, inline validation, and clear error communicationOther plugins' skills for the same job