Feature Request: Skill Dependency and Modular Import System
Problem Statement
When building complex SOP (Standard Operating Procedure) skills, there's often a need to reference knowledge from other skills. Currently, skills are isolated prompt templates with no native way to compose or reference each other.
Real-World Example
Consider a Model Deployment skill that needs to:
- Submit tasks to cloud servers (requires cloud CLI knowledge)
- Search for model documentation (requires search capability)
- Handle errors by searching solutions
The Cloud CLI skill is large and comprehensive, containing:
- Basic usage
- Authentication
- Task submission ← Model Deployment needs this
- Resource monitoring
- Log viewing
- ... many other features
Current Limitations
- No partial import: Cannot import just the "task submission" part
- Dependency chains ignored: "Task submission" depends on "authentication" and "basic usage"
- Context waste: Loading the entire Cloud CLI skill wastes context tokens
- Fragile references: If model-deploy.md hardcodes section names, changes in cloud-cli.md break the reference
- No change detection: No way to know when a dependency has changed
Proposed Solution
1. Export Declaration (in dependency skill)
# cloud-cli.md
---
name: cloud-cli
exports:
submit-task:
description: Submit compute tasks to cloud
includes: [basic-usage, authentication, submit-task]
monitoring:
description: Monitoring and logging
includes: [basic-usage, authentication, log-viewer, metrics]
full:
includes: all
---
The dependency defines stable export interfaces that bundle required sections.
2. Import Declaration (in dependent skill)
# model-deploy.md
---
name: model-deploy
imports:
- from: cloud-cli
use: submit-task
---
The dependent only declares what capability it needs, not internal section names.
3. Runtime Behavior
When user invokes /model-deploy:
- Framework parses
imports - Resolves
cloud-cli.submit-task→ loadsbasic-usage + authentication + submit-task - Merges into context (deduplicates if multiple imports share sections)
- Agent executes with combined knowledge
Benefits
| Problem | Solution |
|---------|----------|
| Partial import | Export bundles only needed sections |
| Dependency chains | Export defines includes with prerequisites |
| Context efficiency | Only imported capabilities are loaded |
| Stable references | Export names are the stable API |
| Change detection | Framework can warn if referenced export is removed |
Optional Enhancements
Versioning
imports:
- from: cloud-cli@1.2
use: submit-task
Checksum validation
Detect when imported content has changed and warn skill authors.
Circular dependency detection
Framework validates no circular imports exist.
Alternatives Considered
- Inline embedding: Doesn't scale for large skills
- Manual file reading: Fragile, no dependency resolution
- Split into micro-skills: Poor UX, too many commands
Implementation Notes
- Backward compatible: Skills without exports/imports work as before
- Could start simple: Just
importsthat load entire skills, then add granular exports
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗