Skills

Composing Skills

The composes[] field on a skill manifest lets a skill inherit the tools and prompt context of other skills. This is the primary mechanism for building meta-skills — high-level capabilities that combine several lower-level skills without duplicating their definitions.

Example

Define a meta-skill that composes two existing skills:

yaml
# skills/advanced-research/manifest.yml
id: advanced_research
name: Advanced Research
description: Full-stack research skill combining search and analysis
tools:
  - research_runner
composes:
  - search_skill      # inherits all search_skill tools
  - analysis_skill    # inherits all analysis_skill tools

How tool inheritance works

typescript
// getSkillToolNames() recursively resolves the full tool list
getSkillToolNames(['advanced_research'])
// Returns: ['research_runner', 'web_search', 'fetch_page', 'analyse_data', 'chart']
//           ^ own tool         ^ from search_skill         ^ from analysis_skill

Recursion and cycle protection

  • composes[] is resolved recursively — a composed skill can itself compose other skills
  • A visited set prevents infinite loops from circular compositions
  • Prompt context from all composed skills is merged and deduplicated before injection

Prompt context merging

typescript
// Context from all composed skills is collected in order
getSkillPromptContext(['advanced_research'])
// Produces a merged block:
// [advanced_research context]
// [search_skill context]
// [analysis_skill context]

Rules

  • A skill cannot compose itself (cycle guard)
  • Tool names from composed skills are deduplicated (Set)
  • A skill's own tools take precedence in ordering; composed tools follow
  • composes[] accepts skill IDs, not file paths
composes[] is purely additive — it can only add tools and context, not remove them. If you need to restrict tools from a composed skill, define a new skill that lists only the tools you want rather than composing the full skill.