> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/docs/docs-ja/autofix-to/automation-and-merging/refine-autofixes-with-aikido-ai.md).

# Aikido AIでAutoFixを洗練する

Aikido では、さまざまな種類の検出事項を自動的に修正できます。 **Aikido AI で絞り込む** チャットパネルを使うと、差分ビューを離れずに自然言語で AutoFix を段階的に調整できます。

#### ユースケース

AutoFix でほとんどの修正は完了します。絞り込みが役立つのは、次のような場合です。

* 修正内容は正しいが、コードベースの命名規則やパターンに合っていない
* 説明コメントを追加したい
* ユニットテストを含めたい
* エラーハンドリングやログ出力の呼び出しなど、特定のロジックを導入したい
* 修正に、AI が利用できないコンテキストを考慮する必要がある
* 対象範囲を絞りたい。たとえば、サニタイズまたは検証される内容を限定したい

#### 修正の絞り込み方法

**手順 1。** 次の方法で差分モーダルを開きます。 `表示` アクションをクリックし、 `Aikido AI で絞り込む` 左下にある。

<figure><img src="/files/0ae2fc8710fd28199592403aaf30778da998a930" alt=""><figcaption></figcaption></figure>

**手順 2。** テキストフィールドに指示を入力します。

<figure><img src="/files/c9ec782a9c988e4b3941daf6f1966f3064aac642" alt=""><figcaption></figcaption></figure>

**手順 3。** 絞り込んだ修正の準備ができると、差分ビューは自動的に更新されます。

<figure><img src="/files/1e74ba7dd27d90e455e0ec30afca78556c618a1c" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
送信した各指示は、その後の絞り込みのためのコンテキストとして保持されるため、AI は最初からやり直すのではなく、前の指示を踏まえて改善していきます。
{% endhint %}

#### 指示を書くときのヒント

症状だけでなく、意図を具体的に書きます。

* 「空のオブジェクトを返す代わりに例外をスローした」
* 「サニタイズ済み変数の名前を `safe_input` を次に設定します: `safeInput` "
* 「正規表現が一致したときにログを追加する」

## コンテキストの永続化

AutoFix を作成する際に、常にあなたの好みを考慮させたい場合は、 [AutoFix 用のカスタムコンテキスト](/docs/docs-ja/autofix-to/automation-and-merging/custom-context-for-autofixes.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.aikido.dev/docs/docs-ja/autofix-to/automation-and-merging/refine-autofixes-with-aikido-ai.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
