SKILL10.0K installs40.5K

Refactor Method Complexity Reduce

Refactor given method `${input:methodName}` to reduce its cognitive complexity to `${input:complexityThreshold}` or below, by extracting helper methods.

Type
Skill
Author
github
Category
Code Review
GitHub stars
40.5K
Installs
10.0K
Last updated
November 2, 2026

Install

npx skills add https://github.com/github/awesome-copilot --skill refactor-method-complexity-reduce

Use cases


Frequently Asked Questions

How does the refactor work?

It reduces the method's cognitive complexity to the threshold you provide by extracting helper methods.

Can I choose the complexity target?

Yes, the threshold is an input to the skill, along with the method name.

Does it rewrite the whole file?

No, it targets a single given method and extracts helpers rather than performing a broad rewrite.


About this skill

Refactors a given method to reduce its cognitive complexity to a specified threshold or below by extracting helper methods. It fits into code review and cleanup workflows where a method has grown too complex to maintain. Useful for developers who want a mechanical, targeted refactor rather than a broad rewrite.

Summary written with AI assistance from the project's public description.


Categories


More from github


Similar Skills