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

bacluc-opencode-completion-check-command

v0.4.0

Published

An [opencode](https://opencode.ai) plugin that automatically verifies task completion by running a shell command after the agent finishes.

Readme

opencode-completion-check-command

An opencode plugin that automatically verifies task completion by running a shell command after the agent finishes.

How It Works

  1. Use the /completion-check-command slash command in your opencode prompt followed by a markdown code block containing the shell command to run

  2. When the agent finishes (session goes idle), the plugin executes the stored command

  3. If the command exits with code 0, the task is considered complete

  4. If the command exits with a non-zero code, the agent is automatically prompted again with:

    you are not yet finished:
    
    stdout:
    <command stdout output>
    
    stderr:
    <command stderr output>
  5. This retry loop continues up to a configurable maximum number of retries (default: 10). Once the limit is reached, the plugin stops re-prompting to prevent burning tokens indefinitely.

Usage

In your opencode session, type:

/completion-check-command
```bash
./check-task.sh
```

The plugin will extract the command from the code block and run it when the agent finishes.

Configuration

Plugin Options

The plugin accepts an maxRetries option (default: 10) that controls the maximum number of times the agent will be re-prompted when the check command fails:

{
  "plugin": [["bacluc-opencode-completion-check-command@<version>", { "maxRetries": 10 }]]
}

Setting maxRetries to 0 disables re-prompting entirely — the command runs once and any failure is silently dropped.

Custom Command Template

The /completion-check-command is automatically registered by the plugin's config hook. If you want to override the template, add it to your opencode.json:

{
  "command": {
    "completion-check-command": {
      "template": "Your custom template here: {{arguments}}",
      "description": "Custom description"
    }
  }
}

Example

Create a check script:

#!/bin/bash
# check-task.sh - verify the task is complete
if [ -f "output.txt" ]; then
  echo "Task complete - output file exists"
  exit 0
else
  echo "Task NOT complete - output file missing"
  echo "Create the file: output.txt"
  exit 1
fi

Then use it in opencode:

Please create a file called output.txt with the contents "Hello World"

/completion-check-command
```bash
./check-task.sh
```

Development

# Install dependencies
npm install

# Run tests
npm test

# Type check
npm run typecheck

# Format code
npm run format