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-agent-mode

v1.3.0

Published

OpenCode-style default agent mode for PI. Markdown agents with YAML frontmatter. Ctrl+Shift+M to cycle, Alt+S to search. Inline execution with full streaming visibility.

Readme

pi-agent-mode

OpenCode-style default agent system for PI coding agent.

Define agents as markdown files with YAML frontmatter, select a default agent, and have all prompts processed through that agent inline — with full real-time streaming visibility. No subprocess subagents.

Features

  • Markdown agent definitions — Simple YAML frontmatter + body
  • Default agent at startup — Set in .pi/settings.json
  • Keyboard shortcutsCtrl+Shift+M to cycle, Alt+S to search agents
  • Visual indicator — Widget banner above editor shows active agent
  • Model & tool restriction — Per-agent model and tool sets
  • Agent search/agent-search <query> or Alt+S to find agents by name, description, or body content
  • Autonomous switchingset_agent tool for LLM-driven switches
  • Session persistence — Active agent survives session resume

Install

pi install npm:pi-agent-mode

Or for project-local:

pi install npm:pi-agent-mode -l

Agent Definition Format

Create .md files in ~/.pi/agent/agents/ (global) or .pi/agents/ (project-local):

---
name: planner
description: Planning specialist - create detailed plans before implementation
model: anthropic/claude-sonnet-4
tools: read, bash, grep, find, ls
---
You are a PLANNING SPECIALIST. Your job is to deeply understand the problem and create a detailed implementation plan.

Rules:
- DO NOT make any changes. You cannot edit or write files.
- Read files IN FULL (no offset/limit) to get complete context.
- Explore thoroughly: grep for related code, find similar patterns.
- Ask clarifying questions if requirements are ambiguous.

Output:
- Create a structured plan with numbered steps.
- For each step: what to change, why, and potential risks.
- List files that will be modified.

Frontmatter Fields

| Field | Required | Description | |-------|----------|-------------| | name | Yes | Agent identifier (used with /agent name) | | description | No | Shown in selector and widget | | model | No | provider/model-id format (e.g. anthropic/claude-sonnet-4) | | tools | No | Comma-separated tool names to restrict to |

The markdown body after frontmatter becomes the agent's system prompt instructions.

Usage

Commands

  • /agent — Show selector to pick an agent
  • /agent <name> — Switch directly to an agent
  • /agent clear — Clear active agent, restore defaults
  • /agents — List all available agents
  • /agent-search <query> — Search agents by name, description, or body content

Keyboard

  • Ctrl+Shift+M — Cycle through available agents
  • Alt+S — Search agents (opens query prompt, then shows ranked results)

CLI

pi --agent planner

Settings

Set default agent in .pi/settings.json:

{
  "defaultAgent": "planner"
}

Autonomous Switching

The LLM can call the set_agent tool to switch agents programmatically:

{
  "agent": "implementer",
  "reason": "Planning complete, switching to implementation"
}

Searching Agents

The LLM can search for agents by content using the search_agents tool:

{
  "query": "planning",
  "limit": 5
}

This searches agent names, descriptions, models, tools, and body content, returning ranked results with relevance scores.

How It Works vs Subagents

| Feature | pi-agent-mode | Subagents | |---------|---------------|-----------| | Process | Inline (same process) | Separate subprocess | | Visibility | Full streaming | Results after completion | | Invocation | Default for all prompts | Explicit tool call | | Switching | /agent or Ctrl+Shift+M | Must specify agent each time |

License

MIT