Merged
Conversation
- SKILL.md description 从 ~1024 字符压到 ~250 字符,提升 agent 激活匹配准确率
- 新增 docs/templates/cursor-rule-template.mdc:单文件 + globs 自动附加
避免 Cursor 每次让用户手动选择规则
- install.sh 同时落 AGENTS.md(通用)和 .cursor/rules/gospec.mdc(Cursor)
支持 NO_CURSOR=1 跳过;落后远端时提示 update
- validate-skill.py 加路由表引用完整性 + 自查清单存在性校验
自查清单缺失默认 warning,--strict 改为 error
- 软化 3 条过严约束(init / interface{} / utils),与 Go 生态实际更贴
- 匹配仓库现行约定(43 个文件用 `## 自查`),原先只匹配"自查清单" - 把 spec/07-code-review.md 加入 self-check 例外(整个文件就是 PR 自查清单) - 给 spec/09-documentation.md 和 spec/01-requirement/lifecycle.md 补 `## 自查` - CI workflow 切到 --strict + 加 install.sh 端到端冒烟测试 (在干净目录跑 install.sh,校验 AGENTS.md / .cursor/rules/gospec.mdc 正确落盘) - README 加 Cursor 单文件规则的说明 - CHANGELOG 记录本轮所有改动
- spec/05-coding/README.md: 技术栈改为"推荐 / 可替换"双列,
明确 Kratos / Casdoor 等是参考栈而非强制;强制的是分层、错误处理、
测试、安全等约束,不是具体库选型
- spec/spec.md: 加"项目阶段裁剪表",按 < 5 人 / 5-20 / > 20 人三档说明
哪些规则可跳过,避免小项目被全套规范压死;核心约束任何阶段都守
- spec/10-observability/slo-alerting.md: 加"可用性目标 → 错误预算"和
"Burn Rate 告警阈值"两张速查表,照抄即可,避免每次手算
- scripts/uninstall.sh: 新增卸载脚本,移除项目根 AGENTS.md(先备份)和
.cursor/rules/gospec.mdc,默认保留全局 skill 目录(KEEP_SKILL=0 一并删);
全程用 \${VAR} 显式封闭变量名,避免与 CJK 字符相邻时 bash 解析失败
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
三组改进,按影响范围排序:
1. Cursor 体验(解决"每次让用户选择规则")
docs/templates/cursor-rule-template.mdc:单文件 +globs: [**/*.go, **/*.proto, ...]+alwaysApply: false,让 Cursor 在编辑相关文件时自动附加,避免每次手动挑选scripts/install.sh同时落AGENTS.md(通用 agent)和.cursor/rules/gospec.mdc(Cursor)scripts/uninstall.sh:清理项目根 AGENTS.md(先备份)+ Cursor 规则;默认保留全局 skill 目录,KEEP_SKILL=0一并删2. SKILL.md / 约束软化(提升 agent 激活准确率 + Go 生态贴合度)
description从 ~1024 字符压到 ~250 字符init():改为"仅允许做注册(pprof / collector / driver),禁止 IO 或可能 panic"interface{}:改为"避免出现在公共 API 边界,解码 / SDK 适配等不可避免场景就近注释"utils/:改为"仅作最后兜底,优先按职责拆mathx//strx/"spec/05-coding/README.md技术栈改为"推荐 / 可替换"双列,明确 Kratos / Casdoor 等是参考栈而非强制spec/spec.md加"项目阶段裁剪表",按 < 5 人 / 5-20 / > 20 人三档说明哪些规则可跳过spec/10-observability/slo-alerting.md加"可用性目标 → 错误预算"和"Burn Rate 告警阈值"两张速查表3. 校验强化(防 spec 静默腐烂)
scripts/validate-skill.py新增:spec/spec.md路由表里所有引用文件必须存在)## 自查/## Checklist标题)--strict标志:自查清单缺失时由 warning 升级为失败spec/09-documentation.md/spec/01-requirement/lifecycle.md补## 自查小节;spec/07-code-review.md整体即为 PR 自查清单,列入例外--strict+ 加install.sh端到端冒烟测试(在干净目录跑 install.sh,校验 AGENTS.md 和 .cursor/rules/gospec.mdc 正确落盘)Test plan
python3 scripts/validate-skill.py --strict .通过(frontmatter + 10 必备文件 + 路由表完整性 + 自查清单)python3 scripts/build-skill.py通过,产出.skill包含 cursor 模板install.sh端到端:在干净目录运行 → AGENTS.md 和 .cursor/rules/gospec.mdc 正确落盘uninstall.sh端到端:清理两个文件 + 备份 AGENTS.md + 默认保留全局 skillvalidate.yml在 PR 上跑通(含 strict + install.sh 冒烟)🤖 Generated with Claude Code