[提案] 使 dubbo-go 对 AI 编程工具更加友好
- Dominant language
- Go
- Stars
- 5k
- Forks
- 1k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 31
Description
### ⚠️ 验证
- [x] 我已经搜索过 [issues](https://github.com/apache/dubbo-go/issues),确信这不是一个重复的提案。
### ✨ 提案摘要
随着 Claude Code、Cursor、GitHub Copilot 等 AI 编程工具的普及,越来越多开发者依赖这些工具来学习和使用开源框架。然而 AI 工具在处理 dubbo-go
相关代码时,常因缺乏项目专属上下文而产生错误的代码生成(使用过时 API、错误的配置格式、不符合 dubbo-go 扩展点规范等)。
本提案建议在 dubbo-go 仓库中引入一套 **AI 上下文文件**,覆盖主流 AI 编程工具,使其能够:
- 生成符合 dubbo-go 当前 API 规范的代码
- 给出正确的注册中心/协议配置建议
- 理解 dubbo-go 的扩展点机制(Filter、Router、LoadBalance 等)
- 准确引导用户排查常见运行时问题
### 🛠️ 实现方法
新增以下文件,**不修改任何现有代码**:
**1. `CLAUDE.md`(Claude Code)**
项目整体上下文:模块结构、核心概念、常见用法入口、版本说明。
**2. `.cursor/rules/dubbo-go.mdc`(Cursor)**
Cursor Rules 格式的编码规范,涵盖:服务定义、Consumer/Provider 写法、配置文件格式。
**3. `.github/copilot-instructions.md`(GitHub Copilot)**
Copilot 仓库级指令,说明项目约定和 API 使用规范。
**4. `llms.txt`(通用标准)**
遵循 [llms.txt 规范](https://llmstxt.org),为所有 LLM 工具提供结构化的项目文档入口,类似 `robots.txt` 的定位。
**5. `.claude/skills/*.md`(Claude Code Skills)**
面向框架使用者的可复用工作流:
| Skill | 用途 |
|-------|------|
| `new-service` | 生成符合规范的 Provider 服务骨架 |
| `new-client` | 生成 Consumer 调用代码 |
| `configure` | 根据注册中心/协议选型生成配置文件 |
| `debug` | 常见运行时问题结构化排查 |
| `migrate` | 从 gRPC / Spring Cloud 迁移指引 |
### 📚 附加上下文
## 目录结构
.
├── CLAUDE.md
├── llms.txt
├── .cursor/
│ └── rules/
│ └── dubbo-go.mdc
├── .github/
│ └── copilot-instructions.md
└── .claude/
└── skills/
├── new-service.md
├── new-client.md
├── configure.md
├── debug.md
└── migrate.md
## 参考
### 标准与规范
- [llms.txt 规范](https://llmstxt.org) — 由 answer.ai / Jeremy Howard 提出,类 robots.txt 的 LLM 上下文标准,Cloudflare、Stripe、Vercel、Supabase 等已采用
- [llms.txt Hub](https://github.com/thedaviddias/llms-txt-hub) — 收录各项目 llms.txt 实现的社区目录
- [GitHub Copilot 自定义指令官方文档](https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions) —
`.github/copilot-instructions.md` 规范说明
- [Cursor Rules MDC 格式](https://github.com/PatrickJS/awesome-cursorrules) — Cursor 官方推荐的 `.cursor/rules/*.mdc` 格式及社区示例集
### 社区实践
- [awesome-claude-md](https://github.com/josix/awesome-claude-md) — 收录主流开源项目 CLAUDE.md 的精选合集,含 Go 项目示例(GoMall、Cloudflare Workers SDK 等)
- [awesome-cursorrules(Go 示例)](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/go-backend-scalability-cursorrules-prompt-file/.cursorrules) — Go
后端项目的 Cursor Rules 参考写法
- [Awesome GitHub Copilot Customizations](https://developer.microsoft.com/blog/introducing-awesome-github-copilot-customizations-repo) — Microsoft 官方发起的 Copilot
自定义指令社区仓库
### 同类框架落地案例
- [OpenAI Agents Python CLAUDE.md](https://github.com/openai/openai-agents-python/blob/main/CLAUDE.md) — OpenAI 官方 Python 多智能体框架的 CLAUDE.md,被 awesome-claude-md
列为必读示范
- [Anthropic Quickstarts CLAUDE.md](https://github.com/anthropics/anthropic-quickstarts) — Anthropic 官方示例项目的 AI 上下文文件组织方式
Contributor guide
Assessment
This issue has not been assessed yet.