# How the PM Skills Plugin Loading Priority System Works: Marketplace Order and Override Rules

> Understand the PM Skills plugin loading priority system. Learn how marketplace order and override rules dictate execution sequence for efficient plugin management.

- Repository: [Pawel Huryn/pm-skills](https://github.com/phuryn/pm-skills)
- Tags: internals
- Published: 2026-07-05

---

**The PM Skills plugin loading priority system determines execution order through an explicit sequence defined in [`.claude-plugin/marketplace.json`](https://github.com/phuryn/pm-skills/blob/main/.claude-plugin/marketplace.json), where later entries override earlier ones, validated by an alphabetical filesystem scan in [`validate_plugins.py`](https://github.com/phuryn/pm-skills/blob/main/validate_plugins.py).**

The phuryn/pm-skills repository bundles multiple Claude plugins into a cohesive collection. Understanding how this PM Skills plugin loading priority system resolves conflicts and establishes deterministic behavior is essential for developers extending the toolkit or troubleshooting skill overrides.

## The Marketplace.json Declaration

The loading sequence originates in the collection's manifest file.

### Explicit Array Ordering

Claude reads the plugin array in [`.claude-plugin/marketplace.json`](https://github.com/phuryn/pm-skills/blob/main/.claude-plugin/marketplace.json) (lines 11‑66) sequentially. The first plugin listed initializes first, followed by the second, establishing a deterministic priority chain. This explicit declaration ensures that dependencies and foundational tools load before dependent extensions.

## Filesystem Validation and Alphabetical Fallback

While the marketplace file dictates priority, the repository includes a validation mechanism to ensure consistency.

### Directory Scanning Logic

The helper script [`validate_plugins.py`](https://github.com/phuryn/pm-skills/blob/main/validate_plugins.py) performs a safety scan using `sorted(os.listdir(base_path))` (lines 81‑86) to identify plugin directories containing `.claude-plugin` subfolders. This alphabetical enumeration mirrors the marketplace order, providing a stable fallback that prevents filesystem-specific ordering anomalies from affecting the load sequence.

## Override Semantics and Conflict Resolution

When skill identifiers collide, the loading priority determines which definition survives.

### Later-Loaded Plugins Win

If two plugins expose a skill or command with identical identifiers, the plugin appearing later in the [`marketplace.json`](https://github.com/phuryn/pm-skills/blob/main/marketplace.json) array overrides the earlier definition. Because skills reside in namespaced folders (e.g., `pm-toolkit/skills/...`), collisions are rare, but this rule guarantees predictable behavior.

## Implementation Walkthrough

The loading mechanism combines filesystem discovery with manifest-based ordering:

```python

# Excerpt from validate_plugins.py demonstrating priority handling

import os, json

def load_plugins(base_path):
    # 1️⃣ Identify plugin directories alphabetically (lines 81-86)

    plugin_dirs = []
    for entry in sorted(os.listdir(base_path)):               # ← alphabetical sort

        full_path = os.path.join(base_path, entry)
        if os.path.isdir(full_path) and os.path.isdir(
                os.path.join(full_path, ".claude-plugin")):
            plugin_dirs.append(full_path)

    # 2️⃣ Load according to marketplace.json sequence (lines 11-66)

    with open(os.path.join(base_path, ".claude-plugin", "marketplace.json")) as f:
        manifest = json.load(f)

    ordered = [p["name"] for p in manifest["plugins"]]        # ← priority list

    for name in ordered:
        print(f"Loading plugin: {name}")

```

This outputs the exact sequence defined in the marketplace configuration:

```

Loading plugin: pm-product-discovery
Loading plugin: pm-product-strategy
Loading plugin: pm-execution
…
Loading plugin: pm-ai-shipping

```

Each skill loads in this precise order, ensuring that `pm-ai-shipping` can override capabilities from `pm-product-discovery` if necessary.

## Summary

- **Primary source**: The PM Skills plugin loading priority system is explicitly defined in [`.claude-plugin/marketplace.json`](https://github.com/phuryn/pm-skills/blob/main/.claude-plugin/marketplace.json) (lines 11‑66).
- **Validation**: [`validate_plugins.py`](https://github.com/phuryn/pm-skills/blob/main/validate_plugins.py) uses `sorted(os.listdir(base_path))` (lines 81‑86) to ensure stable filesystem enumeration.
- **Override rule**: Later entries in the marketplace array overwrite earlier skill definitions with matching identifiers.
- **Deterministic behavior**: The combination of alphabetical scanning and explicit manifest ordering eliminates load-order ambiguity across environments.

## Frequently Asked Questions

### What happens if two plugins define the same skill?

The plugin appearing later in the [`marketplace.json`](https://github.com/phuryn/pm-skills/blob/main/marketplace.json) array wins and overrides the earlier definition. This deterministic overwrite rule ensures predictable behavior when skill identifiers collide, though namespaced folder structures (e.g., `pm-toolkit/skills/...`) minimize such conflicts.

### How does the alphabetical fallback work in the PM Skills plugin loading priority system?

The [`validate_plugins.py`](https://github.com/phuryn/pm-skills/blob/main/validate_plugins.py) script scans the filesystem using `sorted(os.listdir(base_path))` to identify valid plugin directories. This alphabetical sorting (lines 81‑86) serves as a validation mechanism that mirrors the marketplace file's intended order, ensuring the system maintains a stable sequence even if filesystem ordering varies by platform.

### Where is the loading order formally declared?

The canonical loading order is declared in [`.claude-plugin/marketplace.json`](https://github.com/phuryn/pm-skills/blob/main/.claude-plugin/marketplace.json) at lines 11‑66. This JSON array lists plugins in their execution priority, which Claude reads sequentially during initialization according to the phuryn/pm-skills source code.

### Can individual plugin priorities be changed without modifying core files?

Yes. Since the PM Skills plugin loading priority system relies on the array order in [`.claude-plugin/marketplace.json`](https://github.com/phuryn/pm-skills/blob/main/.claude-plugin/marketplace.json), repositioning entries within this file changes their loading priority and override potential. However, changing the order may affect dependency resolution if foundational plugins are moved after their dependents.