Reuse Before Generate

io.github.aradar46由 GitHub 账号 aradar46 发布v0.2.3更新于 Oct 24, 2026

Checks whether your idea already exists before your agent builds it. Searches GitHub, npm, Python.

概览

AI 生成的概览

在写代码之前先查这个想法是否已存在:搜索公开代码库与包索引,让助手优先建议复用现成项目。

可以做什么
  • 搜索 GitHub、GitLab、Show HN、Flathub、F-Droid、GNOME Extensions 等公开仓库与项目
  • 搜索 npm、PyPI、Conda、CRAN、crates.io、NuGet、Maven Central、RubyGems、Packagist、Homebrew、AUR 等包仓库
  • 搜索 Hugging Face 上的 AI 模型与 Docker Hub 上的容器镜像
  • 以结构化 Markdown 返回结果,并提示助手继续用网页搜索查找商业产品或自托管方案
  • 也可在终端以命令行方式直接运行同样的搜索
适用场景
适合在助手准备从零搭建新应用、模块或工具之前使用,先确认是否已有可维护的开源库、软件包或现成产品可以直接复用或扩展。
运行要求
以 stdio 方式在本机运行,通常通过 npx 启动,需要安装 Node.js。无需 API 密钥,所有来源均使用公开接口。可选环境变量 GITHUB_TOKEN 可将 GitHub 搜索速率上限从每分钟 10 次提高到 30 次。搜索需要网络访问。
安装前请注意
搜索关键词会发送到多个第三方公开接口,因此会离开本机。各来源为尽力查询,某个来源不可用或被限流时结果可能不完整。若设置 GITHUB_TOKEN,该令牌会保存在客户端配置中,建议使用权限最小的令牌。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Reuse Before Generate,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

reuse-before-generate

[npm] [license] [reuse-before-generate MCP server]

Your idea probably already exists. Find out before you build it, not after.

When you ask an AI coding assistant to build an app or module, it overenthusiastically starts scaffolding thousands of lines of code from scratch—even when battle-tested open-source libraries or maintained tools already exist.

reuse-before-generate is a zero-dependency MCP server (and CLI tool) that intercepts the AI workflow before code generation begins. It searches public code and package indexes across multiple angles, formats results as structured Markdown, and directs the AI to search the web for existing SaaS products and community discussions.

Sources checked

The server checks these sources in parallel:

SourceWhat it searches
GitHubPublic repositories
GitLabPublic projects
Show HNHacker News product & project launches
FlathubLinux desktop GUI applications
F-DroidAndroid open-source apps & utilities
GNOME ExtensionsDesktop shell extensions
HomebrewCurated CLI utilities & formulas
AURArch Linux tools, daemons, & scripts
PyPIPython packages & utilities
Conda / BiocondaConda-forge & Bioconda packages
CRAN / BioconductorR packages & bioinformatics libraries
npmJavaScript & TypeScript packages
crates.ioRust crates
NuGet.NET packages
Hugging FaceAI models & pipelines
Docker HubPublic container images
Maven CentralJava artifacts
RubyGemsRuby gems
PackagistPHP packages

All added sources use public endpoints and do not require API keys. They are queried on a best-effort basis: if one source is unavailable or rate-limited, results from the other sources are still returned. A GitHub token is optional and only raises GitHub's search rate limit.


Quick Start & Installation

No API keys required to start.

1. Claude Code CLI

bash
claude mcp add -s user reuse-before-generate -- npx -y reuse-before-generate

2. Cursor, Claude Desktop, Antigravity, Windsurf, or VS Code

Add this to your mcpServers configuration (e.g. ~/.claude/mcp.json, ~/.gemini/antigravity-ide/mcp_config.json, or Cursor settings):

json
{  "mcpServers": {    "reuse-before-generate": {      "command": "npx",      "args": ["-y", "reuse-before-generate@latest"]    }  }}
Optional: Higher GitHub API Limits

You can optionally pass a GitHub token to raise GitHub's rate limits:

json
{  "mcpServers": {    "reuse-before-generate": {      "command": "npx",      "args": ["-y", "reuse-before-generate@latest"],      "env": {        "GITHUB_TOKEN": "ghp_your_token_here"      }    }  }}

3. Run Directly in Terminal (CLI Mode)

You can run searches directly from your shell without an MCP client:

bash
npx reuse-before-generate "terminal markdown viewer"# or if cloned locally:node index.js "gnome speech to text offline"

4. Slash Command / Agent Skill

In supported AI coding assistants (Antigravity, Claude Code), you can invoke it directly via slash command:

text
/reuse-before-generate <project description or keywords>

🤖 Make It Automatic for AI Agents

To ensure your AI assistant checks for existing solutions before writing code, add this instruction to your CLAUDE.md, .cursorrules, GEMINI.md, or AGENTS.md:

markdown
Before scaffolding a new project or substantial new module from scratch:1. Call `check_before_building` (or `reuse_before_generate`) from the `reuse-before-generate` MCP server.2. Follow up with web search for existing commercial products or self-hosted tools as directed by the tool.3. Present existing alternatives in a concise table and ask the user whether to reuse or extend an existing project instead of building from scratch.

🤖 AI Disclosure

For details on how AI is used in this project, see What I delegate to AI and what I don't.


License

MIT

来源:README.md,提交 f9141bf

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.3最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分