code-quality-report

生成代码质量报告。当用户请求为项目源代码生成质量报告时,使用此功能。输出名为 code-quality-report.html 的单页 HTML 文件作为质量报告,该报告集成了 Node.js 脚本和 HTML 模板。

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "code-quality-report" with this command: npx skills add warmeaf/code-quality-report-skill/warmeaf-code-quality-report-skill-code-quality-report

生成代码质量报告

质量判断和优化标准

  • 依赖\reference\code-quality-standard.md作为质量判断和优化标准

生成步骤

  1. 确定路径和输出目录

    • 确定源码文件夹路径(通常为src/
    • 确定报告输出文件夹:默认为项目根目录下的`.cqm/code-quality-report/``
    • 如果输出文件夹不存在,则创建该目录
  2. 初始化文件结构数据

    • 执行脚本 node 脚本generate-file-structure.js,第一个参数是源码文件夹路径,第二个参数是${报告输出文件夹}/code-quality-report.json
    • 脚本会在输出文件夹下生成 code-quality-report.json 文件
    • 该 JSON 文件包含源码目录结构,每个代码文件的code_quality字段初始值为0
  3. 评估代码质量

    • 读取${报告输出文件夹}/code-quality-report.json获取所有代码文件列表
    • 对于 JSON 中的每个代码文件:
      • 读取文件内容
      • 根据判断标准,运用 AI 能力评估其质量
      • 每个代码文件的质量指标都是独立的,可使用多个子 Agent 并行处理
      • 将评估结果(0-100 的分数)更新到该文件对应的 code_quality 字段
      • 将更新后的数据写回 code-quality-report.json
  4. 生成 HTML 报告

    • 读取模板文件:code-quality-report-template.html
    • 读取最终的code-quality-report.json数据
    • 在模板文件中找到rawData变量(通常在 JavaScript 代码中)
    • code-quality-report.json的内容直接赋值给rawData变量
    • 将更新后的模板内容保存为${报告输出文件夹}/code-quality-report.html
  5. 收尾

    • 最终报告文件位于${报告输出文件夹}/code-quality-report.html
    • 如果模板文件code-quality-report-template.html中有更改则还原
  6. 优化

    • 最后如果存在得分低于 90 分的文件,则询问是否进行优化

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

code-quality-report

No summary provided by upstream source.

Repository SourceNeeds Review
General

happy-marriage

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated