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

opencode-no-verify-blocker

v0.1.4

Published

OpenCode plugin that blocks `git commit --no-verify` / `git commit -n` to enforce pre-commit hooks.

Readme

opencode-no-verify-blocker

An OpenCode plugin that prevents AI agents from bypassing project pre-commit hooks via git commit --no-verify or git commit -n.

When the agent runs a bash tool call that looks like a git commit (or git commit-tree) with one of the forbidden flags, the plugin throws an error and the command never executes. The agent sees the error message and re-generates a clean command.

Usage

Add the plugin to your opencode.json (project) or ~/.config/opencode/opencode.json (global):

{
  "plugin": ["opencode-no-verify-blocker"],
}

With a custom error message (e.g. pointing to your project's AGENTS.md):

{
  "plugin": [
    [
      "opencode-no-verify-blocker",
      {
        "customMessage": "This project requires all commits to pass pre-commit hooks. See AGENTS.md.",
      },
    ],
  ],
}

Detection

The plugin blocks both the long flag (--no-verify) and the short flag (-n, including merged forms like -nm). Detection only fires when the command looks like a git commit or git commit-tree — other commands (e.g. echo -n, git push -n) are not affected.

| Pattern | Detected? | | ------------------------------------ | ------------ | | git commit --no-verify -m "x" | yes | | git commit -n -m "x" | yes | | git commit -nm "x" (merged flags) | yes | | git -C /repo commit -n | yes | | git --git-dir=/repo/.git commit -n | yes | | git commit-tree --no-verify HEAD | yes | | /usr/bin/git commit -n | yes | | cd /tmp && git commit -n | yes | | git commit -m "x" | no (allowed) | | git push origin main | no (allowed) | | echo -n hi | no (allowed) | | git log --grep=commit | no (allowed) |

API

NoVerifyBlocker / noVerifyBlocker (named exports)

import { NoVerifyBlocker } from "opencode-no-verify-blocker";

default (default export)

import noVerifyBlocker from "opencode-no-verify-blocker";

All three are the same plugin function; pick whichever style your loader prefers.

Options

| Option | Type | Default | Description | | --------------- | -------- | ----------------- | --------------------------------------------------------------------------------------------------------- | | customMessage | string | (English default) | Error message thrown when a forbidden flag is detected. Use this to point users to project-specific docs. |

How it works

The plugin registers a tool.execute.before hook. For every bash tool call:

  1. Skip if the tool is not bash.
  2. Skip if args.command is missing or empty.
  3. If the command does not look like git commit / git commit-tree, allow it.
  4. Otherwise, scan the command for --no-verify or short flag -n (in merged or standalone form).
  5. If found, throw an error. Otherwise, allow it.

Detection uses a conservative whitespace tokenizer — we don't parse shell, which means we may flag commands inside unexecuted echo strings. False positives are tolerable (the user can rephrase), false negatives (missed --no-verify) are not.

Known limitations

  • OpenCode issue #31680: output.args in-place mutation does not work in OpenCode 1.17.7 / 1.17.8, so this plugin can only throw, not silently strip the forbidden flag. If you want the agent to commit anyway, the agent must regenerate the command without the flag.
  • OpenCode issue #6862: the first message in a new session may not trigger tool.execute.before. If the first command is somehow bypassed, send a follow-up message and retry.
  • Shell parsing: we do not parse quotes, escapes, subshells, or variables. A command like git commit -m "$(echo --no-verify)" will not be detected (and arguably shouldn't be, since it would still run the pre-commit hook).
  • Plugin SDK version: requires @opencode-ai/plugin >= 1.0.0 as a peer dependency.

Why?

AI agents (especially when iterating on CI failures or linter errors) frequently add --no-verify to speed up the loop. This bypasses the project's quality gate. opencode-no-verify-blocker enforces that nobody — including the AI — can skip pre-commit hooks, while still letting the agent see the error and recover on the next iteration.

License

MIT