Skills Loader

A complete implementation of a skills system similar to Claude Code, demonstrating the power of nextTurnParams for context injection.

Overview

This example shows how to build encapsulated, self-managing tools that inject domain-specific context into conversations. When a skill is loaded, it automatically enriches subsequent turns with specialized instructions.

Prerequisites

Create a skills directory:

Basic Skills Tool

Usage

Example Skill File

Create ~/.claude/skills/pdf-processing/SKILL.md:

Extended: Multi-Skill Loader

Load multiple skills in a single call:

Extended: Skill with Options

Skills that accept configuration:

Skill Discovery Tool

List and describe available skills:

Complete Example

Putting it all together:

Key Patterns

1. Idempotency

Always check if a skill is already loaded:

2. Graceful Fallbacks

Handle missing skills gracefully:

3. Context Preservation

Always preserve existing input:

4. Clear Markers

Use unique markers to identify injected content:

See Also