BOOTSTRAP.md 模板
BOOTSTRAP.md 定义了 Agent 首次创建或重置时执行的一次性引导流程。它用于收集必要信息、建立初始状态,只在 Agent 初始化阶段执行。
模板
markdown
# BOOTSTRAP.md
## First-Time Setup
### Welcome
Welcome the user and introduce yourself.
Explain what you can help with.
### Collect Preferences
Ask the user for their preferences:
1. Preferred language (Chinese / English / Auto-detect)
2. Communication style (formal / casual)
3. Notification preferences (immediate / batched)
### Initialize Profile
Based on collected preferences:
- Save language preference to USER.md
- Configure response style
- Set up notification schedule
### Confirm Setup
Summarize the configuration and ask for confirmation.
If confirmed, mark bootstrap as complete.工作机制
Bootstrap(引导)流程仅在以下情况触发:
| 触发条件 | 说明 |
|---|---|
| 首次创建 Agent | 新 Agent 尚无配置 |
| 手动重置 | 执行 openclaw agent reset |
| 标记未完成 | Bootstrap 状态未标记为完成 |
Agent 首次启动
│
├─ 检查 Bootstrap 状态
│ │
│ ├─ 未完成 → 执行 BOOTSTRAP.md
│ │ │
│ │ ├─ 引导对话
│ │ ├─ 收集信息
│ │ ├─ 初始化配置
│ │ └─ 标记完成
│ │
│ └─ 已完成 → 跳过,执行 BOOT.md
│
└─ 开始正常对话一次性执行
BOOTSTRAP.md 只执行一次(除非手动重置)。后续启动由 BOOT.md 处理。
实际示例
企业助手引导
markdown
# BOOTSTRAP.md
## Welcome
你好!我是你的企业智能助手。在开始之前,我需要了解一些信息来更好地为你服务。
## Setup Steps
### Step 1: 角色确认
请告诉我你的部门和角色:
- 销售部
- 技术部
- 人事部
- 管理层
### Step 2: 权限配置
根据你的角色,我会配置相应的数据访问权限和工具。
### Step 3: 常用功能
你最常需要哪些功能?
- 数据查询和报表
- 客户管理
- 日程安排
- 文档处理
### Step 4: 确认
我将根据以上信息配置你的专属助手。确认后即可开始使用。个人助手引导
markdown
# BOOTSTRAP.md
## Welcome
Hi! I'm your personal AI assistant. Let me set things up for you.
## Quick Setup
### Language
What language do you prefer for our conversations?
### Interests
What topics are you most interested in? This helps me provide
more relevant suggestions.
### Schedule
Would you like me to send you daily summaries? If so, what time?
### Done
Great! Everything is set up. You can change these settings anytime
by saying "重新设置" or "reconfigure".与 BOOT.md 的协作
markdown
<!-- BOOTSTRAP.md 收集信息 -->
# BOOTSTRAP.md
## Setup
Ask user for timezone preference and save to USER.md.
<!-- BOOT.md 每次使用信息 -->
# BOOT.md
## Startup
Read timezone from USER.md and adjust time-related responses.状态管理
bash
# 查看 Bootstrap 状态
openclaw agent bootstrap-status
# 重置 Bootstrap(会重新触发引导流程)
openclaw agent reset-bootstrap
# 跳过 Bootstrap
openclaw agent skip-bootstrap重置影响
重置 Bootstrap 会清除通过引导收集的配置信息。用户需要重新完成引导流程。
最佳实践
- 简洁友好 — 引导步骤不超过 5 个,避免用户疲劳
- 提供默认值 — 每个选项都有合理的默认选择
- 允许跳过 — 用户可以跳过引导,后续再配置
- 保存持久化 — 收集的信息写入
USER.md持久保存 - 可重新触发 — 用户随时可以通过命令重新引导
