Fixes redundant skill names for agents in subdirectories where the
folder name matches the filename (e.g., tech-writer/tech-writer.md).
Changes:
- Deduplicate when last two path segments are identical
- Handle .yaml extension in addition to .md
- Add comprehensive test suite (40 tests)
Before: bmad-bmm-tech-writer-tech-writer.agent
After: bmad-bmm-tech-writer.agent
Closes#1422
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>