skills/macos/macos-perf/SKILL.md
Activity Monitor, Instruments, top/htop, memory pressure, thermal state, powermetrics, profiling
npx skillsauth add alphaonedev/openclaw-graph macos-perfInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill enables monitoring and profiling macOS system performance using native tools, focusing on CPU, memory, thermal, and power metrics to identify bottlenecks and optimize applications.
Use this skill for diagnosing high CPU usage in apps, investigating memory leaks, profiling resource-intensive processes, checking thermal states during heavy workloads, or analyzing power consumption on macOS devices.
top/htop for CPU, memory, and network usage.vm_stat to detect low-memory conditions.powermetrics for CPU/GPU temperatures and fan speeds.powermetrics to measure battery drain and efficiency.top -o cpu for sorted process lists or instruments -s devices for available templates.Invoke this skill in scripts for automated monitoring or integrate into AI workflows for real-time analysis. For example, run periodic checks in a loop for server-like macOS setups, or trigger profiling when an app exceeds resource thresholds. Always specify exact tools and flags based on the task; e.g., use top for quick views and Instruments for deep dives. If integrating with automation, export data to JSON for parsing.
top -o cpu -s 1 to display processes sorted by CPU usage, updating every second; pipe output to grep for filtering, e.g., top -o cpu | grep "MyApp".vm_stat | grep "Pages" to get free pages; sample code:
output = subprocess.run(['vm_stat'], capture_output=True).stdout
free_pages = int(re.search(r'free:\s+(\d+)', output.decode()).group(1))
powermetrics --samplers cpu,thermal -i 1000 for CPU and thermal data every 1 second.instruments -w <device> -t Time Profiler -D output.trace /path/to/app; use exported .trace files for analysis.ioreg -l | grep "Ambient" to parse ambient temperature from system registry.Integrate by wrapping commands in Python or shell scripts; set environment variables for custom paths, e.g., export INSTRUMENTS_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/instruments. For data export, use plutil to convert .plist outputs to JSON. If combining with other skills, ensure macOS version compatibility (e.g., Instruments requires Xcode); check via sw_vers -productVersion. Avoid running multiple intensive tools simultaneously to prevent resource contention.
Check command exit codes; for example, if top fails, verify with echo $? and handle by logging errors or retrying. For Instruments, parse stderr for messages like "Template not found" and fallback to alternatives. Use try-except in scripts, e.g.:
try:
result = subprocess.run(['instruments', '-t', 'Time Profiler'], check=True)
except subprocess.CalledProcessError as e:
print(f"Error: {e.returncode} - {e.output}")
Common issues include permission errors (run with sudo) or missing dependencies (install Xcode command line tools via xcode-select --install).
top -pid <processID> -o cpu in a loop script, then analyze output to alert if usage > 80%; example script line: while true; do top -pid 1234 -l 1 | grep CPU; sleep 5; done.instruments -t Allocations -D profile.trace /Applications/MyApp.app, then open the trace in Instruments GUI to identify leaks; integrate by scripting: instruments ... && open profile.trace.tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui