diff --git a/CLAUDE.md b/CLAUDE.md index 2fd3508..54665de 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,6 +6,13 @@ - 跑脚本 / 测试一律用 `.venv/Scripts/python.exe ...`,**不要用全局 `python`**(没装 litellm/python-pptx 等会报 ModuleNotFoundError) - requirements 见 `requirements.txt` +## Shell:别把 PowerShell 语法喂给 Bash 工具 + +PowerShell here-string `@'...'@` **只在 PowerShell 工具里有效**;用 Bash 工具跑会把首尾的 `@` 当字面量塞进字符串(踩过:commit message 首尾混进 `@` 行,只能 amend + force-push 收拾)。规矩: +- **多行文本(commit message / 文件内容)优先写进临时文件,再用 `-F ` / 重定向喂命令**,绕开两种 shell 的引号差异 —— 最稳。 +- 必须内联多行时:Bash 工具用 `$'...\n...'` 或 heredoc `<<'EOF'`;PowerShell 工具才用 `@'...'@`。别混。 +- 一句话:**先看自己在用哪个工具(Bash vs PowerShell),再选对应语法**。 + ## 实施前先对方案 非平凡改动(改 >1 个文件 / 涉及行为变化 / 多个候选方案有取舍)动手前**先用自然语言把方案讲给用户确认,认可后再写代码**。一次性 bug 修复 / 改字面量 / 样式微调 / 加日志这类无歧义动作可以直接动手。