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

@flower-ai/flower-code-reviewer

v0.1.0

Published

GitLab Pipeline 代码评审 Agent,运行在 CI 容器内,自动评审 MR 并发表行内/整体评论

Downloads

99

Readme

@flower-ai/flower-code-reviewer

GitLab Pipeline 代码评审 Agent。

工作流程

GitLab CI 触发
   │
   ▼
flower-review --mr-iid $CI_MERGE_REQUEST_IID
   │
   ├─ 选 skill(根据文件类型自动选 general / backend / frontend / security)
   ├─ 构造 prompt(注入 skill 内容 + 严格工具使用约束)
   └─ 启动 pi-coding-agent (print 模式)
        │
        ├─ extension 注册:
        │    - LLM provider(自部署 / 内部 / 第三方代理)
        │    - 合规拦截(只读模式)
        │    - GitLab 工具集
        │
        └─ LLM 自主评审:
             1. gitlab_get_previous_review
             2. gitlab_get_mr_files
             3. gitlab_get_mr_diff
             4. read / grep 看上下文
             5. gitlab_post_line_comment(行内评论)
             6. gitlab_post_comment(整体评论)
   │
   ▼
退出码:
  0 - 评审完成,无 blocker
  1 - 有 blocker,pipeline fail
  2 - agent 运行异常

用法

本地试跑

export GITLAB_TOKEN=xxx
export GITLAB_HOST=https://gitlab.corp.internal
export CI_PROJECT_ID=123
export CI_MERGE_REQUEST_IID=456
export LLM_BASE_URL=...
export LLM_API_KEY=...

cd packages/flower-code-reviewer
npm run dev -- --dry-run

集成到 GitLab CI

.gitlab-ci.example.yml 里的 job 复制到你的项目 .gitlab-ci.yml, 并配置以下 CI 变量(都建议设为 masked / protected):

| 变量 | 含义 | |------|------| | REVIEWER_BOT_TOKEN | GitLab bot 账号的 token,需有 MR 评论权限 | | LLM_BASE_URL | LLM 网关 baseUrl | | LLM_API_KEY | LLM 网关 API key | | SIEM_INGEST_URL | 审计上报地址(可选) |

构建镜像

# 在 flower 根目录
docker build -f packages/flower-code-reviewer/Dockerfile -t yourcompany/flower-code-reviewer:latest .

目录结构

flower-code-reviewer/
├── src/
│   ├── cli.ts             # 入口
│   ├── args.ts            # 参数解析
│   ├── extension.ts       # pi 扩展(注册 provider + 合规 + 工具)
│   ├── run.ts             # 评审主流程
│   ├── prompts.ts         # prompt 构造
│   └── skill-selector.ts  # 自动选 skill
├── skills/                # 评审清单(可独立修改、独立 PR)
│   ├── general.md
│   ├── backend.md
│   ├── frontend.md
│   └── security.md
├── Dockerfile
├── .gitlab-ci.example.yml
└── README.md

TODO

  • runReview() 完成后,拉取本次发的评论,根据 severity=blocker 设置 exit code
  • skill-selector 增加更细粒度的策略(按目录、按语言)
  • 增加单元测试(prompt 生成、skill 选择)
  • 镜像增加多语言代码工具(rg / fd / ast-grep)