ops-mac

GitHub

macOS专属运维技能,提供系统诊断、健康检查及修复功能。自动安装工具集,支持硬件、网络、磁盘、安全等维度的自动化检测与优化,适用于解决Mac变慢或系统异常问题。

claude-ops/skills/ops-mac/SKILL.md Lifecycle-Innovations-Limited/claude-ops

Trigger Scenarios

mac is slow macos fix

Install

npx skills add Lifecycle-Innovations-Limited/claude-ops --skill ops-mac -g -y
More Options

Non-standard path

npx skills add https://github.com/Lifecycle-Innovations-Limited/claude-ops/tree/main/claude-ops/skills/ops-mac -g -y

Use without installing

npx skills use Lifecycle-Innovations-Limited/claude-ops@ops-mac

指定 Agent (Claude Code)

npx skills add Lifecycle-Innovations-Limited/claude-ops --skill ops-mac -a claude-code -g -y

安装 repo 全部 skill

npx skills add Lifecycle-Innovations-Limited/claude-ops --all -g -y

预览 repo 内 skill

npx skills add Lifecycle-Innovations-Limited/claude-ops --list

SKILL.md

Frontmatter
{
    "name": "ops-mac",
    "effort": "low",
    "maxTurns": 30,
    "description": "OPS on-demand: This skill should be used when the user asks to \"mac is slow\", \"macos fix\", or…",
    "allowed-tools": [
        "Bash",
        "Read",
        "Grep",
        "Glob",
        "AskUserQuestion"
    ],
    "argument-hint": "[audit|health|net|disk|procs|security|launchd|fix|ensure|update]"
}

OPS ► MAC — macOS Diagnose & Fix

Load ops-rules before acting. Public repo (no personal data). Outbound: one draft → one approval → one send. If AskUserQuestion / Workflow are missing, follow Rule 10 in ops-rules (Hermes: numbered options / two-turn Telegram card; delegate_task).

One command for native macOS health: it bundles the macos-toolkit CLI suite, auto-installs it on first use, runs a read-only baseline, and remediates the common offenders behind explicit confirmations.

All work routes through ${CLAUDE_PLUGIN_ROOT}/bin/ops-mac, the single source of truth for install + probes + the aggregate audit. The bundled CLIs:

Tool Domain ops-mac subcommand
machealth composite health (CPU/mem/disk/thermal/battery/iCloud/TM/net) health
netwhiz network + WiFi diagnostics net / net wifi
macbroom disk cleanup & reclaimable cache scan disk
pstop process monitoring (CPU/mem hogs) procs
macdog security & privacy audit security
lanchr launchd agent/daemon health (doctor) launchd
macctl power / display / audio control power
macfig hidden macOS defaults defaults
updater app update management update

Platform guard

This skill is macOS only. The dispatcher exits with code 3 on non-Darwin. For Linux/WSL/Windows system optimization use /ops:speedup (cross-platform). The two are complementary — /ops:mac is the deep macOS-native surface; /ops:speedup is the portable cleaner.

Two hard-won quirks (baked into the dispatcher)

  1. machealth check/diagnose can hang forever on a stuck Time Machine / iCloud probe (its checks run in parallel with no per-probe skip flag). Every machealth call is wrapped in a hard timeout (default 25s, override OPS_MAC_MACHEALTH_TIMEOUT). If it trips, the other probes are still reliable — never block on it.
  2. The toolkit's pretty TUI tables render EMPTY when stdout isn't a TTY. The dispatcher forces --json for headless/agent consumers (macbroom, pstop, macdog, lanchr). When you need machine data, always pass --json.

Runtime Context

Before anything, ensure the suite is installed (idempotent — no-op if already present):

${CLAUDE_PLUGIN_ROOT}/bin/ops-mac ensure

Mode routing

Dispatch on $ARGUMENTS:

  • empty / auditBaseline flow (read-only, below)
  • health / net / disk / procs / security / launchd / power / update → run that single probe and print verbatim:
    ${CLAUDE_PLUGIN_ROOT}/bin/ops-mac <subcommand>
    
  • fixRemediation flow (below, Rule 5 confirmations)
  • ensure / install → run ops-mac ensure and report what was added

Baseline flow (/ops:mac or /ops:mac audit)

Run the aggregate audit — it composes the reliable probes in one call:

${CLAUDE_PLUGIN_ROOT}/bin/ops-mac audit

Then summarize for the user with a verdict per area:

OPS ► MAC AUDIT — [version] ([arch])

🔴/🟡/🟢 Security    grade [X]/100 — [firewall/SIP/FileVault/Gatekeeper/remote-login]
🔴/🟡/🟢 Launchd     [N] genuinely-broken user daemons (Apple -9/SIGKILL noise filtered out)
🟢 Processes  top hog: [name] [N]% CPU
🟢 Network    [iface] [ip] — [ok/degraded]
🟢 Disk       ~[N] GB safe reclaimable (biggest: [cache] [N] GB)
⚠ Health     [machealth result, or "probe timed out — TM/iCloud stuck"]

Next: /ops:mac fix to remediate, or pick one area.

Launchd noise filterlanchr doctor flags ~50+ "critical" entries; most are normal:

  • Apple on-demand agents exit -9 (SIGKILL) when idle — expected, not broken.
  • Stale Apple plist paths (cvmsCompAgent, BluetoothUIService, battery helper) — cosmetic.
  • The actionable ones are user/3rd-party daemons with exit status: 1 or a missing binary you own. Surface only those.

Remediation flow (/ops:mac fix)

Run the audit first to know what's wrong, then offer fixes. Per plugin Rule 5, every mutating action needs its own confirmation — never batch-execute. Present via AskUserQuestion, max 4 options each.

Common offenders and their guarded fixes:

1. Firewall — opt-in only, never offered

The application firewall is out of scope for /ops:mac fix. Report its state in the audit and stop there. Do not offer to enable it, do not add it to a fix menu, and do not list it as a recommendation — a firewall that comes on unasked breaks local listeners (dev servers, MCP proxies, VNC, tunnels) that the user did not connect the change to.

Touch it only when the user asks for the firewall by name in that turn ("turn the firewall on", "enable stealth mode"). Then confirm the single action and run:

sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
# stealth (optional): sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on

"Run /ops:mac fix" is not that request.

2. Stale / crashing launchd user daemons

For each actionable entry from lanchr doctor (missing binary, or repeated exit 1), confirm individually:

com.example.foo — binary missing at [path]. This launchd job is dead.
  [Show the plist first]  [Remove it]  [Disable (keep file)]  [Skip]

Use lanchr to remediate where possible; otherwise launchctl bootout/disable after showing the plist. Never touch a daemon the user relies on (CLIProxyAPI/haproxy, gbrain push, ops-daemon, cloudflared tunnels, watchdogs) without spelling out exactly what it is — cross-check before recommending removal.

3. Reclaimable disk

macbroom found ~[N] GB of safe cache. Categories: [list].
  [Clean safe caches]  [Pick categories]  [Review largest first]  [Skip]

On confirm (safe categories only):

macbroom clean --caches            # confirm prompt; or --yolo only after explicit approval

Never run macbroom clean --all --yolo without per-category approval.

4. App updates

${CLAUDE_PLUGIN_ROOT}/bin/ops-mac update    # updater check — then confirm before applying

After any fix, re-run the relevant probe and show before→after.

Mobile mode (Rule 7)

If $SSH_CONNECTION/$SSH_CLIENT/$SSH_TTY is set, $OPS_MOBILE=1, or $COLUMNS < 80: drop the boxes/tables, emit 3–8 plain lines, one fact each. Example:

mac audit:
security B/100 — firewall OFF.
launchd: 2 dead user daemons.
disk: 8.6 GB safe to clean.
health: machealth probe stuck (TM/iCloud).
fix? /ops:mac fix

When to use this vs other skills

Want… Use
macOS-native deep diagnose + fix (firewall, launchd, network, security) /ops:mac
Cross-platform cleaner (Linux/WSL/Windows too) /ops:speedup
Quick "is everything connected?" integration glance /ops:status
Full health check + auto-repair of the ops plugin itself /ops:doctor

Version History

  • 6f1e3e0 Current 2026-08-27 09:32

    优化 ops 工具链:延迟专家发现上下文,修复 bash 引导状态,重构文件读取以消除竞态条件,增强缺失能力索引时的错误处理与恢复机制,修正路由配置。

  • 5751870 2026-08-19 11:48
  • 64bad13 2026-08-12 09:01

Same Skill Collection

claude-ops/skills/boss/SKILL.md
claude-ops/skills/flow/SKILL.md
claude-ops/skills/humanizer/SKILL.md
claude-ops/skills/ledger/SKILL.md
claude-ops/skills/ops-accounts/SKILL.md
claude-ops/skills/ops-ar/SKILL.md
claude-ops/skills/ops-aws-audit/SKILL.md
claude-ops/skills/ops-comms/SKILL.md
claude-ops/skills/ops-competitors/SKILL.md
claude-ops/skills/ops-credentials/SKILL.md
claude-ops/skills/ops-daemon/SKILL.md
claude-ops/skills/ops-dash/SKILL.md
claude-ops/skills/ops-deploy-fix/SKILL.md
claude-ops/skills/ops-deploy/SKILL.md
claude-ops/skills/ops-desk/SKILL.md
claude-ops/skills/ops-desktop/SKILL.md
claude-ops/skills/ops-doctor/SKILL.md
claude-ops/skills/ops-ecom/SKILL.md
claude-ops/skills/ops-feature-dev/SKILL.md
claude-ops/skills/ops-fires/SKILL.md
claude-ops/skills/ops-fleet/SKILL.md
claude-ops/skills/ops-go/SKILL.md
claude-ops/skills/ops-gtm/SKILL.md
claude-ops/skills/ops-home/SKILL.md
claude-ops/skills/ops-inbox/SKILL.md
claude-ops/skills/ops-integrate/SKILL.md
claude-ops/skills/ops-leadgen/SKILL.md
claude-ops/skills/ops-linear/SKILL.md
claude-ops/skills/ops-marketing/SKILL.md
claude-ops/skills/ops-mcp/SKILL.md
claude-ops/skills/ops-merge/SKILL.md
claude-ops/skills/ops-monitor/SKILL.md
claude-ops/skills/ops-next/SKILL.md
claude-ops/skills/ops-orchestrate/SKILL.md
claude-ops/skills/ops-package/SKILL.md
claude-ops/skills/ops-pocket/SKILL.md
claude-ops/skills/ops-projects/SKILL.md
claude-ops/skills/ops-recap/SKILL.md
claude-ops/skills/ops-release/SKILL.md
claude-ops/skills/ops-resume/SKILL.md
claude-ops/skills/ops-revenue/SKILL.md
claude-ops/skills/ops-rotate-setup/SKILL.md
claude-ops/skills/ops-rotate/SKILL.md
claude-ops/skills/ops-rules/SKILL.md
claude-ops/skills/ops-secret-sync/SKILL.md
claude-ops/skills/ops-settings/SKILL.md
claude-ops/skills/ops-ship/SKILL.md
claude-ops/skills/ops-social-planner/SKILL.md
claude-ops/skills/ops-socials/SKILL.md

Metadata

Files
0
Version
4750a0e
Hash
119dce8f
Indexed
2026-08-12 09:01

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-31 10:39
浙ICP备14020137号-1 $bản đồ khách truy cập$