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

@daishengli1024/aicode

v0.1.1

Published

跨 AI 编码工具(Claude Code / codex / opencode)的开发规范管理 CLI

Readme

aicode

跨 AI 编码工具(Claude Code / codex / opencode)的规则管理 + 文档生成 CLI

CI npm version License: MIT Node >= 18

这是什么

aicode 是一个 Node.js CLI 工具,做两件事:

  1. 规则管理:把项目规范(数据库设计、接口设计、代码风格、字典枚举)集中存放在项目级 .aicode/rules/
  2. 文档生成:根据规则自动生成需求文档、设计文档、SQL(MySQL/PostgreSQL)、OpenAPI 规范

核心设计:规则 = 唯一的真相源。改一处规则,所有生成(SQL、OpenAPI、设计文档)都跟着改。

✨ 核心特性

  • 📋 规则集中管理.aicode/rules/*.md(Markdown + YAML frontmatter)
  • 🔄 跨 AI 工具同步:一条命令同步到 Claude Code、codex、opencode
  • 🛠 5 阶段文档生成aicode doc new 一次产出 5 类文档
  • 🔍 自洽性检查:新需求与已有需求自动比对
  • 🇨🇳 中文友好:文件名、commit message、文档都支持中文
  • 🎯 预置规则按项目类型:hasBackend/hasDatabase 决定预置哪些规则

📦 安装

npm install -g @daishengli1024/aicode

要求 Node.js >= 18。

🚀 快速开始

# 1. 在项目根目录初始化(询问 hasBackend / hasDatabase)
cd my-project
aicode init

# 2. 同步规则到所有 AI 工具
aicode sync
# → 生成 CLAUDE.md(Claude Code 读取)
# → 生成 AGENTS.md(codex / opencode 读取)

# 3. 新建需求文档(5 阶段流程)
aicode doc new 订单管理
# Stage 1: 多轮交互收集需求
# Stage 2: 自洽性检查
# Stage 3: 生成需求文档
# Stage 4: 生成设计文档(功能/接口/数据库/字典)
# Stage 5: 顺便生成 SQL + OpenAPI

# 4. 环境检查
aicode doctor

📖 命令一览

| 命令 | 说明 | |---|---| | aicode init | 初始化 .aicode/,询问项目类型 | | aicode rule list | 查看所有规则 | | aicode rule add | 新增规则(交互式) | | aicode rule edit <name> | 编辑规则 | | aicode rule enable <name> | 启用规则 | | aicode rule disable <name> | 禁用规则 | | aicode rule remove <name> | 删除规则 | | aicode doc new <需求> | 5 阶段一体化生成 | | aicode sync | 编译规则并同步到 AI 工具 | | aicode doctor | 环境检查 |

🎯 预置规则(按项目类型自动选)

| 规则 | 含结构化 frontmatter | 适用 | |---|---|---| | db-design.md | sqlRules | 有数据库项目 | | api-design.md | apiRules | 有服务端项目 | | feature-design.md | featureRules | 无服务端项目(CLI / 库) | | dictionary-design.md | dictionaryRules | 总是需要 | | code-style.md | 纯说明 | 总是需要 |

🔄 规则的双重身份

作为开发规范:规则 body 是给 AI 读的说明文档("为什么这么做")

作为生成约束:规则 frontmatter 是给 aicode 读的结构化字段("怎么生成 SQL/OpenAPI")

---
name: db-design
sqlRules:           # ← 机器读
  systemFields: [...]
  foreignKey: false
  charset: utf8mb4
---

# 数据库设计规范   # ← AI 读
- 不使用外键约束
- ...

📚 文档

🧪 开发

git clone https://github.com/daishengli/aicode.git
cd aicode
pnpm install
pnpm test
node bin/aicode.js --version

🤝 贡献

欢迎 PR!详见 CONTRIBUTING.md

📄 许可证

MIT © aicode contributors