| name | sdk |
| description | Skill SDK utilities for loading, registering, and managing skills with caching and auto-selection |
Skill SDK
This is not a user-facing skill - it's a utility SDK that provides infrastructure for the skill system.
Purpose
The SDK directory contains core utilities that power the skill system:
- skill-loader.mjs: Loads skill instructions and metadata with intelligent caching
- skill-registry.mjs: Registers skills and integrates with Anthropic Agent SDK patterns
Components
skill-loader.mjs
Provides functions for loading and caching skill instructions:
loadSkillInstructions(skillName, useCache): Load skill instructions from SKILL.mdloadSkillMetadata(skillName): Extract YAML frontmatter metadatagetAllSkillNames(): Get list of all available skillsautoSelectSkills(query, maxResults): Intelligently select skills based on queryclearCache(): Clear skill cachegetCacheStats(): Get cache statistics
Caching: Skills are cached in .claude/context/cache/skill-cache.json for performance.
skill-registry.mjs
Integrates skills with Anthropic Agent SDK patterns:
registerSkill(skillName): Register a skill and parse its metadatagetAllSkills(): Get all registered skillsgetSkill(skillName): Retrieve a registered skillregisterSkillWithSDK(skillName): Create SDK-compatible skill objectinitializeSkills(): Initialize all skills on startupinvokeSkill(skillName, input, context): Invoke a skill with contextcreateSDKSkill(skillConfig): Create SDK skill instance
Usage
These utilities are used internally by the skill system and skill-manager. They are not invoked directly by users.
Example (internal use):
import { loadSkillInstructions, autoSelectSkills } from '.claude/skills/sdk/skill-loader.mjs';
// Load specific skill
const instructions = await loadSkillInstructions('rule-auditor');
// Auto-select relevant skills
const skills = await autoSelectSkills('audit code for violations', 3);
// Returns: ['rule-auditor', 'code-style-validator', 'fixing-rule-violations']
Skill Format
All skills must follow this format in their SKILL.md:
---
name: skill-name
description: Brief description
allowed-tools: tool1, tool2
version: 1.0.0
---
# Skill Instructions
Detailed instructions for the skill...
Auto-Selection Algorithm
The auto-selection algorithm scores skills based on:
- Name match (10 points): Skill name contains query words
- Description match (5 points per word): Description contains query words
- Tool match (3 points per word): Allowed tools contain query words
Top N skills by score are returned.
Cache Management
- Cache Location:
.claude/context/cache/skill-cache.json - Cache Contents: Skill instructions and metadata
- Cache Invalidation: Manual via
clearCache()or by deleting cache file - Performance: 90%+ reduction in disk I/O for repeated skill loads
Integration Points
The SDK is used by:
- skill-manager: Managing and validating all skills
- Skill tool invocations: Loading skill instructions when invoked
- Auto-selection: Finding relevant skills for user queries
- Workflow execution: Loading skills for workflow steps
Notes
- This is infrastructure code, not a user-facing skill
- Do not invoke this skill directly
- Do not create prompts or commands that reference this skill
- This directory should contain only utility modules for the skill system