LidGuard: Skill for Codex

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

lidguard-power-runtime is a skill for Codex from airtaxi/LidGuard. It costs 55 tokens per session (2,984 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: installed under .agents/ (shared by several agents); 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/.agents/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,984 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.02984
Opus 5.5 $0.00022 $0.01194
Sonnet 5.5 $0.00011 $0.00597
Haiku 4.5 $0.00006 $0.00298

Measured 1mo ago against content hash 0356d9fe7a82, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.
.agents/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. 1mo ago Changed 0356d9fe7a82
  2. 1mo ago Changed 33e45a001d0e
  3. 1mo ago Changed · +1 lines 01d1971cb4d4
  4. 2mo 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 (13 stars, last pushed 1mo ago), licensed MIT. It adds 55 tokens to every session and 2,984 once invoked, about $0.0002 per session on Opus 5.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

lidguard-power-runtime compared with skills from other repositories

lidguard-power-runtime next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
lidguard-power-runtimeairtaxi/LidGuardSkill131mo agoMITB55Codex
gke-compute-classesgoogle/skillsSkill22kyesterdayApache-2.0A83Claude Code, Codex
jetson-diagnosticNVIDIA/skillsSkill3.9kyesterdayApache-2.0A30Claude Code, Codex
holoscan-install-wheelNVIDIA/skillsSkill3.9kyesterdayApache-2.0A34Claude Code, Codex
offensive-z-waveSnailSploit/Claude-RedSkill10k25d agoMITA113Claude Code, Codex
doca-socket-relayNVIDIA/skillsSkill3.9kyesterdayApache-2.0A236Claude Code, Codex
hsb-flashNVIDIA/skillsSkill3.9kyesterdayApache-2.0B94Claude Code