npx skills add https://github.com/boshu2/agentops --skill extract通常通过 SessionStart 钩子自动运行。
处理来自先前会话的待处理学习提取。
SessionStart 钩子运行:
ao extract
这会检查排队的提取任务,并输出供 Claude 处理的提示。
给定 /extract:
ao extract 2>/dev/null
或者检查待处理队列:
cat .agents/ao/pending.jsonl 2>/dev/null | head -5
如果 ao CLI 不可用,则手动处理待处理队列:
if ! command -v ao &>/dev/null; then
echo "ao CLI 不可用 — 运行手动提取"
# 检查待处理队列
if [ -f .agents/ao/pending.jsonl ] && [ -s .agents/ao/pending.jsonl ]; then
echo "发现待处理的提取任务:"
cat .agents/ao/pending.jsonl
# 对于每个待处理条目,检查对应的 forge 输出
# Forge 输出位于 .agents/forge/
for forge_file in .agents/forge/*.md; do
[ -f "$forge_file" ] || continue
echo "正在处理:$forge_file"
done
else
echo "未发现待处理的提取任务。"
fi
# 处理完成后,检查 .agents/forge/ 中是否有未处理的候选文件
FORGE_COUNT=$(ls .agents/forge/*.md 2>/dev/null | wc -l | tr -d ' ')
if [ "$FORGE_COUNT" -gt 0 ]; then
echo "发现 $FORGE_COUNT 个 forge 候选文件 — 请手动审查并提取学习内容。"
echo "对于 .agents/forge/ 中的每个候选文件:"
echo " 1. 阅读候选文件"
echo " 2. 使用步骤 3 中的模板提取可操作的学习内容"
echo " 3. 写入 .agents/learnings/YYYY-MM-DD-<主题>.md"
echo " 4. 高置信度项(>= 0.7)可以直接提升"
fi
fi
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
对于每个 forge 候选文件,使用本技能步骤 3 中定义的相同模板格式提取学习内容。将结果写入 .agents/learnings/。处理完成后,清空待处理队列:
# 清除已处理的条目
> .agents/ao/pending.jsonl
echo "待处理队列已清空"
对于每个排队的会话:
.agents/learnings/写入位置: .agents/learnings/YYYY-MM-DD-<会话ID>.md
# 学习内容:<简短标题>
**ID**: L1
**分类**: <debugging|architecture|process|testing|security>
**置信度**: <high|medium|low>
## 我们学到了什么
<用 1-2 句话描述洞察>
## 重要性
<用 1 句话说明影响/价值>
## 来源
会话:<会话ID>
写入学习文件后,验证每个文件是否包含必填字段:
ls -t .agents/learnings/YYYY-MM-DD-*.md 2>/dev/null | head -5
对于每个文件,检查必填字段:
# 学习内容:<标题> 开头(标题非空)**分类**: <值>,其中值是以下之一:debugging, architecture, process, testing, security**置信度**: <值>,其中值是以下之一:high, medium, low## 我们学到了什么 部分,且标题后至少有一行非空内容报告验证结果:
请勿删除或重试无效的学习内容。 记录警告并继续。无效的学习内容总比没有好 — 警告有助于随时间推移识别提取质量问题。
ao extract --clear 2>/dev/null
告知用户:
会话 N 结束:
→ ao forge --last-session --queue
→ 会话排队进入 pending.jsonl
会话 N+1 开始:
→ ao extract (本技能)
→ Claude 处理队列
→ 写入 .agents/learnings/
→ 验证必填字段
→ 循环结束
钩子触发: session-start.sh 在会话开始时运行
发生的情况:
ao extract 2>/dev/null.agents/learnings/<日期>-<会话>.mdao extract --clear 清空队列结果: 先前会话的知识在会话开始时自动提取,无需用户操作。
用户说: /extract 或 "从上次会话提取学习内容"
发生的情况:
ao extract 检查待处理队列.agents/learnings/结果: 手动处理待处理的提取任务,队列被清空,学习内容被索引。
| 问题 | 原因 | 解决方案 |
|---|---|---|
| 未发现待处理的提取任务 | 队列为空或 ao CLI 不可用 | 检查 .agents/ao/pending.jsonl 是否存在;验证 ao CLI 是否已安装 |
| 无效的学习内容警告 | 缺少分类/置信度/内容 | 审查学习文件,添加缺失字段;请勿删除 |
| extraction --clear 失败 | CLI 不可用或权限错误 | 作为备用方案,手动截断 .agents/ao/pending.jsonl |
| 重复提取 | 处理队列后未清空 | 写入学习内容后始终运行 ao extract --clear |
每周安装次数
153
仓库
GitHub 星标数
197
首次出现时间
2026年2月2日
安全审计
安装于
codex151
claude-code150
opencode149
github-copilot149
kimi-cli149
gemini-cli149
Typically runs automatically via SessionStart hook.
Process pending learning extractions from previous sessions.
The SessionStart hook runs:
ao extract
This checks for queued extractions and outputs prompts for Claude to process.
Given /extract:
ao extract 2>/dev/null
Or check the pending queue:
cat .agents/ao/pending.jsonl 2>/dev/null | head -5
If ao CLI is not available, process the pending queue manually:
if ! command -v ao &>/dev/null; then
echo "ao CLI not available — running manual extraction"
# Check for pending queue
if [ -f .agents/ao/pending.jsonl ] && [ -s .agents/ao/pending.jsonl ]; then
echo "Found pending extractions:"
cat .agents/ao/pending.jsonl
# For each pending entry, check for corresponding forge output
# Forge outputs live in .agents/forge/
for forge_file in .agents/forge/*.md; do
[ -f "$forge_file" ] || continue
echo "Processing: $forge_file"
done
else
echo "No pending extractions found."
fi
# After processing, check .agents/forge/ for unprocessed candidates
FORGE_COUNT=$(ls .agents/forge/*.md 2>/dev/null | wc -l | tr -d ' ')
if [ "$FORGE_COUNT" -gt 0 ]; then
echo "$FORGE_COUNT forge candidates found — review and extract learnings manually."
echo "For each candidate in .agents/forge/:"
echo " 1. Read the candidate file"
echo " 2. Extract actionable learnings using the template in Step 3"
echo " 3. Write to .agents/learnings/YYYY-MM-DD-<topic>.md"
echo " 4. High-confidence items (>= 0.7) can be promoted directly"
fi
fi
For each forge candidate, extract learnings using the same template format defined in Step 3 of this skill. Write results to .agents/learnings/. After processing, clear the pending queue:
# Clear processed entries
> .agents/ao/pending.jsonl
echo "Pending queue cleared"
For each queued session:
.agents/learnings/Write to: .agents/learnings/YYYY-MM-DD-<session-id>.md
# Learning: <Short Title>
**ID**: L1
**Category**: <debugging|architecture|process|testing|security>
**Confidence**: <high|medium|low>
## What We Learned
<1-2 sentences describing the insight>
## Why It Matters
<1 sentence on impact/value>
## Source
Session: <session-id>
After writing learning files, validate each has required fields:
ls -t .agents/learnings/YYYY-MM-DD-*.md 2>/dev/null | head -5
For each file, check required fields:
# Learning: <title> (non-empty title)**Category**: <value> where value is one of: debugging, architecture, process, testing, security**Confidence**: <value> where value is one of: high, , ao extract --clear 2>/dev/null
Tell the user:
Session N ends:
→ ao forge --last-session --queue
→ Session queued in pending.jsonl
Session N+1 starts:
→ ao extract (this skill)
→ Claude processes the queue
→ Writes to .agents/learnings/
→ Validates required fields
→ Loop closed
Hook triggers: session-start.sh runs at session start
What happens:
ao extract 2>/dev/null.agents/learnings/<date>-<session>.mdao extract --clear to empty queueResult: Prior session knowledge automatically extracted at session start without user action.
User says: /extract or "extract learnings from last session"
What happens:
ao extract.agents/learnings/ with proper structureResult: Pending extractions processed manually, queue cleared, learnings indexed.
| Problem | Cause | Solution |
|---|---|---|
| No pending extractions found | Queue empty or ao CLI unavailable | Check .agents/ao/pending.jsonl exists; verify ao CLI installed |
| Invalid learning warning | Missing category/confidence/content | Review learning file, add missing fields; DO NOT delete |
| extraction --clear fails | CLI not available or permission error | Manually truncate .agents/ao/pending.jsonl as fallback |
| Duplicate extractions | Queue not cleared after processing | Always run ao extract --clear after writing learnings |
Weekly Installs
153
Repository
GitHub Stars
197
First Seen
Feb 2, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex151
claude-code150
opencode149
github-copilot149
kimi-cli149
gemini-cli149
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
65,000 周安装
mediumlow## What We Learned section with at least one non-empty line after the headingReport validation results:
Do NOT delete or retry invalid learnings. Log the warning and proceed. Invalid learnings are still better than no learnings — the warning helps identify extraction quality issues over time.