ops-deploy-fix

OPS 按需:当用户要求“部署自动修复”、“部署失败”或相关事项时,应使用此技能。

仓库最近推送
GitHub Stars
564
Forks
64
Issues / PRs
6

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "ops-deploy-fix":https://skillpi.com/zh/skills/deepskill-2dbcfdfe9af0efaad9a8f9d9ac7fd085cb3f4902d07c3ba4704560e43c9dd145。安装前核对上游来源和版本:https://github.com/Lifecycle-Innovations-Limited/claude-ops。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

OPS 按需:当用户要求“部署自动修复”、“部署失败”或相关事项时,应使用此技能。

0 下载

介绍来源: third_party · Lifecycle-Innovations-Limited · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: ops-deploy-fix
description: "OPS on-demand: This skill should be used when the user asks to \"deploy auto-fix\", \"failed deploy\", or…"
argument-hint: '[status|tail|configure|test]'
allowed-tools:
  - Bash
  - Read
  - AskUserQuestion
  - Skill

/ops:deploy-fix — Auto-fix subsystem control surface

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).

This skill is the operator console for the post-merge + build-failure auto-fix loop installed by /ops:setup Step 6.5a. The underlying daemons, hooks, and prompts live in ${CLAUDE_PLUGIN_ROOT}/scripts/, ${CLAUDE_PLUGIN_ROOT}/hooks/, and ${CLAUDE_PLUGIN_ROOT}/prompts/. State lives in ~/.claude/state/ops-deploy-fix/. Logs live in ~/.claude/logs/ops-deploy-fix/.

Plugin rules apply (see claude-ops/CLAUDE.md). In particular:

  • Rule 0 — never echo personal data (slugs are fine, but redact tokens, webhooks, emails)
  • Rule 1 — max 4 options per AskUserQuestion
  • Rule 4 — background by default during configure
  • Rule 5 — destructive ops (clearing locks, wiping state) require explicit per-action confirmation
  • Rule 6 — this skill never sends outbound comms; if a future flow needs to, use the universal send gate

Arguments

The first positional argument selects the subcommand. If absent, present:

/ops:deploy-fix — what do you want to do?
  [status]
  [tail]
  [configure]
  [test]

Subcommands:

Subcommand Purpose
status Dashboard of recent monitor runs, fixer dispatches, locks, budget
tail Follow the latest fixer log live
configure Re-run the wizard from /ops:setup Step 6.5a
test Send a synthetic failure through the pipeline (dry-run, no real fix)

Subcommand: status

Print a compact dashboard. Read all data via Bash; favor parallel reads.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 OPS ► DEPLOY-FIX STATUS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 Master switch:    <on|off>          (deploy_fix_enabled)
 Auto-dispatch:    <on|off>          (auto_dispatch_fixer)
 Danger flag:      <on|off>          (allow_dangerous)
 Budget cap:       <N>/hour/repo     (max_fixes_per_hour)
 Notify channel:   <macos|ntfy|discord|none>
 Fix model:        <haiku|sonnet|opus>

 Last 5 monitor runs:
   2026-04-26T08:14Z  owner/repo-a:dev   merge-watch         deploy-success
   2026-04-26T08:11Z  owner/repo-b:main  build-watch         transient → rerun
   ...

 Last 5 fixer dispatches:
   2026-04-26T08:09Z  owner/repo-b:main  build-fix.md   in-flight   pid 41123
   2026-04-26T07:42Z  owner/repo-a:dev   deploy-fix.md  done        log:fix-...log

 Active locks:
   owner/repo-b:main:build  pid=41123 (alive)

 Hourly budget remaining (this hour, <YYYYMMDD-HH>):
   owner/repo-a   2 / 3
   owner/repo-b   1 / 3
──────────────────────────────────────────────────────

Data sources:

PREFS=~/.claude/plugins/data/ops-ops-marketplace/preferences.json
STATE=~/.claude/state/ops-deploy-fix
LOGS=~/.claude/logs/ops-deploy-fix

# Config snapshot (all keys read with defaults from plugin.json userConfig)
jq -r '{
  deploy_fix_enabled, auto_dispatch_fixer, allow_dangerous,
  max_fixes_per_hour, notify_channel, fix_model
}' "$PREFS" 2>/dev/null

# Monitor runs — last 5 across all repos
ls -t "$LOGS"/monitor-*.log 2>/dev/null | head -5 | while read f; do
  printf '%s  %s\n' "$(stat -f '%Sm' -t '%FT%RZ' "$f" 2>/dev/null || stat --format='%y' "$f" 2>/dev/null | awk '{print $1"T"$2"Z"}')" "$(basename "$f")"
done

# Fixer dispatches — last 5
ls -t "$LOGS"/fix-*.log 2>/dev/null | head -5 | while read f; do
  pid_file="$STATE/lock-$(basename "$f" | sed 's/^fix-//; s/-[0-9]*\.log$//')"
  status="done"
  [ -f "$pid_file" ] && kill -0 "$(cat "$pid_file")" 2>/dev/null && status="in-flight"
  printf '%s  %s  %s\n' "$(stat -f '%Sm' -t '%FT%RZ' "$f" 2>/dev/null || stat --format='%y' "$f" 2>/dev/null | awk '{print $1"T"$2"Z"}')" "$status" "$(basename "$f")"
done

# Active locks
for f in "$STATE"/lock-*; do
  [ -f "$f" ] || continue
  pid=$(cat "$f")
  if kill -0 "$pid" 2>/dev/null; then
    echo "$(basename "$f" | sed 's/^lock-//')  pid=$pid (alive)"
  fi
done

# Hourly budget — read all budget files for current hour
hour=$(date +%Y%m%d-%H)
cap=$(jq -r '.max_fixes_per_hour // 3' "$PREFS")
for f in "$STATE"/budget-*-"$hour"; do
  [ -f "$f" ] || continue
  slug=$(basename "$f" | sed "s/^budget-//; s/-$hour\$//")
  used=$(cat "$f")
  echo "$slug  $((cap - used)) / $cap"
done

After the dashboard, if any lock is older than the configured watcher_timeout_seconds, surface a ⚠️ Stale lock: line and offer:

Stale lock detected for <repo>. Action?
  [Inspect log]
  [Clear lock (Rule 5 — destructive)]
  [Leave it]
  [Skip]

Only on Clear lock should you delete the file (per-action confirmation per Rule 5).


Subcommand: tail

Tail the most-recent fixer log. Resolve via ls -t:

LATEST=$(ls -t ~/.claude/logs/ops-deploy-fix/fix-*.log 2>/dev/null | head -1)
if [ -z "$LATEST" ]; then
  echo "No fixer logs yet. Trigger one with /ops:deploy-fix test or wait for a real failure."
  exit 0
fi
echo "▸ Tailing $LATEST (Ctrl-C to stop)"
tail -f "$LATEST"

Run via Bash with run_in_background: true and a long timeout so the user can read the stream as it grows. Print the resolved log path and the spawned shell PID up-front so the user knows what's running.

If a second positional arg --lines N is passed, do tail -n N -f. If --no-follow, drop -f.


Subcommand: configure

Re-run the wizard from /ops:setup Step 6.5a, plus optionally 6.5b/c/d. Implementation: route into the setup skill with section filter.

Flow:

  1. Read current state from $PREFS_PATH. Print compact summary (same fields as status, no logs).
  2. Ask:
    What do you want to reconfigure?
      [Deploy auto-fix wizard (6.5a)]
      [Recap marquee (6.5b)]
      [Task* reminder (6.5c)]
      [Account rotation toggle (6.5d)]
  3. Execute the corresponding sub-flow inline by following Step 6.5 of skills/setup/SKILL.md — same questions, same persistence, same Rule-3 "never silently skip" semantics.
  4. After persistence, print:
    ✓ Reconfigured. Daemons & hooks pick up the new prefs on the next event — no restart required.

Use run_in_background: true (Rule 4) for any CLI install / brew / curl / tmux source-file triggered along the way.


Subcommand: test

Synthetic dry-run through the pipeline. No real fix dispatch — no agent runs. Confirms wiring: hooks fire → monitor classifies → notify channel pings → state files written → would-dispatch path logged.

Steps:

  1. Pre-flight check:

    PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-}"
    [ -z "$PLUGIN_ROOT" ] && PLUGIN_ROOT=$(find ~/.claude -type d -name claude-ops 2>/dev/null | head -1)
    COMMON="$PLUGIN_ROOT/scripts/lib/deploy-fix-common.sh"
    [ -f "$COMMON" ] || { echo "✗ deploy-fix-common.sh missing — re-install the plugin"; exit 1; }
  2. Ask:

    What should the synthetic failure look like?
      [Build failure (npm run build:* exit 1)]
      [Deploy workflow failure (gh actions check_run)]
      [Health check failure (curl /health 503)]
      [Version mismatch (served SHA != merged SHA)]
  3. Generate a fake event payload matching the chosen kind. Set env var OPS_DEPLOY_FIX_DRY_RUN=1 and invoke the relevant trigger script:

    export OPS_DEPLOY_FIX_DRY_RUN=1
    export OPS_DEPLOY_FIX_TEST_REPO="your-org/your-repo"   # placeholder per Rule 0
    export OPS_DEPLOY_FIX_TEST_BASE="dev"
    case "$kind" in
      build)   bash "$PLUGIN_ROOT/bin/ops-deploy-fix-build-trigger" --synthetic ;;
      deploy)  bash "$PLUGIN_ROOT/bin/ops-deploy-fix-merge-trigger" --synthetic ;;
      health)  bash "$PLUGIN_ROOT/scripts/ops-deploy-monitor.sh" --synthetic-health ;;
      version) bash "$PLUGIN_ROOT/scripts/ops-deploy-monitor.sh" --synthetic-version ;;
    esac

    Trigger scripts must honor OPS_DEPLOY_FIX_DRY_RUN=1 by:

    • Skipping the actual claude -p ... dispatch in dispatch_fix_agent
    • Writing a would-dispatch-<id>-<ts>.log to $LOGS_DIR instead
    • Still incrementing the budget counter (so the test exercises the cap)
    • Logging [DRY-RUN] would notify <channel> instead of firing real notify (no actual outbound messages during test — Rule 6)

    _If the trigger scripts don't yet support --synthetic / OPS_DEPLOY_FIX_DRY_RUN, surface that as a known TODO in the output and degrade to "would-have-dispatched" log-only._

  4. Print the resulting would-dispatch-*.log path and a one-line classification result (transient? dedup-hit? budget-exhausted? would-dispatch-template=<file>).

  5. Offer:

    Test complete. Next?
      [Tail the would-dispatch log]
      [Run another test]
      [Show status dashboard]
      [Done]

Failure modes / hand-offs

  • No prefs file → tell the user to run /ops:setup (or /ops:deploy-fix configure) first.
  • claude CLI missing (status / test) → instruct via output, do not auto-install.
  • jq missing → run brew install jq in background (Rule 4) and retry.
  • Stale lock detection → see status flow above, requires Rule-5 confirmation to clear.
  • Notify channel mis-set (e.g. discord selected but no webhook) → on status, surface as ⚠️ notify_channel=discord but no webhook URL configured and offer [Reconfigure now].

Files this skill reads / writes

  • Read-only: ~/.claude/plugins/data/ops-ops-marketplace/preferences.json, ~/.claude/state/ops-deploy-fix/*, ~/.claude/logs/ops-deploy-fix/*, ${CLAUDE_PLUGIN_ROOT}/scripts/lib/deploy-fix-common.sh, ${CLAUDE_PLUGIN_ROOT}/prompts/{build-fix,deploy-fix}.md
  • Write (with explicit confirmation only): lock files in ~/.claude/state/ops-deploy-fix/lock-* (clear on stale)
  • Write (via configure subcommand): the prefs file, via the merge pattern in Step 6.5

版本历史

  1. v3.12.1 GitHub ↗
    原版更新说明

    ### Fixed - ops-task-reminder: the portable lock now runs the whole counter transaction under a real fcntl.flock, so one worker can no longer remove another's fresh lock and lose counter updates.

  2. v3.12.0 GitHub ↗
    原版更新说明

    ### Changed Add /ops:ops-mix and evidence-only A&R mix-evidence mode using the configured Mixforge engine.

  3. v3.11.0 GitHub ↗
    原版更新说明

    ### Changed Release safety, maintenance and inbox fixes from #1033: passive daemon monitoring, timezone-safe AWS audit dates, fail-closed release merge gates (same-head CI, Copilot review, resolved threads), progressive inbox with attachment and archive read-back proofs, and gate-only outbound wording in ops-desk and ops-leadgen.

  4. v3.10.29 GitHub ↗
    原版更新说明

    ### Fixed - `ops-speedup --clean` stays under 60s: on macOS it skips the slow login-items query (#1036); on Linux it skips the unused disk-reclaim scan and keeps the page cache unless `--aggressive` is set (#1035). - `ops-inbox` shows validated drafts as soon as each one is ready instead of after the whole scan (#1031). ### Changed - Hooks `ops-pretool-skill-update` and `ops-task-reminder` run async; the reminder takes a per-session lock so concurrent runs no longer lose counts, and it now also resets on Task* tools (#1032).

  5. v3.10.28 GitHub ↗
    原版更新说明

    ### Changed ops-ar: Cyanite schema drift (fileUploadRequest id, ID! upload var), real auth test via libraryTracks, webhook must verify HMAC-SHA512 Signature, bpmRangeAdjusted vs bpmPrediction, Soundcharts app-id/key pairing.

此处仅展示最近 5 个版本。 在原站查看完整版本历史 ↗

当前收录版本

0.0.1

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值78/100

亮点

  • 解决明确的运维痛点:部署失败自动修复系统控制台
  • 提供完整的监控、日志、配置、测试闭环功能
  • 面向开发者/运维垂直场景,实用性强
触发精准88/100

亮点

  • 触发词精准完整:'deploy auto-fix', 'failed deploy' 等
  • argument-hint 提供清晰的子命令提示 [status|tail|configure|test]
  • 边界清晰,不易误触
结构规范92/100

待提升项

  • description 重复 原报告严重程度:轻微

    顶层 frontmatter 和 skill_body 内部均包含 description 字段

    改进建议:建议移除 skill_body 内部的 description 字段,保持唯一性

亮点

  • Phase/步骤清晰:四个子命令(status/tail/configure/test)分工明确
  • 每个子命令有详细实现逻辑和出口条件
  • 包含端到端示例(如 status 的完整 dashboard 输出)
  • frontmatter 完整,单文件长度合理
执行可靠90/100

亮点

  • 工具来源明确,参数正确,路径规范
  • 覆盖主要异常:jq 缺失自动安装、stale lock 检测、notify channel 配置检查
  • 不可逆操作(clear lock)有显式确认机制(Rule 5)
  • dry-run 模式防止测试时误操作
证据可验 (前四项均值)87/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

  • 安装或获取外部依赖

    使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。

    主文档提及 · 第 251 行

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。