Token导航 LogoToken导航

Agent Skill · 研究检索

pattern-learning(模式学习)

pattern-learning 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 Codex、Claude、Cursor、Gemini CLI 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

pattern-learning 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为权限未标注;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 59,803。

总安装 376周安装 16GitHub Stars 22下载 132核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/bejranonda/llm-autonomous-agent-plugin-for-claude --skill pattern-learning

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于记录任务执行中的错误、用户纠正和经验缺口。适合让 Agent 持续沉淀问题、修正和最佳实践。通过 npx 安装,需结合原始 README 核验具体用法。安装前建议确认权限范围和维护状态,避免触发联网或命令执行。pattern-learning 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/pattern-learning

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/bejranonda/llm-autonomous-agent-plugin-for-cla…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    权限没有明确标注,第一次使用时只给一个无关紧要的任务,观察它到底读了哪些文件和网络。

常见问题

6 条

pattern-learning 怎么安装?

在终端执行 npx skills add https://github.com/bejranonda/llm-autonomous-agent-plugin-for-claude --skil…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

pattern-learning 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

pattern-learning 需要什么权限?

权限级别没有明确标注。第一次使用时建议只给无关紧要的任务,观察它实际读写了哪些内容。

pattern-learning 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

pattern-learning 用的人多吗?

公开数据是累计安装 376 次,近一周安装 16 次,下载 132 次,GitHub 22 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

pattern-learning 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
pattern-learning

模式学习 · 本页

37622权限未标注未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Overview

This skill provides the framework for autonomous pattern learning and recognition at the project level. It enables Claude agents to:

  • Automatically detect and store successful task execution patterns
  • Build a knowledge base of project-specific approaches
  • Recommend skills and strategies based on historical success
  • Continuously improve through self-assessment and adaptation

Pattern Recognition System

Automatic Pattern Detection

Task Categorization: Automatically classify tasks into categories:

  • refactoring: Code restructuring and improvement
  • bug-fix: Error resolution and debugging
  • feature: New functionality implementation
  • optimization: Performance improvements
  • documentation: Docs creation and updates
  • testing: Test suite development
  • security: Security analysis and fixes

Context Extraction: Automatically extract context from:

  • Programming languages used (file extensions)
  • Frameworks detected (package.json, requirements.txt, etc.)
  • Project structure patterns (MVC, microservices, etc.)
  • Complexity indicators (file count, LOC, dependencies)

Pattern Storage Structure

Directory Setup:

.claude-patterns/
├── patterns.json                   # Main pattern database
├── skill-effectiveness.json       # Skill performance metrics
└── task-history.json              # Complete task execution log

Pattern Data Model:

{
  "version": "1.0.0",
  "project_context": {
    "detected_languages": ["python", "javascript"],
    "frameworks": ["flask", "react"],
    "project_type": "web-application"
  },
  "patterns": [
    {
      "id": "pattern-001",
      "timestamp": "2025-10-20T10:30:00Z",
      "task_type": "refactoring",
      "task_description": "Refactor authentication module",
      "context": {
        "language": "python",
        "framework": "flask",
        "module": "authentication",
        "complexity": "medium"
      },
      "execution": {
        "skills_used": ["code-analysis", "quality-standards"],
        "agents_delegated": ["code-analyzer", "quality-controller"],
        "approach": "Extract method refactoring with pattern matching",
        "duration_seconds": 120
      },
      "outcome": {
        "success": true,
        "quality_score": 96,
        "tests_passing": true,
        "standards_compliance": 98,
        "documentation_complete": true
      },
      "lessons_learned": "Security-critical modules benefit from quality-controller validation",
      "reuse_count": 5
    }
  ],
  "skill_effectiveness": {
    "code-analysis": {
      "total_uses": 45,
      "successful_uses": 42,
      "success_rate": 0.93,
      "avg_quality_contribution": 15,
      "recommended_for": ["refactoring", "bug-fix", "optimization"]
    },
    "testing-strategies": {
      "total_uses": 30,
      "successful_uses": 27,
      "success_rate": 0.90,
      "avg_quality_contribution": 20,
      "recommended_for": ["testing", "feature", "bug-fix"]
    }
  },
  "agent_effectiveness": {
    "code-analyzer": {
      "total_delegations": 38,
      "successful_completions": 36,
      "success_rate": 0.95,
      "avg_execution_time": 85
    }
  }
}

Skill Auto-Selection Algorithm

Decision Process

Step 1: Analyze Current Task

Input: Task description
Output: Task type, context, complexity

Process:
1. Extract keywords and intent
2. Scan project files for context
3. Classify task type
4. Determine complexity level (low/medium/high)

Step 2: Query Pattern Database

Input: Task type, context
Output: Recommended skills, agents, approach

Process:
1. Load patterns.json
2. Filter patterns by task_type match
3. Filter patterns by context similarity
4. Rank by success_rate * reuse_count
5. Extract top 3 most successful patterns

Step 3: Skill Selection

Input: Top patterns, skill effectiveness data
Output: Ordered list of skills to load

Process:
1. Aggregate skills from top patterns
2. Weight by skill effectiveness scores
3. Filter by task type recommendation
4. Return ordered list (highest effectiveness first)

Selection Examples

Example 1: Refactoring Task

Task: "Refactor user authentication module"

Analysis:
- Type: refactoring
- Context: authentication (security-critical)
- Language: Python (detected)
- Complexity: medium

Pattern Query Results:
- Pattern-001: refactoring + auth → success_rate: 0.96
- Pattern-015: refactoring + security → success_rate: 0.94
- Pattern-023: refactoring + Python → success_rate: 0.91

Skill Selection:
1. code-analysis (appeared in all 3 patterns, avg effectiveness: 0.93)
2. quality-standards (appeared in 2/3 patterns, avg effectiveness: 0.88)
3. pattern-learning (for continuous improvement)

Auto-Load: code-analysis, quality-standards, pattern-learning

Example 2: Testing Task

Task: "Add unit tests for payment processing"

Analysis:
- Type: testing
- Context: payment (critical business logic)
- Language: JavaScript (detected)
- Complexity: high

Pattern Query Results:
- Pattern-042: testing + payment → success_rate: 0.89
- Pattern-051: testing + JavaScript → success_rate: 0.92

Skill Selection:
1. testing-strategies (effectiveness: 0.90)
2. quality-standards (for test quality)
3. pattern-learning (for continuous improvement)

Auto-Load: testing-strategies, quality-standards, pattern-learning

Pattern Storage Workflow

Automatic Storage Process

During Task Execution:

  1. Monitor task progress and decisions
  2. Record skills loaded and agents delegated
  3. Track execution metrics (time, resources)
  4. Capture approach and methodology

After Task Completion:

  1. Run quality assessment
  2. Calculate quality score
  3. Determine success/failure
  4. Extract lessons learned
  5. Store pattern to database
  6. Update skill effectiveness metrics
  7. Update agent effectiveness metrics

Storage Implementation

Auto-Create Pattern Directory - WITH SAFETY VALIDATION:

// 🚨 CRITICAL: Always validate content before applying cache_control
function safeExecuteOperation(operation, fallbackContent) {
  try {
    const result = operation();
    // Validate result before using
    if (result !== null && result !== undefined && String(result).trim().length > 0) {
      return result;
    }
  } catch (error) {
    console.log("Operation failed, using fallback");
  }
  // Always return meaningful fallback
  return fallbackContent || "Pattern initialization in progress...";
}

// Executed automatically by orchestrator with safety checks
const dirExists = safeExecuteOperation(() => exists('.claude-patterns/'), false);
if (!dirExists) {
  safeExecuteOperation(() => create_directory('.claude-patterns/'));
  safeExecuteOperation(() => create_file('.claude-patterns/patterns.json', '{"version":"1.0.0","patterns":[]}'));
  safeExecuteOperation(() => create_file('.claude-patterns/skill-effectiveness.json', '{}'));
  safeExecuteOperation(() => create_file('.claude-patterns/task-history.json', '[]'));
}

Store New Pattern - WITH COMPREHENSIVE SAFETY:

// 🚨 CRITICAL: Safe pattern storage with full validation
function store_pattern(task_data, execution_data, outcome_data) {
  // Validate inputs first
  if (!task_data || !execution_data || !outcome_data) {
    console.log("Invalid pattern data, skipping storage");
    return "Pattern data incomplete - storage skipped";
  }

  try {
    const pattern = {
      id: generate_id() || `pattern_${Date.now()}`,
      timestamp: now() || new Date().toISOString(),
      task_type: task_data.type || "unknown",
      task_description: task_data.description || "Task completed",
      context: extract_context(task_data) || {},
      execution: execution_data,
      outcome: outcome_data,
      lessons_learned: analyze_lessons(execution_data, outcome_data) || "Task completed successfully",
      reuse_count: 0
    }

    // Load existing patterns safely
    const db = safeLoadPatterns('.claude-patterns/patterns.json');
    if (!db) {
      return "Pattern database unavailable - storage skipped";
    }

    // Check for similar patterns
    const similar = find_similar_patterns(db.patterns || [], pattern);

    if (similar && similar.length > 0 && similarity_score > 0.95) {
      // Update existing pattern
      increment_reuse_count(similar[0]);
      update_success_rate(similar[0], outcome_data);
    } else {
      // Add new pattern
      (db.patterns = db.patterns || []).push(pattern);
    }

    // Update skill effectiveness
    update_skill_metrics(db, execution_data.skills_used || [], outcome_data);

    // Save with validation
    const saveResult = safeSavePatterns('.claude-patterns/patterns.json', db);
    return saveResult ? "Pattern stored successfully" : "Pattern storage completed";

  } catch (error) {
    console.log("Pattern storage failed:", error.message);
    return "Pattern storage encountered an error but completed safely";
  }
}

// Safe pattern loading with fallback
function safeLoadPatterns(filePath) {
  try {
    if (!exists(filePath)) {
      return { version: "1.0.0", patterns: [], skill_effectiveness: {}, note: "Pattern file not found - using defaults" };
    }
    const content = load(filePath);
    return content && typeof content === 'object' ? content : { version: "1.0.0", patterns: [], skill_effectiveness: {}, note: "Invalid content - using defaults" };
  } catch (error) {
    console.log("Pattern loading failed, using defaults");
    return { version: "1.0.0", patterns: [], skill_effectiveness: {}, note: "Error loading patterns - using defaults" };
  }
}

// Safe pattern saving with validation
function safeSavePatterns(filePath, data) {
  try {
    if (!data || typeof data !== 'object') {
      return false;
    }
    save(filePath, data);
    return true;
  } catch (error) {
    console.log("Save failed, but continuing safely");
    return false;
  }
}

Self-Assessment & Quality Metrics

Quality Score Calculation

Formula:

Quality Score (0-100) =
  tests_passing (30 points) +
  standards_compliance (25 points) +
  documentation_complete (20 points) +
  pattern_adherence (15 points) +
  code_quality_metrics (10 points)

Component Breakdown:

  1. Tests Passing (30 points):

- All tests pass: 30 points - 90-99% pass: 25 points - 80-89% pass: 20 points - <80% pass: 0 points

  1. Standards Compliance (25 points):

- Linting score: up to 15 points - Code style adherence: up to 10 points

  1. Documentation Complete (20 points):

- All functions documented: 20 points - Partial documentation: 10 points - No documentation: 0 points

  1. Pattern Adherence (15 points):

- Follows established patterns: 15 points - Partially follows: 8 points - Deviates from patterns: 0 points

  1. Code Quality Metrics (10 points):

- Cyclomatic complexity: up to 5 points - Code duplication: up to 5 points

Continuous Improvement

Learning Cycle:

Execute Task
    ↓
Measure Quality
    ↓
Store Pattern
    ↓
Analyze Trends
    ↓
Adjust Skill Selection
    ↓
[Next Task Benefits from Learning]

Trend Analysis:

  • Track quality scores over time
  • Identify improving/declining patterns
  • Adjust skill recommendations based on trends
  • Deprecate ineffective approaches

Pattern Retrieval & Recommendation

Query Interface

Find Similar Patterns - WITH SAFETY VALIDATION:

function find_similar_tasks(current_task) {
  // Validate input
  if (!current_task || !current_task.type) {
    return [{ note: "Invalid task input - no similar tasks found", type: "fallback" }];
  }

  try {
    const db = safeLoadPatterns('.claude-patterns/patterns.json');
    if (!db || !db.patterns || !Array.isArray(db.patterns)) {
      return [{ note: "No pattern database available - no similar tasks found", type: "fallback" }];
    }

    const similar = db.patterns
      .filter(p => p && p.task_type === current_task.type)
      .filter(p => context_similarity(p.context || {}, current_task.context || {}) > 0.7)
      .sort((a, b) => (b.outcome?.quality_score || 0) - (a.outcome?.quality_score || 0))
      .slice(0, 5);

    return similar.length > 0 ? similar : [{ note: "No similar tasks found in pattern database", type: "fallback" }];
  } catch (error) {
    console.log("Pattern search failed, returning fallback");
    return [{ note: "Pattern search encountered an error - using fallback", type: "fallback" }];
  }
}

Recommend Skills - WITH SAFETY VALIDATION:

function recommend_skills(task_type, context) {
  // Validate input
  if (!task_type) {
    return ['code-analysis', 'quality-standards']; // Safe default
  }

  try {
    const db = safeLoadPatterns('.claude-patterns/patterns.json');
    if (!db || !db.skill_effectiveness || typeof db.skill_effectiveness !== 'object') {
      return ['code-analysis', 'quality-standards']; // Safe default
    }

    // Get skills with highest success rate for this task type
    const skills = Object.entries(db.skill_effectiveness)
      .filter(([skill, data]) => data && data.recommended_for && data.recommended_for.includes(task_type))
      .sort((a, b) => (b[1]?.success_rate || 0) - (a[1]?.success_rate || 0))
      .map(([skill, data]) => skill);

    return skills.length > 0 ? skills : ['code-analysis', 'quality-standards'];
  } catch (error) {
    console.log("Skill recommendation failed, using safe defaults");
    return ['code-analysis', 'quality-standards'];
  }
}

Usage History Tracking

Maintain Complete History:

// .claude-patterns/task-history.json
[
  {
    "timestamp": "2025-10-20T10:00:00Z",
    "task_description": "Refactor auth module",
    "skills_used": ["code-analysis", "quality-standards"],
    "quality_score": 96,
    "success": true
  },
  {
    "timestamp": "2025-10-20T11:30:00Z",
    "task_description": "Add payment tests",
    "skills_used": ["testing-strategies"],
    "quality_score": 89,
    "success": true
  }
]

When to Apply

Use this skill when:

  • Starting any new task (for pattern retrieval)
  • Completing any task (for pattern storage)
  • Analyzing project approach effectiveness
  • Optimizing skill selection strategy
  • Building project-specific knowledge base
  • Enabling autonomous decision-making
  • Tracking improvement over time

Integration with Agents

Orchestrator Agent:

  • Uses pattern-learning for skill auto-selection
  • Stores patterns after each task
  • Queries patterns before delegation

Quality Controller Agent:

  • References quality score calculations
  • Uses trend analysis for improvement recommendations

All Specialized Agents:

  • Reference pattern database for context
  • Contribute to pattern storage after execution

Resources

Reference Files:

  • REFERENCE.md: Detailed algorithm implementations
  • pattern-database-schema.json: Complete data structure
  • quality-metrics-guide.md: In-depth quality assessment guide

Auto-Generated Files (in project):

  • .claude-patterns/patterns.json
  • .claude-patterns/skill-effectiveness.json
  • .claude-patterns/task-history.json

平台分布

Codex

36.31%
按下载量换算48

Claude

26.71%
按下载量换算35

Cursor

18.77%
按下载量换算25

Gemini CLI

9.65%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

权限未标注

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

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

继续浏览同类 Skills