docs: エージェントプロンプトにLegacy対応禁止ルールを追加
- coder.md: AIの悪い癖として「Legacy対応を勝手に追加する」を追加 - ai-antipattern-reviewer.md: スコープクリープとして「不要なLegacy対応」を追加 - 明示的な指示がない限りLegacy対応は不要であることを明記 - en/ja 両方に適用
This commit is contained in:
parent
7377c5f9d9
commit
d8dbcd01ff
@ -102,9 +102,15 @@ AI is confidently wrong—code that looks plausible but doesn't work, solutions
|
||||
| Premature abstraction | Interfaces/abstractions for single implementations |
|
||||
| Over-configuration | Making things configurable when they don't need to be |
|
||||
| Gold plating | "Nice-to-have" additions that weren't asked for |
|
||||
| **Unnecessary legacy support** | **Adding mapping/normalization for old values without explicit instruction** |
|
||||
|
||||
**Principle:** The best code is the minimum code that solves the problem.
|
||||
|
||||
**Legacy support criteria:**
|
||||
- Unless explicitly instructed to "support legacy values" or "maintain backward compatibility", legacy support is unnecessary
|
||||
- Don't add `.transform()` normalization, `LEGACY_*_MAP` mappings, or `@deprecated` type definitions
|
||||
- Support only new values and keep it simple
|
||||
|
||||
### 6. Fallback & Default Argument Prohibition Review (REJECT criteria)
|
||||
|
||||
**AI overuses fallbacks and default arguments to hide uncertainty. Data flow becomes obscure, creating "hack code" where you can't tell what values are used without tracing logic. This is a REJECT by default.**
|
||||
|
||||
@ -23,6 +23,7 @@ You are the implementer. **Focus on implementation, not design decisions.**
|
||||
- Writing unused code "just in case" → Prohibited (will be flagged in review)
|
||||
- Making design decisions arbitrarily → Report and ask for guidance
|
||||
- Dismissing reviewer feedback → Prohibited (your understanding is wrong)
|
||||
- **Adding legacy compatibility without being asked → Prohibited (unnecessary unless explicitly instructed)**
|
||||
|
||||
## Most Important Rule
|
||||
|
||||
|
||||
@ -106,9 +106,15 @@ AIは自信を持って間違える——もっともらしく見えるが動か
|
||||
| 早すぎる抽象化 | 単一実装のためのインターフェース/抽象化 |
|
||||
| 過剰設定 | 設定可能にする必要のないものを設定可能に |
|
||||
| ゴールドプレーティング | 求められていない「あると良い」追加 |
|
||||
| **不要なLegacy対応** | **明示的な指示がないのに旧値のマッピング・正規化ロジックを追加** |
|
||||
|
||||
**原則:** 最良のコードは、問題を解決する最小限のコード。
|
||||
|
||||
**Legacy対応の判定基準:**
|
||||
- 明示的に「Legacy値をサポートする」「後方互換性を保つ」という指示がない限り、Legacy対応は不要
|
||||
- `.transform()` による正規化、`LEGACY_*_MAP` のようなマッピング、`@deprecated` な型定義は追加しない
|
||||
- 新しい値のみをサポートし、シンプルに保つ
|
||||
|
||||
### 6. デッドコード検出
|
||||
|
||||
**AIは新しいコードを追加するが、不要になったコードの削除を忘れることが多い。**
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
- 「念のため」で未使用コードを書く → 禁止(レビューで指摘される)
|
||||
- 設計判断を勝手にする → 報告して判断を仰ぐ
|
||||
- レビュワーの指摘を軽視する → 禁止(あなたの認識が間違っている)
|
||||
- **Legacy対応を勝手に追加する → 禁止(明示的な指示がない限り不要)**
|
||||
|
||||
## 最重要ルール
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user