ce-simplify-code
できること
既存のコードを、動作を変えずに読みやすく、保守しやすくします。レビューの前に、コードを書いた後の整理をしたい開発者向けです。
使う場面
- ✓機能を書き終え、レビューの前にコードを整えたいとき。
- ✓プロジェクトの中に、役に立たない余分なコード、テスト、コメントがないか確認したいとき。
- ✓バグを直したいだけで、この整理は必要ないとき。
スキルのリンク
https://github.com/EveryInc/compound-engineering-plugin/blob/main/skills/ce-simplify-code/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“今日変更したコードを簡素化して、何も壊れないようにしてもらえますか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは対象のコードを読み、より明確にまたは短くできる部分を見つけて、同じ動作を保ったまま変更を適用します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Simplify code for clarity, reuse, quality, and efficiency, and prune tests and comments that carry no value, while preserving exact behavior. Prioritize readable, explicit code over compact code — fewer lines is not the goal.
Mode
Strip a mode:pipeline token and every proof-test:<path> token from the input before reading the rest as the scope. The proof-test path is context for Step 3, never scope; a caller may pass several.
- Pipeline when
mode:pipelineis present, or when no one asked for this run in their own current message: a step of another skill, or a run the agent starts itself, such as at a completion boundary. Work only on the current work, apply fixes without asking or waiting, and return the Step 5 summary to the caller. That summary is for the caller's record; never paste it into a commit, PR body, or other artifact. - Standalone when the user's own current message asked for this run. Their request sets the scope and focus. Report findings before editing anything, unless the request says to just fix them. Read
references/standalone-report.mdnow, and again before applying any reported finding.
Step 1: Identify scope
Resolve the scope in this order:
- User-named scope is authoritative; do not widen it. In standalone mode it may be the whole repo, an area, or a path.
- Otherwise, in git, use the current branch versus its base. Without a usable base, use staged and unstaged changes (
git diff HEAD). - Outside git or without a diff, use files the user named or that were edited earlier in the conversation.
In pipeline mode the scope is what the caller passed, else the branch diff. Within it, prune only tests and comments the current work added or changed.
If none of the above produces a non-empty scope, pipeline mode reports "nothing to simplify" and returns. Standalone mode asks the user what to simplify, as references/standalone-report.md describes.
Preflight. If the scope has no substantive human-authored code — only documentation, generated or vendored files, dependencies or lockfiles, or mechanical churn — report that there is nothing to simplify and stop without reviewers. For mixed scopes, retain only the code and its tests. This check is about the kind of change, never its size: explicit small scopes still run, and any size or cost threshold is the caller's to set.
When the platform's task-tracking capability is available, show the review, apply, and verification outcomes without creating one task per reviewer. Otherwise continue without simulating a task list in chat.
Step 2: Launch review agents in parallel
Dispatch generic subagents via the platform's subagent primitive (Agent/Task in Claude Code, spawn_agent in Codex) where available; otherwise run the reviews inline or serially. For each reviewer, read its prompt asset from this skill's directory and pass the full file content as the subagent's prompt, together with the resolved scope (the full diff or file set), the mode, any proof test, the user's constraints, and the project standards governing the scope (or their file paths):
references/personas/code-reuse-reviewer.mdreferences/personas/code-quality-reviewer.mdreferences/personas/efficiency-reviewer.mdreferences/personas/test-value-reviewer.md, when the scope holds testsreferences/personas/comment-reviewer.md, when the scope holds comments
A standalone request about only tests or only comments runs only that reviewer.
Do not paraphrase these rubrics from memory. Read each file and pass it verbatim, or the reviewer loses the rules that keep the pass behavior-preserving.
Read references/reviewer-dispatch.md before dispatching; it covers a full harness, releasing review agents, and the permission mode.
Model selection. Use the platform's balanced mid-tier model for these reviewers when the current harness exposes a known override. In Claude Code this is the Sonnet class. In Codex, apply this tier only when the active dispatch primitive exposes an explicit model or custom-agent selector; task wording alone does not select a different model. Otherwise omit the override and inherit the parent model -- a working pass on the parent model beats a broken dispatch.
If the user's or project's active instructions or the live prompt name a model for this subagent, use that model instead of the default tier above. They can name it by the subagent's tier, by its prompt-asset name, or for the subagents bei
よくある質問
コードの動作は変わりますか?
動作は完全に同じに保ち、コードをより明確にまたは効率的にするだけを目指します。
バグを直しますか?
いいえ。このスキルは整理に焦点を当て、バグの修正は別のデバッグのスキルが扱います。
プロジェクトの一部だけを見てもらえますか?
はい。フォルダやパスを指定でき、作業はその範囲内に留まります。
詳細
作者による元の説明
Simplify code for clarity, reuse, quality, and efficiency while preserving behavior, and prune tests and comments that carry no value. Use after implementation and before review, or to audit tests or comments in any part of a repo; use ce-debug for bugs.
人気
- GitHubのスター
- 26k
- ランキング
- #10046
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
ce-babysit-pr
26kエージェントが、開いているGitHubのプルリクエストを、レビューのコメント、失敗したチェック、古くなったブランチを扱いながら、時間をかけてマージに向けて進められるよう支援します。
ce-bakeoff
26kエージェントが、ある問題に対して複数の競合する解決策を作り、それらを比べて、最も強い部分を組み合わせた推奨のアプローチにまとめられるよう支援します。
ce-brainstorm
26kエージェントが、作業を始める前に、短くガイドされた会話を通じて、漠然としたアイデアを明確で適切な大きさの要件に変えられるよう支援します。
ce-code-review
26kエージェントが、指定されたコードの変更やプルリクエストについて、バグ、回帰、テストの不足、基準の問題をレビューし、明確な指摘を報告できるよう支援します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。