Deep Dive into Skill Components
Introduction
Welcome back! In the previous lesson, we learned the difference between config.toml and skills, and we built a minimal "Hello Skill" to understand the basic structure. Now we're ready to go deeper.
In this lesson, we'll build a sophisticated Repo Navigator skill that can analyze any repository's structure, detect tooling and frameworks, and provide a comprehensive map of the project. This skill will serve as our master example for understanding all the components that make skills powerful and reusable.
By the end of this lesson, you'll understand how to craft detailed role definitions, create systematic procedures, structure outputs effectively, and add safety constraints - all the elements that make skills production-ready.
Why a Repo Navigator?
When you join a new project or explore an open-source repository, you face several recurring questions:
- What programming languages are used?
- What package manager and build tools are configured?
- How do I run tests and start the application?
- Where are the main entry points?
- Is there CI/CD configured?
Manually answering these questions requires scanning multiple files, understanding different ecosystem conventions, and piecing together information from various locations. A Repo Navigator skill automates this discovery process, providing instant, structured answers that help you get oriented quickly.
Building the Skill Step by Step
Let's build the Repo Navigator skill component by component. Create a file at .codex/skills/repo-navigator/SKILL.md and follow along as we add each piece.
Component 1: Skill Metadata
Start by adding the metadata header to your SKILL.md file:
The metadata header (YAML front matter) provides essential information about the skill:
Name: A unique identifier used to reference this skill. Use lowercase with hyphens, like a URL slug. This name appears in logs and can be used to explicitly invoke the skill.
Description: A concise summary of what the skill does. This helps both humans and Codex understand the skill's purpose at a glance. Keep it to one sentence focusing on the outcome.
Trigger: The intent pattern that should activate this skill, with concrete examples. This enables Codex to autonomously decide when to use this skill versus its general capabilities.
