agentleFS
dennisonbertramdennisonbertram/claude-mac-guardian/skills/performance-check/SKILL.md

performance-check

Skill1 starsChanged 7 months agoMITView on GitHub

This skill should be used when the user asks to "check performance", "mac is slow", "why is my mac slow", "cpu usage", "memory pressure", or "what's slowing me down". Reports load average, memory pressure, swap, top processes, thermal state, and battery health, then writes a JSON result to ~/.mac-guardian/data/.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When invoked by daily-health-report, return JSON path only.

    line 64
  2. Distinctive:

    Read-only. Do not kill processes.

    line 68

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

performance-check

Captures a point-in-time performance snapshot on macOS.

When to invoke

Trigger on phrases like: "check performance", "mac is slow", "why is my mac slow", "cpu usage", "memory pressure", "what's slowing me down".

What to check

1. Load averages — sysctl -n vm.loadavg or uptime. Compare 1-minute load to sysctl -n hw.ncpu.

  • load / ncpu < 0.7: ok
  • 0.7–1.0: info
  • 1.0–2.0: warn
  • 2.0: critical

2. Memory pressure — vm_stat (pages free / active / inactive / speculative / wired). Compute pressure ratio: (free + inactive) / total.

  • 20% free+inactive: ok

  • 10–20%: info
  • 5–10%: warn
  • <5%: critical

Also parse memory_pressure output when available (memory_pressure 2>/dev/null | tail -5).

3. Swap usage — sysctl vm.swapusage. Parse "used = X.XXM".

  • used = 0: ok
  • used < 512 MB: info
  • 512 MB – 2 GB: warn
  • 2 GB: critical

4. Top 10 CPU consumers — top -l 1 -n 10 -o cpu -stats pid,command,cpu,mem. Record rows.

5. Top 10 memory consumers — top -l 1 -n 10 -o mem -stats pid,command,cpu,mem. Record rows.

6. Thermal state — pmset -g therm 2>/dev/null. Non-zero CPU_Speed_Limit = warn with the value.

7. Battery status (laptops only) — pmset -g batt. Parse percentage, AC Power/Battery Power, charging state. Low percentage on battery with no charger: info.

8. Battery health (laptops only) — ioreg -rc AppleSmartBattery 2>/dev/null. Extract CycleCount, MaxCapacity, DesignCapacity, AppleRawMaxCapacity. Compute MaxCapacity/DesignCapacity × 100:

  • ≥ 85%: ok
  • 75–85%: info
  • 60–75%: warn
  • < 60%: critical Skip gracefully on desktops.

9. Power summary — system_profiler SPPowerDataType 2>/dev/null | head -60 in raw.

10. Uptime — uptime. Uptime > 14 days: info "Consider rebooting; uptime N days."

Output contract

Standard envelope. Write to ~/.mac-guardian/data/performance-check-<ISOdate>.json.

Summary example: "Load 1.32 / 10, 18% memory free, swap 0.0 MB, battery health 92%."

Handoff

  • On direct invocation: bash ${CLAUDE_PLUGIN_ROOT}/scripts/render-single.sh performance-check.
  • When invoked by daily-health-report, return JSON path only.

Safety

  • Read-only. Do not kill processes. Do not change pmset settings.
  • No sudo.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.