Post Refactorのロゴ

Post Refactor

コミュニティ
akitaonrails
post-refactor

最近のリファクタリング後や、PRをいくつかマージした後に、クリーンコードをチェックします。ユーザーが「post-refactor」「after the refactor」「we merged a few PRs」「clean code checks」と言った場合や、PR全体やマージ後の監査は行わず、リグレッション、脆弱性、重複した抽象化、マジック値、ドキュメントの不備、テストカバレッジの不足、不安定なテストを重点的に確認したい場合に使います。

Add to TypingMind

概要

公開者akitaonrails
リポジトリmy-skills
スキル名post-refactor
スター
268
フォーク
31
同梱ファイル
指示のみ
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    akitaonrailsがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Post Refactor」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/akitaonrails/my-skills/tree/master/post-refactor
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/akitaonrails/my-skills.git /tmp/my-skills
mkdir -p .claude/skills
cp -r /tmp/my-skills/post-refactor .claude/skills/post-refactor
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでPost Refactorを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にPost Refactorを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Post Refactorは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Post-Refactor Clean-Code Sweep

Use this skill after a refactor, cleanup series, or a handful of related PRs landed. It is not a full PR audit and should not re-litigate already merged work. Keep the pass focused on the code that changed recently and on defects that refactors commonly leave behind.

Primary goal: answer, "Did we leave the touched code cleaner, safer, and well covered, or did we leave regressions and cleanup debt behind?"

Scope

Pick the narrowest useful range:

  1. If the user names a range, use it exactly.
  2. Else, if a release just happened, inspect changes since the previous tag: git describe --tags --abbrev=0 HEAD^ → PREV_TAG..HEAD.
  3. Else, inspect the last 3-8 related commits or merged PRs.
  4. If the range spans unrelated areas, group by subsystem and review each group separately.

Do not expand into full architecture review unless a finding shows a real risk.

Workflow

1. Establish the changed surface

Collect:

  • commit range and shortlog
  • changed files grouped by subsystem
  • dependency/config/schema changes
  • tests added/changed
  • public/user-facing surfaces touched

Prefer cheap git commands and focused reads. Do not read the whole repository.

2. Run the local safety gate

Run the project's documented post-change checks. If none are documented, infer the normal formatter, lint/static-analysis, test, and security/dependency checks from the stack.

For Rust repos, prefer:

bash
cargo fmt --check
git diff --check
TAILWIND_SKIP=1 cargo test --workspace
TAILWIND_SKIP=1 cargo clippy --workspace --all-targets -- -D warnings

Run vulnerability/dependency checks when available (cargo audit, cargo deny, npm audit, bundle audit, etc.). Treat tool availability separately from findings: "tool not installed" is a validation gap, not a pass.

3. Review the changed code for refactor fallout

For touched implementation files, check:

  • regressions from changed behavior, defaults, serialization, migrations, auth, scope resolution, IO boundaries, or error handling
  • new unwrap, expect, panic, unreachable, broad catches, ignored errors, or lossy fallbacks in runtime paths
  • duplicated helpers or repeated logic that should be consolidated
  • over-abstraction: new traits/generics/public APIs that have only one real caller and no concrete need
  • magic values that should become named constants, config, or comments
  • stale comments/docs that no longer match behavior
  • hidden coupling between modules or crates introduced by the refactor
  • data loss, destructive operations, auth bypass, secret leakage, or unsafe path/scope handling

Bias toward practical clean-code fixes. Do not demand abstraction for one-off logic unless duplication is already causing drift or risk.

4. Review test quality and flake risk

Check whether changed behavior has focused tests. Look for:

  • missing regression tests for bug fixes or behavior changes
  • tests that assert implementation details instead of behavior
  • overly broad snapshot/golden tests that hide the meaningful assertion
  • sleeps/timeouts, wall-clock dependence, network dependence, shared global state, non-temp filesystem writes, randomized order, current-user/home-dir dependence, and cross-test pollution
  • tests that passed only because they were run individually

If a test looked flaky during the session, rerun that exact target once before classifying it. If it passes on rerun, report it as "observed transient" with evidence, not as definitively fixed.

5. Classify findings

Use these severities:

  • BLOCKING: likely regression, vulnerability, data loss, auth/scope bypass, failing gate, reproducible flake, or release/deploy blocker.
  • SHOULD-FIX: maintainability/test gap that is likely to grow or confuse the next change; duplicated logic with drift risk; missing focused test for a real behavior change.
  • NIT: cleanup/documentation/readability issue that is safe to defer.
  • OBSERVATION: verified healthy area or watch item with no required change.

Each finding must include:

  • file/path and line when available
  • why it matters
  • suggested fix or next check
  • whether it was verified by a command/test/read

6. Fix policy

Do not automatically edit code unless the user explicitly asks to fix findings. This skill is primarily a focused review/check. If fixes are requested, keep them small and run the relevant focused gate after each batch.

Specialist routing

  • Use @explorer for broad changed-surface mapping when the range touches many files.
  • Use @oracle for code review, maintainability, security, or flake-risk review of the changed surface.
  • Use @fixer only after findings are accepted and bounded implementation work is clear.
  • Use @designer only for user-visible UI/UX regressions.

Output format

Keep the final report compact:

markdown
## Post-refactor result

Range: <range>
Gate: <pass/fail/partial>

### Findings
- [SEVERITY] <file:line> — <issue>. <recommended action>

### Coverage / flake notes
- <summary>

### Clean-code notes
- <summary>

### Suggested next step
- <one concrete next action, or "none">

If there are no required changes, say so directly and list the checks that passed.

よくある質問

AIスキル「Post Refactor」では何ができますか?

最近のリファクタリング後や、PRをいくつかマージした後に、クリーンコードをチェックします。ユーザーが「post-refactor」「after the refactor」「we merged a few PRs」「clean code checks」と言った場合や、PR全体やマージ後の監査は行わず、リグレッション、脆弱性、重複した抽象化、マジック値、ドキュメントの不備、テストカバレッジの不足、不安定なテストを重点的に確認したい場合に使います。

TypingMindでPost Refactorを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Post Refactorはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにPost Refactorをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/akitaonrails/my-skills/tree/master/post-refactorを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Post Refactorを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Post Refactorで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもPost Refactorを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Post Refactor」は無料ですか?

akitaonrailsがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇