AI は training data の generic average に default します。そのため あなたの style にするには、example、明示的な rules file、そして漏れを捕まえる linter loop によって見せて enforce する必要があります。standards(WordPress Coding Standards、PSR-12 など)を推測してくれることに頼ってはいけません。
AI は training data の generic average に default します。そのため あなたの style にするには、example、明示的な rules file、そして漏れを捕まえる linter loop によって見せて enforce する必要があります。standards(WordPress Coding Standards、PSR-12 など)を推測してくれることに頼ってはいけません。
.eslintrc、phpcs.xml、.editorconfig を貼ります。これは machine-checkable な rules であり、AI は読めます。CLAUDE.md や system prompt に standard を明示します: "This project follows PSR-12. Use 4-space indent, braces on the next line for functions, snake_case for hooks." standing instructions は毎回繰り返すより効きます。# 1. AI generates the change, then you run the project linter on it:
phpcs --standard=phpcs.xml src/NewClass.php
# => src/NewClass.php 12 | ERROR | Expected 1 space after FUNCTION keyword; 0 found
# src/NewClass.php 14 | ERROR | Line indented incorrectly; expected 4 spaces, found 2
# 2. Paste those exact errors back to the AI: "Fix these phpcs errors."
# 3. Re-run until clean. The linter — not the AI's claim — is the source of truth.
この loop は速く収束します。linter が precise な line-level feedback を与え、AI が直接対応できるからです。style を prose で説明するより確実です。
project convention を無視した code は、functionally correct でも review friction と inconsistency を生みます。reviewer は formatting に時間を使い、codebase は drift します。AI はあなたの house style を自動では知りません。必要なのは rules を explicit and checkable にすることです。intent のための rules file、idiom のための representative code、そして loop で enforce する linter。これは人間の teammate を convention に onboard する方法とも同じです。