Front Refactorのロゴ

Front Refactor

コミュニティ
Effeilo
front-refactor

JS、TS、React(JSX/TSX)、CSS、Sass、Vue、Svelte、Astroファイルを、動作を変えずにリファクタリングします。名前の改善、ロジックの簡素化、不要なコードの削除、モダンな構文への更新を行います。使用方法:/front-refactor [apply]

Add to TypingMind

概要

公開者Effeilo
リポジトリclaude-code-frontend-skills
スキル名front-refactor
スター
3
フォーク
0
同梱ファイル
12
リンク
  • Markdown形式の指示

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

  • どのLLMでも利用可能

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

  • 12個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

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

インストール

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

1

TypingMindにインストール

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

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

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

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

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

TypingMindで使用

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

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

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

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

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

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

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

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

スキルの指示

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

Refactor the file that is currently open or explicitly mentioned by the user.

  • Default (no arguments): Preview mode, analyse the file and output a structured diff showing all proposed changes. Do not modify the file.
  • If $ARGUMENTS contains apply: Apply mode, apply all refactoring changes and rewrite the file.

Step 1: Detect the file language

Look at the extension of the target file:

  • If .js, .ts, .mjs, .jsx, .tsx → the language file is front-refactor-js.md
  • If .css, .sass, .scss → the language file is front-refactor-css.md
  • If .vue → the language file is front-refactor-vue.md
  • If .svelte → the language file is front-refactor-svelte.md
  • If .astro → the language file is front-refactor-astro.md
  • Otherwise → inform the user that this file type is not supported. Supported types: .js, .ts, .mjs, .jsx, .tsx, .css, .sass, .scss, .vue, .svelte, .astro.

The path of this skill file is always available from context. Resolve all sub-file paths relative to it.


Step 1.5: Enrich with latest documentation (optional)

If the context7 MCP is available in this session, use it to fetch the latest official documentation for the detected language or framework (e.g., React, Vue, Svelte, Astro, Sass). Use this documentation to complement the rules loaded in Steps 2 and 3, particularly to identify patterns that are deprecated or have a modern idiomatic replacement in the latest version. If context7 is not available, skip this step and continue with your training knowledge.


Step 2: Load the shared rules

Read front-refactor-rules.md (located in the same directory as this skill file). It contains universal refactoring rules and the principles that govern all changes.


Step 3: Load the language-specific rules

Read the language file identified in Step 1 (located in the same directory as this skill file). It contains language-specific refactoring patterns and detection guidance.


Step 4: Read and analyse the target file

Read the entire target file. Collect all applicable refactoring opportunities before producing output. Never apply a refactoring that could change observable behavior (see constraints in front-refactor-rules.md).


Output: Preview mode (default)

Output a structured refactoring plan. Do not modify the file.

## Refactoring Preview: filename.ext

### DEAD: Dead Code Removal
**[line N] Short description**
Before: `code snippet`
After:  `code snippet`
Reason: one sentence explaining why this change is safe.

---

### NAMING: Naming Improvements
...

### SIMPLIFY: Logic Simplification
...

### MODERN: Syntax Modernisation
...

---

### Summary
| Category | Changes |
|---|---|
| DEAD | N |
| NAMING | N |
| SIMPLIFY | N |
| MODERN | N |
| **Total** | **N** |

> Run `/front-refactor apply` to apply all changes.
  • Group changes by category: DEAD → NAMING → SIMPLIFY → MODERN.
  • Omit category sections that have no changes.
  • Each change must include a line reference, a before/after snippet, and a one-sentence reason.
  • If no changes are found, say so explicitly.

Output: Apply mode (apply)

Rewrite the entire file with all refactoring changes applied. Then output a short apply report:

## Refactoring Applied: filename.ext

### Changes made
| Category | Changes |
|---|---|
| DEAD | N |
| NAMING | N |
| SIMPLIFY | N |
| MODERN | N |
| **Total** | **N** |

### Notes
- [any manual follow-up that could not be automated, e.g. a rename that spans multiple files]
  • Output the full rewritten file first, then the apply report.
  • If a change cannot be applied safely in isolation (e.g. a rename that spans multiple files), skip it and list it under Notes.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

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

JS、TS、React(JSX/TSX)、CSS、Sass、Vue、Svelte、Astroファイルを、動作を変えずにリファクタリングします。名前の改善、ロジックの簡素化、不要なコードの削除、モダンな構文への更新を行います。使用方法:/front-refactor [apply]

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

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

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

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

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

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

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

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

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

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

AIスキルとは何ですか?

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

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

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

すべて見る

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

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