agentleFS
kjendrzycakjendrzyca/public-skills/skills/battery-stats/SKILL.md

battery-stats

Skill1 starsChanged 3 months agoMITView on GitHub

Check macOS laptop battery telemetry, current power drain, average watt usage, battery health, cycle count, and recent real-world battery runtime from local pmset/ioreg/system_profiler data. Use ONLY when the user explicitly invokes this skill by name. Never trigger it automatically.

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. About 0 are common, 9 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill to answer battery-status questions directly from the local Mac.

    line 10
  2. Distinctive:

    Run the bundled script from this skill directory:

    line 14
  3. Distinctive:

    Use JSON when another tool or follow-up calculation needs structured data:

    line 20
  4. Very specific:

    Read the Current Battery section first:

    line 30
  5. Very specific:

    Read the Health section:

    line 34
  6. Distinctive:

    Prefer health calculated from nominal capacity divided by design capacity.

    line 35
  7. Very specific:

    Prefer the human Screen-on weighted full runtime line, or runtime.screen_on_robust.weighted_full_runtime in JSON, for "how long does the …

    line 38
  8. Very specific:

    Treat the human Wall-clock battery runtime including sleep line, or runtime.wall_clock_usable.weighted_full_runtime in JSON, as …

    line 39
  9. Distinctive:

    If the current discharge session is included, call it provisional.

    line 40
  10. Very specific:

    Use Average screen-on draw, or screen_on_robust.weighted_avg_power_w in JSON, as the best single number for typical watts during real …

    line 42
  11. Very specific:

    Use Median session draw and Typical range (25-75%) to describe normal variation.

    line 43
  12. Very specific:

    Use Heavier sessions (90%) and Session draw range to describe heavier workloads without overreacting to one noisy session.

    line 44
  13. Very specific:

    Prefer the longer stored history when available.

    line 45
  14. Distinctive:

    Do not overstate precision.

    line 51
  15. Distinctive:

    When current macOS "time remaining" and wattage-derived projections differ, explain that both are estimates and current drain changes …

    line 52
  16. Distinctive:

    Do not include battery serial numbers or other hardware identifiers unless the user explicitly asks for them.

    line 55
  17. Distinctive:

    If recent history has too few meaningful discharge sessions, say that the average is not reliable and fall back to the current macOS …

    line 56

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Battery Stats

Use this skill to answer battery-status questions directly from the local Mac. Do not ask the user to run commands unless they explicitly want the commands.

Quick Start

Run the bundled script from this skill directory:

python3 scripts/battery-stats.py

Use JSON when another tool or follow-up calculation needs structured data:

python3 scripts/battery-stats.py --json

Workflow

  1. Confirm the current machine is macOS. If pmset, ioreg, or system_profiler is missing, report that the skill only supports macOS battery telemetry.
  2. Run scripts/battery-stats.py.
  3. Read the Current Battery section first:
    • current_drain_w is the current whole-battery drain in watts, computed from battery voltage and amperage.
    • battery_power_telemetry_w is the battery telemetry rail when available. Treat it as secondary because it can diverge from the direct voltage/current reading.
    • These values are instantaneous and can move quickly with CPU, display brightness, network, browser, and background work.
  4. Read the Health section:
    • Prefer health calculated from nominal capacity divided by design capacity.
    • Include cycle count and macOS condition when available.
  5. Read the Runtime Estimate section:
    • Prefer the human Screen-on weighted full runtime line, or runtime.screen_on_robust.weighted_full_runtime in JSON, for "how long does the battery last during use?"
    • Treat the human Wall-clock battery runtime including sleep line, or runtime.wall_clock_usable.weighted_full_runtime in JSON, as standby-inclusive context because it includes sleep and maintenance wakes.
    • If the current discharge session is included, call it provisional.
  6. Read the Power Usage Estimate section:
    • Use Average screen-on draw, or screen_on_robust.weighted_avg_power_w in JSON, as the best single number for typical watts during real screen-on use.
    • Use Median session draw and Typical range (25-75%) to describe normal variation.
    • Use Heavier sessions (90%) and Session draw range to describe heavier workloads without overreacting to one noisy session.
    • Prefer the longer stored history when available; otherwise use the regular pmset history.
  7. Answer with concrete numbers and a short interpretation. Include the log span so the user knows what period the average covers.

Interpretation Rules

  • macOS does not provide a Windows-style generated batteryreport; the useful local sources are pmset -g batt, ioreg -rn AppleSmartBattery -r, system_profiler SPPowerDataType, and pmset -g log.
  • Do not overstate precision. Report current drain to about one decimal watt and runtime to the nearest 5-15 minutes.
  • When current macOS "time remaining" and wattage-derived projections differ, explain that both are estimates and current drain changes second by second.
  • Explain average watt usage as an estimate derived from observed battery-percent drop, elapsed screen-on time, and current usable battery energy in Wh. It is useful for describing the user's real workflow, not for hardware benchmarking.
  • A good wording pattern is: "During real screen-on use, this Mac averages about X W. Normal sessions are roughly A-B W, heavier sessions are around C W, and that lines up with about Y hours of practical runtime."
  • Do not include battery serial numbers or other hardware identifiers unless the user explicitly asks for them.
  • If recent history has too few meaningful discharge sessions, say that the average is not reliable and fall back to the current macOS estimate plus health and drain.

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.