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

@inceptionstack/pi-branch-enforcer

v3.2.2

Published

Pi extension — prevents git commit/push directly to main/master, enforces branch workflow

Downloads

2,690

Readme

pi-branch-enforcer

Pi extension that prevents git commit and git push directly to main or master branches. Forces agents to use feature branches and pull requests.

Install

pi install npm:@inceptionstack/pi-branch-enforcer

Or add to your ~/.pi/agent/settings.json:

{
  "packages": ["npm:@inceptionstack/pi-branch-enforcer"]
}

What it blocks

  • git commit while on main or master (any commit without a prior branch switch)
  • git push origin main or any push targeting a protected branch
  • Bare git push (could push current main branch)
  • Force push to protected branches
  • Subprocess bypass attempts — using python/node/perl/ruby to execute git push/commit to protected branches

What it allows

  • git checkout -b feature && git commit ✔️ (branch created first)
  • git push origin feature-branch ✔️
  • git push origin --tags ✔️
  • Any commit/push on a non-protected branch ✔️
  • Subprocess pushes to feature branches ✔️

How it works

Three-tier detection strategy:

Tier 1: Fast regex (< 1ms)

Intercepts bash tool calls and checks:

  1. Commits: Blocked unless the command creates/switches to a non-protected branch first
  2. Pushes: Blocked if the refspec targets main/master or no refspec is given

Tier 2: LLM judge (~1-2s, only when needed)

For complex commands involving scripting languages (python, node, perl, ruby, sh -c):

  1. Quick regex pre-filter checks if command contains a scripting language + git + push/commit
  2. If triggered, calls Claude Haiku via AWS Bedrock for a BLOCK/ALLOW verdict
  3. Catches novel bypass patterns without brittle regex maintenance
  4. Fails open if LLM is unavailable (no blocking legitimate work)

Tier 3: Script file inspection (~1-3s)

Detects when a scripting language executes a file (e.g. node /tmp/script.js):

  1. Extracts the file path from the command
  2. Reads the file contents (first 4KB)
  3. If contents mention git + push/commit, sends to the LLM judge
  4. Catches the "write bypass to file, then run it" evasion pattern

Why LLM over regex? Subprocess bypass detection via regex is a game of whack-a-mole — every new pattern (backticks, os.system, child_process variants, encoding tricks) requires a new rule. An LLM understands intent, catching patterns we haven't anticipated while correctly allowing "main" in commit messages, file paths, or variable names.

Requirements

  • Tier 1: No external dependencies (works everywhere)
  • Tier 2 & 3: Requires AWS Bedrock access in us-east-1:
    • Model: us.anthropic.claude-haiku-4-5-20251001-v1:0
    • IAM permission: bedrock:InvokeModel
    • The aws CLI must be available and authenticated
    • If unavailable, Tier 2 silently fails open (Tier 1 still protects)

Configuration

None needed. Works out of the box. Protected branches are main and master.

License

Apache-2.0