已开启
feat: add code-optimization skill #2723
feat: add code-optimization skill #2723
已开启
Ruiyu_Qiu创建于 6月25日
Ruiyu_Qiu
6月25日

What this PR does / why we need it?

Implements issue #363: a reusable, agent-facing code-optimization skill under
.agents/skills/code-optimization/. This PR is skill-only; it does not change any
file under mindspeed_mm/.

How the skill works (per reviewer feedback): it does not edit code. Running it
produces a Markdown report (code_optimization_report_<date>.md) that lists every
candidate cleanup as one row of a checklist table with a 决策 column, plus for each
candidate a full diff, the ripple analysis (callers / registration / YAML / import /
tests) and a semantics-preservation rationale, and finally a section of items the
skill saw but deliberately did not propose (with reasons). Reviewers go through the
report one by one and decide which items to apply; nothing is applied automatically.

Files:

  • SKILL.md — when to use, the 3-phase workflow (locate → judge → ripple + report), reject
    criteria, no-touch zones, anti-patterns.
  • references/optimization_map.md — where to look first; reuses the repo's own
    fsdp2_code_boundaries.md change tiers as the no-touch baseline.
  • references/finding_schema.md — per-finding field contract and the report-file layout.
  • examples/code_optimization_report_example.md — a real report produced by running
    the skill on mindspeed_mm/: 8 candidates (2 structural: a byte-identical duplicate
    method and a dead private function pair; 6 zero-risk: duplicate imports and dead
    stores) and 10 deliberately skipped items, including two shadowed duplicate
    definitions with different bodies that the skill flags as suspected bugs for a
    human instead of proposing a deletion.

Related issue: https://gitcode.com/Ascend/MindSpeed-MM/issues/363

Does this PR introduce any user-facing change?

No. Documentation / agent skill only. No source, config, or training-behavior change.

How was this patch tested?

  • Every diff in the example report was extracted back out of the Markdown and passed
    git apply --check against master (7a54aa84, the branch base) and against the
    current master head (60591711); all 8 applied together compile (py_compile) and
    pyflakes warnings only decrease.
  • markdownlint (repo docs gate rules), codespell and trailing-whitespace checks pass on
    all files in the skill directory. pre-commit excludes *.md, so it has nothing to
    check for this PR.
likedislike
合并受阻
RRuiyu_Qiu
6月25日 创建了 pull request,commit ec9b75d7
RRuiyu_Qiu
6月25日 关联了issue:【Feature】skill:代码优化
ascend-robotascend-robot成员
6月25日 添加了label:stat/needs-squash
ascend-robotascend-robot成员
6月25日 添加了label:ascend-cla/no
ascend-robot
ascend-robot成员
6月25日 评论:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.


PR Approval Progress

⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)

Module Approval Details

module lgtm status approve status
repo-Ascend/MindSpeed-MM ❌ (0/2)(You can also ask: liuxi_, wanglikai1019, song_hello_world, 刘启元, ningmenglh) ❌ (0/1)(You can also ask: cxiaolong, bigdog1206, 陈志国, yaoyaoxu, 王海涛)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

qiuruiyu531, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
此处折叠了89条消息 查看更多
ascend-robotascend-robot成员
9月12日 删除了label:docs-ci-pipeline-success
ascend-robotascend-robot成员
9月12日 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
9月12日 评论:

✅ 文档门禁通过!

检查项 检查结果 详情
markdownlint ✅ 已通过 查看详情
link-validity-check ✅ 已通过 查看详情
resource-existence-check ✅ 已通过 查看详情
tag-closed-check ✅ 已通过 查看详情
likedislike
ascend-robotascend-robot成员
9月12日 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
9月12日 添加了label:docs-ci-pipeline-success