← 返回
未分类 中文

Auto Skill Extractor

Automatically learn from your AI's work and turn repeated subagent tasks into reusable skills
自动学习AI的工作,将重复的子任务转化为可复用技能
wahajahmed010
未分类 clawhub v2.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 407
下载
💾 0
安装
1
版本
#latest

概述

auto-skill-extractor

Automatically learn from your AI's work and turn repeated subagent tasks into reusable skills.

Description

Watches subagent completions, detects patterns worth reusing, and creates draft skills automatically. After 3 successful re-invocations, drafts are promoted to active skills.

How It Works

  1. Trigger: After every subagent completion, the main agent calls scripts/auto-skill-trigger.py
  2. Score: Complexity is calculated (tool calls × 0.7, +2 for multi-domain, +2 for error recovery)
  3. Extract: If score ≥ 4 and ≥ 3 tool calls → create DRAFT skill in skills/auto-draft/
  4. Evaluate: After 3 successful re-invocations → promote to skills/auto/
  5. Archive: Drafts unused for 7+ days → archived

Integration

Add to AGENTS.md or your agent's completion handler:

# After subagent completion
import subprocess, json

trigger_input = {
    "completion_status": "success",  # or "failed", "timeout"
    "tool_calls": tool_call_count,
    "session_id": session_key,
    "multi_domain": True,  # if task crossed domains (files + web + system)
    "transcript_summary": brief_summary  # keep brief, no secrets
}

# Method 1: Stdin (recommended, no file on disk)
result = subprocess.run(
    ["python3", "scripts/auto-skill-trigger.py"],
    input=json.dumps(trigger_input),
    capture_output=True, text=True
)

# Method 2: File (delete immediately after)
with open("/tmp/trigger.json", "w") as f:
    json.dump(trigger_input, f)
result = subprocess.run(["python3", "scripts/auto-skill-trigger.py", "/tmp/trigger.json"], capture_output=True)
os.remove("/tmp/trigger.json")

Directives

  • #skill: — Manually trigger extraction from last subagent
  • #skill: force — Force extraction (ignore thresholds)

Commands

# List active auto-skills
python3 scripts/skill-lifecycle.py list

# List drafts under evaluation
python3 scripts/skill-lifecycle.py drafts

# Process promotions and archives
python3 scripts/skill-lifecycle.py process

# Manually promote a draft
python3 scripts/skill-lifecycle.py promote my-skill-name

Complexity Scoring

FactorPointsExample
-------------------------
Tool calls × 0.72-5 pts3 tools = 2, 5 tools = 4
Multi-domain+2 ptsFiles + web + system
Error recovery+2 ptsRetry on failure

Threshold: 4 points = creates DRAFT

Directory Structure

skills/
├── auto-draft/          # Draft skills (under evaluation)
│   └── {name}-{hash}/
│       ├── SKILL.md
│       └── meta.json
├── auto/                # Promoted skills (ready to use)
│   └── {skill-name}/
│       ├── SKILL.md
│       └── promotion.json
└── manual/              # Hand-crafted skills

Configuration

  • COMPLEXITY_THRESHOLD = 4 — Lower = more drafts, more curation needed
  • PROMOTE_THRESHOLD = 3 — Re-invocations before promotion
  • ARCHIVE_AGE_DAYS = 7 — Days before unused drafts archived
  • MAX_QUEUE_SIZE = 50 — Pending extraction limit

Safety

  • ✅ No sensitive data persisted (only tool counts, scores, timestamps)
  • ✅ Session IDs are hashed, not stored raw
  • ✅ Path traversal prevention on skill names
  • ✅ Atomic promotions (copy → verify → move)
  • ✅ Queue limits (max 50 pending)
  • ✅ No transcript content written to disk

Companion Skills

  • subagent-orchestration — The subagent pattern that generates the work this skill extracts from
  • skill-creator — For manually creating or improving skills

版本历史

共 1 个版本

  • v2.0.0 当前
    2026-05-07 04:41 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Open Source Contributor

wahajahmed010
使用建筑师‑建造者模式的自主 GitHub 贡献代理。Buck(主代理)负责所有 git/网络 I/O;子代理负责专注的认知任务。
★ 0 📥 531

Council Of Llms

wahajahmed010
真实的OpenClaw子代理多模型委员会审议:生成3个并行子代理,各自使用不同的大语言模型并拥有独特的分析视角(策略、…)
★ 1 📥 687

Subagent Orchestration

wahajahmed010
有效编排 OpenClaw 子代理,覆盖全部三种代理类型(Worker、Researcher、Council),包括正确的生成模式和沙箱约束等。
★ 0 📥 466