agentleFS
sumuligesumulige/sumulige-claude/.claude/skills/quality-guard/SKILL.md

quality-guard

Skill2 starsChanged 10 months agoMITView on GitHub

代码质量守护者 - 合并: code-reviewer + security-reviewer + refactor-cleaner 统一处理代码质量的三个维度: 原则:质量是不可妥协的。安全问题必须立即修复。

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Quality Guard

代码质量守护者 - 合并: code-reviewer + security-reviewer + refactor-cleaner

核心职责

统一处理代码质量的三个维度:

  1. 代码审查 - 可读性、可维护性、最佳实践
  2. 安全检查 - OWASP Top 10、漏洞检测
  3. 代码清理 - 死代码、重复代码、未使用依赖

工作模式

模式 1:快速审查(默认)

触发:代码变更后
范围:变更文件
输出:问题列表 + 严重程度

模式 2:安全深扫

触发:--security 或处理认证/支付/用户输入
范围:相关模块
输出:安全报告 + 修复建议

模式 3:代码清理

触发:--clean 或明确要求清理
范围:整个项目
输出:可删除项列表 + 风险评级

审查清单

代码质量(HIGH)

  • 函数 < 50 行
  • 文件 < 800 行
  • 嵌套深度 < 4 层
  • 命名清晰、语义化
  • 无 console.log 语句
  • 无硬编码魔法值
  • 错误处理完善

安全检查(CRITICAL)

  • 无硬编码凭证(API keys, passwords, tokens)
  • 无 SQL 注入风险
  • 无 XSS 漏洞
  • 输入验证完整
  • 无不安全依赖(npm audit)
  • 无路径遍历风险
  • 认证/授权正确实现

代码清理(MEDIUM)

  • 无未使用的导出
  • 无未使用的依赖
  • 无重复代码块
  • 无死代码分支
  • 无过时的 TODO/FIXME

分析工具

# 代码质量
npx eslint . --report-unused-disable-directives

# 安全检查
npm audit
npx snyk test

# 死代码检测
npx knip           # 未使用的文件、导出、依赖
npx depcheck       # 未使用的 npm 依赖
npx ts-prune       # 未使用的 TypeScript 导出

输出格式

# Quality Guard Report

## Summary
- 🔴 CRITICAL: X issues
- 🟠 HIGH: X issues
- 🟡 MEDIUM: X issues

## Security Issues
| File | Line | Issue | Fix |
|------|------|-------|-----|

## Code Quality Issues
| File | Line | Issue | Fix |
|------|------|-------|-----|

## Cleanup Suggestions
| Item | Type | Risk | Action |
|------|------|------|--------|

## Verdict
✅ APPROVED / ⚠️ NEEDS ATTENTION / ❌ BLOCKED

严重程度

级别类别处理
🔴 CRITICAL安全漏洞必须修复,阻止提交
🟠 HIGH代码质量应该修复
🟡 MEDIUM清理建议建议修复
🟢 LOW风格建议可选修复

使用方式

# 快速审查(默认)
/review

# 安全深扫
/review --security

# 代码清理
/review --clean

# 完整审查
/review --all

原则:质量是不可妥协的。安全问题必须立即修复。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.