code-polish

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Code Polish

代码精修

Combined simplification and review pipeline. This skill orchestrates two sub-skills in sequence:
  1. code-simplify
    — simplify for readability and maintainability
  2. code-review --fix
    — review for correctness, security, and quality, auto-applying all fixes
这是一个集简化与审查于一体的工作流。本Skill会按顺序协调两个子Skill的执行:
  1. code-simplify
    — 提升代码的可读性与可维护性
  2. code-review --fix
    — 审查代码的正确性、安全性与质量,并自动应用所有修复方案

Prerequisites

前置条件

Both the
code-simplify
and
code-review
skills MUST be installed. If either skill is missing, stop immediately and report the error:
ERROR:
code-polish
requires the
code-simplify
and
code-review
skills to be installed. Missing:
<skill-name>
.
必须已安装
code-simplify
code-review
这两个Skill。若缺少其中任意一个,需立即停止操作并报告错误:
错误:
code-polish
需要安装
code-simplify
code-review
Skill。缺失:
<skill-name>

Workflow

工作流

1) Run
code-simplify

1) 执行
code-simplify

Invoke the
code-simplify
skill, forwarding
$ARGUMENTS
as-is.
调用
code-simplify
Skill,原样传递
$ARGUMENTS
参数。

2) Run
code-review --fix

2) 执行
code-review --fix

Invoke the
code-review
skill with the
--fix
flag appended to
$ARGUMENTS
.
调用
code-review
Skill,在
$ARGUMENTS
后追加
--fix
标志。

3) Report

3) 生成报告

Combine the outputs from both skills into a single summary:
  1. Scope: Files and functions touched.
  2. Simplifications: Key changes from
    code-simplify
    .
  3. Review findings and fixes: Findings and applied fixes from
    code-review
    .
  4. Verification: Commands run and outcomes.
  5. Residual risks: Assumptions or items needing manual review.
将两个Skill的输出结果整合为一份汇总报告:
  1. 范围:涉及的文件与函数。
  2. 简化内容:来自
    code-simplify
    的主要修改。
  3. 审查结果与修复:来自
    code-review
    的审查发现及已应用的修复。
  4. 验证情况:执行的命令及结果。
  5. 剩余风险:存在的假设或需要人工审查的内容。