Files
111 998211c483 feat: 初始化考培练系统项目
- 从服务器拉取完整代码
- 按框架规范整理项目结构
- 配置 Drone CI 测试环境部署
- 包含后端(FastAPI)、前端(Vue3)、管理端

技术栈: Vue3 + TypeScript + FastAPI + MySQL
2026-01-24 19:33:28 +08:00

84 lines
2.5 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 更新所有Agent的context.md添加规划文档引用
echo "开始更新所有Agent的context.md文件..."
# 要插入的内容
DOCS_REFERENCE='## 重要规划文档
在开始开发前,请确保你已经理解以下关键文档:
- `../../协作机制设计.md` - 特别是全局上下文(GlobalContext)和服务间调用机制
- `../../模块分工指南.md` - 了解本模块的职责边界
- `../../开发规范文档.md` - 编码标准和API设计规范
- `../../统一基础代码.md` - 可复用的代码模板
'
# 遍历所有Agent目录
for agent_dir in [0-9][0-9]-Agent-*/; do
if [ -d "$agent_dir" ]; then
context_file="${agent_dir}context.md"
# 跳过已经更新过的Auth
if [[ "$agent_dir" == "01-Agent-Auth/" ]]; then
echo "跳过 $agent_dir (已更新)"
continue
fi
# 如果context.md不存在创建它
if [ ! -f "$context_file" ]; then
echo "创建 $context_file"
cat > "$context_file" << EOF
# ${agent_dir%/} 上下文信息
$DOCS_REFERENCE
## 项目位置
- 项目根目录: \`/Users/nongjun/Desktop/Ai公司/本地开发与测试/kaopeilian-backend/\`
- 你的工作目录: [待补充]
## 依赖说明
[待补充]
## 相关文档
[待补充]
EOF
else
# 如果存在,在文件开头添加文档引用
echo "更新 $context_file"
# 检查是否已经包含规划文档引用
if grep -q "重要规划文档" "$context_file"; then
echo " 已包含规划文档引用,跳过"
else
# 创建临时文件
temp_file=$(mktemp)
# 获取第一行(通常是标题)
head -1 "$context_file" > "$temp_file"
echo "" >> "$temp_file"
# 添加文档引用
echo "$DOCS_REFERENCE" >> "$temp_file"
# 添加原文件的其余内容(跳过第一行)
tail -n +2 "$context_file" >> "$temp_file"
# 替换原文件
mv "$temp_file" "$context_file"
echo " ✓ 已添加规划文档引用"
fi
fi
fi
done
echo ""
echo "更新完成!"
echo ""
echo "提示:"
echo "1. 请检查生成的context.md文件"
echo "2. 补充[待补充]的内容"
echo "3. 根据每个Agent的特点调整文档引用"