In this tutorial, we build a complete skill-based agent system for large language models (LLMs) and explore how modular capabilities can be structured like an operating system for AI agents. We define reusable skills, attach metadata and schemas, register them in a central registry, and enable dynamic orchestration through tool calling and multi-step reasoning. The implementation shows how an agent can select the right skill for a task, compose multiple skills for advanced workflows, hot-load new capabilities at runtime, and track everything through an observability dashboard.
The system is built around key abstractions: Skill, SkillMetadata, SkillCategory, and SkillRegistry. Skills are self-describing, versioned, testable, and composable modules, each with a defined schema for execution. The SkillRegistry acts as a central catalog, analogous to an OS process table, allowing skills to be registered, looked up by category or tag, and exposed as OpenAI-compatible tools for LLM function calling.
Example skills include a CalculatorSkill that safely evaluates mathematical expressions and a TextSummarizerSkill that summarizes text at three verbosity levels. The agent uses OpenAI's gpt-4o-mini model and rich for console display. Dependencies include openai and rich, which can be installed via pip.