Token导航 LogoToken导航TokenDH.com
待分类只读github未标认证来源可访问许可证需确认审计通过

extract提取

Agent Skill

extract 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,646

周安装

155

GitHub Stars

321

下载量

1,277
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:extract(提取)
来源仓库:https://github.com/boshu2/agentops
仓库路径:skills/extract
安装命令:
npx skills add https://github.com/boshu2/agentops --skill extract
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/boshu2/agentops --skill extract

简介

extract 自动提取会话知识并排队处理,通常通过 SessionStart hook 触发。

  • 检查 pending.jsonl 队列,输出 prompt 供 Claude 加工为学习材料。
  • 手动执行时需模拟 ao CLI 行为,确保与自动化流程一致。
  • 提取内容应脱敏并聚焦可复用模式,避免记录临时讨论细节。
  • extract 属于待分类类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Extract Skill

Typically runs automatically via SessionStart hook.

Process pending learning extractions from previous sessions.

How It Works

The SessionStart hook runs:

ao extract

This checks for queued extractions and outputs prompts for Claude to process.

Manual Execution

Given /extract:

Step 1: Check for Pending Extractions

ao extract 2>/dev/null

Or check the pending queue:

cat .agents/ao/pending.jsonl 2>/dev/null | head -5

Step 1.5: Without ao CLI — Manual Extraction

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"

Step 2: Process Each Pending Item

For each queued session:

  1. Read the session summary
  2. Extract actionable learnings
  3. Write to .agents/learnings/

Step 3: Write 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>

Step 3.5: Validate Learnings

After writing learning files, validate each has required fields:

  1. Scan newly written files:
ls -t .agents/learnings/YYYY-MM-DD-*.md 2>/dev/null | head -5
  1. For each file, check required fields:

- Heading: File must start with # Learning: <title> (non-empty title) - Category: Must contain **Category**: <value> where value is one of: debugging, architecture, process, testing, security - Confidence: Must contain **Confidence**: <value> where value is one of: high, medium, low - Content: Must contain a ## What We Learned section with at least one non-empty line after the heading

  1. Report validation results:

- For each valid learning: "✓: valid" - For each invalid learning: "⚠: missing " (list each missing field)

  1. 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.

Step 4: Clear the Queue

ao extract --clear 2>/dev/null

Step 5: Report Completion

Tell the user:

  • Number of learnings extracted
  • Key insights
  • Location of learning files

The Knowledge Loop

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

Key Rules

  • Runs automatically - usually via hook
  • Process the queue - don't leave extractions pending
  • Be specific - actionable learnings, not vague observations
  • Close the loop - extraction completes the knowledge cycle

Examples

SessionStart Hook Invocation

Hook triggers: session-start.sh runs at session start

What happens:

  1. Hook calls ao extract 2>/dev/null
  2. CLI outputs queued session IDs and prompts
  3. Agent processes each pending extraction
  4. Agent writes learnings to .agents/learnings/<date>-<session>.md
  5. Agent validates required fields and reports results
  6. Hook calls ao extract --clear to empty queue

Result: Prior session knowledge automatically extracted at session start without user action.

Manual Extraction Trigger

User says: /extract or "extract learnings from last session"

What happens:

  1. Agent checks pending queue with ao extract
  2. Agent reads session summaries from queue
  3. Agent extracts decisions, learnings, failures
  4. Agent writes to .agents/learnings/ with proper structure
  5. Agent validates fields (category, confidence, content)
  6. Agent clears queue and reports completion

Result: Pending extractions processed manually, queue cleared, learnings indexed.

Troubleshooting

ProblemCauseSolution
No pending extractions foundQueue empty or ao CLI unavailableCheck .agents/ao/pending.jsonl exists; verify ao CLI installed
Invalid learning warningMissing category/confidence/contentReview learning file, add missing fields; DO NOT delete
extraction --clear failsCLI not available or permission errorManually truncate .agents/ao/pending.jsonl as fallback
Duplicate extractionsQueue not cleared after processingAlways run ao extract --clear after writing learnings

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.7%
按下载量换算418

Claude

30.18%
按下载量换算385

Cursor

20.41%
按下载量换算261

Gemini CLI

8.95%
按下载量换算114

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills