# Skill Cross Reference Mapper

> Use when mapping skill dependencies and cross-references.

- Skill: `loopyluci/skill-cross-reference-mapper` (Agent Skill)
- Install (CLI): `npx skillmds@latest add loopyluci/skill-cross-reference-mapper`
- Raw SKILL.md: https://api.skillmd.com/api/skills/loopyluci/skill-cross-reference-mapper/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: LoopyLuci (https://skillmd.com/u/loopyluci)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/loopyluci/skill-cross-reference-mapper

---


# Skill Cross-Reference Mapper

Mapping dependencies and relationships between skills — from related_skills extraction through dependency graph building, gap analysis, and circular dependency detection.

## When to Use

- Understanding how skills relate to each other
- Finding skill clusters and knowledge domains
- Detecting orphaned skills with no cross-references
- Building skill navigation and discovery tools
- Identifying prerequisites in learning paths

## Reference Mapper

```python
import re, json
from collections import defaultdict

class ReferenceMapper:
    """Map cross-references between skills."""
    
    def __init__(self):
        self.graph = defaultdict(set)  # skill -> [related_skills]
    
    def extract_references(self, skill_md: str, skill_name: str):
        """Extract related_skills from frontmatter."""
        match = re.search(r'related_skills:\s*\[(.*?)\]', skill_md)
        if match:
            refs = [r.strip() for r in match.group(1).split(',')]
            self.graph[skill_name].update(refs)
            for ref in refs:
                self.graph[ref]  # ensure it exists
    
    def find_orphans(self, all_skills: set) -> List[str]:
        """Skills with no incoming references."""
        referenced = set()
        for refs in self.graph.values():
            referenced.update(refs)
        return list(all_skills - referenced)
    
    def detect_cycles(self) -> List[tuple]:
        """Detect circular references (A→B→A)."""
        cycles = []
        for skill, refs in self.graph.items():
            for ref in refs:
                if skill in self.graph.get(ref, set()):
                    cycles.append((skill, ref))
        return cycles
```

## Verification Checklist

- [ ] related_skills extracted from all skills
- [ ] Orphaned skills identified and flagged
- [ ] Circular references detected
- [ ] Cross-reference graph exportable (JSON/DOT)
- [ ] Prerequisite chains visible for learning paths

