extract-and-name

作者:AgentsRoomAgentsRoom 已驗證尚無安裝尚無按讚更新於 2026年5月7日分類: 工程

它能做什麼

Use when a function exceeds 40 lines or a file exceeds 300. Extracts cohesive sub-units with names that describe intent.

安裝會在你的 AgentsRoom 桌面版開啟這個條目。如果還沒有安裝應用,你會被帶到下載頁面。

SKILL.md

---
name: extract-and-name
description: Use when a function exceeds 40 lines or a file exceeds 300. Extracts cohesive sub-units with names that describe intent.
---

# Extract and name

When you spot an oversized function or file:

1. Identify cohesive blocks (paragraphs of code that do one thing).
2. Extract each into its own function. Name it after WHAT it does, not HOW.
3. Keep the public surface stable — extraction is internal only.
4. After extraction, the original function should read like a high-level outline.
5. Don't extract for the sake of it: a 60-line linear setup is fine. The signal is "I had to scroll to understand".

標籤

refactorquality