LidGuard: Skill for Codex

.codex/skills/lidguard-power-runtime/SKILL.md

lidguard-power-runtime is a skill for Codex from airtaxi/LidGuard. It costs 55 tokens per session (2,871 once invoked), scanned B, original, MIT.

A technical reference for controlling sleep, lid-close behavior, display power, and thermal-related runtime behavior on Windows, Linux, and macOS. It describes the platform APIs and system services used to temporarily keep a computer awake.

In plain words
What is it for?
Implementing keep-awake behavior, lid-close protection, suspend eligibility checks, post-stop suspension, and emergency hibernation across supported operating systems.
Why use it?
It helps prevent incorrect power controls that could leave sleep protection active or alter the user’s system policy. It defines how protections should be released when they are no longer needed.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: mentions OpenCode.

This is airtaxi/LidGuard's own configuration. It tells Codex how to work on LidGuard itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything LidGuard configures →

Reuse

Borrowing it

Nothing to install: this file belongs to airtaxi/LidGuard. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/airtaxi/LidGuard/master/.codex/skills/lidguard-power-runtime/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/airtaxi/LidGuard

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lidguard-power-runtime

README.md
[![agentmods](https://agentmods.dev/badge/skills/airtaxi/lidguard/lidguard-power-runtime/github.svg)](https://agentmods.dev/skills/airtaxi/lidguard/lidguard-power-runtime)
Your own site
<a href="https://agentmods.dev/skills/airtaxi/lidguard/lidguard-power-runtime"><img src="https://agentmods.dev/badge/skills/airtaxi/lidguard/lidguard-power-runtime/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for lidguard-power-runtime

Your own site · 80×15
<a href="https://agentmods.dev/skills/airtaxi/lidguard/lidguard-power-runtime"><img src="https://agentmods.dev/badge/skills/airtaxi/lidguard/lidguard-power-runtime.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,871 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.02871
Opus 5 $0.00028 $0.01435
Sonnet 5 $0.00011 $0.00574
Haiku 4.5 $0.00006 $0.00287

Measured 2d ago against content hash 01d1971cb4d4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade B, and why

lidguard-power-runtime scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- Use non-interactive `sudo -n` only for the exact commands allowed by `macos-permission install`; fail with actionable setup guidance instead of prompting in background runtime paths.
.codex/skills/lidguard-power-runtime/SKILL.md · 107 lines

How it starts

The opening of the file, as written. The whole thing — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LidGuard Power Runtime

Platform Power Control

Windows

  • Use PowerCreateRequest, PowerSetRequest, and PowerClearRequest for normal idle sleep prevention.
  • Use PowerRequestSystemRequired to prevent idle system sleep.
  • Use PowerRequestAwayModeRequired to request away-mode behavior where supported.
  • Keep PowerRequestDisplayRequired optional; use it only when display sleep should also be prevented.
  • Always clear power requests and close handles when protection ends.
  • Do not change sleep idle timeouts. Runtime crashes could leave the user's system policy in a dangerous state.

Linux

  • Target systemd/logind environments.
  • Use systemd-inhibit block inhibitors for normal sleep and idle prevention.
  • Map PreventSystemSleep to the sleep inhibitor.
  • Map PreventSystemSleep and PreventDisplaySleep to the idle inhibitor.
  • Keep PreventAwayModeSleep Windows-only; do not expose or apply it in Linux settings/help output.
  • Map temporary lid-close protection to a separate handle-lid-switch inhibitor only when ChangeLidAction is enabled.
  • Keep SystemdInhibitor releasing normally by closing stdin on the helper process; use process-tree kill only as fallback.
  • Tie inhibitor helper processes to the LidGuard runtime lifetime so stale orphaned inhibitors do not survive the runtime.
  • Request immediate sleep/hibernate with systemctl suspend or systemctl hibernate, returning exit code/stderr when the request fails.
  • Keep Linux as a supported top-level platform when OperatingSystem.IsLinux() is true, even when systemd/logind prerequisites are incomplete; report missing prerequisites from the specific runtime or diagnostic operation.
  • Do not depend on a long-lived sudo -v cache. Prepare persistent privileged logind actions through the Linux polkit rule command.

macOS

  • Target local macOS systems with caffeinate, pmset, ioreg, system_profiler, Apple Silicon IOHIDEventSystemClient temperature sensors, and best-effort powermetrics.
  • Allow the Apple Silicon temperature fast path to use direct source-generated LibraryImport calls into CoreFoundation and IOKit, plus NativeLibrary export lookup for CoreFoundation callback tables, because CsWin32 does not cover macOS frameworks.
  • Use caffeinate assertions for normal idle sleep prevention.
  • Map PreventSystemSleep to caffeinate -i.
  • Map PreventDisplaySleep to caffeinate -d.
  • Do not use caffeinate -s for LidGuard's cross-platform PreventAwayModeSleep setting. Away-mode sleep prevention is Windows-only, and macOS sleep prevention must rely on caffeinate -i so it works on AC and DC power.
  • Map temporary lid-close protection to pmset -a disablesleep 1 only when ChangeLidAction is enabled.
  • Before changing SleepDisabled, save the original state through the pending lid-action backup JSON path; restore it when protection ends or during the next CLI recovery path before normal command execution.
  • Request immediate Sleep with pmset sleepnow.
  • For Hibernate, temporarily back up the current supported hibernatemode, write hibernatemode 25, request pmset sleepnow, and leave the pending hibernatemode backup for the next CLI recovery path instead of restoring it immediately after pmset sleepnow returns. If pmset sleepnow fails, roll back the hibernatemode immediately when possible.
  • Use non-interactive sudo -n only for the exact commands allowed by macos-permission install; fail with actionable setup guidance instead of prompting in background runtime paths.

Read the full file on GitHub · 107 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago Changed · +1 lines 01d1971cb4d4
  2. 11d ago First seen · 106 lines · 55 tokens per session scan B a99f08ff1344

Subscribe to this mod's changes

lidguard-power-runtime is a skill published in the GitHub repository airtaxi/LidGuard (11 stars, last pushed 3d ago), licensed MIT. It adds 55 tokens to every session and 2,871 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

gke-compute-classes

Configures, optimizes, and troubleshoots GKE ComputeClasses. Use when configuring Spot VMs with on-demand fallback, targeting specific accelerators (GPUs/TPUs) or machine families, restricting ComputeClass access, or debugging pending pods related to node pool auto-creation. Do not use for cluster-level Node Auto…

google/skills · 83 tokens

jetson-diagnostic

Read-only Jetson health snapshot for identity, memory, GPU, thermal, power, storage, services, and top processes.

NVIDIA/skills · 30 tokens

doca-socket-relay

Use this skill when the operator is driving the DOCA Socket Relay to bridge a socket-oriented host application onto a BlueField DPU peer without rewriting it — picking the deployment shape (in-process, sidecar, or BlueField service container), configuring the host-side socket and the DPU-side forwarding endpoint…

NVIDIA/skills · 236 tokens

offensive-z-wave

Z-Wave attack methodology — sniffing with Z-Force / EZ-Wave / RTL-SDR + ZniffMobile, S0 (legacy) network-key derivation flaw and key reuse, S2 (modern) ECDH commissioning analysis, replay/injection on unauthenticated nodes, default-key brute-force on test deployments, and home-automation hub pivots. Use when targeting…

SnailSploit/Claude-Red · 113 tokens

hsb-flash

Flash the FPGA on an HSB board connected to an NVIDIA devkit. Supports HSB Lattice boards (FPGA versions 2407, 2412, 2507, 2510) and Leopard Imaging VB1940 "all-in-one" cameras (FPGA versions 2507, 2510). Uses release-specific YAML manifests and board-type-specific program commands. Lattice and VB1940 commands must…

NVIDIA/skills · 94 tokens

jetson-validate-image

Use after jetson-flash-image to run static BSP checks, on-target smoke/regression tests on a flashed DUT, or both. Not for build or flash steps. Triggers: validate bsp, on-target validation.

NVIDIA/skills · 50 tokens