Skill Development Tutorial
Version: 1.2.0 Status: Active Last Updated: 2026-01-27 This tutorial covers creating skills for CLEO’s multi-agent architecture. Skills are modular prompt packages that extend Claude Code’s capabilities with specialized knowledge and workflows.2-Tier Architecture (v0.72.0+): Skills are now protocol identifiers loaded into a universalcleo-subagent. When the orchestrator spawns work, it usessubagent_type: "cleo-subagent"with the skill as context injection. Skill names (e.g.,ct-research-agent) identify protocols, NOT separate agent types. See CLEO-SUBAGENT.md for architecture details.
Overview
What is a Skill?
A skill is a self-contained package that provides:- Specialized Knowledge - Domain expertise packaged as prompt instructions
- Workflow Patterns - Proven patterns for multi-step tasks
- Tool Integration - Instructions for working with MCP servers and APIs
- Reusable Components - Scripts, references, and assets for complex tasks
Skill Organization: Tiers & Categories
CLEO organizes skills into 4 tiers based on complexity and orchestration level:| Tier | Purpose | Complexity | Example Skills |
|---|---|---|---|
| 0 | Orchestration | Highest - Multi-agent coordination | ct-orchestrator |
| 1 | High-Level Planning | High - Epic decomposition | ct-epic-architect |
| 2 | Core Execution | Medium - Specialized implementation | ct-research-agent, ct-task-executor, ct-spec-writer |
| 3 | Specialized/Meta | Variable - Domain-specific or meta-skills | ct-documentor, ct-skill-creator |
| Category | Tags | Purpose |
|---|---|---|
| Orchestration | workflow, coordination, multi-agent | Multi-agent workflow management |
| Planning | planning, architecture, task-management | Epic and task breakdown |
| Research | research, investigation, discovery | Information gathering |
| Implementation | execution, implementation, bash, library | Code creation |
| Testing | testing, bats, integration | Test creation |
| Documentation | documentation, writing, review, style-guide | Documentation workflows |
| Specification | specification, rfc, protocol | Technical specification writing |
| Validation | validation, compliance, audit | Compliance checking |
| Meta | skills, creation, discovery | Skill management |
When to Create a Skill
| Create a Skill When | Do Not Create When |
|---|---|
| Task requires multi-step workflow | Single-step operations |
| Domain expertise is non-obvious | Claude’s native knowledge suffices |
| Same workflow executed repeatedly | One-off task |
| Coordination with task system needed | Direct execution is faster |
| Subagent protocol compliance required | No orchestrator involvement |
Directory Structure
Skills live inskills/{skill-name}/:
Naming Conventions
- Directory:
ct-{descriptive-name}(e.g.,ct-research-agent,ct-task-executor) - SKILL.md: Always uppercase, always present
- References: Lowercase with hyphens (e.g.,
output-patterns.md)
SKILL.md Anatomy
Every skill requires aSKILL.md file with YAML frontmatter and markdown body.
Frontmatter (Required)
description field is the primary trigger mechanism. Claude reads this to determine when to invoke the skill. Include:
- What the skill does
- Specific trigger phrases (what users might say)
- Use cases and contexts
Body Sections
Subagent Protocol Compliance
Skills operating as subagents under an orchestrator MUST follow the subagent protocol.Output Requirements (RFC 2119)
| ID | Rule | Rationale |
|---|---|---|
| OUT-001 | MUST write output to {{OUTPUT_DIR}}/{{DATE}}_{{TOPIC_SLUG}}.md | Persistent storage for orchestrator |
| OUT-002 | MUST append ONE line to {{MANIFEST_PATH}} | O(1) lookup of key findings |
| OUT-003 | MUST return ONLY summary message | Preserves orchestrator context |
| OUT-004 | MUST NOT return content in response | Prevents context bloat |
Why This Matters
The orchestrator reads ONLY manifest entries, never full output files. Returning content in your response bloats the orchestrator’s context window and violates ORC-005 (context budget).Manifest Entry Format
Append ONE line (no pretty-printing):| Field | Guideline |
|---|---|
key_findings | 3-7 one-sentence findings, action-oriented |
actionable | true if findings require implementation work |
needs_followup | Task IDs requiring attention based on findings |
topics | 2-5 categorization tags for discoverability |
status | complete, partial, or blocked |
Return Message Standards
Skills MUST return a standardized message based on completion status:Complete
All work finished successfully:Partial
Some work completed but blockers exist:"status": "partial" and document what was achieved plus blocking reasons.
Blocked
Cannot proceed with work:"status": "blocked" and do NOT complete the task. Leave for orchestrator decision.
Token Injection
Tokens use the{{TOKEN_NAME}} format and are replaced before skill execution.
Required Tokens
Always provided by orchestrator:| Token | Pattern | Example |
|---|---|---|
{{TASK_ID}} | ^T[0-9]+$ | T1234 |
{{DATE}} | ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ | 2026-01-21 |
{{TOPIC_SLUG}} | ^[a-zA-Z0-9_-]+$ | auth-research |
Context Tokens (Optional)
| Token | Default | Description |
|---|---|---|
{{EPIC_ID}} | "" | Parent epic ID |
{{SESSION_ID}} | "" | Session identifier |
{{OUTPUT_DIR}} | claudedocs/agent-outputs | Output directory |
{{MANIFEST_PATH}} | {{OUTPUT_DIR}}/MANIFEST.jsonl | Manifest location |
Task Command Tokens
Portable commands that work with CLEO (or other task systems):| Token | CLEO Default |
|---|---|
{{TASK_SHOW_CMD}} | cleo show |
{{TASK_FOCUS_CMD}} | cleo focus set |
{{TASK_COMPLETE_CMD}} | cleo complete |
{{TASK_LINK_CMD}} | cleo research link |
Using @ References
Reference shared protocols in SKILL.md:Debugging with SKILL_DISPATCH_DEBUG
Enable debug logging to troubleshoot skill selection and injection:Debug Environment Variables
| Variable | Component | Prefix |
|---|---|---|
SKILL_DISPATCH_DEBUG | Skill selection & injection | [skill-dispatch] |
ORCHESTRATOR_SPAWN_DEBUG | Agent spawning lifecycle | [orchestrator-spawn] |
SUBAGENT_INJECT_DEBUG | Prompt template injection | [subagent-inject] |
Common Issues
Wrong skill selected? Check task labels and title keywords:Testing Your Skill
1. Validate SKILL.md Structure
Ensure frontmatter is valid YAML:2. Verify Registration
Add skill toskills/manifest.json:
| Field | Required | Description |
|---|---|---|
name | Yes | Skill identifier (ct-* prefix) |
version | Yes | Semantic version |
description | Yes | Brief purpose statement |
path | Yes | Relative path to skill directory |
tags | Yes | Category tags for grouping |
status | Yes | active or deprecated |
tier | Yes | Tier level (0-3) |
token_budget | No | Recommended token budget |
references | No | Documentation files |
capabilities.inputs | Yes | Required token parameters |
capabilities.outputs | Yes | Output artifact types |
capabilities.dispatch_triggers | Yes | Natural language triggers |
capabilities.dispatch_keywords.primary | No | Primary keyword matches |
capabilities.dispatch_keywords.secondary | No | Secondary keyword matches |
capabilities.chains_to | No | Skills this can delegate to |
constraints.requires_session | No | Whether session context required |
constraints.requires_epic | No | Whether epic context required |
3. Test Skill Invocation
4. Verify Output
Check output file and manifest:Skill Discovery & Dispatch
Dynamic Discovery Mechanism
CLEO uses a registry-based discovery system for skill selection. Skills are automatically detected when:- Directory structure matches:
skills/ct-*/SKILL.mdpattern - Manifest registration: Entry exists in
skills/manifest.json - Valid frontmatter: YAML frontmatter with
name,description,version
Dispatch Matrix
Thedispatch_matrix in skills/manifest.json provides two selection methods:
By Task Type
Maps task types to skills for orchestrator spawning:type: "research", the orchestrator automatically selects ct-research-agent.
By Keyword Pattern
Maps regex patterns to skills for natural language matching:Skill Selection Priority
- Explicit invocation -
/skill-namein prompt (highest priority) - Task type match - Direct match from
dispatch_matrix.by_task_type - Keyword pattern - Regex match from
dispatch_matrix.by_keyword - Trigger phrase - Match from skill’s
capabilities.dispatch_triggers - Default fallback -
ct-task-executorfor generic implementation
Adding Your Skill to Dispatch
When registering a new skill, update the dispatch matrix if it handles a new task type or keyword pattern:Skill Examples
Simple Skill: ct-validator
A validation skill with minimal complexity:- Single-purpose focus (validation)
- Clear trigger phrases
- Structured output format (PASS/PARTIAL/FAIL)
skills/ct-validator/SKILL.md
Research Skill: ct-research-agent
A research skill for gathering information:- Multi-source research (web, docs, codebase)
- Synthesis and recommendations
- Citation tracking
skills/ct-research-agent/SKILL.md
Implementation Skill: ct-task-executor
A generic task execution skill:- Follows task instructions
- Produces deliverables
- Verifies acceptance criteria
skills/ct-task-executor/SKILL.md
Common Patterns
Progressive Disclosure
Keep SKILL.md lean by splitting content:Conditional Details
Link to detailed docs only when needed:Domain Organization
For skills with multiple domains:Anti-Patterns
| Pattern | Problem | Solution |
|---|---|---|
| Returning full content | Bloats orchestrator context | Return only summary message |
| Pretty-printed JSON | Multiple lines in manifest | Single line JSON |
| Missing manifest entry | Orchestrator can’t find findings | Always append to manifest |
| ”When to Use” in body | Not loaded during trigger check | Put in frontmatter description |
| Deeply nested references | Hard to navigate | Keep one level deep |
| Vague triggers | Wrong skill selected | Specific, unambiguous phrases |
Checklist for New Skills
Skill File Structure
- Directory structure:
skills/ct-{name}/SKILL.md - Frontmatter:
name,description,version - Description includes trigger phrases
- Task System Integration section (@ reference)
- Subagent Protocol section (@ reference)
- Output file format defined
- Manifest entry format defined
- Error handling (partial/blocked)
- Completion checklist
Manifest Registration
- Added to
skills/manifest.json - Assigned appropriate tier (0-3)
- Tagged with relevant category tags
-
capabilities.dispatch_triggersdefined -
capabilities.dispatch_keywordsdefined (if applicable) -
capabilities.inputsandoutputsspecified -
capabilities.chains_todefined (if delegates to other skills) -
constraintsspecified (session/epic requirements, token limits)
Dispatch Matrix Integration
- Added to
dispatch_matrix.by_task_type(if handles new task type) - Added to
dispatch_matrix.by_keyword(if has unique keyword patterns)
Testing
- Tested with debug mode (
SKILL_DISPATCH_DEBUG=1) - Verified skill selection via natural language trigger
- Verified output file creation
- Verified manifest entry format
- Tested error handling (partial/blocked scenarios)
Related Documentation
- Subagent Protocol:
skills/_shared/subagent-protocol-base.md - Task System Integration:
skills/_shared/task-system-integration.md - Token Placeholders:
skills/_shared/placeholders.json - Orchestrator Protocol:
docs/guides/ORCHESTRATOR-PROTOCOL.md - Troubleshooting:
docs/troubleshooting.md
Version History
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | 2026-01-21 | Initial release |
