范围

Scope 会捕捉 AI 代理越过侦察阶段约定边界的操作,并暂停以等待你的决定。

aradmanamnaoon
2026年10月10日
0 收藏
38 下载

安装与下载

1 ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install scope

2 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/
工作区 {'/skills/'}

优先级:工作区 › 全局 › 内置

3 提示词安装

将此提示词复制到 Openclaw 即可自动安装。

请帮我使用 Clawhub 安装 skill-scope。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

更倾向于下载?

获取包含原生技能文件的ZIP压缩包。

下载技能 (.zip)

基本信息

名称 范围
Slug scope
创建者 aradmanamnaoon
创建时间 2026-10-10 05:33:06
更新时间 2026-10-10 05:33:06
收藏数 0
使用量 38
浏览量 1

安装指南

  1. ClawHub CLI 从源直接安装技能的最快方式。
    npx clawhub@latest install scope
  2. 手动安装 将技能文件夹复制到以下位置之一
    全局模式
    ~/.openclaw/skills/
    工作区
    /skills/
    优先级:工作区 > 本地 > 内置
  3. 提示词安装 将此提示词复制到 OpenClaw 即可自动安装。
    请帮我使用 Clawhub 安装 scope。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
    更倾向于下载?
    获取包含原生技能文件的ZIP压缩包。
    下载技能 (.zip)

什么是

Scope 是 AI 编码代理的范围漂移防护工具:它会将待执行的文件更改、shell 命令、依赖项添加或重构,与原始任务及侦察阶段记录的边界进行比较。当检测到确实存在范围蔓延时,它会在执行前停止,并生成一份具体报告,说明将要越过的边界。
作为 Openclaw Skills 工具,Scope 有助于让小型开发任务保持小规模,同时不打断正常且符合范围的工作。你可以选择允许代理在说明理由后继续、将工作推迟到后续任务,或恢复到最近一次符合范围的状态。

应用场景

发现代理准备编辑侦察阶段未列入范围的文件。
在 shell 命令可能影响项目目录之外的资源之前暂停。
审查计划外的依赖项添加或与任务无关的重构。
阻止仅以“我顺便……”之类理由为依据的操作。
当代理遇到确实需要扩大任务范围的情况时,让用户保持控制权。
区分真正的范围漂移、侦察不完整、必需的测试文件,以及对范围内文件进行的细微格式调整。

工作原理

代理在侦察阶段确定原始任务以及范围内的文件或资源。
在执行可能超出范围的操作之前,Scope 会将该操作与任务说明和侦察阶段提出的边界进行比较。
如果该操作确实属于范围漂移,Scope 会在执行前暂停,并显示一份结构化报告,指出操作、理由、受影响资源以及具体的边界不匹配之处。
报告提供三个选项:说明理由后继续、将工作推迟到后续任务,或撤销更改并返回到最近一次符合范围的状态。
Scope 会等待用户选择,在用户回应之前不采取任何进一步操作。
用户作出决定后,Scope 会按所选路径执行:记录理由并继续;将事项添加到后续任务列表并恢复范围内的工作;或撤销更改并从最近一次符合范围的状态继续。

配置指南

提供的 SKILL.md 定义了 Scope 的行为,但未指定安装程序、CLI 命令、配置文件或必需依赖项。请按照 AI 代理运行环境的说明,将该技能添加到其使用的技能目录或注册表中,并确保代理能够访问任务说明和侦察结果。

提供的 SKILL.md 未指定安装命令。

请使用代理运行环境记录的流程安装或注册该技能。

为确保范围漂移检查可靠,请记录任务摘要以及侦察阶段发现的文件或资源。文档未说明其他设置选项。

数据架构

Scope 使用任务和侦察结果作为比较基准。该技能未指定持久化存储格式、生成文件或元数据分类体系。
信息 作用
原始任务摘要 定义用于评估待执行操作的任务约定。
侦察阶段的“发现内容”部分 标识已被认定为范围内的文件和资源。
待执行操作 正在评估的文件、资源、命令、依赖项或重构。
漂移报告 Markdown 报告,包含原始任务、拟议操作、范围不匹配、选项和决策提示。
会话日志 用户选择继续时,用于记录其理由。
后续任务列表 用户选择推迟时,用于记录延期工作。
最近一次符合范围的状态 撤销后恢复工作时所用的参考点。
报告要求代理指出即将越过的具体边界;仅发出笼统的超出范围警告是不够的。

高级特性

在执行拟议操作之前拦截范围扩张。
检查多种漂移信号,包括未列出的文件编辑、影响项目目录之外资源的命令、计划外依赖项、无关重构,以及“我顺便……”之类的工作。
使用结构化 Markdown 漂移报告,让用户评估操作及其风险。
提供明确的继续、推迟和撤销路径,然后等待用户确认。
用户批准继续时,将其理由附加到会话日志。
将推迟视为有效的默认选择,并区分真正的范围漂移、侦察遗漏、必需的测试以及细微的格式调整。
提供的技能未说明钩子、多代理协调,或除所述会话日志和后续任务行为之外的自动文件记录功能。


name: scope description: Drift guard that fires during execution when the agent is about to touch a file or run a command outside the boundaries agreed in recon. Compares the pending action against recon's proposed self-rules and the original task description. On drift, stops, shows the specific action that exceeds scope, and offers three options (proceed with justification, defer to follow-up, revert). Prevents silent scope creep where a small task quietly becomes a large one. license: MIT

Scope

The original task is a contract. When the agent starts doing work outside that contract, it has drifted. This skill catches the drift.

When this runs

This skill fires when the agent is about to:

Write or modify a file that was not listed in recon's "What I found" section
Run a shell command that touches resources outside the project directory

Add a dependency that was not part of the original plan

Refactor code that was not part of the task description

Perform any action whose justification is "while I'm here" or "this should also..."

This skill does NOT fire for:

Files that are clearly required by the task but weren't listed in recon (missing inspection)
Test files for code the agent just wrote (part of the task)

Trivial formatting changes to files already in scope

Procedure

  1. Pause before acting

Do not execute the out-of-scope action. The pause is the value.

  1. Produce the drift report

Output exactly this template wrapped in a markdown code block. Make absolutely sure the closing fence is on its own line:

Scope Drift Detected

Original task

[one sentence from recon's task summary]

Action about to be taken

  • File or resource: [path or command]
  • Why: [one sentence justification]

Why this is out of scope

  • recon listed: [the files/resources that were in scope]
  • This action touches: [what it touches]
  • Mismatch: [the specific boundary being crossed]

Options

  1. Proceed with justification
  • Justification: [why this is required after all]
  • Risk: [what could go wrong]
  1. Defer to follow-up
  • Add to follow-up list: [yes/no]
  • Task to create: [one-line description]
  1. Revert
  • Undo the change: [what needs reverting]
  • Return to: [the last in-scope state]

Awaiting decision

Reply "1", "2", or "3".

  1. Wait

Do not take any action until the user chooses.

  1. On user choice Option 1: proceed, but append the justification to the session log
    Option 2: add the item to the follow-up list, return to in-scope work
    Option 3: revert the change and resume from the last in-scope state

Rules for this skill

Only fire on real drift, not on incomplete recon. If the agent forgot to list a required file, that is a recon mistake, not drift.
Always show the specific boundary that is being crossed. "This is out of scope" is not enough.
Never block silently. Every drift detection must produce a report.
Deferring is the default option. Proceeding with justification requires a real reason.

Common mistakes

Firing on every file write. This skill is for drift, not for normal task execution.
Triggering because the agent forgot to list a file in recon. That is not drift; that is an inspection gap. Fix recon, do not fire scope.
Blocking silently. If the skill fires, the user must see the report.
Treating "defer to follow-up" as a failure. It is often the correct choice.
Letting "while I'm here" justifications proceed without the user's confirmation.

Shell Chat

暂停