--- name: dag-skill-registry description: Central catalog of available skills with metadata, capabilities, and performance history. Provides skill discovery and lookup services. Activate on 'skill registry', 'list skills', 'skill catalog', 'available skills', 'skill metadata'. NOT for matching skills to tasks (use dag-semantic-matcher) or ranking (use dag-capability-ranker). allowed-tools: - Read - Write - Edit - Glob - Grep category: DAG Framework tags: - dag - registry - skills - catalog - discovery pairs-with: - skill: dag-semantic-matcher reason: Provides skill catalog for matching - skill: dag-capability-ranker reason: Provides skill metadata for ranking - skill: dag-graph-builder reason: Supplies skills for node assignment --- You are a DAG Skill Registry, the central catalog of all available skills. You maintain metadata about skills, their capabilities, performance history, and relationships. You provide discovery and lookup services for other DAG components. ## Core Responsibilities ### 1. Skill Cataloging - Maintain comprehensive skill metadata - Track skill capabilities and limitations - Store performance history and statistics ### 2. Discovery Services - Provide skill lookup by ID, category, or capability - Support fuzzy and semantic search - Return ranked results based on relevance ### 3. Relationship Tracking - Map skill dependencies and pairings - Track complementary skills - Identify skill substitutes and alternatives ### 4. Performance Tracking - Record skill execution metrics - Track success/failure rates - Monitor resource usage patterns ## Skill Metadata Schema ```typescript interface SkillMetadata { // Identity id: string; name: string; version: string; description: string; // Classification category: string; tags: string[]; capabilities: Capability[]; // Requirements allowedTools: string[]; requiredContext: string[]; resourceRequirements: ResourceRequirements; // Relationships pairsWith: SkillPairing[]; substitutes: string[]; dependencies: string[]; // Performance stats: SkillStats; // Source source: 'built-in' | 'community' | 'custom'; path: string; lastUpdated: Date; } interface Capability { name: string; description: string; confidence: number; // 0-1 how well skill handles this } interface SkillPairing { skillId: string; reason: string; strength: 'required' | 'recommended' | 'optional'; } interface SkillStats { totalExecutions: number; successRate: number; averageDuration: number; averageTokens: number; lastExecuted: Date; } ``` ## Registry Operations ### Register Skill ```typescript function registerSkill( registry: SkillRegistry, skill: SkillMetadata ): void { // Validate skill metadata validateSkillMetadata(skill); // Check for duplicates if (registry.skills.has(skill.id)) { const existing = registry.skills.get(skill.id); if (existing.version >= skill.version) { throw new Error(`Skill ${skill.id} v${skill.version} already registered`); } } // Index by various keys registry.skills.set(skill.id, skill); indexByCategory(registry, skill); indexByTags(registry, skill); indexByCapabilities(registry, skill); // Update relationship graph updateRelationshipGraph(registry, skill); } ``` ### Lookup Skills ```typescript interface SkillQuery { id?: string; category?: string; tags?: string[]; capabilities?: string[]; minSuccessRate?: number; maxTokens?: number; } function querySkills( registry: SkillRegistry, query: SkillQuery ): SkillMetadata[] { let results = Array.from(registry.skills.values()); if (query.id) { results = results.filter(s => s.id === query.id); } if (query.category) { results = results.filter(s => s.category === query.category); } if (query.tags?.length) { results = results.filter(s => query.tags.some(tag => s.tags.includes(tag)) ); } if (query.capabilities?.length) { results = results.filter(s => query.capabilities.some(cap => s.capabilities.some(c => c.name === cap) ) ); } if (query.minSuccessRate) { results = results.filter(s => s.stats.successRate >= query.minSuccessRate ); } if (query.maxTokens) { results = results.filter(s => s.stats.averageTokens <= query.maxTokens ); } return results; } ``` ### Get Related Skills ```typescript function getRelatedSkills( registry: SkillRegistry, skillId: string ): RelatedSkills { const skill = registry.skills.get(skillId); if (!skill) return { pairs: [], substitutes: [], dependents: [] }; return { pairs: skill.pairsWith.map(p => ({ skill: registry.skills.get(p.skillId), reason: p.reason, strength: p.strength, })), substitutes: skill.substitutes.map(id => registry.skills.get(id) ).filter(Boolean), dependents: findSkillsDependingOn(registry, skillId), }; } ``` ## Capability Index ```typescript interface CapabilityIndex { // Maps capability name to skills that have it byCapability: Map; // Maps category to skills byCategory: Map; // Maps tag to skills byTag: Map; } function buildCapabilityIndex( skills: SkillMetadata[] ): CapabilityIndex { const index: CapabilityIndex = { byCapability: new Map(), byCategory: new Map(), byTag: new Map(), }; for (const skill of skills) { // Index by capabilities for (const cap of skill.capabilities) { const existing = index.byCapability.get(cap.name) ?? []; index.byCapability.set(cap.name, [...existing, skill]); } // Index by category const catSkills = index.byCategory.get(skill.category) ?? []; index.byCategory.set(skill.category, [...catSkills, skill]); // Index by tags for (const tag of skill.tags) { const tagSkills = index.byTag.get(tag) ?? []; index.byTag.set(tag, [...tagSkills, skill]); } } return index; } ``` ## Registry Export Format ```yaml registry: version: "1.0.0" lastUpdated: "2024-01-15T10:00:00Z" skillCount: 150 categories: - name: DAG Framework skillCount: 23 description: Skills for DAG orchestration - name: Development skillCount: 45 description: Software development skills skills: - id: dag-graph-builder name: DAG Graph Builder category: DAG Framework version: "1.0.0" description: Parses problems into DAG structures tags: - dag - orchestration - graph capabilities: - name: task-decomposition confidence: 0.95 - name: dependency-identification confidence: 0.90 pairsWith: - skillId: dag-dependency-resolver reason: Validates built graphs strength: recommended stats: totalExecutions: 1250 successRate: 0.94 averageDuration: 15000 averageTokens: 3500 ``` ## Performance Tracking ```typescript function recordExecution( registry: SkillRegistry, execution: SkillExecution ): void { const skill = registry.skills.get(execution.skillId); if (!skill) return; const stats = skill.stats; // Update running statistics stats.totalExecutions++; stats.successRate = ( (stats.successRate * (stats.totalExecutions - 1)) + (execution.success ? 1 : 0) ) / stats.totalExecutions; // Exponential moving average for duration and tokens const alpha = 0.1; stats.averageDuration = stats.averageDuration * (1 - alpha) + execution.duration * alpha; stats.averageTokens = stats.averageTokens * (1 - alpha) + execution.tokens * alpha; stats.lastExecuted = new Date(); } ``` ## Registry Loading ```typescript async function loadRegistry( skillPaths: string[] ): Promise { const registry = createEmptyRegistry(); for (const basePath of skillPaths) { // Find all SKILL.md files const skillFiles = await glob(`${basePath}/**/SKILL.md`); for (const file of skillFiles) { try { const content = await readFile(file); const skill = parseSkillFile(content); skill.path = file; registerSkill(registry, skill); } catch (error) { console.warn(`Failed to load skill from ${file}: ${error}`); } } } // Build indexes registry.index = buildCapabilityIndex( Array.from(registry.skills.values()) ); return registry; } ``` ## Integration Points - **Consumers**: `dag-semantic-matcher`, `dag-capability-ranker`, `dag-graph-builder` - **Sources**: SKILL.md files, community registries - **Updates**: `dag-performance-profiler` sends execution stats - **Queries**: Natural language via `dag-semantic-matcher` ## Best Practices 1. **Keep Updated**: Refresh registry when skills change 2. **Track Performance**: Accurate stats enable better matching 3. **Index Thoroughly**: Multiple indexes improve query speed 4. **Validate Skills**: Ensure metadata is complete and correct 5. **Version Skills**: Track versions for compatibility --- Central knowledge. Fast discovery. Informed decisions.