home / skills / a5c-ai / babysitter / power-management-monitor
This skill monitors system power state and autonomously manages sleep prevention, battery alerts, and power source changes to keep workflows uninterrupted.
npx playbooks add skill a5c-ai/babysitter --skill power-management-monitorReview the files below or copy the command above to add this skill to your agents.
---
name: power-management-monitor
description: Monitor system power state including battery, AC, sleep, and wake events
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
tags: [power, battery, system, cross-platform, monitoring]
---
# power-management-monitor
Monitor system power state including battery level, AC/battery status, and sleep/wake events.
## Capabilities
- Monitor battery level and charging
- Detect AC/battery power source
- Handle sleep/wake events
- Prevent system sleep
- Low battery notifications
- Power-aware feature toggling
## Input Schema
```json
{
"type": "object",
"properties": {
"projectPath": { "type": "string" },
"framework": { "enum": ["electron", "native"] },
"events": { "type": "array" }
},
"required": ["projectPath"]
}
```
## Electron Example
```javascript
const { powerMonitor, powerSaveBlocker } = require('electron');
powerMonitor.on('suspend', () => console.log('System suspending'));
powerMonitor.on('resume', () => console.log('System resumed'));
powerMonitor.on('on-battery', () => console.log('On battery'));
powerMonitor.on('on-ac', () => console.log('On AC power'));
// Prevent sleep during important tasks
const id = powerSaveBlocker.start('prevent-app-suspension');
// ... do work ...
powerSaveBlocker.stop(id);
```
## Related Skills
- `screen-capture-api`
- `system-services-integration` process
This skill monitors system power state including battery level, AC vs battery source, and sleep/wake events. It provides hooks for low-battery alerts, prevents system sleep during critical tasks, and toggles features based on power conditions. The implementation targets Electron and native JS environments and integrates into agentic workflows to make power-aware decisions.
The monitor listens to OS power events (suspend, resume, on-battery, on-ac) and queries battery state and charge level. It exposes APIs to start/stop sleep prevention and to register event handlers for low-battery or source-change events. It can emit structured events for orchestration engines to pause/resume tasks or adjust feature flags when power conditions change.
Which platforms are supported?
The skill is designed for Electron and native JavaScript environments that expose OS power APIs; behavior may vary by operating system.
How do I avoid preventing sleep indefinitely?
Start the sleep blocker only for the duration of the critical operation and always call the corresponding stop method in finally/cleanup code to ensure it is released.