fix(path-utils): deduplicate subdirectory agent names#1428
Closed
ZvoneO wants to merge 1 commit intobmad-code-org:mainfrom
Closed
fix(path-utils): deduplicate subdirectory agent names#1428ZvoneO wants to merge 1 commit intobmad-code-org:mainfrom
ZvoneO wants to merge 1 commit intobmad-code-org:mainfrom
Conversation
…1422) 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 bmad-code-org#1422 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughAdds comprehensive unit tests for path-utils.js functions and modifies path-utils.js to handle .yaml file extensions and deduplicate agent skill names when folder and file names match, addressing issue Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Author
|
Tech writer successfully tested in Claude Code as /bmad-bmm-tech-writer.agent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1422 - Redundant agent skill names for subdirectory agents
When agents live in subdirectories where the folder name matches the filename (e.g.,
tech-writer/tech-writer.md), the currenttoDashPath()function produces redundant names likebmad-bmm-tech-writer-tech-writer.agent.Changes
.yamlfiles in addition to.mdpath-utils.jsBefore/After
bmm/agents/tech-writer/tech-writer.mdbmad-bmm-tech-writer-tech-writer.agent.mdbmad-bmm-tech-writer.agent.mdcis/agents/storyteller/storyteller.mdbmad-cis-storyteller-storyteller.agent.mdbmad-cis-storyteller.agent.mdbmm/agents/dev.mdbmad-bmm-dev.agent.mdbmad-bmm-dev.agent.md(unchanged)bmm/agents/dev.yamlbmad-bmm-dev.yaml.agent.mdbmad-bmm-dev.agent.md(fixed)Edge Cases Handled
create-prd/workflow.md→create-prd-workflow)a/b/writer/writer.md→a-b-writer)Test Plan
node test/test-path-utils.js)🤖 Generated with Claude Code