From da74f85c10c540129ddf7ba6a4f2cb314b8bde80 Mon Sep 17 00:00:00 2001 From: xingzihai <1315258019@qq.com> Date: Thu, 26 Mar 2026 04:37:08 +0000 Subject: [PATCH] fix: address review feedback from PR #929 - Add missing code-review.md and development-workflow.md to zh/README.md directory listing - Add mkdir -p command before copy in manual install instructions - Fix TypeScript test command path in SKILL-DEVELOPMENT-GUIDE.md - Add Anti-Patterns section to SKILL.md template - Add Template category to Skill Categories table in CONTRIBUTING.md - Add Pre-Review Requirements section to code-review.md (both en and zh) - Add Pre-Review Checks step to development-workflow.md (both en and zh) - Add trailing newlines to all files that were missing them --- CONTRIBUTING.md | 1 + docs/SKILL-DEVELOPMENT-GUIDE.md | 14 +++++++++----- rules/common/code-review.md | 10 +++++++++- rules/common/development-workflow.md | 6 ++++++ rules/zh/README.md | 10 ++++++++-- rules/zh/agents.md | 2 +- rules/zh/code-review.md | 10 +++++++++- rules/zh/coding-style.md | 2 +- rules/zh/development-workflow.md | 8 +++++++- rules/zh/git-workflow.md | 2 +- rules/zh/hooks.md | 2 +- rules/zh/patterns.md | 2 +- rules/zh/performance.md | 2 +- rules/zh/security.md | 2 +- rules/zh/testing.md | 2 +- 15 files changed, 57 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dd956663..bf5db0a1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -142,6 +142,7 @@ Link to complementary skills (e.g., `related-skill-1`, `related-skill-2`). | **Workflow** | Step-by-step processes | `tdd-workflow`, `refactoring-workflow` | | **Domain Knowledge** | Specialized domains | `security-review`, `api-design` | | **Tool Integration** | Tool/library usage | `docker-patterns`, `supabase-patterns` | +| **Template** | Project-specific skill templates | `project-guidelines-example` | ### Skill Checklist diff --git a/docs/SKILL-DEVELOPMENT-GUIDE.md b/docs/SKILL-DEVELOPMENT-GUIDE.md index 6a5b123c..a772c868 100644 --- a/docs/SKILL-DEVELOPMENT-GUIDE.md +++ b/docs/SKILL-DEVELOPMENT-GUIDE.md @@ -90,6 +90,10 @@ Main patterns and guidelines. // Practical, tested examples \`\`\` +## Anti-Patterns + +Show what NOT to do with concrete examples. + ## Best Practices - Actionable guidelines @@ -602,14 +606,14 @@ description: Quick reference for [API/Library]. Test all code examples: ```bash -# For TypeScript -npx tsc --noEmit examples/*.ts +# For TypeScript (run from inside the skill directory or specify the path) +npx tsc --noEmit skills/your-skill-name/examples/*.ts # For Python -python -m py_compile examples/*.py +python -m py_compile skills/your-skill-name/examples/*.py # For Go -go build ./examples/... +go build ./skills/your-skill-name/examples/... ``` --- @@ -903,4 +907,4 @@ npm run test:e2e --- -**Remember**: A good skill is focused, actionable, and immediately useful. Write skills you'd want to use yourself. \ No newline at end of file +**Remember**: A good skill is focused, actionable, and immediately useful. Write skills you'd want to use yourself. diff --git a/rules/common/code-review.md b/rules/common/code-review.md index e2364b07..d79ba9bf 100644 --- a/rules/common/code-review.md +++ b/rules/common/code-review.md @@ -14,6 +14,14 @@ Code review ensures quality, security, and maintainability before code is merged - When architectural changes are made - Before merging pull requests +**Pre-Review Requirements:** + +Before requesting review, ensure: + +- All automated checks (CI/CD) are passing +- Merge conflicts are resolved +- Branch is up to date with target branch + ## Review Checklist Before marking code complete: @@ -113,4 +121,4 @@ This rule works with: - [testing.md](testing.md) - Test coverage requirements - [security.md](security.md) - Security checklist - [git-workflow.md](git-workflow.md) - Commit standards -- [agents.md](agents.md) - Agent delegation \ No newline at end of file +- [agents.md](agents.md) - Agent delegation diff --git a/rules/common/development-workflow.md b/rules/common/development-workflow.md index d97c1b1d..ae070be2 100644 --- a/rules/common/development-workflow.md +++ b/rules/common/development-workflow.md @@ -36,3 +36,9 @@ The Feature Implementation Workflow describes the development pipeline: research - Detailed commit messages - Follow conventional commits format - See [git-workflow.md](./git-workflow.md) for commit message format and PR process + +5. **Pre-Review Checks** + - Verify all automated checks (CI/CD) are passing + - Resolve any merge conflicts + - Ensure branch is up to date with target branch + - Only request review after these checks pass diff --git a/rules/zh/README.md b/rules/zh/README.md index 0793b4fd..34f71910 100644 --- a/rules/zh/README.md +++ b/rules/zh/README.md @@ -14,7 +14,9 @@ rules/ │ ├── patterns.md │ ├── hooks.md │ ├── agents.md -│ └── security.md +│ ├── security.md +│ ├── code-review.md +│ └── development-workflow.md ├── zh/ # 中文翻译版本 │ ├── coding-style.md │ ├── git-workflow.md @@ -24,6 +26,7 @@ rules/ │ ├── hooks.md │ ├── agents.md │ ├── security.md +│ ├── code-review.md │ └── development-workflow.md ├── typescript/ # TypeScript/JavaScript 特定 ├── python/ # Python 特定 @@ -60,6 +63,9 @@ rules/ > 并破坏语言特定文件使用的 `../common/` 相对引用。 ```bash +# 创建目标目录 +mkdir -p ~/.claude/rules + # 安装通用规则(所有项目必需) cp -r rules/common ~/.claude/rules/common @@ -99,4 +105,4 @@ cp -r rules/php ~/.claude/rules/php `rules/common/` 中可能被语言特定文件覆盖的规则会标记: -> **语言说明**:此规则可能被语言特定规则覆盖,对于某些语言,该模式可能不是惯用的。 \ No newline at end of file +> **语言说明**:此规则可能被语言特定规则覆盖,对于某些语言,该模式可能不是惯用的。 diff --git a/rules/zh/agents.md b/rules/zh/agents.md index dc75dcf4..3723d4b4 100644 --- a/rules/zh/agents.md +++ b/rules/zh/agents.md @@ -47,4 +47,4 @@ - 高级工程师 - 安全专家 - 一致性审查者 -- 冗余检查者 \ No newline at end of file +- 冗余检查者 diff --git a/rules/zh/code-review.md b/rules/zh/code-review.md index 608709e9..bb4c228c 100644 --- a/rules/zh/code-review.md +++ b/rules/zh/code-review.md @@ -14,6 +14,14 @@ - 进行架构更改时 - 合并 pull request 之前 +**审查前要求:** + +在请求审查之前,确保: + +- 所有自动化检查(CI/CD)已通过 +- 合并冲突已解决 +- 分支已与目标分支同步 + ## 审查检查清单 在标记代码完成之前: @@ -113,4 +121,4 @@ - [testing.md](testing.md) - 测试覆盖率要求 - [security.md](security.md) - 安全检查清单 - [git-workflow.md](git-workflow.md) - 提交标准 -- [agents.md](agents.md) - 代理委托 \ No newline at end of file +- [agents.md](agents.md) - 代理委托 diff --git a/rules/zh/coding-style.md b/rules/zh/coding-style.md index dd975d88..e20a609e 100644 --- a/rules/zh/coding-style.md +++ b/rules/zh/coding-style.md @@ -45,4 +45,4 @@ - [ ] 没有深层嵌套(>4 层) - [ ] 正确的错误处理 - [ ] 没有硬编码值(使用常量或配置) -- [ ] 没有变更(使用不可变模式) \ No newline at end of file +- [ ] 没有变更(使用不可变模式) diff --git a/rules/zh/development-workflow.md b/rules/zh/development-workflow.md index 610fbbac..f0aa9785 100644 --- a/rules/zh/development-workflow.md +++ b/rules/zh/development-workflow.md @@ -35,4 +35,10 @@ 4. **提交与推送** - 详细的提交消息 - 遵循约定式提交格式 - - 参见 [git-workflow.md](./git-workflow.md) 了解提交消息格式和 PR 流程 \ No newline at end of file + - 参见 [git-workflow.md](./git-workflow.md) 了解提交消息格式和 PR 流程 + +5. **审查前检查** + - 验证所有自动化检查(CI/CD)已通过 + - 解决任何合并冲突 + - 确保分支已与目标分支同步 + - 仅在这些检查通过后请求审查 diff --git a/rules/zh/git-workflow.md b/rules/zh/git-workflow.md index 15b27ed2..50a4217f 100644 --- a/rules/zh/git-workflow.md +++ b/rules/zh/git-workflow.md @@ -21,4 +21,4 @@ 5. 如果是新分支,使用 `-u` 标志推送 > 对于 git 操作之前的完整开发流程(规划、TDD、代码审查), -> 参见 [development-workflow.md](./development-workflow.md)。 \ No newline at end of file +> 参见 [development-workflow.md](./development-workflow.md)。 diff --git a/rules/zh/hooks.md b/rules/zh/hooks.md index c16bcd40..e66383bc 100644 --- a/rules/zh/hooks.md +++ b/rules/zh/hooks.md @@ -27,4 +27,4 @@ - 缺失的项目 - 多余的不必要项目 - 错误的粒度 -- 误解的需求 \ No newline at end of file +- 误解的需求 diff --git a/rules/zh/patterns.md b/rules/zh/patterns.md index ef51b297..e39f245e 100644 --- a/rules/zh/patterns.md +++ b/rules/zh/patterns.md @@ -28,4 +28,4 @@ - 包含成功/状态指示器 - 包含数据负载(错误时可为空) - 包含错误消息字段(成功时可为空) -- 包含分页响应的元数据(total、page、limit) \ No newline at end of file +- 包含分页响应的元数据(total、page、limit) diff --git a/rules/zh/performance.md b/rules/zh/performance.md index a8d34a79..11a2911c 100644 --- a/rules/zh/performance.md +++ b/rules/zh/performance.md @@ -52,4 +52,4 @@ 1. 使用 **build-error-resolver** 代理 2. 分析错误消息 3. 增量修复 -4. 每次修复后验证 \ No newline at end of file +4. 每次修复后验证 diff --git a/rules/zh/security.md b/rules/zh/security.md index 1fbf01a1..3956a481 100644 --- a/rules/zh/security.md +++ b/rules/zh/security.md @@ -26,4 +26,4 @@ 2. 使用 **security-reviewer** 代理 3. 在继续之前修复关键问题 4. 轮换任何已暴露的密钥 -5. 审查整个代码库中的类似问题 \ No newline at end of file +5. 审查整个代码库中的类似问题 diff --git a/rules/zh/testing.md b/rules/zh/testing.md index c73c1491..cb899fa7 100644 --- a/rules/zh/testing.md +++ b/rules/zh/testing.md @@ -26,4 +26,4 @@ ## 代理支持 -- **tdd-guide** - 主动用于新功能,强制先写测试 \ No newline at end of file +- **tdd-guide** - 主动用于新功能,强制先写测试