Agent skill
skill-discovery
Automatically discover/load local skills and suggest external skills based on task context
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/skill-discovery-baphled-dotopencode
SKILL.md
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 knowledgepre-action— decision framework that benefits from loaded skills
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?