fix(pro-installer): handle flat .md files when applying path placeholders - #19
Open
ifdev25 wants to merge 1 commit into
Open
fix(pro-installer): handle flat .md files when applying path placeholders#19ifdev25 wants to merge 1 commit into
ifdev25 wants to merge 1 commit into
Conversation
…ders
copyAgentCategory always called replacePathPlaceholdersInDir on the
copied destination, but the destination is a file when the source entry
is a flat .md (current layout of aiblueprint-cli-premium/agents-config/agents).
replacePathPlaceholdersInDir runs fs.readdir on its argument, which
throws ENOTDIR and breaks `agents pro setup`:
Failed to install premium configs: ENOTDIR: not a directory,
scandir '~/.agents/agents/code-architect.md'
Switch to applyPathPlaceholders, the existing helper in agents-installer
that branches on file vs directory (already used by
installCategoryToAgents). Export it so pro-installer can reuse it.
Adds a regression test that reproduces the original ENOTDIR error and
covers the legacy directory layout plus the "skip when claudeDir has a
real entry" path.
horde-dimitri
approved these changes
Jun 10, 2026
horde-dimitri
left a comment
There was a problem hiding this comment.
Hermes Agent Review
Verdict: Approved
Reviewed the flat .md pro-installer placeholder handling. The change correctly routes flat files through applyPathPlaceholders() instead of directory traversal, and the regression tests cover the previous ENOTDIR path plus skip behavior for real user files. No blocking correctness, security, or maintainability issues found.
Reviewed by Hermes 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
copyAgentCategorycallsreplacePathPlaceholdersInDiron the copied destination, but the destination is a file when the source entry is a flat.md(the current layout ofaiblueprint-cli-premium/agents-config/agents/).replacePathPlaceholdersInDirrunsfs.readdiron its argument, which throwsENOTDIRand breaksagents pro setup:This was reproducible on Windows running
npx aiblueprint-cli@latest agents pro setupagainst the current premium repo.Fix
Switch to
applyPathPlaceholders— the existing helper inagents-installer.tsthat branches on file vs directory (already used byinstallCategoryToAgents). Export it sopro-installer.tscan reuse it.Diff is intentionally minimal:
src/lib/agents-installer.ts:exportapplyPathPlaceholders(+1/-1)src/lib/pro-installer.ts: import + use the helper, exportcopyAgentCategoryfor the test (+3/-2)tests/pro-installer.test.ts: new regression test file (+122)Test plan
tests/pro-installer.test.tswith 3 cases:.mdsource entry — fails withENOTDIRbefore the fix, passes after.{CLAUDE_PATH}substitution inside).claudeDiris correctly skipped.mainwith exactly the original error (ENOTDIR: scandir '...\agents\agents\code-architect.md') by reverting only the fix line.bun test:run—103 passed / 9 failed(the 9 failures are pre-existing Windows path/symlink-permission issues unrelated to this change; same counts before and after).bun run build— OK.