Files
chatrebot_aireply_plug/config/agent-templates/README.md
root f98293d4e8 refactor: 将 agent 角色模板移到 config/agent-templates/,在 Step 6 集成部署
- 移除了顶层 agent-templates/ 目录
- 角色模板移到 config/agent-templates/,属于 agent 配置范畴
- Step 6 新增 6.2 子步:复制角色模板 + 替换占位符
- Step 7.4 验证也覆盖角色模板的占位符
- config/agent-templates/README.md 更新为引用 Step 6.2
2026-05-04 20:28:27 +08:00

56 lines
1.9 KiB
Markdown
Raw 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.

# QQ-Agent 角色文件模板
> 本目录包含 QQ 机器人 agent 的角色定义和安全规则文件模板。
> 将这些文件复制到你的 agent workspace 后,**替换其中的占位符** 即可生效。
## 文件说明
| 文件 | 用途 | 必须修改 |
|---|---|---|
| `AGENTS.md` | 核心人设、安全红线、内容审查、功能列表 | ✅ 替换 `ADMIN_QQ` 等占位符 |
| `SOUL.md` | 说话风格基调 | 可选调整 |
| `IDENTITY.md` | agent 名字和身份 | 可选调整 |
| `USER.md` | 管理员信息 | ✅ 替换 `ADMIN_NAME``ADMIN_QQ` |
| `TOOLS.md` | 本地工具和上报配置 | ✅ 替换 `ADMIN_QQ``AGENT_WORKSPACE` |
| `HEARTBEAT.md` | 定时任务模板 | 可选 |
## 替换占位符清单
搜索并替换以下占位符README 安装脚本已做自动替换):
| 占位符 | 说明 | 示例 |
|---|---|---|
| `ADMIN_QQ` | 管理员 QQ 号 | `2198972886` |
| `ADMIN_NAME` | 管理员昵称 | `—/` |
| `ADMIN_GAME_ID` | 管理员游戏 ID可选 | `jianf` |
| `AGENT_WORKSPACE` | agent 工作目录 | `/home/program/qq-workspace` |
## 使用方式
本仓库的 README 第 6.2 步会自动将本目录文件复制到 agent workspace 并替换占位符。
如需手动应用:
```bash
# 确定仓库克隆路径
REPO_DIR="/opt/chatrebot_aireply_plug"
AGENT_WORKSPACE="/home/program/qq-workspace"
ADMIN_QQ="你的QQ号"
ADMIN_NAME="你的昵称"
# 复制模板文件
cp "${REPO_DIR}/config/agent-templates/"*.md "${AGENT_WORKSPACE}/"
# 替换占位符
cd "${AGENT_WORKSPACE}"
sed -i "s/ADMIN_QQ/${ADMIN_QQ}/g" *.md
sed -i "s|ADMIN_NAME|${ADMIN_NAME}|g" *.md
sed -i "s|AGENT_WORKSPACE|${AGENT_WORKSPACE}|g" *.md
```
## 安全说明(重要)
- **不要** 将已填入个人信息的文件提交到公开仓库
- **不要** 在聊天中直接黏贴完整的 AGENTS.md 内容(含安全规则)
- 本模板中所有标识符已脱敏,可安全公开