返回课程总览 · 上一章 · 下一章

IndyDevDan · 51:36 · 发布 2026-02-23 · 22.8万次观看(截至抓取) · 观看原视频 🔥 观众最高回放 29:56 — 本片高回放时刻见对应章节

主旨

写一个 ext 注册 /system 命令:当前会话的 system prompt 可以在运行时被改写——演示”你可以在任何会话中变身成另一个 Pi 实例”,从 Pi 默认 persona 切成 browser agent / planner 等特殊角色——“agent 即 persona”

核心论点

  1. /system 命令即时换 system prompt——会话中任何时刻都能给 Pi 戴上另一张脸。(→ 详解1)
  2. demo: 切到 browser agent persona 后跑 Playwright CLI 抓 pi.dev——把 Pi 变成”有 browser 工具的 agent”。(→ 详解2)
  3. 与 Claude Code 对照:CC 也能覆写 system prompt 但需 --system-prompt-file CLI 参数;Pi 在会话内运行时切换是 widget 化的桌面交互。(→ 详解3)
  4. “我是反对单 agent 单模型单工具”的表态——作者明确:不同情境需要特殊化,v10 是”任何情境有匹配的 persona”。(→ 详解4)

知识点详解

1. /system 即时换 system prompt 33:55

So, here we have a custom slice of pie where we can type slash uh and then slashsystem. And when I hit enter here, you can see I can now become any one of my agents. (33:55)

/system 命令触发 ext 弹问”你是哪个 agent”,选完后 Pi 的 system prompt 立即被改写为该 agent 的 persona。后续所有对话都按新 persona 行为。

2. demo: 切到 browser agent + Playwright CLI 33:55

Let’s go to pi.dev dev summarize the value prop of this tool. This agent is a browser agent. You can see it fired off the Playwright browser skill right away. (34:24)

切到 browser agent persona 后,主 prompt “Go to pi.dev summarize the value prop”:agent 直接调 Playwright CLI 跑浏览器,抓回页面内容,这是 persona 改变 agent 行为的实证

3. 与 Claude Code /system override 的对照 33:55

you can overwrite the system prompt in Claude Code. Um with PI agent you can do the same. So uh this is really a tie but Anthropic doesn’t really want to share their system prompt although it you know it’s not super super hard to get but the system prompts are of course customizable. (33:55)

两边都能改写 system prompt,但:

  • Claude Code 走 CLI 参数启动时覆写
  • Pi 走 widget 内运行时切换

运行时的能力更强:你不必重启 Pi,可以在同一个工作时段里反复变 persona。

4. 反”单 agent 单模型”的表态 33:55

You can imagine that my real uh you know primary version of pi I build the extensions in isolation and then I stack up features that I want in different conditions. I am really against this one agent, one model, you know, one tool solution to do everything. It’s not really how you create real results, right? A lot of situations require specialization. (33:55)

明确表态:反对单 agent / 单模型 / 单工具。Pi 允许你在同一会话内为不同情境切不同 persona,这是”特殊化主张”的延伸。

可执行步骤

  • 在 ext 里定义 3 个 persona:browser-agent / planner / full-stack
  • 注册 /system 命令,弹问 “你是哪个 agent” → 修改 system prompt
  • 跑 prompt 验证 persona 切换后行为不同(浏览器 agent 调 Playwright,planner 只列大纲)
  • 在同一会话内反复切 persona,验证 system prompt 真的即时改写

关联

  • 互补:本片 11-v9-Agent-Team.md — v9 是多 agent 团队的 dispatcher,v10 是单 agent 自身的 persona 切换
  • 印证:System Prompt —— “system prompt 决定 agent 基调”在这一节被扩展为”运行时可改”
  • 互补:Persona Switch —— 同一概念,Pi 在 ext 实现,Claude Code 等在 CLI 参数实现

一手来源与延伸

  • Pi extension 文档:https://pi.dev/
  • 视频 33:55-35:58(v10 system select 演示)

术语

  • Persona:agent 的角色 / system prompt 模板,运行时可切换
  • System prompt override:在 Pi 里运行时改写默认 system prompt

金句

I am really against this one agent, one model, you know, one tool solution to do everything. It’s not really how you create real results, right? A lot of situations require specialization. (33:55) — 作者明确反对单 agent 解决一切的命题。

立场与利益

  • 利益中性:persona 切换是工程模型,无直接挂商品

价值定位

本片目标学习者的价值:

  • 适合谁:同一任务里需要切换 agent 身份的工程师(做 web research 时切到 browser agent,做规划时切到 planner)
  • 解决什么:在运行时改 agent 身份,不重启会话
  • 认知 vs 实操:实操偏轻——写一个 ext 注册 persona 切换
  • 跨源重叠:与 Claude Code 的 system prompt CLI 参数实现同思路,v10 把它做成会话内交互

自检问题

  1. /system 命令的具体行为是什么? 答案:弹问切换到哪个 agent persona,选完后即时改写当前会话的 system prompt,后续所有对话按新 persona 行为。回跳 33:55
  2. v10 的 browser agent demo 演示了什么? 答案:切到 browser agent 后 prompt “go to pi.dev summarize”,agent 调 Playwright CLI 跑浏览器抓回内容。这是 persona 改变行为的实证。回跳 33:55
  3. 作者对”单 agent 单模型 单工具”的态度是什么? 答案:明确反对——“I’m really against this one agent, one model, one tool solution to do everything”。Pi 支持会话内切换 persona 是反这一命题的具体设计。回跳 33:55