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-plugin-auto-maintain

v0.6.63

Published

Gitee repo trigger plugin for opencode — event-driven triage, implement, review handlers

Readme

opencode-plugin-auto-maintain

自主维护循环系统 — opencode 插件,自动处理 Gitee 仓库的 issue → 实现 → 审核。

特性

  • 三个内置循环:分拣 (1h)、实现 (1h)、审核 (30m)
  • 零代码扩展:用户只需创建 Markdown 文件即可添加新循环
  • 自动调度:内置 setInterval 调度器,无需外部依赖
  • Gitee API:直接调用 Gitee REST API v5
  • Git 操作:通过 simple-git 自动 clone、分支、提交、推送

安装

# 1. 安装依赖
npm install

# 2. 编译
npm run build

配置插件

opencode.json 中添加插件配置:

{
  "plugins": {
    "opencode-plugin-auto-maintain": {
      "enabled": true
    }
  }
}

环境变量

| 变量 | 说明 | 默认值 | |------|------|--------| | GITEE_TOKEN | Gitee API token | 必填 | | AUTO_MAINTAIN_GIT_ROOT | 仓库 clone 根目录 | /tmp/auto-maintain-repos |

内置循环

| 循环 | 周期 | 职责 | |------|------|------| | Cycle 0 (triage) | 1h | 分拣:评分分类新 issue | | Cycle A (implement) | 1h | 实现:创建分支、修改代码、提交 PR | | Cycle B (review) | 30m | 审核:AI 预审 PR、更新标签 |

添加自定义循环(零代码)

创建一个 Markdown 文件即可添加新循环:

~/.config/opencode/skills/auto-maintain/cycles/deploy.md

---
name: auto-maintain-deploy
description: "Cycle C: 部署已审核通过的 PR"
metadata:
  cycle-interval: 2h
  cycle-depends-on: auto-maintain-review
  cycle-enabled: true
  cycle-batch-size: 3
  cycle-priority: 10
---

## 部署流程

1. 扫描 `bot-review-ready` 标签的 PR
2. 合并 PR 到主分支
3. 更新 issue 为 closed
4. 通知部署成功

插件自动发现并注册新循环,无需修改任何代码。

自定义工具

| 工具 | 说明 | |------|------| | auto_maintain_status | 查看调度器状态 | | auto_maintain_start | 启动调度器 | | auto_maintain_stop | 停止调度器 | | auto_maintain_run_cycle | 手动执行指定循环 |

Issue 标签状态机

open → bot-processing → bot-review-ready → (人工审核) → closed
                     ↓ (太复杂)
                     bot-needs-design → (人工) → bot-ready-to-implement
                     ↓ (失败)
                     bot-failed → (重试)

文件结构

auto-maintain/
├── src/
│   ├── index.ts                    # 插件入口
│   ├── types.ts                    # 核心类型
│   ├── gitee.ts                    # Gitee API 封装
│   ├── git.ts                      # Git 操作封装
│   ├── scheduler.ts                # 调度器
│   ├── cycles/
│   │   ├── base.ts                 # 内置循环基类
│   │   ├── loader.ts               # SKILL.md → Cycle 转换
│   │   ├── registry.ts             # 自动发现循环
│   │   └── builtin/
│   │       ├── triage.ts           # Cycle 0
│   │       ├── implement.ts        # Cycle A
│   │       └── review.ts           # Cycle B
│   └── tools/
│       └── index.ts                # 自定义工具
├── skills/auto-maintain/
│   ├── SKILL.md                    # 主 skill
│   ├── loop-prompt.md              # 循环提示词
│   └── cycles/                     # 内置循环文档
│       ├── triage.md
│       ├── implement.md
│       └── review.md
├── commands/                       # 自定义命令
│   ├── start.md
│   ├── stop.md
│   └── status.md
├── scripts/
│   └── start-loops.sh              # 启动脚本
├── package.json
├── tsconfig.json
└── opencode.json

许可

MIT // test