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

v1.11.0

Published

Deterministic workflow and safety policy enforcement for OpenCode

Downloads

6,121

Readme

OpenCode Workflow Guard

npm License: MIT Tests

Deterministic policy and enforcement layer for OpenCode. Workflow Guard enforces workflow and safety invariants through hard plugin hooks, not prompt instructions that LLMs can ignore.

Workflow Guard is deliberately not an agent harness: it can constrain actions, record and explain decisions, and supply bounded context, but it does not plan, prioritize, delegate, or autonomously sequence the agent's work. Bounded continuation may resume an existing session with unfinished owned todos; it never chooses the next task or creates new work.


Quick Start

1. Installation

Install the current published version globally with OpenCode's plugin installer:

VERSION=$(npm view opencode-workflow-guard version)
opencode plugin "opencode-workflow-guard@$VERSION" --global --force

Requires OpenCode >= 1.18. OpenCode detects the package's server and TUI targets and updates both global configs. Use the same command after a release to upgrade; the explicit version gives OpenCode a fresh package-cache key. Restart OpenCode after installation. See docs/installation.md for details and links to the OpenCode plugin documentation.

For the optional TUI badge, configure "opencode-workflow-guard" in tui.json. OpenCode resolves the package's exported ./tui entrypoint automatically for TUI plugins. The companion keeps a static Workflow Guard shield in the prompt bar; warning toasts provide block details without changing agent behavior. Do not place the TUI module under the server plugins/ directory.

Workflow Guard status badge in the OpenCode TUI

2. Verification

npm run typecheck    # Strict TypeScript check (0 errors)
npm test             # Run 415+ unit and adversarial tests
npm run test:all     # Typecheck + unit + install/load checks
WORKFLOW_GUARD_LIVE_E2E=1 npm run test:install # Also run policy probes with OpenCode's most recently selected model

Core Guardrails Overview

The plugin enforces 24 deterministic policy rules across four main pillars:

  • Branch & History Protection: Enforces feature-branch workflows (blocks edits/commits on main/master), hard-blocks direct or forced pushes to protected branches, enforces mergeability pre-flight checks, enforces secondary review approval before PR creation by default, and requires PR changelogs / changesets.
  • Task & Verification Discipline: Gates file mutations on active todowrite tasks with subagent inheritance, blocks concurrent direct edits to the same canonical file across sessions, requires same-session fresh reads before edit/write can replace existing files, blocks silent task deletion, enforces fresh test verification evidence before task completion, and journals completion claims vs. verification mismatches.
  • Secrets & Workspace Confinement: Confines edit tools and recognized shell/git mutations within the workspace root (including symlink and ../ escape checks), scrubs sensitive environment variables in agent subshells, and redacts .env reads with safe schema masks. Arbitrary executables are not OS-sandboxed; use containers or filesystem isolation when hard confinement is required.
  • Destructive CLI & Environment Safety: Intercepts destructive cloud/database/infrastructure commands, stops script laundering and interpreter evasion, blocks TTY hangs (vim, nano, sudo), and guards against dangerous package manager flags.

For complete policy specifications and override rules, see docs/policies.md.


Documentation Index

| Guide | Description | |---|---| | Policy Reference | Comprehensive specification of all 24 enforced policies, invariants, and override semantics | | Installation & Configuration | Setup options, global vs. local install, worktree isolation, and project configuration | | Managed Deployment | Administrator-managed OpenCode policy, platform locations, and startup diagnostics | | Troubleshooting | Diagnosing policy blocks, common false positives, and emergency override procedures | | Testing Architecture | Test harness design, adversarial regression matrix, and CI verification | | Contributing Guide | Development workflow, coding conventions, test requirements, and changeset PR rules | | Security Policy | Vulnerability disclosure policy and threat model |


License

MIT