問題はエージェントへの指示文(プロンプト)を日本語で書いたときに、生成されるコードや diff、計画、テスト案の質がどう変わるかです。私の体感では、短い質問(「この関数を pure にしてほしい」程度)であれば日本語と英語で差はほぼ感じません。差が出てくるのは、複数ステップの計画指示、ライブラリ固有の前提を踏まえた書き換え、エラーログを読ませた上での原因推定など、長文かつ条件付きの指示を渡したときです。
第二に、命令理解のシャープさです。Refactor this function to be pure. Move side effects to a separate adapter. のような英語の命令文は、構文的に短く、動詞と目的語が明確です。日本語で同等の指示を書こうとすると「副作用は別アダプタに切り出してから純関数として書き直してほしい」のように、修飾と語順の自由度が高くなり、モデルが意図のどの部分を主目的として扱うかに揺らぎが生まれます。
# Project Agent Rules## Language Policy- User-facing chat responses: Japanese (です/ます調)- Internal planning, tool calls, and code-generation reasoning: English- Code comments: English unless a Japanese comment already exists in the file- README, CHANGELOG, and user docs: Japanese- Commit messages: English imperative ("Add", "Fix", "Refactor")- Variable names: English; do not romanize Japanese words## When the user asks in Japanese:1. Acknowledge briefly in Japanese2. Switch to English internally for code planning3. Present code with English comments4. Summarize the result in Japanese at the end## When generating diffs:- Always show full file path and the reason for the change in Japanese- Keep code changes minimal; explain in English why each change is necessary
# pseudo-flow: 日本語の意図を英語の精密な指示に変換してから Antigravity に渡すfrom typing import Literaldef to_agent_prompt(user_intent_ja: str, mode: Literal["plan", "diff", "review"]) -> str: """日本語の意図を英語の構造化プロンプトに変換する。 軽量モデル(Gemma 4 9B / Phi など)でも十分な品質が出る領域。 """ system = ( "You are a translator that converts Japanese developer intent into " "precise English instructions for a coding agent. Preserve identifiers. " "Output only the English instruction, no preamble." ) style_hint = { "plan": "Produce a numbered plan with file paths.", "diff": "Produce a unified diff with file paths. Minimal change.", "review": "Produce a checklist of risks and required tests.", }[mode] return f"{system}\n{style_hint}\nJP_INTENT: {user_intent_ja}"# 呼び出し例intent = "RxJavaのSingleをCoroutinesに置き換えて、エラーは上位で集約してほしい"english_instruction = call_lightweight_model(to_agent_prompt(intent, "diff"))# english_instruction を Antigravity のセッションに流す