Skip to content

fix: strip skills prefix from bare skill plugin export#738

Open
zeel2104 wants to merge 2 commits intomicrosoft:mainfrom
zeel2104:fix/plugin-pack-skills-nesting
Open

fix: strip skills prefix from bare skill plugin export#738
zeel2104 wants to merge 2 commits intomicrosoft:mainfrom
zeel2104:fix/plugin-pack-skills-nesting

Conversation

@zeel2104
Copy link
Copy Markdown

Description

Fix duplicated skills/skills/ nesting in apm pack --format plugin for bare skill dependencies referenced through virtual paths like skills/<name>.

The exporter now normalizes bare-skill slugs before writing bundle paths, so dependencies such as github/awesome-copilot/skills/javascript-typescript-jest pack to skills/javascript-typescript-jest/ as expected. Added regression coverage for both the collector helper and the end-to-end plugin export path.

Fixes #719

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)
uv run python -m pytest tests/unit/test_plugin_exporter.py -q
uv run python -m pytest tests/unit/test_packer.py -q

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes incorrect skills/skills/ directory nesting when exporting plugin bundles for bare-skill dependencies referenced via virtual paths like skills/<name>, aligning packed output with plugin.json expectations and the plugin host directory convention.

Changes:

  • Normalize bare-skill slugs derived from dependency virtual_path by stripping leading skills/ prefixes before emitting bundle paths.
  • Add unit + end-to-end regression tests to ensure apm pack --format plugin places bare skills under skills/<skill-name>/ (no duplicated skills/).
Show a summary per file
File Description
src/apm_cli/bundle/plugin_exporter.py Adds _normalize_bare_skill_slug() and uses it in _collect_bare_skill() to prevent skills/skills/ nesting for virtual_path="skills/<name>".
tests/unit/test_plugin_exporter.py Adds regression coverage for slug normalization and for the full plugin export path to ensure no duplicated skills/ directory is produced.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] apm pack --format plugin produces duplicated skills/ directory nesting

3 participants