Skip to content

fix(pack): ship root skills when .apm/ authors none (#4709) - #4713

Merged
Daniel Meppiel (danielmeppiel) merged 3 commits into
mainfrom
danielmeppiel-4709-pack-root-skills
Nov 22, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 3 commits into
mainfrom
danielmeppiel-4709-pack-root-skills

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

When a package also has an .apm/ directory (for example .apm/instructions/), apm pack skipped its root skills/ directory. A path install of the same package still deploys those root skills (SkillIntegrator.skill_source_paths: a root skills/ holding a skill is the skill source), so the bundle came out missing them.

Pack now takes skills from root skills/ when .apm/skills/ authors no skill (_packs_root_skills in bundle/plugin_exporter.py, shared by every plugin bundle format). The bundle then carries every primitive the path install deploys, and the "Skipping root-level skills/" warning is no longer printed in that case.

If skills exist in both places, .apm/ stays the publishing source and root skills/ is still reported as skipped, so test_pack_auto_includes_only_apm_authored_skills keeps passing. Other root plugin directories (agents, commands, instructions, hooks) keep the existing .apm/ authority and their warnings. The bundle format is unchanged.

test_omitted_includes_with_apm_dir_skips_root_components (added in #2600) asserted the old skip for an .apm/ tree with no skills. Its root-skill assertion now follows the approved scope, and it still pins that root agents are not packed.

Docs: reference/cli/pack.md.

Issue and approved scope

Issue: Fixes #4709

Human scope-approval comment: apm-scope:v1 approval on #4709 (review contact Daniel Meppiel (@danielmeppiel)).

Does this PR complete the issue, or what remains? It completes the fix. The strict cell bundle-ships-root-skills-with-apm-dir lives in corpus train #4711, which has not merged yet. It will be flipped to required in this PR once #4711 lands, or #4711 flips it if this PR lands first.

Type of change

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

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

New tests:

  • tests/unit/test_plugin_exporter.py::test_root_skills_ship_when_apm_dir_authors_no_skill: red on main.
  • test_root_skills_stay_skipped_when_apm_dir_authors_skills: pins the mixed-layout case.
  • tests/integration/test_pack_root_skills_e2e.py::test_pack_archive_ships_root_skills_beside_apm_instructions: real binary; the archive lists the root skill and the instruction.

Manual check: the issue's repro (apm pack --archive, then apm install <zip>) now deploys both .agents/skills/f-bun/SKILL.md and .github/instructions/f-bun.instructions.md.

Local results:

  • Unit: 251 passed.
  • Pack integration suites with APM_E2E_TESTS=1: 241 passed.
  • Lint contract: green.

Changelog

  • One fragment per section, changelog.d/<pr>.<section>.md, holding
    one line: user-visible effect first, 25 words or fewer, ending with
    (#PR); breaking changes only under upgrade notes; no Highlights; no
    new lines under ## [Unreleased]. See changelog.d/README.md and
    .github/instructions/changelog.instructions.md.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • Spec edit
  • Manifest edit
  • Test edit
  • CONFORMANCE.{md,json} regenerated
  • N/A -- pack now ships what install already deploys; no new contract.

apm-spec-waiver: pack ships the root skills a path install already deploys; no new contract.

A package whose skills live in root skills/ while .apm/ holds other
primitives deploys those skills on a path install, but pack skipped them.
Pack now takes skills from root skills/ when .apm/skills/ has no skill, so
the bundle carries what install deploys; with skills in both, .apm/ stays
the source and the root directory is still reported skipped.

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 21, 2026 23:24
apm-spec-waiver: pack ships the root skills a path install already deploys; no new contract.

Co-authored-by: Copilot App <[email protected]>
@danielmeppiel Daniel Meppiel (danielmeppiel) added the full-integration Run the full integration suite (ci-integration.yml) on this PR before merge label Nov 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A directory or dangling symlink named SKILL.md disables the root fallback, causing pack to omit a valid root skill that path installation deploys.

1 open issue
What changed in this PR

This PR addresses #4709 by making plugin bundles include root skills/ when .apm/skills/ contains no skills, aligning that layout with path installs.

Changes:

  • Adds shared root-skill fallback logic and suppresses the corresponding skip warning.
  • Preserves .apm/ precedence when both locations contain skills.
  • Adds exporter and archive regression coverage, updates pack documentation, and records the fix.
File Description
tests/​unit/​test_plugin_exporter.py Covers root-skill fallback and mixed-layout precedence.
tests/​integration/​test_pack_root_skills_e2e.py Checks that an archive includes root skills alongside .apm/ instructions.
src/​apm_cli/​bundle/​plugin_exporter.py Implements fallback selection and adjusts skip warnings.
docs/​src/​content/​docs/​reference/​cli/​pack.md Documents the root-skills exception.
changelog.d/​4713.fixed.md Records the user-visible packaging fix.

Review effort: Balanced

Comment thread src/apm_cli/bundle/plugin_exporter.py Resolved
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit d6484f1 into main Nov 22, 2026
64 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-4709-pack-root-skills branch November 22, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-integration Run the full integration suite (ci-integration.yml) on this PR before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] apm pack --archive silently drops root skills/ when the package also has an .apm/ directory

2 participants