npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pi-prompt-composer

v1.3.1

Published

Build multi-option slash commands from plain prompts — variable expansion, arg collection & interactive selectors for Pi

Readme

pi-prompt-composer

Build multi-option slash commands from plain prompts — variable expansion, arg collection & interactive selectors for Pi.

Turn a directory of .md prompt files into a single /command with Tab-completable subcommands, a rich interactive selector, and automatic missing-argument collection.

Quick start

# Install
pi install pi-prompt-composer

# Copy the bundled examples into your project prompt root
mkdir -p .pi/prompts/review
cp -r $(pi resolve pi-prompt-composer)/examples/prompts/review/* .pi/prompts/review/

# Reload Pi, then try:
#   /review           → interactive selector
#   /review summary   → asks for missing "change" arg, then sends
#   /review fix "bug" → dispatches immediately

How it works

A folder with an _index.md (containing type: group) becomes a grouped command. Every other .md file in that folder becomes a subcommand.

.pi/prompts/
├── workspace.md              ← flat Pi prompt, unchanged
├── review/
│   ├── _index.md             ← type: group  →  /review
│   ├── summary.md            ←                  /review summary
│   └── fix.md                ←                  /review fix

Both prompt roots are scanned:

  • User: ~/.pi/agent/prompts/
  • Project: <project>/.pi/prompts/

Flat .md files outside group directories continue to work as native Pi prompts.

Features

| Feature | Behavior | |---------|----------| | Direct dispatch | /review fix "the bug" → substitutes args, sends immediately | | Bare-command selector | /review → rich TUI selector with aligned descriptions and dynamic usage hints | | Missing-arg collection | Prompts with required args metadata pause and ask before sending | | Autocomplete | Tab after /review shows subcommand names with descriptions | | Unknown subcommand | Typos show a warning with available alternatives | | Escape syntax | \$ARGUMENTS renders as literal $ARGUMENTS | | Discovery warnings | Malformed metadata surfaces as Pi notifications on session start | | Bundled /compose | Built-in helpers for creating, extending, and simplifying grouped prompts | | Authoring skill | Comprehensive compose-grouped-prompts skill loaded on demand for deep guidance |

Bundled /compose command

The package ships a built-in /compose grouped command for authoring grouped prompts:

| Command | Purpose | |---------|---------| | /compose | Interactive selector for compose operations | | /compose new <group-name> | Create a new grouped prompt set | | /compose add <group-name> | Add subcommands to an existing group | | /compose remove <group-name> | Remove or simplify a subcommand |

The bundled /compose is loaded with lowest precedence. If you create your own compose/ group in user or project prompts, it overrides the built-in version.

Required tools

The /compose prompts work best with pi-ask-user installed — it provides the ask_user tool for interactive decision handshakes during prompt authoring. If required tools are missing, a persistent warning banner appears at session start:

 Missing tools: ask_user — run pi install pi-ask-user

Authoring skill

The package also ships a compose-grouped-prompts skill with:

  • Workflow guidance for creating, adding, and removing prompts
  • Layout conventions and naming rules
  • Frontmatter and args reference
  • Realistic examples and anti-patterns

The skill is loaded on demand when the model needs deeper guidance beyond what the /compose prompts provide.

Writing prompts

_index.md (required)

---
type: group
description: Review workflows
order: [summary, fix]
---

type: group is the hard gate — directories without it are ignored.

order is optional — controls subcommand display order in autocomplete and the selector. Listed names appear first in the given order; unlisted subcommands are appended alphabetically. Omit for default alphabetical ordering.

Nested prompt files

---
description: Summarize a change
args:
  - name: change
    required: true
    hint: What changed?
  - name: context
    required: false
    hint: Additional context
---
Summarize the following change:
$ARGUMENTS

Argument syntax is Pi-native: $1, $2, $@, $ARGUMENTS, ${@:N}, ${@:N:L}.

Use \$ to escape a literal dollar sign (e.g., \$ARGUMENTS renders as $ARGUMENTS).

args metadata

Each item needs:

| Field | Required | Default | Notes | |-------|----------|---------|-------| | name | yes | — | Items without name are skipped with a warning | | required | no | false | Whether the extension asks for this arg when missing | | hint | no | "" | Shown in the input prompt and selector usage hint |

Parsing is lenient — a missing hint or required won't break the prompt. Only a missing name drops that individual arg item.

What this package owns vs Pi-native

| Concern | Owned by | |---------|----------| | Frontmatter parsing, arg syntax, substitution | Pi (reused) | | Folder → command grouping, selector, arg collection | pi-prompt-composer | | Flat .md prompt behavior | Pi (unchanged) | | Command precedence (grouped wins over flat) | Pi (extension commands take precedence) |

Known limitations

See docs/ISSUES.md for tracked defects and status.

Non-goals (this version)

  • No shell substitution or preprocessing
  • No nesting deeper than /group subcommand
  • No aliases or dynamic subcommands

Development

bun install
bun run typecheck && bun run lint && bun run test

Autofix: bun run fix · Watch: bun run test:watch

Related packages

| Package | Description | |---------|-------------| | @victor-software-house/pi-openai-proxy | OpenAI-compatible HTTP proxy for Pi's multi-provider model registry |

License

MIT