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-focus-guard

v0.2.0

Published

Pi extension that groups discuss, write, and commit guards under focus-prefixed commands.

Readme

pi-focus-guard

Successor Pi extension that groups the existing focus-related guard rails under one clear command family.

pi-focus-guard is intended to replace the separate pi-write-guard and pi-discuss-mode extensions. The core idea is not to invent new semantics, but to make the related controls visibly belong together by exposing them under /focus-* commands.

Intent

When collaborating with an agent, the user often wants to control the working mode at a conversational level:

  • Are we discussing only, or may the agent act?
  • If the agent may act, where may it write?
  • Are we still reviewing and finishing collaboratively, or may the agent commit?

The extension makes those mode boundaries explicit and visible in one namespace.

Rationale

The old extensions solve related problems but appear as unrelated command families:

  • pi-write-guard controls where writes may happen.
  • pi-discuss-mode controls whether tool use is allowed at all.

In practice, both are focus controls: they communicate user intent about the current collaboration phase. A unified extension reduces command discovery friction and makes session state easier to reason about.

The intended command shape is:

/focus-write-guard ...
/focus-write-guard-all
/focus-discuss ...
/focus-discuss-off
/focus-discuss-read
/focus-discuss-block
/focus-commit-guard
/focus-commit-guard-on
/focus-commit-guard-off

Startup flags can set the initial mode:

--write-guard <dirs>
--write-guard-all
--write-guard-off
--dm-off
--dm-read
--dm-block
--commit-guard
--commit-guard-on
--commit-guard-off

Explicit off flags override persisted state for their guard.

Scope

Preserve existing behavior while porting

The write-guard and discuss-mode logic should be ported without behavioral adaptation. The successor should keep the existing semantics from the source extensions unless a later change is explicitly requested.

That means:

  • Write allowlist behavior should match pi-write-guard.
  • Bash write detection should match pi-write-guard.
  • Discuss block/read/off behavior should match pi-discuss-mode.
  • Read-only bash classification should match pi-discuss-mode.
  • Existing denial-message intent should remain cooperative: denied actions are policy boundaries, not technical failures to route around.

New behavior: commit guard

pi-focus-guard adds one new guard:

/focus-commit-guard
/focus-commit-guard-on
/focus-commit-guard-off

When enabled, bash commands containing git commit are blocked.

The block message should explain that the user intentionally does not want commits yet, because the collaboration phase is still about finishing together, reviewing the diff, and deciding when the milestone is ready.

The commit guard also exposes a footer status icon, matching the style of the discuss and write guards, so the user can see at a glance whether premature commits are currently blocked: 📝 means commit guard is off, 🚫 means commit guard is on.

This guard is not a security boundary. It is a collaboration signal that prevents premature commits and encourages review before finalizing work.

Successor plan

pi-focus-guard is planned as the effective successor to:

  • pi-write-guard
  • pi-discuss-mode

Those older extensions can be deprecated later after parity is verified.

Non-goals for the initial port

  • Do not redesign write-guard policy semantics.
  • Do not redesign discuss-mode policy semantics.
  • Do not silently add new config precedence rules; startup flag precedence is explicit: off flags override on/read/block flags and persisted state for that guard.
  • Do not keep legacy command names unless explicitly chosen later.
  • Do not treat denied writes or blocked commits as errors to work around.

Verification expectations

Before treating this successor as ready, tests should show parity for:

  • focus-prefixed command registration;
  • startup flag registration and initial-mode behavior;
  • write/edit path allowlist blocking;
  • bash write detection;
  • discuss block mode;
  • discuss read mode;
  • read-only bash allowance;
  • /focus-commit-guard printing commit guard status;
  • commit guard blocking git commit while enabled;
  • commit guard allowing non-commit bash when enabled;
  • commit guard allowing git commit when disabled;
  • commit guard footer icon reflecting enabled/disabled state.