✅ 方式一(最推荐):一次性用 Shell 命令生成全部文件
适合:
- VS Code
- Git Bash / WSL / macOS / Linux
- 最快、最专业
1️⃣ 在项目根目录打开终端
mkdir sql_prompts
2️⃣ 一次性生成所有文件
mkdir sql_prompts; "00_base_agent.md",
"01_simple_query.md",
"02_aggregation.md",
"03_time_series.md",
"04_yoy_mom.md",
"05_topn_rank.md",
"06_join_multi_table.md",
"07_data_validation.md",
"08_performance_opt.md",
"09_explain_sql.md","full_query" | % { New-Item "sql_prompts/$_.md" -Force }
3️⃣ 验证
ls sql_prompts
你会看到:
00_base_agent.md
01_simple_query.md
02_aggregation.md
03_time_series.md
04_yoy_mom.md
05_topn_rank.md
06_join_multi_table.md
07_data_validation.md
08_performance_opt.md
09_explain_sql.md
📌 这是我强烈建议你用的方式
后面你做 AI 数据项目,几乎都会这么建结构。
✅ 方式二:Windows(不装 WSL / Git Bash)
如果你用的是 Windows 原生 PowerShell:
1️⃣ 打开 PowerShell(项目目录)
mkdir sql_prompts
2️⃣ 创建文件
$files = @(
"00_base_agent.md",
"01_simple_query.md",
"02_aggregation.md",
"03_time_series.md",
"04_yoy_mom.md",
"05_topn_rank.md",
"06_join_multi_table.md",
"07_data_validation.md",
"08_performance_opt.md",
"09_explain_sql.md"
)
foreach ($f in $files) {
New-Item -Path "sql_prompts$f" -ItemType File
}
📌 PowerShell 稍微啰嗦,但完全可用。
✅ 方式三:VS Code「无命令行」方案(兜底)
适合:
- 你暂时不想碰命令行
操作步骤
-
VS Code 左侧资源管理器
-
右键 → 新建文件夹 →
sql_prompts -
在文件夹里:
- 右键 → 新建文件
- 按顺序创建这些文件名
❗不推荐长期用(慢 + 不专业)