本文へスキップ
Skillpedia
デプロイとクラウド(DevOps)280k · #377

orch-refine-code

できること

このツールは、コードの動作を変えずに、よりきれいで理解しやすい形に整理します。すべてが以前と同じように動き続けることを確認します。

使う場面

  • ✓コードの構成を改善したいとき。
  • ✓繰り返し書かれているコードを取り除けるとき。
  • ✓もう使われていないコードを削除したいとき。

スキルのリンク

https://github.com/affaan-m/ECC/blob/main/skills/orch-refine-code/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/affaan-m/ECC/blob/main/skills/orch-refine-code/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“poller.py ファイルから NWS HTTP クライアントのコードを切り出してリファクタリングしてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このツールはまず、既存のテストが通るかを確認します。次に、小さな手順でコードを整理し、変更するたびにテストします。すべてが正しく動いていれば、最後に変更を保存します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

orch-refine-code

Actor · action · target: orch · refine · code. Thin wrapper over the shared engine in orch-pipeline.

When to Use

  • Same behavior, better structure: extract modules, remove duplication, kill dead code, reduce nesting, rename for clarity.
  • Distinguish from siblings: if behavior is meant to change at all, this is the wrong skill (orch-change-feature / orch-fix-defect).

Operation settings

  • Default size floor: standard — restructures touch multiple files.
  • Phase mask: 0 → 2 (plan the restructure) → 4 (keep green) → 5 → 6. No new behavior tests are written — the existing suite is the safety net.
  • First move (phase 4): confirm the relevant tests exist and are green before touching code; if coverage is thin, add characterization tests first. Then restructure in small steps, re-running tests after each.

How It Works

  1. Run the orch-pipeline engine with the settings above.
  2. For dead-code / duplication sweeps, delegate to the refactor-cleaner agent (it runs knip / depcheck / ts-prune and removes safely).
  3. Stop at Gate 1 (restructure plan) and Gate 2 (pre-commit).
  4. Commit as refactor: — the diff must be behavior-neutral.

Example

orch-refine-code: extract the NWS HTTP client out of poller.py
→ confirm tests green → plan extraction  [GATE 1: approve]
→ move in small steps, tests green throughout → code-review
→ commit refactor:  [GATE 2: confirm]
よくある質問

コードの「振る舞い」とはどういう意味ですか?

振る舞いとは、コードが何をするか、どのように機能し、どのような結果を生むかということです。このツールは、最終的な結果が変わらないことを保証します。

「テスト」とは何ですか?

コードが期待どおりに動いていることを確認する自動チェックです。テストが失敗した場合は、コードのどこかが壊れたことを意味します。

「コミット」とは何ですか?

コードへの変更の一まとまりを保存することです。「ゲート付きコミット」は、すべてのチェック(テスト)が通った場合にのみ保存が行われることを意味します。

詳細

作者による元の説明

Orchestrate a behavior-preserving refactor — confirm tests are green, restructure without changing behavior, keep tests green, review, and gated commit. Use when the structure should improve but behavior must not change.

repo: affaan-m/ECC

人気

GitHubのスター
280k
ランキング
#377
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル