把兩家點名的 anti-pattern 放進同一份檔案,你會發現它長得非常眼熟:
刪之前 · 十一條,五種病
# CLAUDE.md
- Always read ARCHITECTURE.md, DATABASE.md and DEPLOY.md before ANY change.
- Default to writing no comments. Never write multi-paragraph docstrings.
- Leave documentation as appropriate.
- ALWAYS run the full test suite after every edit. Never skip tests.
- Think step by step before answering. Explain your reasoning.
- Example of db_query: db_query({ sql: "SELECT id FROM users WHERE ..." })
- Ask for approval before running any command.
- Ask for approval before modifying any file outside src/.
- Use pnpm, not npm.
- Follow STYLE.md. Also: 2-space indent, single quotes, no semicolons.
- Use pnpm, not npm. (see above)
刪之後 · 五行
# CLAUDE.md
Monorepo on pnpm workspaces. Service boundaries: ARCHITECTURE.md. Schema changes: DATABASE.md.
Write code that reads like the surrounding code — match its comment density, naming and idiom.
Run the affected tests, fix failures caused by your change, rerun. Don't ask at each step.
Done means: tests green, lint clean, one PR-sized diff with a two-line summary.
Ask before: touching migrations/, anything under infra/, or any destructive git operation.
逐條對應:全域前置閱讀變成任務導向的指標;兩條互相打架的註解規則變成一條判斷;「一定要跑測試」變成授權加完成標準(Astra 自己會跑,留著反而造成多餘測試);「think step by step」整條刪掉,推理預算不是這樣調的(法則 04);tool 範例刪掉;兩處的 pnpm 收成一處,STYLE.md 的內容不再複述;「任何指令都要問」變成只在真正危險的三種操作前問——過嚴的核准規則會讓有能力的模型提早停手。