# How Commands Enable Chaining Multiple Skills in the pm-skills Marketplace

> Discover how phuryn pm-skills uses markdown commands to chain skills, creating deterministic pipelines where output becomes input, enabling complex workflows without hard-coding.

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

---

**Commands enable chaining multiple skills by declaring sequential workflows in markdown files that invoke named skills in order, passing the output of each step as input to the next, creating deterministic pipelines without hard-coded logic.**

The **pm-skills** repository implements a lightweight, skill-based plugin system where complex product management workflows are constructed through declarative orchestration. Rather than embedding business logic in code, the architecture uses markdown files to define **commands** that automatically load and execute **skills** in sequence. This design allows users to build sophisticated, multi-step processes—such as product discovery or resume review—by simply referencing skill names in a workflow section.

## The Architecture of Command-Driven Skill Chaining

### Commands as Declarative Workflows

In the pm-skills system, **commands** are user-triggered workflows defined in markdown files under `*/commands/*.md`. Each command file contains a `Workflow` section that explicitly lists the skills to execute in order. When a user invokes a command like `/discover`, the AI runtime parses the command file at [`pm-product-discovery/commands/discover.md`](https://github.com/phuryn/pm-skills/blob/main/pm-product-discovery/commands/discover.md) (lines 33-71) and executes the listed skills sequentially.

The chaining mechanism relies on explicit naming conventions. The command does not contain implementation logic; instead, it references skills by their identifiers (e.g., `brainstorm-ideas-existing`, `prioritize-assumptions`). According to the repository README (lines 32-44), this pattern creates a "loading contract" where the engine resolves skill names to their corresponding [`SKILL.md`](https://github.com/phuryn/pm-skills/blob/main/SKILL.md) files on demand.

### Skills as Reusable Knowledge Blocks

**Skills** are self-contained, reusable knowledge blocks stored in `*/skills/*/SKILL.md`. Each skill encapsulates domain-specific logic including prompts, schemas, and evaluation rules. Because skills are isolated and stateless, they can be invoked by any command without modification. The command simply calls the skill by name, and the engine loads the appropriate file from the corresponding plugin directory.

For example, the `identify-assumptions-new` skill located at [`pm-product-discovery/skills/identify-assumptions-new/SKILL.md`](https://github.com/phuryn/pm-skills/blob/main/pm-product-discovery/skills/identify-assumptions-new/SKILL.md) extracts risky assumptions across value, usability, and feasibility categories. This same skill can be invoked by multiple commands without code duplication.

### Dynamic Loading and Execution Flow

The engine uses **dynamic loading** to resolve skill references at runtime. When a command mentions a skill, the engine locates the file using the pattern `/plugin-name:skill-name` or resolves it automatically from the local plugin scope. After a skill finishes execution, its output becomes the contextual input for the next step in the workflow.

**Checkpoints** provide interactive control points. After a skill completes, the command can prompt the user to confirm results or choose alternative paths before proceeding. This ensures that chains remain deterministic yet flexible, allowing human oversight between automated steps.

**Result aggregation** occurs in the final workflow step, where the command compiles outputs from all preceding skills into a unified artifact—such as a discovery plan or structured document.

## Concrete Examples of Skill Chaining

### Example 1: The `/discover` Command (Product Discovery Pipeline)

The `/discover` command demonstrates a four-stage skill chain for product discovery. Located in [`pm-product-discovery/commands/discover.md`](https://github.com/phuryn/pm-skills/blob/main/pm-product-discovery/commands/discover.md), this command orchestrates the following sequence:

```markdown

## Workflow

### Step 2: Brainstorm Ideas (Divergent Phase)

Apply the **brainstorm-ideas-existing** or **brainstorm-ideas-new** skill:
- Generate ideas from PM, Designer, and Engineer perspectives
- Present the top 10 ideas

### Step 3: Identify Assumptions (Critical Thinking Phase)

For each selected idea, apply the **identify-assumptions-existing** or **identify-assumptions-new** skill:
- Surface assumptions across risk categories

### Step 4: Prioritize Assumptions (Focus Phase)

Apply the **prioritize-assumptions** skill:
- Map assumptions on an Impact × Risk matrix

### Step 5: Design Experiments (Validation Phase)

For the top‑priority assumptions, apply **brainstorm-experiments-existing** or **brainstorm-experiments-new** skill:
- Design 1‑2 experiments per critical assumption

```

This workflow chains four distinct skills together, passing the generated ideas and identified assumptions forward to produce a complete discovery plan.

### Example 2: The `/review-resume` Command

The `/review-resume` command in [`pm-toolkit/commands/review-resume.md`](https://github.com/phuryn/pm-skills/blob/main/pm-toolkit/commands/review-resume.md) illustrates a simpler single-skill invocation that can be extended:

```markdown

## Workflow

### Step 2: Evaluate Against 10 Best Practices

Apply the **review-resume** skill:
1. Impact Metrics
2. XYZ+S Formula
...

### Step 3: Generate Review

```

Here, the command invokes the `review-resume` skill defined in [`pm-toolkit/skills/review-resume/SKILL.md`](https://github.com/phuryn/pm-skills/blob/main/pm-toolkit/skills/review-resume/SKILL.md), which encapsulates the 10-point best-practice checklist for product management resumes.

### Example 3: The `/write-prd` Command

The `/write-prd` command in [`pm-execution/commands/write-prd.md`](https://github.com/phuryn/pm-skills/blob/main/pm-execution/commands/write-prd.md) chains the `create-prd` skill multiple times to build a document incrementally:

```markdown

## Workflow

### Step 1: Gather Input

Invoke **create-prd** skill to collect title, problem statement, and scope.

### Step 2: Structure PRD

Invoke **create-prd** skill again to fill each of the 8 sections (Problem, Target, Goals, etc.).

### Step 3: Output Document

Compile the sections into a markdown PRD and save to the workspace.

```

This pattern shows how the same skill can be invoked repeatedly within a single command chain to build complex outputs through iterative refinement.

## Key Implementation Details

The chaining mechanism depends on several critical design decisions in the pm-skills source code:

- **File Resolution**: Skills are auto-loaded when referenced by name in command workflows. The engine expects skill definitions in `*/skills/*/SKILL.md` files.
- **State Management**: Each skill runs to completion and returns results to the command context. The command aggregates these into the final artifact, such as the discovery plan created by the `/discover` command.
- **Interactive Checkpoints**: Commands can insert user confirmation steps between skill executions, allowing the workflow to branch or halt based on human input before the next skill loads.

## Summary

- **Commands** in pm-skills are markdown files that declare sequential workflows, enabling commands to enable chaining multiple skills through simple name references.
- **Skills** are self-contained modules stored in [`SKILL.md`](https://github.com/phuryn/pm-skills/blob/main/SKILL.md) files that execute domain-specific logic and return results to the command context.
- The `/discover` command at [`pm-product-discovery/commands/discover.md`](https://github.com/phuryn/pm-skills/blob/main/pm-product-discovery/commands/discover.md) demonstrates a four-skill chain for product discovery, while `/write-prd` shows iterative skill reuse.
- **Dynamic loading** resolves skill names at runtime without hard-coded imports, supporting flexible plugin architectures.
- **Checkpoints** and **result aggregation** ensure chained workflows remain interactive and produce unified, actionable outputs.

## Frequently Asked Questions

### What is the difference between a command and a skill in pm-skills?

A **command** is a user-facing workflow defined in `*/commands/*.md` that orchestrates the execution flow, while a **skill** is a reusable domain module defined in `*/skills/*/SKILL.md` that encapsulates specific logic like brainstorming or prioritization. Commands chain skills by name, but skills never invoke commands directly.

### How does the pm-skills engine know which skill to load when chaining?

The engine resolves skill names using the loading contract described in the README (lines 32-44). When a command references a skill like `brainstorm-ideas-existing`, the runtime searches for the corresponding [`SKILL.md`](https://github.com/phuryn/pm-skills/blob/main/SKILL.md) file in the plugin directory, either implicitly or explicitly via the `/plugin-name:skill-name` syntax.

### Can a command chain skills from different plugins?

Yes. Because the loading contract supports explicit plugin scoping using the `/plugin-name:skill-name` format, a command in one plugin can invoke skills from another plugin. This enables cross-functional workflows that combine, for example, product discovery skills from `pm-product-discovery` with execution skills from `pm-execution`.

### What happens if a skill fails during a chained workflow?

The architecture supports **checkpoints** between steps, allowing the command to handle skill outputs and errors interactively. If a skill produces unexpected results, the command can pause for user confirmation, redirect to alternative skills, or terminate the chain, preventing the next skill from receiving invalid input.