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

create-rule

v0.0.5

Published

A command-line tool for downloading and installing rules into the local editor.

Readme

GitHub 仓库地址

English Version Documentation

create-rule

项目简介

create-rule 是一款为开发者设计的命令行工具,可高效下载并集成 LLM 相关规则到主流本地编辑器(Trae、Cursor、Windsurf),简化规则管理,提升 AI 项目工作流效率。

规则来源:当前所有规则内容均来源于 https://cursor.directory/rules

功能说明

| 模块 | 描述 | |--------------------|--------------------------------------------------------------| | 规则下载 | 支持通过模板名或 URL 下载远程规则 | | 多编辑器适配 | 自动检测并支持 Trae、Cursor、Windsurf 编辑器 | | 路径自动保存 | 自动将规则文件保存到各编辑器标准路径 | | 覆盖与交互体验 | 支持覆盖已有文件,提供交互式 CLI 体验 | | CLI 选项丰富 | 丰富的命令行选项,灵活管理规则 |

安装与使用方法

安装步骤

  1. 克隆仓库或直接下载:
git clone <repo-url>
cd create-rule
  1. 安装依赖:
npm install
  1. 构建(可选):
npm run build

快速开始

  • 直接运行(无需全局安装):
npx create-rule
  • 全局安装后运行:
npm link
create-rule

常用命令选项

| 选项 | 说明 | |-------------------------|--------------------------------| | -t, --template NAME | 指定规则模板名或 URL | | --overwrite | 覆盖已存在的规则文件 | | -h, --help | 显示帮助信息 |

编辑器规则文件保存路径

| 编辑器 | 路径 | |----------|----------------------------------------| | Trae | .trae/rules/project_rules.md | | Cursor | .cursor/rules/.mdc | | Windsurf | .windsurfrules |

交互流程

  1. 选择目标编辑器(trae/cursor/windsurf)
  2. 输入或选择规则模板名(slug 或 URL)
  3. 工具自动下载规则内容并保存到指定本地路径

示例

create-rule trae my-rule-slug
create-rule --template https://cursor.directory/api/my-rule-slug

常见问题与注意事项

  • 请确保 Node.js 版本为 16 及以上。
  • 规则模板名需与远程仓库一致或使用有效 URL。
  • 使用 --overwrite 可覆盖目标路径下的已有规则文件。
  • 若因网络问题下载失败,请检查网络连接或重试。

依赖说明

  • Node.js 16+
  • 主要依赖:@clack/prompts、mri、picocolors、node-fetch、fs-extra、unbuild 等。

贡献指南

欢迎通过 issue 或 PR 参与贡献,包括但不限于:

  • 新增或优化规则模板
  • 改进 CLI 功能与用户体验
  • 修复 bug 或完善文档

贡献流程:

  1. Fork 本仓库并创建新分支
  2. 提交更改并发起 Pull Request
  3. 等待维护者审核合并

联系与支持信息

  • 问题与建议请通过 GitHub Issues 提交
  • 更多信息请访问项目主页或文档中心

许可证

MIT