Flowness: Skill for Claude Code

.claude/skills/downtime-recovery/SKILL.md

downtime-recovery is a skill for Claude Code from Towow-ai/Flowness. It costs 157 tokens per session (2,672 once invoked), scanned A, original, Apache-2.0.

A recovery procedure for restarting background services after downtime. It measures delayed work, stale locks, running processes, resource usage, and code versions before bringing services back online.

In plain words
What is it for?
Use it to survey a stopped system, decide how to handle queued work, restart services one at a time, check system health, and identify processes that need the updated code.
Why use it?
It reduces the risk that a large backlog will overload the machine or that old processes will keep running outdated code.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is Towow-ai/Flowness's own configuration. It tells Claude Code how to work on Flowness 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 Flowness configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 .claude/downtime-recovery/survey.py # 人读(从仓库根运行).

Reuse

Borrowing it

Nothing to install: this file belongs to Towow-ai/Flowness. 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/Towow-ai/Flowness/main/.claude/skills/downtime-recovery/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/Towow-ai/Flowness

Made for: Claude Code.

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 downtime-recovery

README.md
[![agentmods](https://agentmods.dev/badge/skills/towow-ai/flowness/downtime-recovery/github.svg)](https://agentmods.dev/skills/towow-ai/flowness/downtime-recovery)
Your own site
<a href="https://agentmods.dev/skills/towow-ai/flowness/downtime-recovery"><img src="https://agentmods.dev/badge/skills/towow-ai/flowness/downtime-recovery/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 downtime-recovery

Your own site · 80×15
<a href="https://agentmods.dev/skills/towow-ai/flowness/downtime-recovery"><img src="https://agentmods.dev/badge/skills/towow-ai/flowness/downtime-recovery.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 157 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,672 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Rogue Agent · line 16
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
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.00157 $0.02672
Opus 5 $0.00078 $0.01336
Sonnet 5 $0.00031 $0.00534
Haiku 4.5 $0.00016 $0.00267

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

Security

Grade A, and why

downtime-recovery scanned grade A with 0 findings 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 12d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/downtime-recovery/SKILL.md · 91 lines

How it starts

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

停机复工(downtime-recovery)

我是谁

我是停机与复工之间的那道闸。系统停机(daemon 停摆/冲刺减负/事故)期间,账本还在被活跃会话写入、任务还在完工、升级还在堆积——停机不是暂停,是欠债。我的职责是:复工时先把债盘清楚,再按安全顺序泄流,让每个服务"温和接管"而不是"积压喷发"。

我相信什么

重启不是恢复,是一次放大器。 停机越久,水位线落得越远;直接重启,daemon 会把整段积压一口气处理掉——并发派发、并发抢锁、并发起会话,停机多久就炸多大(实锤:落后 3240 条 → load 22+ 秒炸;现在见过落后 22 万条的)。

先测量,后动手。 复工的第一动作永远是跑盘点(只读、零副作用),不是 launchctl load。不知道欠了多少债就还债,是赌博。

一次一个,动完核实。 每启动一个服务,先确认它的行为正常(日志/内存/负载)再动下一个。资源门看真信号:memory_pressure 等级 = normal 且换页速率 ≈0 且 load < 核数×1.5 才继续;不达标就停下等,不硬上。(macOS 的"空闲内存 MB"和 swap 占用量都是误导指标,别拿它们做依据——2026-07-05 内存诊断的教训。)

积压的处理是决策,不是默认。 22 万条积压里多数派发早已过期(对应任务可能已被别人做完)。"补派积压"还是"快进放弃、只管新事件",是要看着报告做的判断——常常值得派一个排序 agent 专门研究,偶尔需要 owner 拍板(放弃积压=有任务永不被自动派发,属范围决定)。

修好的代码不会自动进正在跑的旧进程。(2026-07-04 教训)性能修复合并后,停机前启动的常驻进程内存里还是旧代码——复工清单必须包含"识别在跑旧代码的进程并重启之",否则修了白修。

怎么做(六步 SOP)

第 1 步 · 盘点(只读)

python3 .claude/downtime-recovery/survey.py          # 人读(从仓库根运行)
python3 .claude/downtime-recovery/survey.py --json   # 喂排序 agent(从仓库根运行)

产出六组数字:A 各水位线落后量 / B 积压队列 / C 服务实况 vs 登记态 / D 卫生(stale 锁、死 pid 持有 commit.lock)/ E 在跑旧代码的进程 / F 当前资源水位。

(登记:survey.py 是单点脚本——只 track 在仓库根 .claude/downtime-recovery/,不随任何 skill 部署面分发;本 SKILL 三面与 RUNNING-SERVICES.md 顶部指针都指这同一个绝对路径。要挪它必须所有指针同改,owner 选向之前只登记、不挪。)

第 2 步 · 分诊排序(默认派 agent)

--json 报告喂给一个排序 agent(Sonnet 够用),让它交回:安全复工顺序 + 每步理由 + 每步的验证方式 + 需要 owner 拍板的点。派发信要点:报告全文 + 本 SKILL 的硬规则 + RUNNING-SERVICES.md 各服务登记(暂停原因/恢复命令/踩坑记录,尤其 §4 orchestrator 的 2026-07-04 积压喷发记录)。积压小(各水位线 behind < 几百、队列个位数)时可弃权自己排,但弃权留账:在第 6 步的复工记录里写明理由与当时的积压数字(埋掉的是一个独立的排序视角)。

第 3 步 · 卫生先行(低风险、腾地方)

  • 死 pid 文件:python 内部 unlink(先 ps 验证进程真死;绝不用 shell rm 碰 .towow 路径——guard 会拦且拦得对)。
  • stale 会话锁:用 ./tw plan/goal reap-stale-session 系列(vitality 裁决),不手删。
  • commit.lock 被死进程持有:新提交会经"诚实 holder 探测"(commit 50555a102)识破,一般无需手动;若探测未上线到在跑进程,按 RUNNING-SERVICES 处置。
  • 在跑旧代码的进程(报告 E 组):逐个按其登记的停/起方式重启(launchd 的 kickstart -k;非 launchd 的按登记命令)。

第 4 步 · 水位线决策(本 SOP 的核心判断)

⚠ 先记住一个代码实锤(orchestrator.py 主循环的 E.5 安全暂停块,搜 is_orchestrator_paused):paused 状态下 daemon 不 scan、不派发、也不推进水位线,纯 idle——不存在"暂停着慢慢追平"这条路。真实可走的是:

Read the full file on GitHub · 91 lines

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. 12d ago First seen · 91 lines · 157 tokens per session scan A f1034b33295e

Subscribe to this mod's changes

downtime-recovery is a skill published in the GitHub repository Towow-ai/Flowness (102 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 157 tokens to every session and 2,672 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.