[Coding Agent] Update API Compatibility Claude Code Skills (Part3)#7910
Merged
Conversation
📚 本次 PR 文档预览链接(点击展开)
|
Contributor
There was a problem hiding this comment.
Pull request overview
本 PR 对《Paddle API 对齐 PyTorch 项目》相关的 Coding Agent Skill 体系做结构化重构:将分散的规则/背景信息收敛到标准化的 SKILL.md 与项目级 CLAUDE.md,并补充安装脚本与目录说明,减少重复内容、降低维护成本。
Changes:
- 新增项目级
CLAUDE.md与安装脚本,并更新目录 README 说明与使用入口。 - 将原先分散的
.md/.mdr规则文件整合/迁移为.claude/skills/*/SKILL.md体系,删除冗余旧文件。 - 对多个 Skill 的流程描述做一致化调整(步骤命名、编译/运行要求、注意事项补充等)。
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/dev_guides/coding_agent/README.md | 重写 coding_agent 目录说明,明确 Agent 规则组成、结构与项目入口 |
| docs/dev_guides/coding_agent/api_compatibility/README.md | 重写项目 README:结构、安装、使用方式与链接入口 |
| docs/dev_guides/coding_agent/api_compatibility/pytorch-alignment-validator.md | 删除旧版独立规则文档(已整合到 SKILL.md) |
| docs/dev_guides/coding_agent/api_compatibility/python-decorator.md | 删除旧版独立规则文档(已整合到 SKILL.md) |
| docs/dev_guides/coding_agent/api_compatibility/install.sh | 新增一键安装脚本(安装 skills + 复制 CLAUDE.md 到项目根) |
| docs/dev_guides/coding_agent/api_compatibility/cpp-sink.mdr | 删除旧版 mdr 规则(已整合到 SKILL.md) |
| docs/dev_guides/coding_agent/api_compatibility/api-docs-updater.mdr | 删除旧版 mdr 规则(已整合到 SKILL.md) |
| docs/dev_guides/coding_agent/api_compatibility/api-compatibility.md | 删除旧版主控规则文档(已整合到 SKILL.md) |
| docs/dev_guides/coding_agent/api_compatibility/api-change-decider.md | 删除旧版决策规则文档(已整合到 SKILL.md) |
| docs/dev_guides/coding_agent/api_compatibility/.claude/skills/README.md | 删除旧的 skills README(结构信息已迁移/收敛) |
| docs/dev_guides/coding_agent/api_compatibility/.claude/skills/pytorch-alignment-validator/SKILL.md | 更新对齐验证 Skill(验收标准/编译与回退原则等) |
| docs/dev_guides/coding_agent/api_compatibility/.claude/skills/python-decorator/SKILL.md | 补充 python-decorator Skill 的上下文与注意事项(如“简单别名优先”等) |
| docs/dev_guides/coding_agent/api_compatibility/.claude/skills/modify-origin-api/SKILL.md | 调整 modify-origin-api 的注意事项与约束描述 |
| docs/dev_guides/coding_agent/api_compatibility/.claude/skills/create-pr/SKILL.md | 优化 create-pr 的信息来源与 PR body 模板格式 |
| docs/dev_guides/coding_agent/api_compatibility/.claude/skills/cpp-sink/SKILL.md | 为 cpp-sink 增加元数据字段(context) |
| docs/dev_guides/coding_agent/api_compatibility/.claude/skills/api-docs-updater/SKILL.md | 补充文档更新原则(避免强调“PyTorch 风格”等) |
| docs/dev_guides/coding_agent/api_compatibility/.claude/skills/api-compatibility/SKILL.md | 精简总控 Skill 背景内容,补充流程约束与子 Skill 列表 |
| docs/dev_guides/coding_agent/api_compatibility/.claude/skills/api-change-decider/SKILL.md | 重构方案决策 Skill 的规则表述(流程图/合并规则等) |
| docs/dev_guides/coding_agent/api_compatibility/.claude/skills/add-new-compat-api/SKILL.md | 新增 compat API 变体 Skill(复用 add-new-api 流程) |
| docs/dev_guides/coding_agent/api_compatibility/.claude/skills/add-compatibility-test/SKILL.md | 轻量调整兼容测试 Skill 步骤描述(措辞一致化) |
| docs/dev_guides/coding_agent/api_compatibility/.claude/install.sh | 新增 .claude 内安装脚本(安装 skills + 复制 CLAUDE.md) |
| docs/dev_guides/coding_agent/api_compatibility/.claude/CLAUDE.md | 新增项目级背景知识与路径速查表,作为上下文自动加载源 |
Comment on lines
+11
to
+13
| └── .claude/ # Claude Code 配置 | ||
| ├── CLAUDE.md # 项目背景(自动加载) | ||
| └── skills/ # Skill 定义 |
| ├── api-compatibility/ # 总控 | ||
| ├── api-change-decider/ # Step1:方案决策 | ||
| ├── python-decorator/ # Step2:Python 装饰器 | ||
| ├── cpp-sink/ # Step2:C++下沉 |
Comment on lines
+14
to
+16
| | Paddle | `${ROOT_DIR}/Paddle` | Paddle 框架源码仓库,包含所有 Paddle API 的实现 | Step2:代码修改 + Step3:兼容测试 | | ||
| | PaConvert | `${ROOT_DIR}/PaConvert` | PyTorch 转换工具仓库,包含所有 Pytorch 单元测试 | Step4:对齐验证 | | ||
| | docs | `${ROOT_DIR}/docs` | Paddle 文档仓库,包含所有 Paddle API 中文文档 | Step5:文档更新 | |
Comment on lines
+23
to
+25
| |API 差异文档|`torch.{api_name}.md`|`${ROOT_DIR}/docs/docs/guides/model_convert/convert_from_pytorch/api_difference/`下一级目录|torch.tan.md|| | ||
| |C++下沉使用|`python_api_info.yaml`、`ops.yaml`|`${ROOT_DIR}/Paddle/paddle/phi/ops/yaml/`|python_api_info.yaml、ops.yaml|| | ||
| |C++下沉使用|`_paddle_docs.py`|`${ROOT_DIR}/Paddle/python/paddle/`|_paddle_docs.py|| |
| ```bash | ||
| # ===== Paddle PR 创建(无依赖,先创建) ===== | ||
| gh pr create --repo PaddlePaddle/Paddle --base develop --head zhwesky2010:claude \ | ||
| gh pr create --repo PaddlePaddle/Paddle --base develop --head zhwesky20:claude \ |
|
|
||
| # ===== Docs PR 创建(依赖 Paddle PR 号) ===== | ||
| gh pr create --repo PaddlePaddle/docs --base develop --head zhwesky2010:claude \ | ||
| gh pr create --repo PaddlePaddle/docs --base develop --head zhwesky20:claude \ |
|
|
||
| # ===== PaConvert PR 创建(依赖 Docs 和 Paddle PR 号) ===== | ||
| gh pr create --repo PaddlePaddle/PaConvert --base master --head zhwesky2010:claude \ | ||
| gh pr create --repo PaddlePaddle/PaConvert --base master --head zhwesky20:claude \ |
Comment on lines
+56
to
+58
| echo "使用方法:" | ||
| echo " cd $PROJECT_ROOT" | ||
| echo " /api-compatibility torch.atan" |
608f0cc to
44fcb5e
Compare
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.
调优《Paddle API 对齐 PyTorch 项目》 Skill(Part3)
本 PR 在 #7899 、#7901 、#7906 基础上, 对《Paddle API 对齐 PyTorch 项目》下的 Coding Agent Skill 体系进行架构重构,将分散的规则文件统一整合到标准化的 SKILL.md 格式,消除信息冗余,降低维护成本。
主要变更
1. 新增核心配置
CLAUDE.md新增项目级配置文件,自动加载到 AI 上下文,包含:
${ROOT_DIR}变量定义install.sh新增一键安装脚本,简化环境配置流程。
2. 精简 Skill 文件
将各个 SKILL.md 中重复的背景知识统一迁移至 CLAUDE.md,各 Skill 仅保留专属流程:
/api-compatibility/api-change-decider/create-pr/cpp-sinkverbose字段/python-decorator/pytorch-alignment-validator3. 删除冗余文件
删除独立的
.md/.mdr文件,避免信息重复维护:api-change-decider.mdapi-compatibility.mdapi-docs-updater.mdrcpp-sink.mdrpython-decorator.mdpytorch-alignment-validator.mdskills/README.md4. 更新目录说明
重构
coding_agent/README.md:api_compatibility作为项目入口