Fix multi-file packages dropping supporting files on format conversion#272
Conversation
When installing a multi-file package with `--as <format>` (e.g. `prpm install <pkg> --as claude,codex`), the conversion path converted only the main file (SKILL.md) and then collapsed the entire file list down to that single file. Every supporting file (references/, agents/, helpers/, etc.) was silently dropped before the install loop ran, so the converted target (codex) received only SKILL.md while the native claude install kept the full tree. Preserve all files during conversion: convert only the main entry point and copy the remaining files verbatim, letting the existing multi-file install loop write the full directory tree to the target format's location (e.g. .agents/skills/<name>/ for codex). Also guard the Cursor .mdc rename against progressive-disclosure skills so converted skills installed to .openskills/ keep their SKILL.md name and supporting files, matching the single-file install path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
🤖 My Senior Dev — Analysis Complete👤 For @khaliqgant📁 Expert in View your contributor analytics → 📊 2 files reviewed • 1 high risk • 6 need attention 🚨 High Risk:
🚀 Open Interactive Review →The full interface unlocks features not available in GitHub:
💬 Chat here: 📖 View all 12 personas & slash commandsYou can interact with me by mentioning In PR comments or on any line of code:
Slash commands:
AI Personas (mention to get their perspective):
For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews. |
| // Skip the Cursor .mdc rename when the skill is installed via progressive | ||
| // disclosure (.openskills/) — there it stays a SKILL.md, matching the | ||
| // single-file install path, and supporting files are preserved verbatim. | ||
| const isCursorConversion = (effectiveFormat === 'cursor' && pkg.format === 'claude' && pkg.subtype === 'skill') && !needsProgressiveDisclosureMulti; |
There was a problem hiding this comment.
Suggestion: The added !needsProgressiveDisclosureMulti guard makes isCursorConversion false for multi-file skill installs that go through progressive disclosure (.openskills/), which skips the Cursor-specific processing block entirely. As a result, converted Cursor installs no longer get Cursor post-processing (like header/config application) in the multi-file path, creating behavior drift from the single-file path and potentially producing improperly configured installed content. Keep progressive-disclosure filename behavior, but still run the Cursor post-processing on the converted main file. [logic error]
Severity Level: Major ⚠️
- ❌ Multi-file Claude→Cursor skills ignore user cursor config overrides.
- ⚠️ Progressive `.openskills` installs behave differently from single-file installs.Steps of Reproduction ✅
1. Configure a Cursor MDC override in user config as defined in
`packages/cli/src/core/user-config.ts:11-17,54-59` (e.g., set `cursor: { alwaysApply:
true, globs: ["src/**/*.ts"] }` in `~/.prpmrc` so `config.cursor` is non-empty when
`handleInstall` runs).
2. Create a multi-file Claude skill tarball using the `createTarGz` helper from
`packages/cli/src/__tests__/install-multifile.test.ts:56-104`, with at least `SKILL.md`
and one supporting file (e.g., `helpers/utils.md`), and a mocked registry package `{
format: 'claude', subtype: 'skill' }` as in the multi-file test at lines 175-187.
3. In a Vitest test similar to
`packages/cli/src/__tests__/install-format-conversion.test.ts:68-118`, mock `getConfig` to
return the config from step 1, mock `getPackage`/`downloadPackage` to return the
multi-file tarball from step 2, and call `handleInstall('complex-skill', { as: 'cursor'
})` so execution enters the conversion block at
`packages/cli/src/commands/install.ts:701-232` and produces `convertedContent` via
`toCursor(canonicalPkg)` (see `packages/converters/src/to-cursor.ts:28-51` which always
emits an MDC header).
4. Because the tarball is multi-file, `handleInstall` enters the multi-file branch at
`packages/cli/src/commands/install.ts:1400-1599`, computes
`needsProgressiveDisclosureMulti` as `true` for `effectiveFormat === 'cursor'` and
`effectiveSubtype === 'skill'` using `FORMAT_NATIVE_SUBTYPES.cursor` from
`packages/types/src/package.ts:12-26`, then evaluates `const isCursorConversion =
(effectiveFormat === 'cursor' && pkg.format === 'claude' && pkg.subtype === 'skill') &&
!needsProgressiveDisclosureMulti;` at line 1502, making `isCursorConversion` `false`.
5. In the multi-file write loop at `packages/cli/src/commands/install.ts:1540-1659`, the
Cursor post-processing block guarded by `if (isCursorConversion)` (around line 1575) is
skipped entirely, so the converted SKILL content is written without running
`addMDCHeader`/`applyCursorConfig(fileContent, config.cursor)` for this multi-file
progressive install, while the single-file path still applies Cursor post-processing
unconditionally for cursor installs via the `if (format === 'cursor' && effectiveFormat
=== 'cursor')` block at lines 1351-1359.
6. Inspect the arguments passed to the mocked `saveFile` (as done in the existing tests)
and observe that `.openskills/complex-skill/SKILL.md` contains the default MDC header
generated by `toCursor` (including `alwaysApply` from
`packages/converters/src/to-cursor.ts:110-129`) but does not reflect user-specified
overrides from `config.cursor` (e.g., custom `globs` or `alwaysApply` values),
demonstrating that multi-file progressive Claude→Cursor installs no longer receive the
Cursor config post-processing that single-file installs do.(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** packages/cli/src/commands/install.ts
**Line:** 1502:1502
**Comment:**
*Logic Error: The added `!needsProgressiveDisclosureMulti` guard makes `isCursorConversion` false for multi-file skill installs that go through progressive disclosure (`.openskills/`), which skips the Cursor-specific processing block entirely. As a result, converted Cursor installs no longer get Cursor post-processing (like header/config application) in the multi-file path, creating behavior drift from the single-file path and potentially producing improperly configured installed content. Keep progressive-disclosure filename behavior, but still run the Cursor post-processing on the converted main file.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
User description
Problem
Installing a multi-file package to a converted format drops every file except the main entry point. For example:
SKILL.md+references/+agents/+workforce/….agents/skills/<name>/SKILL.mdRoot cause
In
packages/cli/src/commands/install.ts, the--asconversion path converted only the main file and then replaced the entire extracted file list with that single file:All supporting files were discarded before the file-writing loop ran. The native install never converts, which is why only the converted target was affected.
Fix
.agents/skills/<name>/for codex, with subdirectories preserved)..mdcrename against progressive-disclosure skills so converted skills installed to.openskills/keep theirSKILL.mdname and supporting files, matching the single-file install path.Supporting files are copied as-is rather than symlinked: codex's
SKILL.mdis regenerated by the converter (frontmatter normalized, body rebuilt), so a directory symlink to the claude copy would point codex at the un-converted file. The support files are identical either way.Tests
--as codexnow writes all files to.agents/skills/<name>/with subdirectories preserved.tsc --noEmitis clean. The 2 failing tests inpublish.test.tsare pre-existing onmainand unrelated.🤖 Generated with Claude Code
CodeAnt-AI Description
Keep supporting files when converting multi-file installs
What Changed
--asnow keeps all supporting files instead of dropping everything except the main file.helpers/andreferences/stay in place under the same package folder.Impact
✅ Preserved skill bundles during format conversion✅ Fewer missing-file installs for Codex skills✅ Clearer Cursor skill installs with supporting files intact💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.