# Command Chaining Pattern in PM Skills: How Slash Commands Orchestrate Multi-Step Workflows

> Explore the command chaining pattern in PM Skills. Discover how slash commands orchestrate multi-step workflows, efficiently passing data between modular skill files for streamlined execution.

- Repository: [Pawel Huryn/pm-skills](https://github.com/phuryn/pm-skills)
- Tags: how-to-guide
- Published: 2026-07-04

---

**PM Skills implements a command chaining pattern where slash commands like `/discover` act as lightweight orchestrators that sequentially invoke modular skill files, feeding the output of each step into the next until producing the final result.**

The `phuryn/pm-skills` repository structures product management workflows using this command chaining pattern to decouple orchestration logic from domain expertise. Each slash command serves as a declarative entry point that chains together reusable skills—self-contained markdown files encapsulating specific techniques like assumption identification or experiment design. This architecture enables complex multi-step processes to be executed through a single command while maintaining modularity across the codebase.

## How the Command Chaining Pattern Works

The pattern follows a linear pipeline: `command → load skill → run skill → (optional user checkpoint) → next skill → … → final output`.

According to the repository's top-level [`README.md`](https://github.com/phuryn/pm-skills/blob/main/README.md), "Commands use skills. Some skills serve multiple commands..." 【/cache/repos/github.com/phuryn/pm-skills/main/README.md#L43-L49】. This design separates the orchestration layer (commands) from the implementation layer (skills), allowing the same skill to be reused across different workflows without duplication.

### Step-by-Step Execution Flow

When a user invokes a slash command, the system executes four distinct phases:

1. **Parse user intent** – Extract the command name and arguments from the slash invocation.
2. **Load the first skill** – Retrieve the skill file specified in the command's chain definition.
3. **Execute and capture** – Run the skill, capture its output, and optionally prompt the user for clarification.
4. **Chain to next skill** – Feed the accumulated context into the next skill in the sequence until the final skill produces the end result.

## Real-World Example: The `/discover` Command Chain

The `/discover` command, defined in [`pm-product-discovery/commands/discover.md`](https://github.com/phuryn/pm-skills/blob/main/pm-product-discovery/commands/discover.md), demonstrates a five-step chain that guides product discovery from ideation to experimentation plan.

As implemented in `phuryn/pm-skills`, the command explicitly lists each step and the skill it invokes 【/cache/repos/github.com/phuryn/pm-skills/main/pm-product-discovery/commands/discover.md#L18-L69】:

| Step | Skill Invoked | Purpose |
|------|--------------|---------|
| 1 | `brainstorm-ideas-new` or `brainstorm-ideas-existing` | Generate product ideas from PM, Designer, and Engineer perspectives |
| 2 | `identify-assumptions-new` or `identify-assumptions-existing` | Surface risk assumptions for selected ideas |
| 3 | `prioritize-assumptions` | Rank assumptions on an Impact × Risk matrix |
| 4 | `brainstorm-experiments-new` or `brainstorm-experiments-existing` | Design validation experiments for top assumptions |
| 5 | `write-discovery-plan` (implicit) | Assemble outputs into a markdown discovery plan |

The markdown source explicitly defines Step 2 as: "For each selected idea, apply the **identify-assumptions-existing** or **identify-assumptions-new** skill" 【/cache/repos/github.com/phuryn/pm-skills/main/pm-product-discovery/commands/discover.md#L43-L57】.

## Code Implementation Examples

### Command Orchestrator Logic

While the repository uses markdown files for declarative definitions, the execution model follows this Python-like orchestration pattern:

```python
def run_command(name, args):
    # Mapping of command → list of skill identifiers

    chains = {
        "discover": [
            "brainstorm-ideas-new",
            "identify-assumptions-new",
            "prioritize-assumptions",
            "brainstorm-experiments-new",
        ],
        "tailor-resume": [
            "review-resume",
            "customize-resume",
        ],
    }

    for skill_name in chains[name]:
        output = run_skill(skill_name, args)
        # Optionally ask the user to confirm or provide extra data

        args = merge_args(args, output)   # Feed result into next skill

    return output

```

### Skill Reuse Across Commands

The `review-resume` skill demonstrates reuse across multiple commands. While the `/review-resume` command uses it directly, the `/tailor-resume` command incorporates it as a chained step.

In [`pm-toolkit/commands/tailor-resume.md`](https://github.com/phuryn/pm-skills/blob/main/pm-toolkit/commands/tailor-resume.md), Step 3 explicitly invokes: "Apply the **review-resume** skill: **Keyword alignment**... **Bullet point rewriting**..." 【/cache/repos/github.com/phuryn/pm-skills/main/pm-toolkit/commands/tailor-resume.md#L37-L44】. This reusability ensures that resume evaluation logic remains consistent whether the user requests a standalone review or a tailored optimization.

## Key Files Defining the Pattern

- **[`README.md`](https://github.com/phuryn/pm-skills/blob/main/README.md)** (top-level): Documents the core architecture where "Commands use skills" and explains that individual skills serve multiple commands 【/cache/repos/github.com/phuryn/pm-skills/main/README.md#L43-L49】.
- **[`pm-product-discovery/commands/discover.md`](https://github.com/phuryn/pm-skills/blob/main/pm-product-discovery/commands/discover.md)**: Concrete implementation showing a command chaining four distinct skills through explicit step definitions 【/cache/repos/github.com/phuryn/pm-skills/main/pm-product-discovery/commands/discover.md】.
- **[`pm-toolkit/commands/tailor-resume.md`](https://github.com/phuryn/pm-skills/blob/main/pm-toolkit/commands/tailor-resume.md)**: Example of skill reuse, chaining the `review-resume` skill within a larger workflow 【/cache/repos/github.com/phuryn/pm-skills/main/pm-toolkit/commands/tailor-resume.md】.
- **`pm-*/skills/*/SKILL.md`**: Individual skill definitions (e.g., `brainstorm-ideas-new`, `identify-assumptions-new`, `review-resume`) that serve as the atomic units in the command chains.

## Summary

- **PM Skills** implements a command chaining pattern that separates command orchestration from skill implementation.
- Each **slash command** (e.g., `/discover`, `/tailor-resume`) defines a sequential chain of skill invocations in its markdown file.
- **Skills** are self-contained, reusable modules that can be shared across multiple commands, such as `review-resume` being used by both `/review-resume` and `/tailor-resume`.
- The pattern follows a **linear execution flow**: parse intent → load skill → execute → feed output to next skill → produce final result.
- Command chains are explicitly defined in files like [`pm-product-discovery/commands/discover.md`](https://github.com/phuryn/pm-skills/blob/main/pm-product-discovery/commands/discover.md) and [`pm-toolkit/commands/tailor-resume.md`](https://github.com/phuryn/pm-skills/blob/main/pm-toolkit/commands/tailor-resume.md).

## Frequently Asked Questions

### What is the command chaining pattern in PM Skills?

The command chaining pattern is an architectural design where slash commands act as lightweight orchestrators that sequentially invoke modular skill files. Each command defines a specific sequence of skills to execute, passing context from one step to the next until the final skill produces the end result. This pattern is documented in the repository's [`README.md`](https://github.com/phuryn/pm-skills/blob/main/README.md) and implemented throughout the `pm-product-discovery` and `pm-toolkit` directories.

### How does output from one skill feed into the next?

The command execution model captures the output of each skill and merges it into the arguments context for the subsequent skill. As shown in the orchestrator logic, the system calls `merge_args(args, output)` between steps, ensuring that insights generated by early skills (like identified assumptions) are available to later skills (like prioritization matrices) without manual user intervention.

### Can skills be reused across different commands?

Yes, skills are designed as reusable modules that can be invoked by multiple commands. For example, the `review-resume` skill is used by both the `/review-resume` command and as a chained step in the `/tailor-resume` command, as defined in [`pm-toolkit/commands/tailor-resume.md`](https://github.com/phuryn/pm-skills/blob/main/pm-toolkit/commands/tailor-resume.md) 【/cache/repos/github.com/phuryn/pm-skills/main/pm-toolkit/commands/tailor-resume.md#L37-L44】. This reuse ensures consistent application of domain expertise across different workflows.

### Where is the chain sequence defined for each command?

The chain sequence is defined declaratively within each command's markdown file in the `commands/` directory. For instance, the `/discover` command in [`pm-product-discovery/commands/discover.md`](https://github.com/phuryn/pm-skills/blob/main/pm-product-discovery/commands/discover.md) explicitly lists each step (Step 1 through Step 5) and specifies which skill to invoke at each stage 【/cache/repos/github.com/phuryn/pm-skills/main/pm-product-discovery/commands/discover.md#L18-L69】.