> 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/custom-context-for-autofixes.md).

# AutoFixのカスタムコンテキスト

Aikidoでは、SASTルールに追加のカスタムコンテキストや指示を加え、AutoFixを好みに合わせて強化できます。

一般的なユースケースには以下が含まれます:

* 特定のエラーハンドリングやログ記録ロジックを導入する
* カスタムのコメントスタイルを追加する
* AutoFixにユニットテストを含める
* コードリポジトリにない追加のコンテキストを提供する
* AutoFixの適用範囲を絞る

## SASTルールレベルでのカスタムコンテキスト

SASTルール向けのカスタムコードコンテキストの詳細なドキュメントは、以下で確認できます [こちら](https://help.aikido.dev/code-scanning/scanning-practices/custom-code-context-for-sast-rules)。Aikidoは、カスタムコードコンテキストを、問題のスキャン（AutoTriage）と修正（AutoFix）の両方に使用します。

カスタムコードコンテキストは、すべてのコードリポジトリ、または一部のリポジトリに対して設定できます。

## グローバルカスタムコンテキスト

**リポジトリごとのカスタムコンテキスト**

コードリポジトリ内のすべてのAutoFixルールに対してカスタムコンテキストを提供したい場合は、次を `.aikido` コードリポジトリ内のファイルに追加してください（詳細は `.aikido` ファイル [こちらで確認できます](/docs/docs-ja/kdosukyan/scanning-practices/ignore-via-code-with-aikido-files.md))

<pre><code>autofix:
<strong>  fix_context:
</strong><strong>    - path: aikido-autofix-all.md
</strong></code></pre>

この例を機能させるには、 `aikido-autofix-all.md` がリポジトリのルートに存在し、コンテキストを含んでいる必要があります。

**言語ごとのカスタムコンテキスト**

設定を特定の言語に絞るには、次を使用します:

```
autofix:
  fix_context:
    - path: aikido-autofix-javascript.md
      language: javascript
```

language に指定できる値は次のとおりです:

* .NET
* Android
* C
* clojure
* dart
* elixir
* go
* iOS
* java
* javascript
* kotlin
* php
* python
* ruby
* rust
* scala
* swift
* terraform
* typescript
* VB
* YAML


---

# 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/custom-context-for-autofixes.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.
