AgentSkillsCN

clean-code-coach

提供代码整洁指导与重构建议。当您需要审查或提升代码的可读性、可维护性、命名规范、函数设计、注释质量、代码格式、错误处理、测试覆盖、边界定义、设计模式、并发处理,或应用代码整洁原则中的常见“异味”与启发式方法时,可使用此技能。

SKILL.md
--- frontmatter
name: clean-code-coach
description: Clean Code coaching and refactoring guidance. Use when reviewing or improving code readability, maintainability, naming, functions, comments, formatting, error handling, tests, boundaries, design, concurrency, or when applying Clean Code smells/heuristics.

Clean Code Coach

Overview

Provide structured, actionable Clean Code guidance using rule files and a compiled AGENTS guide. Use this skill for reviews, refactor plans, or code generation that prioritizes clarity and maintainability.

Quick start

  1. Identify the language and scope (files, constraints, tests).
  2. Scan for the top 3-5 issues using rule categories.
  3. Propose small, safe refactors with rationale.
  4. Suggest or run tests to protect behavior.

Structure

  • AGENTS.md is the compiled guide with section summaries and rule index.
  • rules/ contains one file per rule with incorrect vs. correct examples.
  • references/clean-code-heuristics.md contains an extended heuristic checklist.
  • references/clean-code-summary.md contains a chapter-level summary and workflow tips.

How to use rules

  • Start with the relevant section in AGENTS.md.
  • Read the specific rule file under rules/ for details and examples.
  • Tag review findings by rule title or file name for consistency.

Output format

  • Provide a short list of prioritized findings (3-5).
  • For each finding: impact, suggested refactor, and test notes.
  • Offer an optional refactor sequence if changes are interdependent.