跳到正文
cccskills
免费在 GitHub 公开

methods

Refactor long methods or large code blocks by extracting small, focused helper methods with clear names and narrow responsibilities. Use when asked to extract methods or run `/refactor:methods`.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md1.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Extract Methods Refactor

Ask the user for the file or directory to refactor. Support multiple files if a directory is provided.

Process

Work through these steps in order, making a separate commit for each extraction:

  1. Extract simple helper methods

    • Calculations, formatting, simple logic
    • Single responsibility, behavior-focused names
    • Pass necessary parameters rather than sharing state
  2. Extract complex logic blocks

    • Validation, transformations, data processing
    • Well-named methods that reveal intent
    • Apply proper access modifiers (private for helpers)
  3. Extract control flow sections

    • Only when it improves readability
    • Avoid over-extraction that hurts clarity

After EACH extraction:

  • Run tests automatically
  • If tests fail, revert the change immediately
  • If tests pass and using IDE refactoring tool, commit: . r <description>
  • If tests pass but manual refactoring, commit: ^ r <description>

Guidelines

  • Extract pragmatically to improve code organization
  • Name methods based on behavior not implementation
  • Ensure each method ≤ 25 lines
  • Preserve original functionality exactly

Output

  • If no methods to extract, report "No methods to extract"
  • Otherwise provide brief summary (e.g., "Extracted 5 methods from 3 large blocks")

Commit Format

Use Arlo's Commit Notation (ACN):

  • . r extract validateUserCredentials method - IDE refactoring
  • ^ r extract transformRawStockData method - Manual refactoring

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

中文简介正在准备中。当前显示原文说明。

SDiamante13/dotfiles102026年10月2日 更新

catchup

免费

Rebuilds session context after a clear by reading git history, plans, and beads state. Triggers on 'catch up'.

中文简介正在准备中。当前显示原文说明。

SDiamante13/dotfiles102026年10月2日 更新

changelog

免费

Generate a bullet-point summary of branch changes for a PR description. Triggers on "changelog", "pr summary", "summarize branch", or "/changelog".

中文简介正在准备中。当前显示原文说明。

SDiamante13/dotfiles102026年10月2日 更新

commit

免费

Commit the current changes with quality checks, status review, staged diff inspection, appropriate tests, and a clear commit message. Use when the user says "commit", "c", asks to make a commit, or wants changes saved in git.

中文简介正在准备中。当前显示原文说明。

SDiamante13/dotfiles102026年10月2日 更新

declutter

免费

Refactor code to remove dead code, useless comments, unused variables, and unused imports. Use when asked to declutter a class, clean up noisy code, remove cruft, or run `/refactor:declutter`.

中文简介正在准备中。当前显示原文说明。

SDiamante13/dotfiles102026年10月2日 更新

dry

免费

Refactor duplicated code by extracting helpers, shared abstractions, or clearer reusable structure. Use when asked to apply DRY, remove duplication, consolidate repeated logic, or run `/refactor:dry`.

中文简介正在准备中。当前显示原文说明。

SDiamante13/dotfiles102026年10月2日 更新

查看 SDiamante13 的全部技能

报告此技能的问题