learn-from-history

Solid

从过去 N 天的对话历史中提炼经验教训——分析每次 agent 交互中的异常、失败、成功模式, 提出 CLAUDE.md/AGENTS.md 更新建议、可凝聚为 skill 的新方向、以及现有 skill 的改进点。 当用户说"总结历史对话"、"learn from history"、"回顾最近的对话"、"从历史中学习"、 "分析最近的 agent 表现"、"对话历史分析"、"最近有什么可以改进的"、 "提炼一下这几天的经验"、"历史经验总结"时立即触发。 也适用于用户想知道"最近 agent 出了哪些问题"、"有什么可以优化的"、 "哪些操作可以自动化"等经验提炼场景。 只要用户想从对话历史中系统性地提取可行动的改进方向,就应使用此 skill。

AI & Automation 165 stars 30 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 86/100

Stars 20%
74
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Learn From History 从过去 N 天的对话历史中系统性地提取经验教训。 使用 Python 提取脚本将 SQLite 消息转为精简纯文本(过滤 reasoning 块和无用工具调用细节), 再按天分配 **general-purpose agent**(必须支持写文件,不能用 explore), 最后汇总产出可执行的改进方案。 ## 核心原则 1. **先提纯再分析**:提取脚本做 JSON→纯文本转换 + 过滤,agent 只读有意义的内容 2. **按天分治**:每天一个 agent,独立并行分析,最后汇总 3. **去重优先**:每个 TRAP/skill 建议必须先交叉比对现有 CLAUDE.md 和 skill 列表 4. **可行动**:输出不只是问题清单,更要是可立即执行的 Edit 建议 5. **聚焦异常**:正常的 thread 只需记录意图和模式,深挖只���有错误的 thread 6. **批量提取**:用 `extract_range.py` 一次提取整个时间段,不需要逐天手动跑 7. **默认按项目过滤**:所有操作默认限定在当前工作目录的项目中(`cwd` 过滤)。跨项目发现单独归类,不混入当前项目建议 --- ## 工作流程 五阶段流水线:发现 → 提取 → 分析 → 汇总 → 输出与编辑。 ### 阶段一:发现应分析的天数 **全部通过 Python 脚本**,禁止直接使用 SQL。 ```bash # 【重要】必须显式指定 --cwd,从 env 的 Working directory 获取 python3 .claude/skills/learn-from-history/scripts/extract_range.py --query-active-days --days 7 --cwd <工作目录> # 跨项目模式 python3 .claude/skills/learn-from-history/scripts/extract_range.py --query-active-days --days 7 --all ``` 脚本自动: - 连接 SQLite 数据库 - 按当前 cwd 过滤项目(默认行为) - 返回活跃日期列表(thread 数 + 消息数) **跨项目模式**(如用户明确要求分析所有项目): ```bash python3 .claude/skills/learn-from-history/scripts/extract_range.py --query-active-days --days 7 --all ``` **边界处理**: - 若无任何记录 → 报告"近期该项目无对话记录,可用 --all 查看所有项目",结束 - 若脚本报数据库不存在 → 报告"未找到对话数据库",结束 - 若返回 >7 天 → 合并消息量最小的两天为一个 agent(如 06-12+06-13 共 160KB+110KB) ### 阶段二:提取纯文本 用 `extract_range.py` **一次性**提取整个时间段的对话,脚本自动按天拆分输出文件。 ```bash # 【重要】必须显式指定 --cwd,从 env 的 Working directory 获取 python3 .claude/skills/learn-from-history/scripts/extract_range.py <开始日期> <结束日期> --cwd <工作目录> #...

Details

Author
KonghaYao
Repository
KonghaYao/peri
Created
5 months ago
Last Updated
today
Language
Rust
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

self-improving-agent

Curate Claude Code's auto-memory into durable project knowledge. Analyze MEMORY.md for patterns, promote proven learnings to CLAUDE.md and .claude/rules/, extract recurring solutions into reusable skills. Use when: (1) reviewing what Claude has learned about your project, (2) graduating a pattern from notes to enforced rules, (3) turning a debugging solution into a skill, (4) checking memory health and capacity.

0 Updated today
kuangketongxue
Data & Documents Listed

neat-freak

Knowledge and governance closeout: reconcile project docs, rule files (CLAUDE.md/AGENTS.md), authorized agent memory, and workspace residue with what the code and runtime actually do, so the next session or the next person starts from one current answer. Trigger when the user names "neat-freak", "洁癖", or "/neat" — and also on clear knowledge-closeout intent without the name: syncing or tidying project docs/rules/memory after development ("把文档和记忆整理一下", "收尾时把文档同步掉", "docs 和代码对不上了"), stale or conflicting CLAUDE.md/memory, a clean handoff to a teammate or a fresh session, auditing whether workspace rules are actually followed, or auditing whether every stated requirement across the conversation is actually closed ("我的需求都完成了吗", "需求都搞定了吗", "需求闭环审计", "全部对话的需求都闭环了吗"). Do not trigger for pure coding/refactoring/debugging tasks, tidying data or prose (JSON, 周报, changelog announcements), or a bare "整理" with no project-knowledge context.

0 Updated today
kuangketongxue
AI & Automation Listed

repo-init

生成或增量更新跨工具通用的 AGENTS.md(Claude Code / Cursor / Codex 等 60+ 工具自动读取), 更新时保留用户手写内容,不整份覆盖;兼容既有 CLAUDE.md——迁移其内容进 AGENTS.md 后降为一行引用(@AGENTS.md)。 触��词:生成/更新 AGENTS.md、init、初始化或优化项目上下文、迁移/合并 CLAUDE.md、让工具快速了解项目。 仅用户明示触发,不自动监听。

0 Updated today
BaixuanZhu