code-quality-audit

Audit code quality issues in recently written code.

1|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/Linnanli/xClaw --skill code-quality-audit-linnanli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-quality-audit
Source: https://github.com/Linnanli/xClaw/tree/main/.github/skills/code-quality-audit
Command: npx skills add https://github.com/Linnanli/xClaw --skill code-quality-audit-linnanli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

对刚写完的代码执行质量审查。检查补丁式代码、函数过长、嵌套过深、重复逻辑、Rust unwrap/clone 滥用、以及是否重复造了有成熟库的轮子。在完成一段较复杂的实现后、提交前、或用户说帮我看看代码质量时激活。

Core Features & Use Cases

  • 补丁式代码检查:评估新增的边缘用例是否合理,避免为了覆盖边缘情况而引入冗余实现。
  • 函数规模与嵌套:检测函数是否超过合理长度、嵌套层数是否过深,提供重构建议和早返回策略。
  • 重复逻辑与代码清理:识别重复实现,提取可复用的函数/模块以提升可维护性。
  • Rust 特有问题:指出 unwrap/clone 滥用点,给出更安全的替代方案或设计改进。
  • 代码质量改进建议:给出具体修改方向、改动清单和优先级。

Quick Start

提交代码后,自动对代码质量进行审查并给出具体修改方向。

Frequently Asked Questions about code-quality-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit code quality and identify refactoring targets before a commit?

To audit code quality before a commit, review recently written code for overly long functions, deep nesting, and duplicated logic. This identifies patch-style implementations and generates prioritized refactoring suggestions to improve maintainability.

How do I fix Rust unwrap and clone misuse during a static code review?

Fixing Rust unwrap and clone misuse during a static code review involves pinpointing unsafe usage points and applying safer alternative patterns. This ensures error handling robustness and prevents potential runtime panics in your implementation.

What is patch-style code and how does static analysis detect it?

Patch-style code is redundant implementation added to cover edge cases, detected by static analysis through evaluating new logic. It identifies whether newly added edge case handling is reasonable or unnecessarily bloating the codebase.

Does this code quality audit work for non-Rust programming languages?

This code quality audit works for non-Rust languages by detecting generic issues like duplicated logic, deep nesting, and overly long functions. However, specific checks for Rust unwrap and clone misuse are only applicable to Rust codebases.

What is the best way to reduce deep nesting and function length in recent code changes?

The best way to reduce deep nesting and function length is to apply early return strategies and extract reusable modules. This refactoring approach improves code maintainability and simplifies complex implementations.

When should I run a code quality review during the development workflow?

You should run a code quality review after completing a complex implementation and before committing. This ensures newly written code is audited for reinvented library wheels and structural issues before integration.