Skip to main content

Architecture

Auto-Skill follows a three-stage pipeline: Observe → Detect → Forge, with an optional discovery layer for community skills.

┌─────────────────────────────────────────────────────┐
│ Coding Agent Session │
│ User works normally → tool calls happen │
└──────────────────────┬──────────────────────────────┘
│ PostToolUse hook

┌──────────────────────────────────────────────────────┐
│ OBSERVER (src/hooks/observer.ts) │
│ Records tool events to SQLite │
│ Fields: tool_name, input, response, success, time │
└──────────────────────┬───────────────────────────────┘
│ Stop hook

┌──────────────────────────────────────────────────────┐
│ DETECTOR (src/core/pattern-detector.ts) │
│ │
│ ┌─────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Sequence │ │ Session │ │ Design │ │
│ │ Matcher │ │ Analyzer │ │ Pattern │ │
│ │ (V1 core) │ │ (V2 context) │ │ Detector │ │
│ └──────┬──────┘ └──────┬───────┘ └──────┬───────┘ │
│ └───────────────┼────────────────┘ │
│ ▼ │
│ Confidence Scoring │
│ (occurrences × success × length × recency) │
└──────────────────────┬───────────────────────────────┘
│ patterns with confidence ≥ 0.7

┌──────────────────────────────────────────────────────┐
│ FORGE (src/core/skill-generator.ts) │
│ Generates SKILL.md with YAML frontmatter │
│ Output: ~/.claude/skills/auto/ │
└──────────────────────────────────────────────────────┘

Core Modules

ModuleFilePurpose
EventStoresrc/core/event-store.tsSQLite persistence for tool events
PatternDetectorsrc/core/pattern-detector.tsCore pattern matching + V2 orchestration
SequenceMatchersrc/core/sequence-matcher.tsSliding-window subsequence extraction
SkillGeneratorsrc/core/skill-generator.tsSKILL.md file generation
SessionAnalyzersrc/core/session-analyzer.tsConversation intent and context
MentalAnalyzersrc/core/mental-analyzer.tsSemantic codebase understanding
DesignPatternDetectorsrc/core/design-pattern-detector.ts18 pattern recognizers
Configsrc/core/config.tsConfiguration management

Hybrid Layer (Optional)

When enabled, the pipeline extends with external sources:

┌──────────────────────────────────────────────────────┐
│ UNIFIED SUGGESTER (src/core/unified-suggester.ts) │
│ │
│ Sources: │
│ ┌──────────┐ ┌──────────┐ ┌──────────────────────┐ │
│ │ Local │ │ Mental │ │ Skills.sh │ │
│ │ Patterns │ │ Model │ │ (27k+ community) │ │
│ └────┬─────┘ └────┬─────┘ └────────┬─────────────┘ │
│ └─────────────┼────────────────┘ │
│ ▼ │
│ Ranking: local > proven > hints > external │
└──────────────────────┬───────────────────────────────┘


┌──────────────────────────────────────────────────────┐
│ ADOPTION & GRADUATION │
│ src/core/skill-tracker.ts + src/core/graduation-manager.ts │
│ │
│ External skill (50%) → Proven (75%) → Local (85%+) │
│ Criteria: 5+ uses, 80% success rate │
└──────────────────────────────────────────────────────┘

Storage

All data is local. Anonymous telemetry is opt-in with privacy-first defaults (see Telemetry).

StoreLocationFormat
Tool events~/.claude/auto-skill/events.dbSQLite
Adoption tracking~/.claude/auto-skill/skills_tracking.dbSQLite
Generated skills~/.claude/skills/auto/SKILL.md files
External skills~/.claude/skills/external/SKILL.md files
Graduation logskills/graduation_log.jsonJSON

Technology Stack

ComponentTechnology
LanguageTypeScript (Node.js 18+)
StorageSQLite (better-sqlite3)
Code parsingTypeScript AST
Config formatYAML
Skill formatMarkdown + YAML frontmatter
Web UIHono
CLICommander