CRITICAL PROTOCOLS (ABSOLUTE PRIORITY)
Defines 10 non-negotiable rules for AI behavior, covering language, cleanup, error handling, and code integrity.
View sourceWhat this file does
Defines 10 non-negotiable rules for AI behavior, covering language, cleanup, error handling, and code integrity.
When to use it
- Setting up an AI assistant for a Japanese-speaking project
- Enforcing strict code quality and documentation sync in a team
- Preventing AI from leaking secrets or retrying failed tasks endlessly
- Establishing rollback and test protection policies for automated agents
CRITICAL PROTOCOLS (ABSOLUTE PRIORITY)
以下のルールは、いかなる状況でも最優先で遵守すること:
- 日本語化: ユーザーに提示するアーティファクト(計画書・タスク・確認事項)は、作成時に必ず日本語で記述すること。
- 言語規定: 思考プロセスは英語で行う。ユーザーへのレスポンス、アーティファクト、コミットメッセージ、コード内のコメントは必ず日本語で記述すること。(システムエラーやログの引用は原文のままでよい)
- 不要ファイル・ブランチの削除: テストなどで作成したファイルやブランチは不要になった時点で削除すること。
- 自動化の限界と報告: ツール実行が3 回以上連続して失敗した場合や、権限不足・環境固有の問題に直面した場合は、執拗に再試行せず、直ちにユーザーに状況を報告し手動対応を依頼すること。
- 品質保証: コード修正完了時は、必ず Format, Lint, Test を実行し、PASS することを確認すること。ただし、タスク開始前から存在するエラーについてはこの限りではない。新規の変更が既存の機能を破壊していないことを確認すること。
- 既存テストの保護: 修正により既存のテストが失敗した場合、テストコードを安易に修正してはならない。まず実装のバグを疑い、テスト修正が必要な場合は、それが「意図した仕様変更」であることをユーザーに確認すること。
- 機密情報の保護: パスワード、API キー、トークンなどの機密情報を、ログ・アーティファクト・チャットの応答などに絶対に出力しないこと。
.envの取り扱いに注意すること。 - ドキュメントの同期: 機能や仕様を変更した際は、コードの修正だけでなく、関連するドキュメント(README、API 仕様書、主要なコメント等)も必ず同期して更新すること。
- 作業中断時のロールバック: エラーや中断によりタスクを終了する場合、原則として作業開始前のクリーンな状態に復元すること。ただし、有用な作業途中経過がある場合は、クリーンする前にユーザーに確認すること。
- 既存コードとの整合性: 新規コード、テストを作成する際は、既存のコードベースの設計パターン、命名規則、ディレクトリ構造を尊重し、独自のスタイルを混入させないこと。
What's inside
10 numbered rules, each with a bold heading and explanatory paragraph
Change this for your project
- Replace
日本語化with your own language requirement if not Japanese - Replace
ユーザーに提示するアーティファクト(計画書・タスク・確認事項)with your own artifact types - Replace
Format, Lint, Testwith your own tool names if different
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Related Documents
Totem — Development Rules
Defines team-wide conventions for a pnpm monorepo: branch strategy, commit rules, tooling, and a mandatory knowledge-search workflow before coding.
MechCAD-MLLM
Proposes a MLLM + dual-decoder architecture for mechanical CAD generation, combining Drawing2CAD and CAD-GPT ideas.
Prompt Generator
Generates Stable Diffusion and Flux prompts via Qwen3-8B on Ollama, with a Gradio UI and CLI.
Agent Instructions
Defines a three-layer architecture (directive, orchestration, execution) for AI agents that self-anneal errors and update living SOPs.