🎯 Feature Overview
Problem: Skills often reference other prompts, instructions, or agents (e.g., in prerequisites or related content), but there's no automated validation that these references exist or are correctly formatted.
Solution: Build a validator that checks skill dependencies during the build process and generates a dependency graph visualization.
📋 Development Plan
Phase 1: Analysis & Design (Day 1)
-
Audit existing skills to understand dependency patterns:
- Search for reference patterns in skills/
- Document dependency formats found in frontmatter and markdown content
- Identify common reference types (prerequisites, related skills, see-also)
-
Design validator schema:
interface SkillDependency {
source: string; // skill file path
target: string; // referenced file path
referenceType: 'prerequisite' | 'related' | 'seeAlso';
isValid: boolean;
line: number;
}
Phase 2: Core Validation (Days 2-3)
-
Create validation module at eng/validators/skill-dependencies.mjs:
- Extract dependencies from frontmatter (prerequisites, relatedSkills)
- Parse markdown links for internal references
- Validate that referenced files exist
- Report broken references with file paths and line numbers
-
Integrate into build script at eng/update-readme.mjs:
- Run validation during
npm run build
- Fail build in CI if broken references found
- Warn locally for developer feedback
-
Add npm script to package.json:
"validate:deps": "node eng/validators/skill-dependencies.mjs"
Phase 3: Visualization (Day 4)
-
Generate dependency graph using Mermaid:
- Create nodes for each skill/prompt/instruction
- Draw edges showing dependencies with type labels
- Highlight broken references in red
- Generate graph output to DEPENDENCIES.md
-
Generate DEPENDENCIES.md:
- Include Mermaid diagram of all dependencies
- Statistics section (total deps, valid, broken)
- List of broken references if any exist
Phase 4: Testing (Day 5)
-
Create test fixtures in eng/validators/__tests__/fixtures/:
- Valid skill with correct references
- Skill with broken link
- Skill with circular dependency
-
Write unit tests:
- Test detection of valid references
- Test catching broken references
- Test handling of circular dependencies
- Test frontmatter parsing
- Test markdown link extraction
-
Local testing:
npm run validate:deps
npm run build
git diff DEPENDENCIES.md
Phase 5: Documentation & PR (Day 6)
-
Update .github/copilot-instructions.md:
- Document skill dependency validation
- Explain valid reference types
- Show example frontmatter with references
- Link to DEPENDENCIES.md visualization
-
Create PR with:
- Clear description of feature and benefits
- Example validation output
- Screenshot of dependency graph
- Updated documentation
✅ Acceptance Criteria
📊 Success Metrics
- Zero broken references in main branch
- Automated validation prevents future breaks
- Visual dependency graph helps contributors understand relationships
- No impact on existing contributor workflows
🔄 Future Enhancements
- Circular dependency detection with warnings
- Suggest similar files when reference is broken
- Dependency impact analysis (what breaks if I delete this skill?)
- Interactive graph with clickable nodes
- Auto-fix broken references based on fuzzy matching
🧪 Testing Strategy
Local Testing:
# Run validation on current repo
npm run validate:deps
# Test with intentionally broken reference
echo '[test](nonexistent.md)' >> skills/test-skill/SKILL.md
npm run validate:deps # Should fail
# Verify build integration
npm run build # Should include validation
CI Testing:
- Add GitHub Actions workflow to fail PRs with broken dependencies
- Generate dependency graph as PR comment
📝 Implementation Notes
- Use existing
vfile-matter for frontmatter parsing (already in dependencies)
- Leverage
glob for file discovery patterns
- Follow existing validator patterns from
validate-skills.mjs and validate-collections.mjs
- Maintain consistent error reporting format across validators
- Support both absolute and relative path references
🏷️ Labels
- enhancement
- build-system
- validation
- documentation
🎯 Feature Overview
Problem: Skills often reference other prompts, instructions, or agents (e.g., in prerequisites or related content), but there's no automated validation that these references exist or are correctly formatted.
Solution: Build a validator that checks skill dependencies during the build process and generates a dependency graph visualization.
📋 Development Plan
Phase 1: Analysis & Design (Day 1)
Audit existing skills to understand dependency patterns:
Design validator schema:
Phase 2: Core Validation (Days 2-3)
Create validation module at
eng/validators/skill-dependencies.mjs:Integrate into build script at
eng/update-readme.mjs:npm run buildAdd npm script to
package.json:Phase 3: Visualization (Day 4)
Generate dependency graph using Mermaid:
Generate DEPENDENCIES.md:
Phase 4: Testing (Day 5)
Create test fixtures in
eng/validators/__tests__/fixtures/:Write unit tests:
Local testing:
Phase 5: Documentation & PR (Day 6)
Update
.github/copilot-instructions.md:Create PR with:
✅ Acceptance Criteria
npm run validate:depscommand available📊 Success Metrics
🔄 Future Enhancements
🧪 Testing Strategy
Local Testing:
CI Testing:
📝 Implementation Notes
vfile-matterfor frontmatter parsing (already in dependencies)globfor file discovery patternsvalidate-skills.mjsandvalidate-collections.mjs🏷️ Labels