> 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.
