code-simplifier が便利

🔄
note

Claude の公式のプラグイン集である claude-plugins-official で code-simplifier という subagent が提供されていてこれが結構便利。名前の通り、書いたコードをシンプルにしてくれる。

自分はこれを Custom Slash Command で呼び出して、変更したらテストを実行するようにして使っている。

---
description: Simplify and refactor code while ensuring tests pass
allowed-tools: Task(code-simplifier:code-simplifier)
---

Simplify and refactor code using the code-simplifier subagent, then verify behavior is unchanged by running tests.

## Instructions

1. Use the `code-simplifier:code-simplifier` subagent to perform the refactoring
   - Focus on clarity, consistency, and maintainability
   - Preserve all existing functionality
2. After refactoring, run the project's test suite to verify behavior is unchanged
3. If tests fail, investigate and fix any regressions introduced by the refactoring
4. Report the changes made and test results

## Additional Context

$ARGUMENTS
> /code-simplifier
> /code-simplifier @src/index.ts をリファクタリングして

CLAUDE.md に毎回実行してと書いておくのもよさそうだが、そこそこ実行コストが高いように感じているので、今のところは明示的に呼び出すようにしている。

yaakai.to