Apprentice — Watch Me Once. Do It Forever.
The entire history of computing: you describe what you want → the computer executes.
Apprentice flips it: you do what you want → the agent watches → it becomes a permanent skill.
This is Programming by Demonstration — a 30-year holy grail of human-computer interaction research. Every attempt failed because it required constrained environments or rigid formal specifications. LLM agents make it possible for the first time:
- - Watch what you actually do (not what you say you do)
- Understand your intent, not just your actions
- Generalize across contexts — knowing what's a variable vs. what's a constant
- Turn it into a repeatable workflow your agent can run, refine, and chain forever
External Endpoints
| Endpoint | Purpose | Data Sent |
|---|
| None | Fully local | Nothing leaves your machine |
Apprentice records locally. All synthesis happens via your already-running LLM session. No external APIs.
Security & Privacy
- - Zero external calls. Observation logs, workflow files, and all synthesis happen locally.
- No credentials accessed. Apprentice observes what you tell it — it doesn't read system files or intercept your input at an OS level.
- You review before saving. After observation, you see the synthesized workflow and approve it before it's saved as a permanent skill.
- Sandboxed execution. Generated workflow run scripts are plain bash with full security manifest headers.
Trust Statement: Apprentice writes observation logs and workflow SKILL.md files locally. The only thing it sends to the LLM is your described observation + synthesis request, using your existing session. Nothing leaves your machine.
Model Invocation Note
Apprentice is always user-initiated. It activates on "watch me" or equivalent phrases, and pauses until you say "done" or "stop watching." Synthesis runs once per observation session, with your review before saving. Workflows execute only when explicitly invoked.
How It Works
Step 1 — Start Observation
"Watch me"
"Apprentice mode on"
"Learn this"
"I'm going to show you how I do X"
The agent enters observation mode. It listens and records your actions.
Step 2 — Do the Task Naturally
Just do what you normally do. Talk out loud if it helps — the agent hears everything:
- - Commands you run
- Files you create, edit, or delete
- Decisions you make and why
- The order of steps
- What changes between runs (variables) vs. what stays constant
You don't need to be formal. "Now I update the README with the project name" is enough.
Step 3 — Stop Observation
CODEBLOCK1
Step 4 — Review the Synthesis
Apprentice shows you:
- - What it understood as the workflow name and purpose
- The steps it identified, in order
- The variables it detected (things that change each run)
- The constants (things that stay the same)
- The generated workflow as a readable, editable description
You approve, edit, or reject.
Step 5 — It's a Permanent Skill
Approved workflows live in
apprentice/workflows/ as named SKILL.md files. Your agent can:
"Run new-project-setup"
"Do the weekly-report workflow with topic=AI agents"
"What workflows have you learned?"
"Replay morning-routine"
Example: Learning a Workflow
User:
CODEBLOCK3
[User does the following, narrating out loud]:
CODEBLOCK4
User:
CODEBLOCK5
Apprentice responds:
CODEBLOCK6
Next time:
"New project setup for analytics-redesign"
→ Agent runs all 5 steps automatically with PROJECT_NAME=analytics-redesign
Trigger Phrases
Start observation:
CODEBLOCK8
Stop observation:
CODEBLOCK9
Run a workflow:
CODEBLOCK10
Manage workflows:
"What have you learned?"
"Show me my workflows"
"Delete [workflow-name]"
"Edit [workflow-name]"
"When did you learn [workflow-name]?"
What Makes a Good Observation
The more context you give, the better Apprentice understands:
✅ Talk out loud — "Now I'm going to update the config with the new API key"
✅ Explain why — "I always do this before deploying because staging needs different env vars"
✅ Name the variables — "The PROJECT_NAME here would change each time"
✅ Mark the end — "And that's the whole workflow, every time"
❌ Silent actions — Apprentice can only learn what it can observe through your conversation
❌ GUI-only tasks — Apprentice works with what you describe; it doesn't watch your screen
Workflow Files
Each learned workflow lives in apprentice/workflows/<name>/:
CODEBLOCK12
The generated SKILL.md is a full, valid OpenClaw skill. This means:
- - Other skills can call it
- You can edit it manually to refine
- You can publish it to ClawHub to share with others
Chaining Learned Workflows
Once you have multiple workflows, Apprentice can chain them:
CODEBLOCK13
Workflow Library
After a few weeks of use, your workflow library becomes a personal operating system — a library of you. Things like:
- -
morning-routine — the first 15 minutes of your day - INLINECODE4 — how you start every project
- INLINECODE5 — how you compile and send the Friday summary
- INLINECODE6 — every step you take when a new client joins
- INLINECODE7 — your exact deployment sequence
- INLINECODE8 — how you prepare before reviewing a PR
No two users' libraries will ever be the same. This is your agent, shaped by what only you do.
File Structure
CODEBLOCK14
Philosophy
Every tool ever built asks: What do you want?
Apprentice asks: Can I watch?
The difference is everything. When you describe what you want, you lose nuance — the order matters, the edge cases matter, the "I always do this first" matters. When Apprentice watches, it captures all of it, exactly as you actually do it.
Your agent doesn't get smarter by being trained on more data. It gets smarter by watching you.
学徒——只需看我一次,便能永远执行
整个计算历史:你描述想要什么 → 计算机执行。
学徒颠覆了这一点:你做你想做的事 → 智能体观察 → 它成为永久技能。
这是演示编程——人机交互研究30年来的圣杯。每一次尝试都失败了,因为它需要受限环境或严格的正式规范。LLM智能体首次使其成为可能:
- - 观察你实际做了什么(而非你说你做了什么)
- 理解你的意图,而不仅仅是你的动作
- 跨情境泛化——知道什么是变量,什么是常量
- 将其转化为可重复的工作流,你的智能体可以永远运行、优化和串联
外部端点
| 端点 | 用途 | 发送的数据 |
|---|
| 无 | 完全本地 | 没有任何内容离开你的机器 |
学徒在本地记录。所有合成通过你正在运行的LLM会话进行。无外部API。
安全与隐私
- - 零外部调用。 观察日志、工作流文件和所有合成均在本地进行。
- 不访问凭据。 学徒观察你告诉它的内容——它不会读取系统文件或在操作系统层面拦截你的输入。
- 保存前由你审查。 观察后,你会看到合成的工作流,并在其作为永久技能保存前批准。
- 沙盒执行。 生成的工作流运行脚本是纯bash脚本,带有完整的安全清单头。
信任声明: 学徒在本地写入观察日志和工作流SKILL.md文件。它发送给LLM的唯一内容是你描述的观察结果+合成请求,使用你现有的会话。没有任何内容离开你的机器。
模型调用说明
学徒始终由用户发起。它在watch me或等效短语时激活,并暂停直到你说done或stop watching。每次观察会话运行一次合成,保存前由你审查。工作流仅在明确调用时执行。
工作原理
第1步——开始观察
Watch me
Apprentice mode on
Learn this
Im going to show you how I do X
智能体进入观察模式。它监听并记录你的操作。
第2步——自然地执行任务
只需做你通常做的事。如果有帮助,可以大声说出来——智能体听到一切:
- - 你运行的命令
- 你创建、编辑或删除的文件
- 你做出的决定及其原因
- 步骤的顺序
- 每次运行中变化的内容(变量)与保持不变的内容(常量)
你不需要正式。Now I update the README with the project name就足够了。
第3步——停止观察
Done
Stop watching
Thats it
End observation
第4步——审查合成结果
学徒向你展示:
- - 它理解的内容作为工作流名称和目的
- 它识别的步骤,按顺序排列
- 它检测到的变量(每次运行变化的内容)
- 常量(保持不变的内容)
- 生成的工作流作为可读、可编辑的描述
你可以批准、编辑或拒绝。
第5步——成为永久技能
批准的工作流作为命名的SKILL.md文件保存在apprentice/workflows/中。你的智能体可以:
Run new-project-setup
Do the weekly-report workflow with topic=AI agents
What workflows have you learned?
Replay morning-routine
示例:学习一个工作流
用户:
Watch me set up a new project
[用户执行以下操作,并大声叙述]:
mkdir projects/client-dashboard
cd projects/client-dashboard
cp -r ~/templates/react-starter .
sed -i s/TEMPLATE_NAME/client-dashboard/g README.md
git init
git remote add origin git@github.com:myorg/client-dashboard.git
echo Done — this is how I start every new project
用户:
Done watching
学徒回应:
🎓 观察完成 — 新项目设置
我理解的内容:
目的:从模板初始化新项目
名称:new-project-setup
我识别的步骤:
1. 使用名称[PROJECT_NAME]创建项目目录
2. 复制React启动模板
3. 将README中的模板占位符替换为[PROJECT_NAME]
4. 初始化git仓库
5. 在[GITORG]/[PROJECTNAME]添加远程源
变量(每次运行变化):
• PROJECT_NAME — 新项目的名称
• GIT_ORG — 你的GitHub组织(默认:myorg)
常量(每次相同):
• 模板源:~/templates/react-starter
• README占位符:TEMPLATE_NAME
看起来对吗?[接受] [编辑] [拒绝]
下次使用时:
New project setup for analytics-redesign
→ 智能体自动运行所有5个步骤,PROJECT_NAME=analytics-redesign
触发短语
开始观察:
Watch me
Apprentice mode
Learn this
Remember how I do this
Ill show you
Teaching you something
停止观察:
Done
Stop watching
Thats it
Got it?
End lesson
运行工作流:
Run [workflow-name]
Do the [workflow-name] workflow
[workflow-name] with [variable=value]
Replay [workflow-name]
管理工作流:
What have you learned?
Show me my workflows
Delete [workflow-name]
Edit [workflow-name]
When did you learn [workflow-name]?
如何做好观察
你提供的上下文越多,学徒理解得越好:
✅ 大声说出来 — Now Im going to update the config with the new API key
✅ 解释原因 — I always do this before deploying because staging needs different env vars
✅ 命名变量 — The PROJECT_NAME here would change each time
✅ 标记结束 — And thats the whole workflow, every time
❌ 静默操作 — 学徒只能通过你的对话学习它能观察到的内容
❌ 仅GUI任务 — 学徒处理你描述的内容;它不观察你的屏幕
工作流文件
每个学习到的工作流保存在apprentice/workflows//中:
apprentice/workflows/new-project-setup/
├── SKILL.md ← 学习到的工作流(兼容OpenClaw)
├── run.sh ← 生成的执行脚本
└── observation.json ← 原始观察日志(可编辑)
生成的SKILL.md是一个完整、有效的OpenClaw技能。这意味着:
- - 其他技能可以调用它
- 你可以手动编辑以优化
- 你可以发布到ClawHub与他人分享
串联学习到的工作流
一旦你有多个工作流,学徒可以串联它们:
After running new-project-setup, also run notify-team
→ 智能体按顺序串联两个工作流
If the deploy workflow fails, run rollback-staging
→ 带错误处理的条件串联
工作流库
使用几周后,你的工作流库将成为个人操作系统——一个你的库。例如:
- - morning-routine — 你一天的前15分钟
- new-project-setup — 你启动每个项目的方式
- weekly-report — 你编译和发送周五总结的方式
- client-onboarding — 新客户加入时你采取的每一步
- deploy-staging — 你精确的部署序列
- code-review-prep — 你在审查PR前的准备方式
没有两个用户的工作流库会是相同的。这是你的智能体,由只有你做的事情塑造而成。
文件结构
apprentice/
├── SKILL.md ← 你在这里
├── README.md ← 安装指南
├── scripts/
│ ├── observe.py ← 观察会话管理器
│ ├── synthesize.py ← 将观察转化为工作流SKILL.md
│ └── run.py ← 执行命名的工作流
└── workflows/ ← 你学习到的工作流库
└── (安装时为空,随你成长)
理念
每个被构建的工具都会问:你想要什么?
学徒问:我可以看吗?
区别在于一切。当你描述你想要什么时,你会失去细微差别——顺序很重要,边缘情况很重要,我总是先做这个很重要。当学徒观察时,它捕捉到所有内容,完全按照你实际执行的方式。
你的智能体不会因为接受更多数据训练而变得更聪明。它通过观察你而变得更聪明。