Skip to main content
Auto-Skill follows a pipeline architecture with three main stages: Observer, Detector, and Skill Forge. This design enables automatic learning from workflows while maintaining a human-in-the-loop model.

Architecture Overview

Stage 1: Observer (Event Capture)

The Observer hooks into your coding agent’s tool execution flow to capture workflow events in real-time.

How It Works

1

Hook installation

Auto-Skill installs hooks via hooks/hooks.json that intercept tool calls in your coding agent.
2

Event capture

Each tool invocation (Read, Edit, Bash, etc.) is captured with:
  • Tool name and input parameters
  • Tool response and outcome
  • Success/failure status
  • Session and project context
  • Timestamp
3

Storage

Events are stored in a local SQLite database at ~/.claude/auto-skill/events.db.

Tool Event Structure

interface ToolEvent {
  id: string;              // Unique event ID
  sessionId: string;       // Groups events by conversation
  projectPath: string;     // Project being worked on
  toolName: string;        // e.g., "Read", "Edit", "Bash"
  toolInput: Record<string, unknown>;
  toolResponse: string | null;
  success: boolean;        // Did the tool call succeed?
  timestamp: string;       // ISO-8601 timestamp
  agentId?: string;        // Which agent (Claude, Cursor, etc.)
}
The Observer is non-intrusive. It doesn’t modify tool behavior or slow down your workflow. Events are captured asynchronously.

Stage 2: Detector (Pattern Recognition)

The Detector analyzes captured events to identify reusable patterns.

Detection Triggers

Patterns are detected based on multiple signals:

Repetition

Same tool sequence appears 3+ times across sessions.Example: Read → Grep → Edit → Bash repeated for multiple files.

Success Patterns

High success rate on similar tasks indicates a reliable approach.Example: 90% success rate on deployment workflows.

User Corrections

When you redirect the agent’s approach, Auto-Skill learns the preferred method.Example: You suggest a different testing framework.

Error Recovery

Successful self-correction patterns are valuable.Example: Agent fixes type errors in a consistent way.

Session Analysis

Auto-Skill performs deep session analysis to understand context: Intent Detection: Identifies what you’re trying to accomplish
  • debug — Fixing errors or investigating issues
  • implement — Adding new features or functionality
  • refactor — Restructuring existing code
  • test — Writing or running tests
Workflow Type Recognition: Detects development methodologies
  • TDD (Test-Driven Development)
  • Deployment workflows
  • Migration patterns
  • Setup/configuration routines
Problem Domain Extraction: Identifies technologies and frameworks
  • Languages: TypeScript, Python, Go, etc.
  • Frameworks: React, Next.js, Express, etc.
  • Tools: Docker, Kubernetes, AWS, etc.

Design Pattern Detection

Auto-Skill recognizes 18 design patterns across three categories:
  • MVC (Model-View-Controller)
  • Microservices
  • Layered Architecture
  • Event-Driven Architecture
  • Repository Pattern

Pattern Structure

interface DetectedPattern {
  id: string;
  toolSequence: string[];           // e.g., ["Read", "Edit", "Bash"]
  occurrenceCount: number;          // How many times seen
  confidence: number;               // 0.0 to 1.0
  sessionIds: string[];             // Which sessions
  firstSeen: string;                // When first detected
  lastSeen: string;                 // Most recent occurrence
  successRate: number;              // Success rate (0.0 to 1.0)
  suggestedName: string;            // Auto-generated name
  suggestedDescription: string;     // Auto-generated description
  
  // Rich context
  sessionContext?: {
    primary_intent: string;         // debug, implement, etc.
    problem_domains: string[];      // ["react", "typescript"]
    workflow_type: string;          // TDD, deployment, etc.
    tool_success_rate: number;
  };
  
  codeContext?: {
    primary_languages: string[];
    analyzed_files: number;
  };
  
  designPatterns?: DesignPattern[];
}

Stage 3: Skill Forge (Generation)

The Skill Forge creates valid SKILL.md files from detected patterns or loads skills from external sources.

Local Skill Generation

For patterns detected in your workflow:
1

Pattern validation

Verify the pattern meets minimum criteria:
  • 3+ occurrences
  • 70%+ confidence
  • Consistent tool sequence
2

SKILL.md generation

Generate a valid skill file with:
  • YAML frontmatter (name, description, metadata)
  • Procedural steps extracted from the pattern
  • Example code snippets
  • Context tags
3

Spec validation

Validate against agentskills.io spec.
4

Storage

Save to ~/.claude/skills/auto/ with auto-generated name.

External Skill Discovery

For community skills from Skills.sh and other sources:
1

Context matching

Compare detected pattern context to external skill metadata:
  • Match frameworks and languages
  • Compare intent and workflow type
  • Score relevance (0.0 to 1.0)
2

Skill loading

Fetch full SKILL.md content from source:
  • Skills.sh API
  • RFC 8615 well-known endpoints
  • Direct GitHub repositories
3

Recommendation

Present to user with:
  • Confidence score
  • Match reason
  • Installation instructions

Generated Skill Example

---
name: react-test-workflow
description: Workflow for testing React components with TypeScript
auto-generated: true
source-sessions: ["session-1", "session-2"]
confidence: 0.85
tags: ["react", "typescript", "testing", "TDD"]
workflow-type: TDD
---

# React Test Workflow

This skill codifies a workflow for testing React components using TypeScript.

## When to Use

Use this skill when:
- Writing tests for React components
- Following TDD methodology
- Working with TypeScript and Jest/Vitest

## Steps

1. Read the component file to understand its structure
2. Search for existing test patterns
3. Create or update the test file
4. Run tests and verify results

## Example

```typescript
import { render, screen } from '@testing-library/react';
import { MyComponent } from './MyComponent';

describe('MyComponent', () => {
  it('renders correctly', () => {
    render(<MyComponent />);
    expect(screen.getByText('Hello')).toBeInTheDocument();
  });
});

## Human-in-the-Loop Model

Auto-Skill never automatically activates skills. You maintain full control:

<CardGroup cols={2}>
  <Card title="User Confirmation" icon="hand">
    Skills require explicit approval before activation. Review the generated skill and decide whether to use it.
  </Card>
  
  <Card title="Customization" icon="pen">
    Edit skills before activation. Modify steps, add context, or adjust parameters.
  </Card>
  
  <Card title="Ignore/Blacklist" icon="ban">
    Ignore patterns you don't want. Blacklist patterns that shouldn't be suggested again.
  </Card>
  
  <Card title="Graduation" icon="graduation-cap">
    Decide when to graduate local patterns to community skills. Auto-Skill suggests, you approve.
  </Card>
</CardGroup>

## Confidence Scoring

Auto-Skill uses confidence scores to guide suggestions:

| Confidence | Source | Meaning | Action |
|-----------|--------|---------|--------|
| 50% | External | Newly discovered community skill | Suggest for trial |
| 75% | Proven | Successfully used 5+ times | Recommend adoption |
| 85% | Graduated | Local pattern replaced by community skill | Strongly recommend |
| 95% | Established | High usage, high success rate | Auto-suggest |

<Note>
  Confidence evolves over time based on usage and success rate. A skill that starts at 50% can grow to 95% as it proves effective in your workflow.
</Note>

## Key Design Decisions

Auto-Skill's architecture is based on several important design choices:

### Agent Plugin Architecture

Instead of being a standalone tool, Auto-Skill integrates as a plugin:
- **Hooks** for observation
- **Skills** for output
- **Symlinks** for cross-agent sharing

### Local-First Storage

All data stays on your machine:
- SQLite for event storage
- Filesystem for generated skills
- No cloud dependencies

### Per-Project + Global Detection

Patterns are detected both:
- **Per-project**: Specific to your current codebase
- **Globally**: Across all projects you work on

### Pluggable Providers

Skill sources are extensible:
- **Local**: Your own generated skills
- **Skills.sh**: 27,000+ community skills
- **Well-known**: RFC 8615 `.well-known/ai-skills` endpoints
- **Custom**: Add your own providers

## Multi-Agent Support

Auto-Skill works with multiple AI coding agents:

- Claude Code (claude.ai/code)
- Cursor (cursor.sh)
- GitHub Codex
- Aider (aider.chat)
- Windsurf
- Any agent supporting SKILL.md format

**Cross-agent sharing** is enabled via symlinks. A skill generated for Claude can be used by Cursor, and vice versa.

<Tip>
  Use `auto-skill agents list` to see all known agents. Use `auto-skill agents detect` to find installed agents on your system.
</Tip>

## Next Steps

<CardGroup cols={3}>
  <Card title="API Reference" icon="code" href="/api/pattern-detector">
    Explore all SDK functions
  </Card>
  
  <Card title="CLI Guide" icon="terminal" href="/cli/overview">
    Learn CLI commands
  </Card>
  
  <Card title="Examples" icon="flask" href="https://github.com/MaTriXy/auto-skill/tree/main/examples">
    View code examples
  </Card>
</CardGroup>

Build docs developers (and LLMs) love