本文へ移動
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(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

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月8日 更新

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月8日 更新

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月8日 更新

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月8日 更新

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月8日 更新

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月8日 更新

hashintel のスキルをすべて見る

このスキルの問題を報告する