reflect
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseReflect
反思功能
Mine the current conversation for durable learnings, then route them into skill edits.
从当前对话中提炼可复用的经验,然后将这些经验转化为对Skill的修改。
When to invoke
调用时机
- The user said "reflect" or "/reflect".
- A complex task (5+ tool calls) just landed cleanly and the recipe is worth keeping.
- The agent hit dead ends, found the working path, and the path generalizes.
- The user corrected the agent's approach mid-task.
- A non-trivial workflow emerged that isn't captured anywhere.
Skip when the conversation is trivial, off-topic, or already covered by an existing skill the parent followed correctly. One-offs are not learnings.
- 用户说出'reflect'或'/reflect'。
- 一个复杂任务(调用工具5次及以上)顺利完成,且其流程值得留存。
- Agent陷入过死胡同,之后找到了可行路径,且该路径具有通用性。
- 用户在任务进行中纠正了Agent的处理方式。
- 出现了未被任何现有Skill覆盖的重要工作流程。
当对话内容琐碎、偏离主题,或者已被父Agent正确遵循的现有Skill覆盖时,请跳过此功能。单次偶发的内容不属于可复用经验。
Process
执行流程
1. Locate the active transcript
1. 定位当前对话记录
The parent finds its own transcript file before fanning out. The system prompt names the active workspace's directory; use that path. Do not glob across . That crosses workspace boundaries and reads private chats from unrelated projects.
agent-transcripts/~/.cursor/projects/*/bash
ls -t <agent-transcripts>/*.jsonl <agent-transcripts>/*/*.jsonl <agent-transcripts>/*/subagents/*.jsonl 2>/dev/null | head -10Three transcript layouts: legacy flat (), current nested (), and subagent ().
<id>.jsonl<id>/<id>.jsonl<parent>/subagents/<child>.jsonlFor each candidate, read the first JSONL line and check that contains the conversation's opening user prompt. Take the matching path. If no path resolves, write a tight digest of the session and pass that instead.
message.content[0].text父Agent在生成子代理前需找到自身的对话记录文件。系统提示中会指定当前工作区的目录,请使用该路径。不要遍历,这会跨越工作区边界,读取无关项目的私密对话。
agent-transcripts/~/.cursor/projects/*/bash
ls -t <agent-transcripts>/*.jsonl <agent-transcripts>/*/*.jsonl <agent-transcripts>/*/subagents/*.jsonl 2>/dev/null | head -10对话记录有三种格式:旧版扁平格式()、当前嵌套格式()和子代理格式()。
<id>.jsonl<id>/<id>.jsonl<parent>/subagents/<child>.jsonl对于每个候选文件,读取第一行JSONL内容,检查是否包含对话的初始用户提示。选择匹配的路径。如果没有找到匹配路径,则生成会话的精简摘要并使用该摘要。
message.content[0].text2. Spawn three reviewers in parallel
2. 并行生成三个审核子代理
One message, three calls, , explicit on each, agent mode (). Reviewers need MCP access for context lookups (tickets, chat threads, observability traces referenced in the transcript); readonly strips MCPs. The prompt forbids file writes; the parent applies edits.
Tasksubagent_type: generalPurposemodel:readonly: false| Lens | | Prompt template |
|---|---|---|
| Judgment | your configured reflect-judgment model (default | |
| Tooling | your configured reflect-tooling model (default | |
| Divergent | your configured reflect-judgment model (default | |
Pass each template verbatim, substituting the transcript path or digest where marked. Reviewers return findings in the response body.
Task发送一条消息,发起三次调用,设置,为每个调用明确指定,Agent模式设为。审核子代理需要MCP访问权限来查询上下文(对话记录中引用的工单、聊天线程、可观测性追踪数据);readonly模式会移除MCP权限。提示中禁止文件写入操作,由父Agent执行修改。
Tasksubagent_type: generalPurposemodel:readonly: false| 视角 | | 提示模板 |
|---|---|---|
| 判断 | 你配置的reflect-judgment模型(默认 | |
| 工具使用 | 你配置的reflect-tooling模型(默认 | |
| 发散思考 | 你配置的reflect-judgment模型(默认 | |
原样传递每个模板,在标记位置替换为对话记录路径或摘要。审核子代理会在响应体中返回审核结果。
Task3. Synthesize
3. 结果合成
One call, , using your configured reflect-judgment model (default ), agent mode (). The synthesizer's quality check includes spot-verifying citations, which can require MCP access; readonly strips MCPs. Use verbatim, with each reviewer's full output inlined where marked. The synthesizer returns a structured Accepted / Rejected / Backlog list.
Tasksubagent_type: generalPurposeclaude-opus-4-8-thinking-xhighreadonly: falsereferences/synthesizer.md发起一次调用,设置,使用你配置的reflect-judgment模型(默认),Agent模式设为。合成子代理的质量检查包括抽查引用内容,这可能需要MCP访问权限;readonly模式会移除MCP权限。原样使用模板,在标记位置内联每个审核子代理的完整输出。合成子代理会返回结构化的「已接受/已拒绝/待办」列表。
Tasksubagent_type: generalPurposeclaude-opus-4-8-thinking-xhighreadonly: falsereferences/synthesizer.md4. Structural enforcement check
4. 结构合规性检查
Sanity-check the synthesizer's Accepted list. For any item that would be enforced more reliably by a lint rule, script, metadata flag, or runtime check, move it from Accepted to Backlog. The synthesizer already applies this criterion; this is a final pass before edits land. See the encode-lessons-in-structure principle skill.
对合成子代理返回的「已接受」列表进行合理性检查。对于任何可以通过lint规则、脚本、元数据标记或运行时检查更可靠执行的项,将其从「已接受」移至「待办」。合成子代理已应用此标准,这是执行修改前的最终检查。请参考encode-lessons-in-structure原则Skill。
5. Apply
5. 执行修改
Before applying any Accepted edit, present the synthesizer's full Accepted/Rejected/Backlog output to the user and wait for explicit approval. The user picks which subset to apply and may redirect routings. Skill changes affect every future agent in the org; do not auto-apply.
Backlog items file to whatever devex / backlog tracker your team uses automatically. Those are tracker submissions, not skill edits. Only the Accepted list waits for approval.
For each approved Accepted item, follow the Routing field exactly:
- Trivial existing-skill edit (a one-line bullet, a tightened sentence, a stale fact corrected): parent does directly.
- Substantive existing-skill edit (a new section, a new pattern table, more than ~10 lines): hand to Cursor's built-in skill and run its draft / test / iterate loop.
create-skill - (the skill exists but didn't trigger when it should have): hand to
tune description: <skill path>and run its description-optimization loop.create-skill - : hand creation to
new skill via create-skill: <kebab-name>. Do not invent the shape ad hoc.create-skill
If your environment ships a SKILL.md validator, run it on every touched skill before declaring done. Skip this step if it doesn't.
在执行任何「已接受」的修改前,向用户展示合成子代理的完整「已接受/已拒绝/待办」输出,并等待用户明确批准。用户可以选择要执行的子集,也可以重新指定修改路径。Skill的变更会影响组织内所有未来的Agent,请勿自动执行。
待办项会自动提交到团队使用的devex/待办事项追踪系统中。这些是追踪系统提交项,而非Skill修改。只有「已接受」列表需要等待批准。
对于每个获得批准的「已接受」项,严格按照Routing字段执行:
- 对现有Skill的微小修改(单行项目符号、语句精简、过时事实修正):由父Agent直接执行。
- 对现有Skill的重大修改(新增章节、新增模式表、修改内容约10行以上):交给Cursor内置的Skill,并运行其草稿/测试/迭代流程。
create-skill - (Skill已存在但未在应触发时触发):交给
tune description: <skill path>Skill,并运行其描述优化流程。create-skill - :将创建任务交给
new skill via create-skill: <kebab-name>Skill。请勿自行设计Skill结构。create-skill
如果你的环境提供SKILL.md验证器,请在完成前对所有被修改的Skill运行验证。如果没有则跳过此步骤。
6. Summarize for the user
6. 向用户总结
Short list, no preamble:
- Edits applied: . What changed, one line each.
<skill path> - New skills created: . One line each (rare).
<skill path> - Backlog filed to the devex tracker: (
<issue title>). One line each.<tags> - Dropped: one line per rejected finding + reason from the synthesizer.
简洁列表,无需开场白:
- 已执行的修改:。每项修改用一行说明变更内容。
<skill path> - 已创建的新Skill:。每项用一行说明(少见)。
<skill path> - 已提交到devex追踪系统的待办项:(
<issue title>)。每项用一行说明。<tags> - 已舍弃:每个被拒绝的结果加一行说明,附上合成子代理给出的原因。