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

@tryinget/pi-prompt-template-execution

v0.2.0

Published

Live prompt-template execution successor for model/thinking/args semantics.

Readme


summary: "@tryinget/pi-prompt-template-execution package overview." read_when:

  • "Orienting to this package or directory before changing its behavior."

@tryinget/pi-prompt-template-execution

Live monorepo-owned successor for the external npm:pi-prompt-template-model package inside the pi-extensions monorepo.

Current scope

This package owns prompt-template execution semantics for prompt files that need extension behavior such as model, thinking, restore, skill, model conditionals, and argument substitution.

Current live posture:

  • exposes a minimal Pi extension entrypoint through package.json#pi.extensions
  • does not expose package.json#pi.prompts
  • does not ship prompt bundles
  • replaces the external npm:pi-prompt-template-model execution owner for /commit
  • treats Pi core prompt-template commands as metadata/template expansion entries, not as extension execution owners
  • blocks duplicate extension command owners through the guarded registration path
  • keeps pi-session-compaction separate as the compaction-summary owner

Implemented surfaces

  • prompt-template discovery for extension-relevant prompt markdown:
    • global/user prompt directory
    • project prompt directory
    • project prompt overrides global by name
    • duplicate same-source diagnostics
    • reserved command-name diagnostics
    • description-only prompts ignored by the extension loader so Pi core keeps plain prompt metadata ownership
  • frontmatter subset:
    • model
    • description
    • restore
    • thinking
    • skill resolved through skill lookup/message helpers
  • prompt-template-model-compatible model fallback through @tryinget/pi-model-selection
  • argument substitution:
    • $1, $2, ...
    • $@
    • $ARGUMENTS
    • ${@:N} and ${@:N:L}
  • prompt-template-model-compatible model conditionals:
    • <if-model is="provider/model">...<else>...</if-model>
    • comma-separated specs and provider wildcard conditionals such as openrouter/*
    • nested conditionals
    • fail-soft invalid-markup diagnostics that leave content unchanged
  • execution planning:
    • selected model
    • rendered content
    • switch/restore model intent
    • thinking intent
  • command registration guard:
    • requires explicit enablement from the live entrypoint
    • requires loader/execution tests to be confirmed
    • requires no-double-registration preflight confirmation
    • requires an explicit existing-command snapshot
    • filters Pi core prompt/source commands out of extension-owner collision checks
    • blocks duplicate extension command owners and duplicate same-package registration
  • command runner:
    • refreshes prompt templates at invocation time
    • switches model when needed
    • sends rendered user message through Pi host APIs
    • supports deferred agent_settled restore timing for model/thinking restore
    • restores immediately if message dispatch fails
  • Pi host adapter:
    • normalizes pi.setModel, pi.setThinkingLevel, pi.sendUserMessage, pi.getThinkingLevel, queued skill messages, and UI notification behavior
  • dry-run diagnostic and safety reports:
    • list which prompt templates would be claimed
    • report loader diagnostics and command-snapshot collisions
    • remain report-only; no package install/reload/hook activation side effects
  • compatibility canary helpers:
    • compare prompt loading, command descriptions, invalid-frontmatter diagnostics, model selection decisions, and /commit execution-plan summaries against explicit external-compatible fixture expectations
    • include restore, thinking, model-conditionals, invalid frontmatter/model/restore/thinking, model-less conditional inheritance, empty rendered prompt abort, and restore-false + thinking fixtures

/commit cutover interpretation

After Phase 4, /commit has exactly one extension execution owner: this package's extensions/prompt-template-execution.js.

Pi core may still expose a prompt-source /commit command from ~/.pi/agent/prompts/commit.md. That core prompt entry is expected because Prompt Vault exports the prompt markdown for template expansion and editor visibility. It is not treated as a duplicate prompt-template execution owner.

Explicit non-goals

  • no package prompt bundle registration
  • no package.json#pi.prompts
  • no independent subagent runtime
  • no loop/chain/workflow runtime
  • no /prompt-tool or run-prompt tool
  • no compaction hook ownership

Loop/chain/workflow ownership belongs in packages/pi-society-orchestrator/. Subagent/runtime execution belongs to ASC. Compaction ownership belongs in packages/pi-session-compaction/ and remains separate.

Template baseline

This package was created from ../pi-extensions-template in simple-package mode and keeps .copier-answers.yml tracked. It is deliberately adapted as a root-managed live extension package with a minimal extension entrypoint and no prompt bundle.

Validation

cd packages/pi-prompt-template-execution
npm run check