本文へ移動
cccskills
無料GitHub で公開

refactor

Use when code quality needs improvement after implementation, without changing behavior

日本語の概要は準備中です。原文の説明を表示しています。

Trevoke/org-gtd.elスター 486(GitHub 486 + cccskills 0)

実行スコア 未検証

インストール方法を見る

含まれるファイル(1)

  • SKILL.md2.9 KB

SKILL.md(原文)

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

/refactor — Code Quality Pass

Overview

Improve code structure without changing behavior. Propose changes, get approval, make one change at a time with tests between each.

Core principle: Never change behavior. Tests must stay green after every change.

When to Use

  • After implementation and QA pass
  • User requests a quality check on recent work
  • You notice structural issues while working

The Process

1. Establish Baseline

Run the test suite first. Actually run it.

~/bin/eldev etest -r dot

Record the result. This is your safety net. If tests aren't green before you start, fix that first.

2. Identify What Changed

git diff main...HEAD    # if on a branch
git log --oneline -N    # user specifies range

Read all changed files in full — not just the diff. Context matters.

3. Find Issues

Look for:

IssueSignal
DRY violationsSame logic in two places
SRP violationsFunction hard to name (doing too much)
NamingNames don't match what the code does
Unnecessary complexityAbstraction not earning its keep
Dead codeUnreachable branches, unused functions

Don't look for:

  • Style preferences (tab vs space, quote style)
  • Missing documentation on unchanged code
  • "Improvements" to code you didn't change

4. Propose Changes — Get Approval

Present refactorings ordered by highest impact, lowest risk first:

### 1. [Title] — Impact: High, Risk: Low

**What**: [what to change]
**Why**: [why it improves the code]
**Risk**: [what could go wrong]

Ask the user which to do. Don't start changing code without approval.

5. Make Changes — One at a Time

For each approved refactoring:

  1. Run tests — confirm green before starting
  2. Make one change — a single, atomic refactoring
  3. Run tests — confirm still green
  4. Commit — describe the refactoring, not the code

If tests fail after a change: revert immediately. You introduced a bug.

6. Final Verification

~/bin/eldev etest -r dot

All tests must pass. Report the final state.

Common Mistakes

MistakeFix
Changing behavior ("while I'm here")Refactoring changes structure ONLY. If tests break, revert.
Not running tests before startingRun tests FIRST. No green baseline = no refactoring.
Making changes without user approvalPropose, get approval, then act.
Multiple changes at onceOne change, one test run, one commit. Atomic.
Renaming public APIThat's a breaking change, not a refactoring.
Proposing 10+ changesFocus on 3-5 highest-impact items. Less is more.
Describing changes without making themActually edit the files. Actually run the tests.

レビュー

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

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

architect

無料

Use when requirements exist and a technical design is needed before implementation begins

日本語の概要は準備中です。原文の説明を表示しています。

Trevoke/org-gtd.el4862026年8月7日 更新

define

無料

Use when a new feature request, bug report, or work request needs requirements defined before implementation

日本語の概要は準備中です。原文の説明を表示しています。

Trevoke/org-gtd.el4862026年8月7日 更新

implement

無料

Use when a design exists and it's time to break it into tasks and execute with subagent dispatch and review

日本語の概要は準備中です。原文の説明を表示しています。

Trevoke/org-gtd.el4862026年8月7日 更新

qa

無料

Use when implementation is complete and you want to verify quality through adversarial testing that writes code and provides evidence

日本語の概要は準備中です。原文の説明を表示しています。

Trevoke/org-gtd.el4862026年8月7日 更新

test

無料

Use EVERY TIME you need to run tests, verify tests pass, or check for regressions. ALWAYS use this instead of running eldev directly.

日本語の概要は準備中です。原文の説明を表示しています。

Trevoke/org-gtd.el4862026年8月7日 更新

Use when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions

日本語の概要は準備中です。原文の説明を表示しています。

Trevoke/org-gtd.el4862026年8月7日 更新

Trevoke のスキルをすべて見る

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