Skill: skill-discovery
classification: Core Universal
tier: T0 (System Behavior)
confidence: 10/10
source: system-mandatory
dependencies: pre-action, memory-keeper
aliases: skill-discovery, automatic-skill-discovery
Purpose
Skill Discovery ensures the agent has the correct domain expertise for every task. It performs two critical functions:
- Internal Auto-loading (Phase 0): Automatically identifies and loads installed skills based on task context.
- External Suggestion: Proactively identifies gaps and suggests relevant community skills from skills.sh.
Phase 0: Automatic Classification
Execute BEFORE any tool call.
Algorithm
- PARSE request to identify task type and domain.
- CLASSIFY by task type (not language):
- Implementation — Writing code in any language
- Testing — Writing tests, test fixtures, test harnesses
- Writing/Documentation — Prose, READMEs, ADRs, runbooks, API docs
- Research/Investigation — Exploring codebases, understanding systems
- Architecture/Design — System design, patterns, refactoring
- Security — Vulnerability assessment, secure coding, audits
- Operations/DevOps — Deployment, CI/CD, infrastructure, monitoring
- Data Analysis — Metrics, statistics, analysis, reporting
- Git/Delivery — Commits, PRs, releases, version management
- Orchestration/Planning — Task breakdown, delegation, coordination
- LOAD skills from the Internal Skill Selection Matrix matching the task type.
- DETECT programming language (if applicable) and load language-specific skills via codebase detection.
- DELEGATE if complexity warrants (multiple files, architecture decisions, novel problems).
Internal Skill Selection Matrix
| Task Type |
Category |
Skills |
| Implementation (any language) |
unspecified-high |
clean-code, error-handling, design-patterns |
| Testing (any language) |
unspecified-high |
bdd-workflow, bdd-best-practices, test-fixtures |
| Writing/Documentation |
writing |
documentation-writing, british-english, proof-reader |
| Research/Investigation |
deep |
investigation, research, critical-thinking, epistemic-rigor |
| Architecture/Design |
ultrabrain |
architecture, design-patterns, systems-thinker, domain-modeling |
| Security |
unspecified-high |
security, cyber-security, prove-correctness |
| Operations/DevOps |
unspecified-high |
devops, automation, infrastructure-as-code, monitoring |
| Data Analysis |
unspecified-high |
epistemic-rigor, question-resolver, math-expert |
| Git/Delivery |
quick |
git-master, create-pr, release-management |
| Orchestration/Planning |
ultrabrain |
architecture, systems-thinker, scope-management, estimation |
| Refactoring |
deep |
refactor, clean-code, design-patterns |
| Performance/Optimization |
unspecified-high |
performance, profiling, benchmarking |
| Debugging/Troubleshooting |
deep |
investigation, critical-thinking, logging-observability |
External Skill Suggestion (skills.sh)
Suggest an external skill when ALL local options are exhausted and ANY of these conditions are met:
- Unfamiliar technology — The task involves a library not covered by installed skills.
- Explicit skill gap — The agent recognises it lacks domain expertise.
- User signals need — The user asks for help with a specific technology.
- Repeated uncertainty — 2+ uncertain statements about the same technology in one session.
Guardrails for Suggestions
- Max 1 suggestion per session — Do not nag.
- User consent required — NEVER auto-import.
- 70% confidence threshold — Only suggest when highly confident it helps.
- Max size 5KB — Per system convention.
Execution Rules
- Classify Context FIRST - Before tools, before thinking, classify the request context.
- Auto-select Internal Skills - Match keywords from the prompt to the skill matrix.
- Inject load_skills - Ensure all selected skills are injected into the task call.
- Identify External Gaps - If local skills are insufficient, check skills.sh (max once).
- Phase 0 Gate - Prevents proceeding without appropriate skill coverage.
Anti-Patterns
❌ Proceeding without domain-specific skills loaded
❌ Manual skill loading when skill-discovery is possible
❌ Suggesting external skills more than once per session
❌ Auto-importing external skills without explicit user consent
❌ Loading irrelevant skills that waste token context
Integration Points
- Phase 0 gate - Runs before all other processing.
- Skill-auto-loader-config.jsonc - Source of truth for baseline and keyword mappings.
- Universal Skill - Always loaded by default.
KB Reference
~/vaults/baphled/3. Resources/Knowledge Base/AI Development System/Skills/Core-Universal/Skill Discovery.md
Related skills
agent-discovery — routes to specialist agents; skill-discovery loads domain knowledge
pre-action — decision framework that benefits from loaded skills
1---2name: skill-discovery-33description: Automatically discover/load local skills and suggest external skills based on task context4---5
6# Skill: skill-discovery
7
8**classification:** Core Universal
9**tier:** T0 (System Behavior)
10**confidence:** 10/10
11**source:** system-mandatory
12**dependencies:** pre-action, memory-keeper
13**aliases:** skill-discovery, automatic-skill-discovery
14
15---
16
17## Purpose
18
19Skill Discovery ensures the agent has the correct domain expertise for every task. It performs two critical functions:
201. **Internal Auto-loading (Phase 0)**: Automatically identifies and loads installed skills based on task context.
212. **External Suggestion**: Proactively identifies gaps and suggests relevant community skills from [skills.sh](https://skills.sh).
22
23---
24
25## Phase 0: Automatic Classification
26
27**Execute BEFORE any tool call.**
28
29### Algorithm
30
311. **PARSE** request to identify task type and domain.
322. **CLASSIFY** by task type (not language):
33 - **Implementation** — Writing code in any language
34 - **Testing** — Writing tests, test fixtures, test harnesses
35 - **Writing/Documentation** — Prose, READMEs, ADRs, runbooks, API docs
36 - **Research/Investigation** — Exploring codebases, understanding systems
37 - **Architecture/Design** — System design, patterns, refactoring
38 - **Security** — Vulnerability assessment, secure coding, audits
39 - **Operations/DevOps** — Deployment, CI/CD, infrastructure, monitoring
40 - **Data Analysis** — Metrics, statistics, analysis, reporting
41 - **Git/Delivery** — Commits, PRs, releases, version management
42 - **Orchestration/Planning** — Task breakdown, delegation, coordination
433. **LOAD** skills from the Internal Skill Selection Matrix matching the task type.
444. **DETECT** programming language (if applicable) and load language-specific skills via codebase detection.
455. **DELEGATE** if complexity warrants (multiple files, architecture decisions, novel problems).
46
47---
48
49## Internal Skill Selection Matrix
50
51| Task Type | Category | Skills |
52|-----------|----------|--------|
53| **Implementation** (any language) | unspecified-high | clean-code, error-handling, design-patterns |
54| **Testing** (any language) | unspecified-high | bdd-workflow, bdd-best-practices, test-fixtures |
55| **Writing/Documentation** | writing | documentation-writing, british-english, proof-reader |
56| **Research/Investigation** | deep | investigation, research, critical-thinking, epistemic-rigor |
57| **Architecture/Design** | ultrabrain | architecture, design-patterns, systems-thinker, domain-modeling |
58| **Security** | unspecified-high | security, cyber-security, prove-correctness |
59| **Operations/DevOps** | unspecified-high | devops, automation, infrastructure-as-code, monitoring |
60| **Data Analysis** | unspecified-high | epistemic-rigor, question-resolver, math-expert |
61| **Git/Delivery** | quick | git-master, create-pr, release-management |
62| **Orchestration/Planning** | ultrabrain | architecture, systems-thinker, scope-management, estimation |
63| **Refactoring** | deep | refactor, clean-code, design-patterns |
64| **Performance/Optimization** | unspecified-high | performance, profiling, benchmarking |
65| **Debugging/Troubleshooting** | deep | investigation, critical-thinking, logging-observability |
66
67---
68
69## External Skill Suggestion (skills.sh)
70
71Suggest an external skill when ALL local options are exhausted and ANY of these conditions are met:
721. **Unfamiliar technology** — The task involves a library not covered by installed skills.
732. **Explicit skill gap** — The agent recognises it lacks domain expertise.
743. **User signals need** — The user asks for help with a specific technology.
754. **Repeated uncertainty** — 2+ uncertain statements about the same technology in one session.
76
77### Guardrails for Suggestions
78- **Max 1 suggestion per session** — Do not nag.
79- **User consent required** — NEVER auto-import.
80- **70% confidence threshold** — Only suggest when highly confident it helps.
81- **Max size 5KB** — Per system convention.
82
83---
84
85## Execution Rules
86
871. **Classify Context FIRST** - Before tools, before thinking, classify the request context.
882. **Auto-select Internal Skills** - Match keywords from the prompt to the skill matrix.
893. **Inject load_skills** - Ensure all selected skills are injected into the task call.
904. **Identify External Gaps** - If local skills are insufficient, check skills.sh (max once).
915. **Phase 0 Gate** - Prevents proceeding without appropriate skill coverage.
92
93---
94
95## Anti-Patterns
96
97❌ Proceeding without domain-specific skills loaded
98❌ Manual skill loading when skill-discovery is possible
99❌ Suggesting external skills more than once per session
100❌ Auto-importing external skills without explicit user consent
101❌ Loading irrelevant skills that waste token context
102
103---
104
105## Integration Points
106
107- **Phase 0 gate** - Runs before all other processing.
108- **Skill-auto-loader-config.jsonc** - Source of truth for baseline and keyword mappings.
109- **Universal Skill** - Always loaded by default.
110
111## KB Reference
112
113`~/vaults/baphled/3. Resources/Knowledge Base/AI Development System/Skills/Core-Universal/Skill Discovery.md`
114
115## Related skills
116
117- `agent-discovery` — routes to specialist agents; skill-discovery loads domain knowledge
118- `pre-action` — decision framework that benefits from loaded skills