AgentSkillsCN

complexity

代码复杂度指南,使用策略模式或分派表将圈复杂度保持在 6 以下。在编写或重构具有复杂分支逻辑的函数时使用。

SKILL.md
--- frontmatter
name: complexity
description: Code complexity guidelines to keep cyclomatic complexity below 6 using strategy patterns or dispatch tables. Use when writing or refactoring functions with complex branching logic.

Code Complexity Guidelines

Apply these guidelines to keep code complexity manageable.

Cyclomatic Complexity

Keep the cyclomatic complexity of each function below 6.

  • If you have a large switch case, consider using the strategy pattern or dispatch table instead