diff --git a/builtins/en/instructions/implement.md b/builtins/en/instructions/implement.md index cb230e8..4c4c41e 100644 --- a/builtins/en/instructions/implement.md +++ b/builtins/en/instructions/implement.md @@ -7,6 +7,7 @@ Use reports in the Report Directory as the primary source of truth. If additiona - Update relevant tests when modifying existing code - Test file placement: follow the project's conventions - Running tests is mandatory. After completing implementation, always run tests and verify results +- When introducing new contract strings (file names, config key names, etc.), define them as constants in one place **Scope output contract (create at the start of implementation):** ```markdown diff --git a/builtins/en/instructions/review-arch.md b/builtins/en/instructions/review-arch.md index 6d9abde..d1afd74 100644 --- a/builtins/en/instructions/review-arch.md +++ b/builtins/en/instructions/review-arch.md @@ -8,6 +8,7 @@ Do not review AI-specific issues (already covered by the ai_review movement). - Test coverage - Dead code - Call chain verification +- Scattered hardcoding of contract strings (file names, config key names) **Previous finding tracking (required):** - First, extract open findings from "Previous Response" diff --git a/builtins/en/policies/coding.md b/builtins/en/policies/coding.md index d658b28..188fdac 100644 --- a/builtins/en/policies/coding.md +++ b/builtins/en/policies/coding.md @@ -284,6 +284,7 @@ function formatPercentage(value: number): string { ... } - **Direct mutation of objects/arrays** - Create new instances with spread operators - **console.log** - Do not leave in production code - **Hardcoded secrets** +- **Scattered hardcoded contract strings** - File names and config key names must be defined as constants in one place. Scattered literals are prohibited - **Scattered try-catch** - Centralize error handling at the upper layer - **Unsolicited backward compatibility / legacy support** - Not needed unless explicitly instructed - **Internal implementation exported from public API** - Only export domain-level functions and types. Do not export infrastructure functions or internal classes diff --git a/builtins/ja/instructions/implement.md b/builtins/ja/instructions/implement.md index dda69ca..269c6fc 100644 --- a/builtins/ja/instructions/implement.md +++ b/builtins/ja/instructions/implement.md @@ -7,6 +7,7 @@ Report Directory内のレポートを一次情報として参照してくださ - 既存コードを変更した場合は該当するテストを更新 - テストファイルの配置: プロジェクトの規約に従う - テスト実行は必須。実装完了後、必ずテストを実行して結果を確認 +- ファイル名・設定キー名などの契約文字列を新規導入する場合は、定数として1箇所で定義すること **Scope出力契約(実装開始時に作成):** ```markdown diff --git a/builtins/ja/instructions/review-arch.md b/builtins/ja/instructions/review-arch.md index 51ceb71..6932dc8 100644 --- a/builtins/ja/instructions/review-arch.md +++ b/builtins/ja/instructions/review-arch.md @@ -8,6 +8,7 @@ AI特有の問題はレビューしないでください(ai_reviewムーブメ - テストカバレッジ - デッドコード - 呼び出しチェーン検証 +- 契約文字列(ファイル名・設定キー名)のハードコード散在 **前回指摘の追跡(必須):** - まず「Previous Response」から前回の open findings を抽出する diff --git a/builtins/ja/policies/coding.md b/builtins/ja/policies/coding.md index df77a33..eabef2f 100644 --- a/builtins/ja/policies/coding.md +++ b/builtins/ja/policies/coding.md @@ -284,6 +284,7 @@ function formatPercentage(value: number): string { ... } - **オブジェクト/配列の直接変更** - スプレッド演算子で新規作成 - **console.log** - 本番コードに残さない - **機密情報のハードコーディング** +- **契約文字列のハードコード散在** - ファイル名・設定キー名は定数で1箇所管理。リテラルの散在は禁止 - **各所でのtry-catch** - エラーは上位層で一元処理 - **後方互換・Legacy対応の自発的追加** - 明示的な指示がない限り不要 - **内部実装のパブリック API エクスポート** - 公開するのはドメイン操作の関数・型のみ。インフラ層の関数や内部クラスをエクスポートしない