Skill SDK Utilities

VerifiedSafe

The Skill SDK Utilities provide core infrastructure for the skill system, including loading skill instructions with caching, registering skills with the Anthropic Agent SDK, and intelligent auto-selection of skills based on queries. This internal toolkit helps manage skill metadata and integration points, reducing disk I/O and enabling seamless skill workflow execution.

Sby Skills Guide Bot
DevelopmentIntermediate
1006/2/2026
Claude Code
#sdk#skill-management#caching#auto-selection

Recommended for

Our review

This SDK provides core utilities to load, cache, and register skills, with an auto‑selection feature for integration with the agent system.

Strengths

  • Intelligent caching reduces disk I/O by over 90%
  • Auto‑selection algorithm scores skills by name, description, and tool relevance
  • Seamless integration with Anthropic Agent SDK patterns

Limitations

  • Not a user‑facing skill
  • Requires understanding of the skill system to use
  • Cache invalidation is manual
When to use it

Use this SDK when building or extending a skill‑based agent system that needs automated loading, caching, and selection of skills.

When not to use it

Do not use it for direct user interactions or general‑purpose tasks that do not rely on the skill infrastructure.

Security analysis

Safe
Quality score88/100

The SKILL.md is purely documentation describing internal utility modules. It contains no executable code, destruction commands, data exfiltration, or obfuscated payloads. No allowed tools are declared, and the content is informational.

No concerns found

Examples

Load skill instructions
Load the skill instructions for the 'rule-auditor' skill.
Auto-select skills for a query
Select relevant skills for auditing code for violations, returning the top 3.
Register a skill manually
Register the skill named 'code-style-validator' with the SDK.

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:

  1. skill-loader.mjs: Loads skill instructions and metadata with intelligent caching
  2. 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.md
  • loadSkillMetadata(skillName): Extract YAML frontmatter metadata
  • getAllSkillNames(): Get list of all available skills
  • autoSelectSkills(query, maxResults): Intelligently select skills based on query
  • clearCache(): Clear skill cache
  • getCacheStats(): 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 metadata
  • getAllSkills(): Get all registered skills
  • getSkill(skillName): Retrieve a registered skill
  • registerSkillWithSDK(skillName): Create SDK-compatible skill object
  • initializeSkills(): Initialize all skills on startup
  • invokeSkill(skillName, input, context): Invoke a skill with context
  • createSDKSkill(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:

  1. Name match (10 points): Skill name contains query words
  2. Description match (5 points per word): Description contains query words
  3. 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
Related skills