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-per-model-prompt

v0.3.1

Published

Model-scoped system prompt correction layers for pi-coding-agent

Readme

pi-per-model-prompt

Model-scoped system prompt correction layers for pi.

This package ships a single pi extension that appends a small all-model harness core and then layers targeted model corrections on top. It stays intentionally narrow: it does not replace Pi's baseline harness policy and it does not try to become a second general-purpose prompt framework.

What it does

Every model receives one shared harness-core append layer with:

  • output_contract
  • scope_discipline
  • tool_discipline
  • dependency_checks
  • verification_contract
  • user_updates_spec
  • safety_boundary

On top of that, the package targets two model families used inside Pi:

OpenAI GPT-5

  • gpt-5* → GPT-5 family baseline layer
  • gpt-5.*-codex → adds Codex-line coding corrections
  • gpt-5.4* → adds GPT-5.4 execution/follow-through delta
  • exact selected model gpt-5.4 → forces Responses API text.verbosity = "low" at runtime via before_provider_request
  • gpt-5.3-codex → adds exact-model compact answer-shape / ambiguity delta

Anthropic Claude

  • *claude* (any id containing opus, sonnet, or haiku) → Claude family baseline + coding-agent layer

Layer composition is additive. For example:

  • mistral-largeHARNESS_CORE
  • gpt-5.4HARNESS_CORE + GPT5_FAMILY + GPT54
  • gpt-5.4-codexHARNESS_CORE + GPT5_FAMILY + GPT5_CODEX + GPT54
  • gpt-5.3-codexHARNESS_CORE + GPT5_FAMILY + GPT5_CODEX + GPT53_CODEX
  • claude-sonnet-4-5HARNESS_CORE + CLAUDE_FAMILY + CLAUDE_CODING_AGENT

Each layer is appended once via a unique marker, so repeated turns or partial prompt reuse stay idempotent.

Install

From npm

After publishing:

pi install npm:pi-per-model-prompt

From a local checkout

pi install /path/to/pi-per-model-prompt

Temporary loading during development

pi --no-extensions -e /path/to/pi-per-model-prompt/index.ts

Package layout

index.ts                                   # package entry declared in package.json -> pi.extensions
src/index.ts                               # extension implementation; registers before_agent_start + before_provider_request hooks
src/model-identity.ts                      # model id parser (gpt-5*, claude-*)
src/resolve.ts                             # layer resolution by family/version/tags
src/prompt.ts                              # prompt composition helpers
src/layers/base.ts                         # all-model harness-core append layer
src/layers/openai/gpt5/family.ts           # GPT-5 family baseline
src/layers/openai/gpt5/codex.ts            # GPT-5 Codex line layer
src/layers/openai/gpt5/gpt-5.4.ts         # GPT-5.4 delta
src/layers/openai/gpt5/gpt-5.3-codex.ts   # GPT-5.3-Codex delta
src/layers/anthropic/claude/family.ts      # Claude family baseline
src/layers/anthropic/claude/coding-agent.ts # Claude coding-agent layer
test/*.test.ts                             # coverage for parsing, composition, resolution, extension hook

The package uses a pi manifest in package.json:

{
  "keywords": ["pi-package"],
  "pi": {
    "extensions": ["./index.ts"]
  }
}

This matches Pi's package-loading rules from docs/packages.md and docs/extensions.md.

Development

npm install
npm test

Optional packaging check:

npm pack --dry-run

Design guard rails

  • Keep the shared harness-core append layer stable, minimal, and model-agnostic.
  • Keep family and exact-model rules evidence-driven and narrower than the shared core.
  • Prefer additive layers over branching prompt trees.
  • Keep exact-model deltas narrow and auditable.

See docs/architecture.md for maintenance guidance.

License

MIT