> 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を段階的に調整できます。これは [Aikido Agent](/docs/docs-ja/aikido-agent/aikido-agent.md)、同じインテリジェンスによって [Ask Aikido](/docs/docs-ja/aikido-agent/ask-aikido.md).

#### ユースケース

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を作成する際にAikidoに常にあなたの設定を考慮させたい場合は、使用してください [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.
