Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/Kihara777/NixKitsnpx agentmods add skills/kihara777/nixkits/nix-flake-update-checkWrote 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.
[](https://agentmods.dev/skills/kihara777/nixkits/nix-flake-update-check)<a href="https://agentmods.dev/skills/kihara777/nixkits/nix-flake-update-check"><img src="https://agentmods.dev/badge/skills/kihara777/nixkits/nix-flake-update-check/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.
<a href="https://agentmods.dev/skills/kihara777/nixkits/nix-flake-update-check"><img src="https://agentmods.dev/badge/skills/kihara777/nixkits/nix-flake-update-check.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00258 | $0.15117 |
| Opus 5.5 | $0.00103 | $0.06047 |
| Sonnet 5.5 | $0.00052 | $0.03023 |
| Haiku 4.5 | $0.00026 | $0.01512 |
Grade A, and why
nix-flake-update-check scanned grade A 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 15d 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
`gh` 与裸 `curl` 的关键差别是**失败时显式报错、非零退出**,不会静默返回空 How it starts
The opening of the file, as written. The whole thing — 839 lines — stays where its author put it; the contents beside it link to each section on GitHub.
nix flake 软件包更新检查(通用)
检查 nix flake 仓库中各软件包的上游发布更新并执行版本升级。
本技能只包含与仓库无关的通用方法。仓库特有的环节(文档同步、维护日志、 内置插件清单等)由仓库适配层提供——见文末「仓库适配层」。
本技能的文件构成
主流程在本文档;两份配套参考按需查阅,不必通读:
| 文件 | 内容 | 何时读 |
|---|---|---|
SKILL.md(本文) |
交互式澄清 + 第 0~9 步主流程 + 适配层契约 | 始终 |
builders.md |
按 builder 的 hash 更新流程、flake.lock 处置 |
第 4 步 |
traps.md |
nixpkgs 漂移陷阱、fail-closed 校验、外链审计、Actions 更新、补丁内版本 | 第 2 步末尾(Actions)与第 7 步自检命中时 |
交互式澄清:一次流程内解决所有待定项
在开始前先判断所运行的智能体是否支持交互式提问(如 DSH 提供
ask_user_question,可一次提出多个问题并等待用户选择)。支持就积极使用
——凡是不确定、有多种合理做法、或必须由用户拍板的事项,当场问,不要
先按自己的猜测执行完、再让用户在下一条消息里纠正。
为什么这条是强要求:软件更新是多决策点流程(升级策略、跨大版本取舍、 依赖冲突的解法、通道选择、是否部署)。若每个决策点都退化成「猜一次 → 被纠正 → 重来」,一次更新会膨胀成多轮往返,且每次重来都要重跑构建——而构建是 本流程最贵的环节(Rust/python 包动辄数十分钟)。把决策点前置到开始之前, 整个流程才可能一次跑完。
必须提问的情形
| 情形 | 为什么必须问 |
|---|---|
| 跨大版本升级(3.x → 4.x) | 可能含 breaking change、新的硬性要求,或需要用户接受行为变化 |
| 依赖冲突有两种以上合理解法 | 如「抬依赖版本」vs「跳过该包」vs「打补丁放宽校验」——代价与风险差别很大,且有的会破坏上游安全契约 |
| 需要新增 overlay / 补丁 / 额外 vendored 包 | 增加维护面,属结构性改动 |
| 构建时长或体积显著增加 | 用户可能宁愿暂缓 |
| 通道选择(stable / next / alpha) | 取决于用户想跟哪条线,技能无法推断 |
| 是否部署到运行中的系统 | 影响生产环境 |
| 发现的信息与文档记载冲突 | 可能是文档过时,也可能是现状异常,需用户判断 |
提问的写法
- 一次问全:把本轮所有待定项合并成一批提问,不要挤牙膏式地一问一等。
- 给出可选项与代价:每个选项写清影响(尤其「破坏上游契约」这类后果)。
- 给出推荐项并说明理由:把推荐项放第一位,标注「推荐」。
- 能自己查证的不要问:先查 release notes / 上游源码 / 构建报错, 把问题收敛到真正需要人决策的那几个。
不支持交互式提问时(如纯命令行 agent):把上述待定项汇总成一份清单 一次性输出,并说明每项的影响与推荐做法,然后停下等待——同样避免 「猜完再被纠正」的多轮往返。宁可一次问完,不要边做边猜。
与「先做完再汇报」的取舍
默认行为是自主推进,本技能是例外:因为更新流程的返工成本极高(重建代价), 提问的成本远低于猜测的错误成本。但只问真正需要决策的——机械步骤 (取 hash、改版本号、同步文档、记日志)自行完成,不要拿流程细节去打扰用户。
适用前提
- 仓库是 nix flake(根目录存在
flake.nix)。 - 包定义以独立
.nix文件形式存在,通常位于packages/(或其他目录), 由flake.nix经callPackage引用。 - 若仓库布局不同(如所有包写在单个
flake.nix、或位于nix/等目录), 以第 2 步的自动发现结果为准,不必强行套用目录名。
第 0 步:同步远端,并确认活跃 issue / PR
在做任何版本比对之前,先把本地与远端对齐,再读一遍仓库上已经被人报出来的 东西——未关闭的 issue 与 PR。
git fetch origin # 并行会话 / 压缩检查点可能让本地副本落后于 origin
git status -sb | head -1 # 当前分支,领先/落后多少
git log --oneline @{u}..HEAD # 本地尚未推送的提交——它们同样是「在途工作」
# 仓库坐标从 remote 推导,不要硬编码;无 remote 时显式指定 REPO="<owner>/<repo>"
REPO=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
gh issue list --repo "$REPO" --state open --limit 100 \
--json number,title,author,createdAt,labels
gh pr list --repo "$REPO" --state open --limit 100 \
--json number,title,author,createdAt,headRefName,isDraft
What ships with it
2 files 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.
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.
- 15d ago Changed · +32 lines 74e6a0b52434
- 16d ago Changed · +21 lines dde887db82e5
- 17d ago Changed · +8 lines 0ca72ce3bd7c
- 20d ago Changed · +1 lines 13d95b05b6d3
- 22d ago Changed · +39 lines 738390e33bc1
- 1mo ago Changed · +168 lines · +57 tokens per session 190238defc10
- 1mo ago Changed · +5 lines e88f07d76c85
- 1mo ago Changed · +102 lines b6974bf9f4e7
- 1mo ago Changed · -181 lines · +65 tokens per session 44fe76b6086d
- 1mo ago First seen · 644 lines · 136 tokens per session scan A f964b54c17ee
nix-flake-update-check is a skill published in the GitHub repository Kihara777/NixKits (28 stars, last pushed 2d ago), licensed MIT. It adds 258 tokens to every session and 15,117 once invoked, about $0.0010 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-17.
nix-flake-update-check compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| nix-flake-update-checkKihara777/NixKits | Skill | 28 | 2d ago | MIT | A | 258 | Claude Code, Codex |
| whyalyraffauf/hoenn | Skill | 235 | 1mo ago | GPL-3.0 | A | 89 | Claude Code, Codex |
| technical-writingalyraffauf/hoenn | Skill | 235 | 1mo ago | GPL-3.0 | A | 52 | Claude Code |
| unslopalyraffauf/hoenn | Skill | 235 | 1mo ago | GPL-3.0 | A | 14 | Claude Code, Codex |
| howalyraffauf/hoenn | Skill | 235 | 1mo ago | GPL-3.0 | A | 64 | Claude Code, Codex |
| quality-codealyraffauf/hoenn | Skill | 235 | 1mo ago | GPL-3.0 | A | 43 | Claude Code, Codex |
| teachalyraffauf/hoenn | Skill | 235 | 1mo ago | GPL-3.0 | A | 60 | Claude Code, Codex |