快速上手

官方 Quickstart 的路径是:登录并打开文件夹 → 让 Agent 解释仓库 → 做一处小改动 → 审查 diff 并跑检查 → 更大的活改用 Plan Mode。下面按同一顺序写可直接粘贴的提示词。

打开 Agent:macOS 用 Cmd+I,Windows / Linux 用 Ctrl+I(侧栏)。


1. 解释这个仓库

工作区根目录打开后,把下面整段发给 Agent:

Explain this codebase. Point me to the main entry points, key modules,
and anything I should read before making changes.

(中文仓库也可以写:「解释这个代码库。指出主入口、关键模块,以及改代码前我该先读什么。」)

Agent 会搜文件、读相关源码,再总结结构。这是进入陌生仓库最快的办法。若回答太空,补一句:

List the commands in package.json / Makefile / pyproject.toml that
run tests, lint, and the local dev server. Quote the exact scripts.

2. 做一处小改动

先让它提议,你来选,而不是「随便优化一下」:

Suggest three small, safe improvements in this codebase.
Explain the tradeoffs and wait for me to choose one.

适合当第一次任务的例子:改文案、修小 UI、补一条缺失的 aria-label、给 README 加一句真实的启动命令。选定后:

Implement option 2 only. Do not refactor unrelated files.
When you finish, show the diff and tell me how to verify it.

你已经知道要改什么时,直接描述结果,不要描述按键:

In the README, add a "Windows (PowerShell)" section that shows how
to create a venv and run the existing test script. Match the repo's
current commands; do not invent new npm scripts.

3. 审查 diff 并验证

Agent 改完后,侧栏 / 编辑器会出 diff。你自己做三件事:

  1. 读 diff:范围是否只覆盖你批准的文件?有没有顺手「清理」无关模块?
  2. 让它跑仓库已有的检查(测试、类型、lint、本地构建),不要让它发明新工具链:
Run the checks this project already uses (tests, typecheck, lint, or
the local build). Paste the exact commands you ran and their exit codes.
  1. 你自己再跑一遍(PowerShell 示例,按仓库改):
# Node 示例
npm test

# Python 示例
python -m pytest
# macOS / Linux
npm test
# 或
python -m pytest

官方也把「审查与测试」写成独立工作流;第一次上手,能复述命令与退出码就够了。


4. 更大的改动切到 Plan Mode

任务跨多文件、需要调研、或必须先批准再写代码时,在 Agent 输入框按 Shift+Tab 转到 Plan Mode。官方顺序是:

  1. 研究仓库,找出相关文件
  2. 追问需求
  3. 写出可审的实现计划
  4. 等你批准后再构建

可以这样开场:

We need to add a /health JSON endpoint that returns { "ok": true }
without changing authentication. Research the existing HTTP stack,
ask me anything unclear, and produce a plan. Do not edit files yet.

细节见 Plan Mode。计划跑偏时:用检查点或 Git 回滚文件,改计划,再点构建——通常比在错误实现上叠提示更快。


一次完整练习(建议 20 分钟)

你做的事完成标准
1Ctrl+I / Cmd+I,发送「解释仓库」你能指出入口文件与测试命令
2要 3 个小改进,只批准 1 个diff 只动少数文件
3让 Agent 跑已有检查,你再跑一次退出码为 0,或你理解失败原因
4Shift+Tab,为一个假想功能出计划计划列出文件;尚未改代码
flowchart TD
  A[打开文件夹] --> B[解释仓库]
  B --> C[选一个小改动]
  C --> D[审查 diff]
  D --> E[跑已有检查]
  E --> F{还要跨多文件?}
  F -->|否| G[提交或丢弃]
  F -->|是| H[Shift+Tab Plan Mode]
  H --> I[批准后再构建]

提示词习惯(现在就能用)

避免
写可观察的结果(「测试要绿」「文案要改成 X」)「优化一下」「弄得专业一点」
限制范围(「只改 docs/」「不要动 schema」)一次塞进重构 + 新功能 + 依赖升级
要求引用已有脚本名让 Agent 自创 npm run fancy-check
做完后要验证步骤默认「看起来对」就合并

需要 Agent 边做边排队 或长目标时,见 Agent 工作台 的队列与 /goal


下一步

评论