跳到正文
cccskills
免费在 GitHub 公开

ln-refactor

Plan a refactor as a sequence of tiny safe commits via interview and codebase exploration. Use when restructuring working code, or when the user says 'plan a refactor'.

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

查看安装方法

包含的文件(1)

  • SKILL.md3.2 KB

SKILL.md(原文)

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

Ln Refactor

"Make the change easy, then make the easy change" (Beck). Plan a refactor as tiny commits that each leave the codebase working (Fowler). Preparatory refactoring first, behavioral changes last.

memory/REFACTOR.md is a temporary derivative execution aid. Do not create alternate refactor ledgers or archive completed refactor plans; delete the file when the refactor is finished or superseded.

Skip steps you consider unnecessary.

Input

The area to refactor: $ARGUMENTS

Plan

  1. Capture the problem. Explore the codebase to verify assertions. Present alternatives the user may not have considered. Hammer out exact scope — what changes, what stays.
  2. Check test coverage of the affected area. If coverage is insufficient for safe refactoring, the first step must be characterization tests (Feathers, Working Effectively with Legacy Code) — suggest ln-build for that before continuing.
  3. Break the refactor into tiny commits. Order by safety: renames first (align to the lexicon in memory/SPEC.md if it exists), then extractions (deepen shallow modules — Ousterhout), then interface alignments, then behavioral changes last. Each commit is a complete, passing state.
  4. Write the refactor plan to memory/REFACTOR.md. Delete the file when the refactor is complete or superseded.

Output

Use this structure:

## Problem Statement

What is wrong, from the developer's perspective.

## Solution

The target state, from the developer's perspective.

## Commits

Ordered list of tiny commits. Each described in plain English — no file paths or snippets. Each leaves the codebase working.

1. [Commit description]
2. [Commit description]
3. ...

## Decisions

- Modules built or modified
- Interface changes
- Architectural decisions
- Schema changes, API contracts

No file paths or code snippets — they go stale. Record in `memory/SPEC.md` §Decisions when finalized.

## Testing Decisions

- What makes a good test here (behavior, not implementation)
- Which modules get tested
- Prior art in the codebase

## Out of Scope

What this refactor deliberately excludes.

Routing

After filing the refactor plan, present these options to the user (use tool-ask-question):

#LabelTargetWhy
1Build first commitln-buildRefactor plan is clear; implement one commit-sized step from memory/REFACTOR.md
2Scope a commitln-scopeA commit needs more precise behavior/acceptance definition
3Back to triageln-consultPlan needs reassessment

Recommended: 1 when the first commit step is concrete enough to execute; otherwise 2


Adapted from mattpocock/skills/request-refactor-plan.

评价

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

评论

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

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

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

0 / 1000 字

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

同一仓库的技能

Build AI chat interfaces using ai-elements components — conversations, messages, tool displays, prompt inputs, and more. Use when the user wants to build a chatbot, AI assistant UI, or any AI-powered chat interface.

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

hashintel/brunch82026年10月17日 更新

Search the live web via Perplexity Search API. Use when you need current documentation, release notes, vendor pages, news, domain-constrained web search, or date/recency filtering. Not for local codebase search or stable docs already in context.

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

hashintel/brunch82026年10月17日 更新

cli-cdp

免费

Chrome DevTools CLI for browser automation via shell commands. Use when interacting with web pages from the command line — navigating, clicking, filling forms, inspecting console/network, taking screenshots, or extracting page content. Triggers on: browse a page, automate Chrome, inspect console, check network requests, take a screenshot, fill a form, click a button.

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

hashintel/brunch82026年10月17日 更新

Uses the chrome-devtools-axi CLI for browser automation, accessibility-tree snapshots, console and network inspection, screenshots, Lighthouse audits, and performance traces. Use when interacting with Chrome from the shell, especially when the user mentions chrome-devtools-axi, AX snapshots, browser debugging, or DevTools automation from the command line.

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

hashintel/brunch82026年10月17日 更新

cli-cmux

免费

Deep expertise in cmux — the terminal multiplexer with native browser views. Use when managing panes, reading terminal output, sending keystrokes, opening browser views, or manually testing web UIs and TUIs inside cmux. Triggers on: cmux, open a browser pane, split terminal, read screen, send keys, test this UI in cmux, preview in cmux.

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

hashintel/brunch82026年10月17日 更新

Uses the gh-axi CLI for GitHub shell operations: issue, pull request, workflow run, release, repo, search, and API tasks. Prefer this over regular `gh` for GitHub reads and simple mutations when an agent needs compact, structured, suggestion-rich output. Triggers on: gh, GitHub CLI, github issue, github pr, pull request, workflow run, github release, gh api, repo inspection, list PRs, view issue, check workflow runs, inspect repo, GitHub shell operations.

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

hashintel/brunch82026年10月17日 更新

查看 hashintel 的全部技能

报告此技能的问题