Agent skill

Learn From History Audit

by KonghaYao in KonghaYao/peri

Audits recent agent conversation history and turns repeated failures and successes into testable harness improvement proposals that later audits can check.

Apache-2.0Auto-check passedAgent Workflows

SKILL.md written in Chinese; this summary is our English description.

Install Learn From History Audit

skills CLI
$ npx skills add KonghaYao/peri --skill learn-from-history -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install KonghaYao/peri learn-from-history --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/KonghaYao/peri.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/learn-from-history .claude/skills/learn-from-history && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
learn-from-history
GitHub stars
229
Token cost
~3.5k tokens
SKILL.md length
764 words
Files
7 (incl. scripts, references)
Skills in repo
19
Repo updated
First seen
Licence
Apache-2.0

At a glance

Audits recent agent conversation history and turns repeated failures and successes into testable harness improvement proposals that later audits can check.

  • Works in 10 steps: 核对当前仓库的入口、产物位置与授权 → 创建 snapshot run → 检查 manifest → …
  • Reviewing how your coding agent performed over the past week
  • SKILL.md covers 事实源, 流程 and 失败处理
  • Runs Python scripts from its folder; calls python3

What it does

History learning is treated as an observable improvement loop. Inputs are fixed, evidence is drilled into in layers, the narrowest change surface is located, and each suggestion states a predicted benefit and a regression risk to be checked against later history. By default the audit covers the last 7 calendar days of the current project, including today, never crosses projects unless you ask for `--all`, and only reports unless you have clearly authorized applying changes or committing. The method follows three layers of observability: components, experience and decisions.

`scripts/run_history.py` takes a snapshot of the conversation database, creates a private run folder under `/tmp/learn-from-history/` and writes a `manifest.json` whose status must be ready or empty, and any failed day aborts the run. The agent inspects the manifest for scope, thread and message counts, truncations and parse failures, and spot-checks threads, since zero parse failures does not prove the content is complete. `extract_daily.py` and `validate_run.py` handle extraction and validation, reports follow `references/analysis-template.md`, and a JSON ledger under `spec/reviews/` tracks decisions across runs where that folder is allowed. The SKILL.md is written in Chinese.

When your agent uses it

  • Reviewing how your coding agent performed over the past week
  • Finding repeated failure patterns that a rule or script could prevent
  • Checking whether an earlier harness change actually helped

Example prompts

  • “Audit the last week of agent conversations and tell me the top repeated failures.”
  • “Learn from history for this project and propose changes with expected benefit and risk.”
  • “Check whether the rule we added after the last audit reduced those failures.”

Requirements

  • Python 3 to run the scripts
  • Access to the agent's local conversation history

Workflow steps

10 steps, taken from the step headings in SKILL.md.

  1. 核对当前仓库的入口、产物位置与授权
  2. 创建 snapshot run
  3. 检查 manifest
  4. 执行分析单元
  5. 机器校验经验层
  6. 归因上轮决策
  7. 聚合、去重与组件归属
  8. 生成报告与 decision manifest
  9. 按已有授权编辑
  10. 清理敏感输入

What it can do on your machine

Read from SKILL.md and the folder at commit 6da603f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 4 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • arxiv.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Learn From History Audit loads about 3.5k tokens when it runs, and up to ~4.1k if it reads all its reference files. Until then it costs about 28 tokens; SKILL.md has 764 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~28
When it runs · the whole SKILL.md, loaded when a task matches
~3.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from KonghaYao/peri at commit 6da603f, republished under its Apache-2.0 licence (© KonghaYao). 764 words, ~3,533 tokens.

Download SKILL.mdSave it as .claude/skills/learn-from-history/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
learn-from-history
description
审计近期对话历史,把重复失败与成功模式转成可证伪的 harness 改进契约,并在后续审计中归因。 用户要求总结历史对话、回顾近期 agent 表现、从历史中学习或寻找可自动化改进时使用。

Learn From History

把历史学习当成一个可观测改进环,而不是经验摘抄:固定输入,分层下钻证据,定位最窄变更面,为每项建议同时声明预测收益与回归风险,再由后续历史验证。

默认审计当前项目最近 7 个自然日期(含今天),不跨项目。默认只报告;用户已明确要求应用建议或提交时,按其授权范围完成,不重复确认。报告和 decision manifest 本身不扩大编辑、回滚或发布权限。

本流程采用 Agentic Harness Engineering 的三层可观测思想,并适配为有人确认的项目审计:

  1. 组件可观测:每个失败模式只归属一个首选变更面;
  2. 经验可观测:最终概览可下钻到 unit finding,再到固定 snapshot 的原始 thread;
  3. 决策可观测:每个变更建议都是带收益预测、回归风险和验收条件的可证伪契约。

事实源

  • 运行编排与 unit prompt:scripts/run_history.py
  • 提取逻辑:scripts/extract_daily.py
  • run 与 decision manifest 校验:scripts/validate_run.py
  • unit 报告格式:references/analysis-template.md
  • 跨轮决策账本:spec/reviews/history-learn-YYYY-MM-DD.json

extract_range.py 仅保留手工范围导出的兼容用途,不是主路径。

流程

0. 核对当前仓库的入口、产物位置与授权

先读根指引和 docs/standards/documentation.md。本仓库的维护入口是本文件及相邻 scripts/;其他安装目录中的旧副本不能替代受版本控制的实现。显式保留本轮用户要求的日期、项目、更新范围与提交授权,交接后从原始请求核对,不让压缩摘要重新解释权限。

本仓库按 DOC-HISTORY-001 / DOC-LINK-001 禁止重建 spec/reviews/,因此使用临时报告模式:报告与变更/验收记录写到本次 run 目录,稳定结论更新对应事实源;完整过程不进入仓库。该模式执行步骤 1–4、6 和已授权的编辑,使用 run validator 验证输入覆盖;步骤 5 和步骤 7 的持久 decision ledger 分支不适用,不声称通过 decision ledger 校验或形成跨轮因果归因。完成后按步骤 9 的临时模式清理输入。后文的 spec/reviews/ 账本协议仅用于明确允许该目录的仓库,不能借技能恢复已废弃目录。

1. 创建 snapshot run

从环境中的 Working directory 取得项目根,显式传入 --cwd:

bash
python3 .claude/skills/learn-from-history/scripts/run_history.py \
  --days 7 \
  --cwd <工作目录>

只有用户明确要求跨项目时才使用 --all:

bash
python3 .claude/skills/learn-from-history/scripts/run_history.py --days 7 --all

脚本创建权限为 0700 的唯一目录:

text
/tmp/learn-from-history/<run_id>/
  manifest.json
  snapshot/threads.db
  extracted/<day>/*.txt
  prompts/unit-NNN.txt
  summaries/

它通过 SQLite backup 固定本次审计的数据边界,提取物权限为 0600。manifest.json 是本次运行的唯一输入清单,记录 snapshot digest、repository_root、日期、thread、消息数、输入 digest、降级统计和分析单元。

完成标准:命令 exit 0,manifest status=ready 或 status=empty。任一日期失败时命令必须 exit 非零;不得分析部分成功结果。empty 时报告近期无记录并结束。

2. 检查 manifest

Read manifest.json,核对:

  • project_filter 或 all_projects 与用户范围一致;
  • window.active_days、totals.thread_count、totals.message_count;
  • totals.truncations 与 totals.parse_failures;
  • 每个 unit 的输入、消息数、prompt、summary 和 sidecar 路径。

再试读窗口两端及不同消息格式的 thread:有消息计数却只有空白正文、工具调用消失或系统提醒被当成用户原话时,先检查提取器与持久化协议。parse_failures=0 不单独证明内容完整。格式契约以 peri-acp-types/src/store.rs 和 messages/ 为准;修改提取器须用 legacy/V1 的真实 SQLite 往返、工具配对与损坏输入回归验证,不只测 JSON helper。修复后从同一 snapshot 补提取,记录旧/新 manifest 与 extractor digest,重审变化的输入;不得沿用旧 digest 或旧行号宣称完成。

本流程按 thread 的 updated_at 日期归档完整 thread,不按消息切断因果链。报告中写清该语义。

不要扫描 run 目录猜测输入,也不要读取其他 run 的同名文件。

3. 执行分析单元

每个 unit 的完整任务已经写入 prompts/unit-NNN.txt。派发 general-purpose agent 时,把该 prompt 文件内容作为任务;子 agent 自己直接 Read/Write,不得再次调用 Agent,不得修改仓库。

调度规则:

  • 1 个 unit:同步执行;
  • 2 个以上独立 unit:可后台并行,无固定并发上限;
  • unit 较多时:分批启动,当前批次全部收到终态后再启动下一批;
  • agent 失败时优先 resume 原 child thread,不创建重复任务;
  • background 的 started/completed 通知不是通过证据,不轮询未完成结果。

单元按 thread 文件大小和数量规划,不机械按天切分;大日期可拆成多个 unit,小日期可合并。每个 agent 必须同时写:

  • summaries/unit-NNN.md:thread 结果和跨 thread finding;
  • summaries/unit-NNN.json:status=analyzed、输入 digest、覆盖数、finding 契约和降级复核。

优先比较相同或相近意图中的成功/失败轨迹,找出分歧点;它比单独阅读失败更能区分能力缺口、随机执行偏差和 harness 缺陷。每条 finding 的证据与反证必须写成:

text
extracted/<day>/<thread>.txt :: <可定位摘录或事件>

原始 thread 是证据层,不是默认阅读入口;先读 unit finding,主张不足时再下钻。输入中有 [TRUNCATED ...] 或 [MESSAGE_PARSE_FAILED] 时,必须人工评估该 thread 是否仍足够支撑 finding,并在 degraded_inputs_reviewed 登记;证据不足则写入 blocked,不得外推。

4. 机器校验经验层

所有 unit 终态后运行:

bash
python3 .claude/skills/learn-from-history/scripts/validate_run.py \
  /tmp/learn-from-history/<run_id>

validator 检查:

  • summary 非空且不是 null;
  • sidecar unit ID、status=analyzed、thread 数和消息数;
  • 输入文件集合与 manifest 完全相等,digest 未变化;
  • 降级输入已显式复核,没有 blocked 输入或 extraction failure;
  • finding 含 classification、failure pattern、root cause、可下钻 evidence/counterevidence、带分母 frequency、impact、confidence、fact source;
  • finding 已选择 target surface,解释归属,并声明 predicted fixes、risk regressions 与 acceptance。

完成标准:命令 exit 0 且 validation.json 为 passed;其 attestation 记录本次实际读取的 manifest digest 与完整 sidecar {unit_id, path, sha256} 集合,供同日 decision ledger 复写并在后续审计中三方核对。失败 unit 优先 resume;校验通过前不得汇总或宣称完成。

5. 归因上轮决策

在汇总新建议前,按日期读取当前项目 spec/reviews/ 中相关的 history-learn-*.json。只处理 status=implemented、含实施验证,且未被任何更新账本给出经保留的 validation.json、manifest digest 和 unit sidecar 共同证明的 keep | revert 终局 verdict 的变更;自报或已丢失 run 证据的终局不生效,improve 与 inconclusive 保持待观察。

对每个 prior change:

  1. 将 predicted_fixes 与本轮观察到的改善逐项对照;
  2. 主动检查 risk_regressions,并从旧有成功模式中选择至少一个 preserved-success probe;
  3. 区分“改动后发生”与“由改动导致”;没有同类对照、明确分歧点或独立验收时,不声称因果;
  4. 给出 keep | improve | revert | inconclusive | not_implemented verdict;
  5. revert 只是建议,仍需用户确认,且必须说明恢复范围与保留哪些有效部分。

历史窗口未覆盖实施前基线、相关场景未再次出现、运行环境或模型改变时,verdict 必须是 inconclusive,不能用“未再出现失败”冒充修复成功。

6. 聚合、去重与组件归属

只读取当前 manifest 列出的 unit summary/sidecar。每条 finding 先分类:

  • rule_gap:真实稳定规则缺口;
  • active_issue_covered:已有 active issue,禁止复制事故叙事;
  • skill_gap:现有 skill 缺指引或触发失败;
  • execution_deviation:规则已覆盖但未遵循;
  • external_blocker:环境、权限、provider 或平台阻塞。

再读取当前项目根路由和 finding 所需的最小事实源:

  • 根 CLAUDE.md:判断项目哲学与路由,不复制工程细则或事故叙事;
  • docs/standards/ 与测试 canonical standard:稳定规则;
  • 对应模块 CLAUDE.md:模块入口和专属不变量;
  • spec/issues/:active change、事故验收和具体产品风险;
  • spec/global/problems.md:历史索引;
  • DiscoverSkillsTool:当前 skill catalog。

按最窄有效层选择一个首选 target surface:

失败根因首选面
稳定工程约束缺失standard 或 module guidance
产品行为/架构缺陷active issue,再落到 implementation + test
可复用但按需触发的工作流缺失skill
工具说明或 schema 让模型误用现有能力tool description
工具能力、错误恢复或输出形态不足tool implementation
需要跨步骤观察、拦截或完成门middleware
需要隔离上下文或专门角色处理独立子任务subagent
多轮重复出现且跨任务稳定的边界经验memory
参数/注册/权限装配错误configuration
已有规则未执行,且无结构性缺口none;记录 execution deviation
外部平台或权限阻塞external

不要默认把所有教训塞进 prompt、规则或本 skill。论文消融显示组件收益不相加,重复约束会增加冗余检查;若多个候选面表达同一防线,只保留执行力最强且副作用最小的一层,其他层仅在有独立证据时补充。

只有多次证据、影响明确且存在事实源缺口时才建议新稳定规则;单次事件默认不制度化。若可观测,记录消息数、重复工具调用、错误重试或耗时等效率代理,但不能以“更短”替代任务正确性。

Show full SKILL.md (348 more words)Show less
7. 生成报告与 decision manifest

临时报告模式:写入本次 run 的 findings.md 与 changes.json,记录范围、证据/反证、已有覆盖、采用或未采用的建议、目标与保留行为的验收及实际结果。引用已通过 run validator 的 unit sidecar;不传 --decision-manifest,不把这份临时记录称为已认证的跨轮账本。没有可核对的旧账本时,旧建议的效果为 inconclusive。随后按已有授权进入步骤 8。

持久账本模式(仅允许 spec/reviews/ 的仓库):

写入同日配对产物:

text
spec/reviews/history-learn-YYYY-MM-DD.md
spec/reviews/history-learn-YYYY-MM-DD.json

Markdown 报告至少包含:

  1. snapshot 截止时间、项目过滤和“按 thread updated_at 归日”语义;
  2. 日期、thread、消息、unit、截断和解析失败统计;
  3. prior change attribution 与 verdict;
  4. finding 的根因、可下钻证据/反证、频次、影响、置信度与事实源;
  5. 稳定规则候选、skill 候选、已有覆盖、成功模式;
  6. validation 结果和 blocked 项;
  7. 结构化 change plan。

JSON 是决策账本,至少包含:

json
{
  "version": 1,
  "run_id": "<snapshot run id>",
  "source_run_dir": "/tmp/learn-from-history/<run_id>",
  "source_manifest_sha256": "<manifest.json sha256>",
  "source_sidecars": [
    {
      "unit_id": "unit-NNN",
      "path": "summaries/unit-NNN.json",
      "sha256": "<sidecar sha256>"
    }
  ],
  "project_filter": "<project root or null>",
  "prior_attribution": [
    {
      "source": "spec/reviews/history-learn-YYYY-MM-DD.json",
      "change_id": "CHG-001",
      "verdict": "keep|improve|revert|inconclusive|not_implemented",
      "rationale": "<为何该证据支持此 verdict;区分时序相关与因果>",
      "observed_fixes": [
        {
          "source_finding": "unit-NNN/F-NNN",
          "source_run_id": "<本轮 snapshot run id>",
          "source_manifest_sha256": "<本轮 manifest.json sha256>",
          "finding_contract": {
            "id": "F-NNN",
            "classification": "<本轮 finding classification>",
            "failure_pattern": "<本轮 finding failure_pattern>",
            "root_cause": "<本轮 finding root_cause>",
            "target_surface": "<本轮 finding target_surface>",
            "predicted_fixes": [],
            "risk_regressions": [],
            "acceptance": {"target": [], "preserved_success": []}
          },
          "finding_digest": "<finding_contract 的规范 SHA-256>",
          "prior_contract": "<旧 change.predicted_fixes 中的原文>",
          "outcome": "fixed|improved|unchanged|regressed|not_observed",
          "observed_delta": "<本轮观察到的脱敏变化>"
        }
      ],
      "observed_regressions": [
        {
          "source_finding": "unit-NNN/F-NNN",
          "source_run_id": "<本轮 snapshot run id>",
          "source_manifest_sha256": "<本轮 manifest.json sha256>",
          "finding_contract": {
            "id": "F-NNN",
            "classification": "<本轮 finding classification>",
            "failure_pattern": "<本轮 finding failure_pattern>",
            "root_cause": "<本轮 finding root_cause>",
            "target_surface": "<本轮 finding target_surface>",
            "predicted_fixes": [],
            "risk_regressions": [],
            "acceptance": {"target": [], "preserved_success": []}
          },
          "finding_digest": "<finding_contract 的规范 SHA-256>",
          "prior_contract": "<旧 change.risk_regressions 中的原文>",
          "outcome": "fixed|improved|unchanged|regressed|not_observed",
          "observed_delta": "<本轮观察到的脱敏变化>"
        }
      ]
    }
  ],
  "changes": [
    {
      "id": "CHG-001",
      "status": "proposed|implemented|blocked",
      "source_findings": ["unit-NNN/F-NNN"],
      "classification": "skill_gap",
      "failure_pattern": "<observable pattern>",
      "root_cause": "<causal hypothesis>",
      "baseline": "<当前 snapshot 中脱敏的发生率、成功率或具体现状>",
      "target_surface": "skill",
      "files": ["<repository-relative path>"],
      "why_this_surface": "<component choice>",
      "predicted_fixes": ["<next-run observable outcome>"],
      "risk_regressions": ["<preserved behavior at risk>"],
      "acceptance": {
        "target": ["<target check>"],
        "preserved_success": ["<preserved-success check>"]
      },
      "verification": []
    }
  ]
}

一个 logical change 对应一个 entry;不要把跨组件“大改造”打包成不可归因的一项。baseline 必须保留当前 snapshot 中脱敏、可比较的发生率或具体现状,因为 /tmp 原始输入清理后它是下轮归因的参照。source_sidecars 必须逐项复制本轮 validation.json.attestation.sidecars,与 source_manifest_sha256 一起把 canonical repository ledger 绑定到实际通过校验的 unit sidecar;旧 ledger 缺此字段时历史终局 fail closed,但该 change 仍可在新账本中重新归因。change 的 classification、target_surface 与 acceptance 不能脱离所引用 finding;可以追加检查,但不能省略 finding 已声明的检查。acceptance.target 与 acceptance.preserved_success 各至少一项,按折叠空白后的文本全局唯一。proposed 时 verification 为空;实施后每个 acceptance 恰好对应一个 {check, command, status, result},且全部为 passed。prior attribution 的 observation 必须同时绑定当前 source_finding、本轮 run/manifest、finding_contract 及其规范 digest、旧 change 中逐字匹配的 prior_contract、受限 outcome 和本轮 observed_delta;finding_contract 取 validator 定义的核心 finding 字段。keep 至少需要 fixed|improved 且不能有 regressed,revert 至少需要 regression observation 的 regressed 且不能同时声称修复。不能用无关 finding 与自由文本拼出强 verdict。建议必须列出至少一个预测修复、一个回归风险或明确的 no-risk 理由,以及目标验收和 preserved-success 验收。报告和 JSON 都必须脱敏,不复制凭据、认证头、完整用户数据或本机私密配置。

生成后运行:

bash
python3 .claude/skills/learn-from-history/scripts/validate_run.py \
  /tmp/learn-from-history/<run_id> \
  --decision-manifest spec/reviews/history-learn-YYYY-MM-DD.json

如果校验的是旧 v1 --all run,manifest 可能没有 repository_root 且 project_filter=null;此时必须显式绑定账本所属仓库,不能从 decision 路径静默推断:

bash
python3 .claude/skills/learn-from-history/scripts/validate_run.py \
  /tmp/learn-from-history/<run_id> \
  --decision-manifest spec/reviews/history-learn-YYYY-MM-DD.json \
  --repository-root <工作目录>

完成标准:run 与 decision manifest 均为 passed,每个 change 都能追溯到当前 unit finding。

8. 按已有授权编辑

先核对本轮和前文的授权。用户已明确要求更新项目内规则、技能或提交时,直接执行该范围;仅缺失会影响操作范围的授权时提问,不能把模糊的“全部”跨作用域解释:

  • 仅报告:不改文件;
  • 项目内稳定规则:只改项目 standards/模块事实源;
  • 项目内全部:还可改项目级 skill、测试或 active issue;
  • 包含用户级 skill:单独明确授权后才可修改 ~/.claude/skills/;
  • 逐项确认:按 change ID 选择。

新 skill、用户级文件、提交、push 和高影响 Git 操作永远不由“项目内全部”隐式授权。

编辑时保持一项 change 对应最小 diff。完成后:

  1. 运行该项 acceptance 中的目标检查与 preserved-success 检查;
  2. 在本轮变更记录中填写实际实施状态与逐项验证结果;持久账本模式将 decision manifest 的 status 改为 implemented,verification 为 acceptance.target 与 acceptance.preserved_success 每个检查写一个 {check, command, status, result},check 与原文一致且全部为 passed;未实施保持 proposed,受阻写 blocked;
  3. 临时报告模式核对 run validation 和逐项验收;持久账本模式再次运行 decision manifest 校验;
  4. 用户已明确要求提交时,按 docs/standards/git.md 核对改动归属与 staged diff 后提交;未授权提交则只报告,不把 commit 授权扩展成 push。

若多个 change 同时落地且作用面重叠,下一轮无法可靠单项归因;优先分批实施或在报告中显式标记 confounded。

9. 清理敏感输入

临时报告模式在 run 校验通过、报告写完且逐项验收完成后,执行 python3 .claude/skills/learn-from-history/scripts/validate_run.py <run_dir> --cleanup-inputs。保留 manifest、validation、unit summary/sidecar 与本轮脱敏报告、变更记录;若曾补提取,还须清理本次生成的旧原始提取物和补充 diff,不删除其他 run。该模式不产生持久账本 attestation。

以下为持久账本模式:

最终报告和 decision manifest 写完、全部校验通过后,默认清理 snapshot、原始提取物和 prompts:

bash
python3 .claude/skills/learn-from-history/scripts/validate_run.py \
  /tmp/learn-from-history/<run_id> \
  --decision-manifest spec/reviews/history-learn-YYYY-MM-DD.json \
  --cleanup-inputs

保留 manifest、validation.json、summary sidecar 和脱敏报告/决策账本;它们共同构成后续终局 attribution 的证据链。历史 attestation 必须从限定 run/repository 根下以不跟随 symlink 的普通文件读取,并让解析内容与 digest 来自同一次打开;canonical repository ledger 的 source_sidecars、旧 validation.json.attestation 与保留 sidecar digest 必须逐项一致。路径异常、换指、产物缺失或 digest 不符时一律 fail closed。此时旧 keep|revert 不得关闭变更,下一轮继续归因。该链提供可审计的一致性和 Git 可追踪锚,不宣称能抵抗可同时重写仓库 ledger、Git 历史与 /tmp 产物的主体;报告和 ledger 仍需人工确认。若用户明确需要保留原始审计输入,跳过 cleanup 并提示其敏感性和路径。

失败处理

状态行动
数据库不存在或 snapshot 失败报告阻塞并结束
manifest empty报告近期无记录,可询问是否 --all
manifest failed 或命令非零不启动 agent;修复或重新创建 run
agent 中断resume 原 child thread
sidecar 缺失、digest 不符、覆盖不全validator 失败;不得汇总
finding 无原始路径 locator、根因或反证检查validator 失败;补证据,不降格为直觉建议
输入截断/解析失败且无法复核标为 blocked,不将相关判断写成稳定规则
prior change 缺基线或相关场景未复现inconclusive,不判 keep/revert
回归风险未搜索不实施;补 preserved-success probe
事实源已有同义规则标记已覆盖或仅强化原 Verify
建议涉及用户级 skill单独确认,不继承项目内编辑授权

© KonghaYao, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (scripts, references) in .claude/skills/learn-from-history of KonghaYao/peri.

  • SKILL.md
  • references/analysis-template.md
  • scripts/extract_daily.py
  • scripts/extract_range.py
  • scripts/run_history.py
  • scripts/validate_run.py
  • tests/test_extract_daily.py

Open the folder on GitHubat commit 6da603f

Compare with similar skills

Learn From History Audit next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Learn From History Audit compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Learn From History Audit this skillKonghaYao/peri229—~3.5kAutomated safety check: PassApache-2.0
Harness Evaltech-leads-club/agent-skills7k—~3.9kAutomated safety check: PassCC-BY-4.0
Analyze Chat Customizationmicrosoft/vscode-chat-customizations-evaluation142—~135Automated safety check: PassCustom licence
Learn From PRdotnet/maui23k—~2.5kAutomated safety check: PassMIT
Write Skilldruxt/druxt.js114—~926Automated safety check: PassMIT
Toolkitnotque/vexjoy-agent441—~3.1kAutomated safety check: NotesMIT

Similar skills

  • Harness Eval

    tech-leads-club/agent-skills

    Evaluates a repository's agent harness (AGENTS.md, rules, skills) for broken paths, redundant instructions and usefulness, and stops at reports.

    7k GitHub stars~3.9k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check passed
  • Analyze Chat Customization

    microsoft/vscode-chat-customizations-evaluation

    Official

    Runs Chat Customizations Evaluations analysis for the active customization file and summarizes the findings from the Problems panel.

    142 GitHub stars~135 tokensUpdated 8 days ago
    Agent WorkflowsAuto-check passed
  • Learn From PR

    dotnet/maui

    Official

    Analyzes a finished pull request that involved an agent to find what slowed or helped it, and recommends specific changes to instruction files, skills and docs.

    23k GitHub stars~2.5k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Write Skill

    druxt/druxt.js

    Creates or changes a druxt.js contributor skill in .agents/skills, with its evals and the tests that gate it.

    114 GitHub stars~926 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Toolkit

    notque/vexjoy-agent

    Toolkit management: create and evaluate skills and agents, manage routing tables, generate Claude.md.

    441 GitHub stars~3.1k tokensUpdated yesterday
    Agent WorkflowsAuto-check: notes
  • Microsoft Foundry

    microsoft/GitHub-Copilot-for-Azure

    Official

    Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end.

    255 GitHub starsUsed in 1 repo~6.7k tokens
    AI & LLM EngineeringAuto-check passed

More from KonghaYao/peri

All 18 skills in this repo
  • Queries Langfuse traces, prompts, datasets and sessions, and analyzes local LLM gateway logs for requests, context growth, token use and cache hits.

    229 GitHub stars~4.3k tokensUpdated today
    Auto-check: notes
  • Runs commands, reads and edits files, and copies data on remote machines through a single-file Node script that wraps the system ssh and scp, in Chinese.

    229 GitHub stars~924 tokensUpdated today
    Auto-check: warnings
  • Advisor Consultation

    KonghaYao/peri

    Sends a compact, redacted decision packet to a tool-free Opus advisor subagent when a task has high-risk trade-offs or stalled investigations, then weighs the answer.

    229 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Scheduled Tasks Cron

    KonghaYao/peri

    Registers, lists and removes recurring agent tasks with five-field cron expressions, and sets safety rules so a schedule is created only when the user clearly asks.

    229 GitHub stars~917 tokensUpdated today
    Auto-check passed
  • Verifies and repairs a feature by using the real Peri terminal UI as a user would, looping verify, decide, fix and review until a fresh round shows no blockers.

    229 GitHub stars~2.1k tokensUpdated today
    Auto-check: notes
  • Ultracode

    KonghaYao/peri

    Multi-agent workflow orchestration. An agent skill from KonghaYao/peri.

    229 GitHub stars~2k tokensUpdated today
    Auto-check passed

Categories

Questions about Learn From History Audit

What does Learn From History Audit do?

Audits recent agent conversation history and turns repeated failures and successes into testable harness improvement proposals that later audits can check. History learning is treated as an observable improvement loop. Inputs are fixed, evidence is drilled into in layers, the narrowest change surface is located, and each suggestion states a predicted benefit and a regression risk to be checked against later history.

When should I use Learn From History Audit?

Learn From History Audit fits situations like: reviewing how your coding agent performed over the past week; finding repeated failure patterns that a rule or script could prevent; checking whether an earlier harness change actually helped.

How do I install Learn From History Audit in Claude Code?

Run `npx skills add KonghaYao/peri --skill learn-from-history -a claude-code`. Or copy the skill folder (.claude/skills/learn-from-history in KonghaYao/peri) into .claude/skills/learn-from-history in your project. Claude Code loads it when a task matches its description.

How do I install Learn From History Audit in Codex?

Run `npx skills add KonghaYao/peri --skill learn-from-history -a codex`. Or copy the skill folder (.claude/skills/learn-from-history in KonghaYao/peri) into .agents/skills/learn-from-history in your project. Codex loads it when a task matches its description.

Can I use Learn From History Audit in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add KonghaYao/peri --skill learn-from-history -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/learn-from-history, .gemini/skills/learn-from-history, .github/skills/learn-from-history and .opencode/skills/learn-from-history in your project.

What does Learn From History Audit need to run?

Going by SKILL.md and its folder, Learn From History Audit needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3 to run the scripts; Access to the agent's local conversation history.

Does Learn From History Audit access the network?

SKILL.md names 1 domain. As links in the text: arxiv.org. This is read from the text; nothing was executed.

Is Learn From History Audit safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Learn From History Audit use?

Learn From History Audit is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Learn From History Audit use?

About 3.5k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 580 tokens, read only when the agent opens those files.

What are the alternatives to Learn From History Audit?

Skills that share tags, products or a category with Learn From History Audit: Harness Eval (tech-leads-club/agent-skills, 7k stars), Analyze Chat Customization (microsoft/vscode-chat-customizations-evaluation, 142 stars), Learn From PR (dotnet/maui, 23k stars) and Write Skill (druxt/druxt.js, 114 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Learn From History Audit?

KonghaYao (a GitHub user) maintains it in KonghaYao/peri, which has 229 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 11, 2026.

Source: KonghaYao/peri on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.