Skip to content

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

@Antonin-Rouxel-LaPoste-BGPN

Description

Describe the bug

When running apm pack --format plugin, the resulting build artifact contains a duplicated skills/skills/ directory structure instead of the expected skills/. The plugin.json declares "skills": ["skills/"], but the pack command places the skill folders one level too deep, resulting in skills/skills/<skill-name>/SKILL.md instead of skills/<skill-name>/SKILL.md.

To Reproduce

Steps to reproduce the behavior:

  1. Run command apm pack
  2. With parameters --format plugin inside a project containing an apm.yml with dependencies.apm pointing to a GitHub-hosted skill (e.g. github/<org>/<repo>/skills/<skill-name>)
  3. Inspect the build output directory: build/<name>-<version>/
  4. See error: the skills are placed under build/<name>-<version>/skills/skills/<skill-name>/ instead of build/<name>-<version>/skills/<skill-name>/

Expected behavior

The packed plugin should produce the following structure:

build/halo-angular-1.0.0/
├── plugin.json
└── skills/
    └── javascript-typescript-jest/
        └── SKILL.md

Actual behavior

build/halo-angular-1.0.0/
├── plugin.json
└── skills/              ← declared in plugin.json as "skills": ["skills/"]
    └── skills/          ← duplicated nesting introduced by apm pack
        └── javascript-typescript-jest/
            └── SKILL.md

Environment

  • OS: Linux (Debian GNU/Linux 13 trixie, dev container)
  • APM Version: 0.8.11 (81082e2)
  • VSCode Version: 1.115.0

Logs

apm pack --format plugin exits with code 0 (no error reported), making the issue silent. The malformed output is only discoverable by inspecting the build directory manually.

apm.yml:

name: halo-angular
version: 1.0.0
description: APM project for halo-angular
author: Antonin Rouxel

dependencies:
  apm:
    - github/awesome-copilot/skills/javascript-typescript-jest
  mcp: []
scripts: {}

Generated plugin.json:

{
  "name": "halo-angular",
  "version": "1.0.0",
  "description": "APM project for halo-angular",
  "author": {
    "name": "Antonin Rouxel"
  },
  "skills": [
    "skills/"
  ]
}

Additional context

The root cause appears to be that apm pack resolves the skill destination path as skills/ (from plugin.json) and then copies the skill folders into a subdirectory also named skills/, resulting in double nesting. The pack command should either flatten the resolved path or not append an extra skills/ segment when the destination folder is already named skills/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedDirection approved, safe to start workbugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions