agent-self-maintenance

agent-self-maintenance is a skill for Claude Code, Codex from Kihara777/NixKits. It costs 87 tokens per session (1,432 once invoked), scanned A, original, MIT.

A set of checks for keeping an AI coding assistant's journal, facts, observations, and self-check results current and clearly supported by evidence.

In plain words
What is it for?
Use it to check journal updates after commits, review old records at session start, recheck dated facts, label evidence sources, and record self-check results.
Why use it?
Important maintenance work can silently stop, become outdated, or mix reported information with measured facts. These checks make missing or stale records visible.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to check journal updates after commits, review old records at session start, recheck dated facts, label evidence sources, and record self-check results.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kihara777/nixkits/agent-self-maintenance
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Kihara777/NixKits --skill agent-self-maintenance
Clone the repo
git clone --depth 1 https://github.com/Kihara777/NixKits

Made for: Claude Code, 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 agent-self-maintenance

README.md
[![agentmods](https://agentmods.dev/badge/skills/kihara777/nixkits/agent-self-maintenance/github.svg)](https://agentmods.dev/skills/kihara777/nixkits/agent-self-maintenance)
Your own site
<a href="https://agentmods.dev/skills/kihara777/nixkits/agent-self-maintenance"><img src="https://agentmods.dev/badge/skills/kihara777/nixkits/agent-self-maintenance/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 agent-self-maintenance

Your own site · 80×15
<a href="https://agentmods.dev/skills/kihara777/nixkits/agent-self-maintenance"><img src="https://agentmods.dev/badge/skills/kihara777/nixkits/agent-self-maintenance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,432 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.
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.00087 $0.01432
Opus 5.5 $0.00035 $0.00573
Sonnet 5.5 $0.00017 $0.00286
Haiku 4.5 $0.00009 $0.00143

Measured 3d ago against content hash 4e21f1f8bbdd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

agent-self-maintenance 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 3d 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.

skills/agent-self-maintenance/SKILL.md · 115 lines

How it starts

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

Agent 自我维护:五个会失败的小机制

为什么需要它们

一个会长期工作的 agent 最容易发生的不是「做错」,而是**「没人问」**:

  • 日记停在某一天,没人发现;
  • 自检红了三天,没人知道;
  • 事实库写着「上游已迁移」,而实际没有;
  • 「她说的」和「我量的」被混成一句结论。

这五件事的共同点:不做也不会报错。所以每个机制都必须有一个「会失败」的形态, 并且要能回答「谁在跑它」。

五个机制

1. 日记闸门(journal gate)

判据(两条,都从本 session 自己的事件日志读):

  • 做过事:本 session 里出现过 git commit;
  • 没记事:journal/<当日>.md 不存在或未被本 session 修改。

两条同时成立 → 收尾时提醒一次。是门,不是自觉。

边界:只在「有 journal 惯例的仓库」启用;没配置就安静——不要每个 session 都念 「你没写日记」,那会变成噪音,而噪音会被忽略。

2. 开局对账(journal catchup)

闸门有一个结构性缺口:它只在 session 里活着。没有 session 的工作(终端里改的、 定时任务动的)它看不见。所以开局要读一次账:

输入 要回答的问题
自检收据 上次自检是什么时候?红了哪几项?
日记 上次日记是哪天?之后有没有提交?
事实库 有没有过期的事实?(每条事实带日期)

三种状态不合并:ok / red / stale。「没跑过」必须说出来。

3. 事实核查(facts check)

事实库里的每一条都是活标本:带日期、带证据、带探针。

  • 探针:一条能重新量出该事实的命令;
  • 第三种状态:无法核验(探针跑不了)——它既不是通过也不是失败;
  • 抄来的与量到的分开记:source: upstream-doc vs source: measured。

4. 自我观察(inquiry)

每一条观察回答三个问题:

  1. 这是她说的(引用 + 时间)?
  2. 还是我量的(命令 + 输出)?
  3. 还是不确定(明确标注)?

条目必须带日期与证据。不要在一句话里混用两种来源。

5. 自检收据(selfcheck receipt)

自检脚本每跑一次写一份收据(时刻、rev、失败项)。判据有五种状态:

状态 含义
ok 刚跑过且全绿
red 跑过但有失败项
stale 太久没跑(阈值由仓库定)
missing 没有收据
unreadable 收据在但读不出来

只有 ok 是安静的;其余四种都要在开局说出来。

边界:机制搬走,数据留在原地

东西 归属
五个机制的判据与形态 技能 / 预设(可移植)
事实条目、观察条目、预算阈值、自检阈值 仓库自己的数据(不随机制搬)
收据文件(state/selfcheck.json) 仓库自己的产物(不进版本库)

为什么这条重要:机制是「怎么判断」,数据是「判断什么」。把数据随机制一起下放, 等于替使用者断言了他们的事实——而那些事实第二天就会过期。

适配层:本仓的东西写在本仓

通用层只写「机制长什么样」,具体落点属于各仓库自己的适配层。分法是一句话:

写在这里(通用) 写在适配层(各仓自己的)
判据的形态(「做过事」+「没记事」两条同时成立才提醒) 判据读哪个文件、用文件 mtime 还是 git commit
五种状态的语义(ok / red / stale / missing / unreadable) 阈值是多少、收据文件叫什么名字
「数据不随机制搬走」这条边界 事实库、观察库、预算各自放在哪

判据只有一句:换个仓库还成立吗? 成立写这里,不成立写适配层。

写成适配层时至少要说清三件事:实现文件在哪、谁在跑它、哪些数字必须现取 (写死的数字第二天就会变成假话)。找不到「谁在跑」那一栏,就先别写——那说明它还是 说明书,不是机制。

最小落地

不要求任何特定 harness。三个可移植形态:

  1. 钩子(harness 支持时):session 结束 / 开始时触发;
  2. 收尾命令:make check 或 scripts/maintain.sh 里串一遍;
  3. 纯人工 + 收据:至少让「没跑」留下痕迹。

Read the full file on GitHub · 115 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. 3d ago First seen · 115 lines · 87 tokens per session scan A 4e21f1f8bbdd

Subscribe to this mod's changes

agent-self-maintenance is a skill published in the GitHub repository Kihara777/NixKits (29 stars, last pushed yesterday), licensed MIT. It adds 87 tokens to every session and 1,432 once invoked, about $0.0003 per session on Opus 5.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-10-21.

Related

Other skills, from other repositories

Cortex

Operate Cortex, the LifeOS memory system — the typed Knowledge Archive (People, Companies, Ideas, Research with typed related: links) plus recall of prior work sessions, ISAs, and conversations. Search, add, harvest, develop, ingest, distill, graph-navigate, recall. USE WHEN cortex, knowledge, knowledge base, search…

danielmiessler/LifeOS · 196 tokens

wiki-dashboard

Create dynamic, queryable Obsidian dashboard views using Bases or Dataview. Use for auto-updating tables, indexes, or structured views of vault content; not for ordinary question answering.

Ar9av/obsidian-wiki · 42 tokens

Migrate

Intakes external content, classifies chunks against LifeOS taxonomy, commits with provenance. Sources: .md/.txt, stdin, LifeOS dirs, CLAUDE.md/Cursor/OpenAI Custom Instructions, Obsidian/Notion/Apple Notes exports. MigrateScan classifies → routing table. MigrateApprove with…

danielmiessler/LifeOS · 158 tokens

relevance-coarse-filter

Cheap, high-recall first-pass filter that removes obvious junk from a detector candidate pool before expensive story-origin research and PR judgment. Decides keep, monitoronly, or reject — never ranks, writes angles, verifies dates, or decides whether to pitch.

elvisun/newsjack · 57 tokens

session-compact

AI DevKit · Compact a historical AI coding session with Jev when context is long, work is handed off or resumed, or durable continuation facts and memory candidates need extraction.

codeaholicguy/ai-devkit · 39 tokens

company-brain

Your team's shared, AI-ready knowledge base — people, companies, meetings, SOPs, and decisions structured so an agent can answer on your team's behalf. Team-scope sibling to second-brain — personal notes go there, not here. Modes — capture, compile (wiki pages + INDEX.md), query (trust-weighted, saved to outputs/)…

coreyhaines31/makerskills · 230 tokens