box

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Box

Box

Flags

参数

FlagEffect
--persist
After searching, save a repo reference in the working dir
AGENTS.md
.
--update
Force
git pull
even if the repo exists locally.
--list
Skip all work; list cloned repos and exit.
--no-subagents
Run the full workflow in the main thread; never dispatch subagents.
No flags → clone if missing, search, report. Never write
AGENTS.md
without
--persist
.
参数作用
--persist
搜索完成后,在工作目录的
AGENTS.md
中保存仓库引用。
--update
即使仓库已在本地存在,强制执行
git pull
--list
跳过所有工作,列出已克隆的仓库后退出。
--no-subagents
在主线程中运行完整工作流,绝不调度subagent。
无参数时→若仓库不存在则克隆,进行搜索并生成报告。未使用
--persist
时绝不写入
AGENTS.md

Execution mode

执行模式

The mode is a branch. Pick it before Step 2. Full selection rules, role definitions, stage barriers, and stage contracts are in
./REFERENCE.md
; read the section for the mode you pick before running its stages.
  • Direct mode, main thread runs prepare, search, and (if
    --persist
    ) persist itself. Triggered by
    --no-subagents
    , the user declining delegation, or no subagent/Task tool. Execute immediately; never refuse for lack of subagents.
  • Delegated mode (default when a subagent tool exists and the user did not opt out), main thread coordinates only and dispatches a subagent per stage.
模式是一个分支选项。请在步骤2之前选择模式。完整的选择规则、角色定义、阶段限制和阶段契约均在
./REFERENCE.md
中;在运行对应模式的阶段前,请阅读该模式的相关章节。
  • Direct模式:主线程自行执行准备、搜索以及(若使用
    --persist
    参数)持久化操作。触发条件为使用
    --no-subagents
    参数、用户拒绝委托,或无subagent/Task工具。立即执行,绝不因缺少subagent而拒绝执行。
  • Delegated模式(当存在subagent工具且用户未选择退出时为默认模式):主线程仅负责协调,为每个阶段调度一个subagent。

Sandbox location

沙箱位置

All repos live in the skill's own directory, the anchor (the directory holding this
SKILL.md
). Include the anchor in every subagent brief.
  • Sandbox root:
    ./sandbox/
  • Manifest:
    ./sandbox/manifest.json
  • Cloned repos:
    ./sandbox/{slug}/
所有仓库都存储在该skill专属的目录——锚点(即存放本
SKILL.md
的目录)中。请在每个subagent的任务说明中包含锚点信息。
  • 沙箱根目录:
    ./sandbox/
  • 清单文件:
    ./sandbox/manifest.json
  • 已克隆仓库:
    ./sandbox/{slug}/

--list
or bare invocation

使用
--list
或无参数调用

Read
./sandbox/manifest.json
and list cloned repos (or "No repos cloned yet."), then stop. Main thread handles this directly. No prepare/search/persist. See the startup template in
./REFERENCE.md
.
读取
./sandbox/manifest.json
并列出已克隆的仓库(或显示“尚未克隆任何仓库”),然后停止运行。此操作由主线程直接处理,不执行准备/搜索/持久化步骤。具体启动模板请查看
./REFERENCE.md

Step 1: Detect the target

步骤1:识别目标

  • URL present: use it; derive the slug from the repo name.
  • Name mentioned: read
    ./sandbox/manifest.json
    for a matching slug. If absent, stop and ask.
  • 提供URL:直接使用该URL,从仓库名称中派生slug。
  • 提及名称:在
    ./sandbox/manifest.json
    中查找匹配的slug。若未找到,停止运行并询问用户。

Step 2: Prepare the repo

步骤2:准备仓库

Delegated: dispatch one prepare subagent (anchor, slug, url,
--update
); wait. Direct: run the Prepare contract from
./REFERENCE.md
. On error, stop and report.
委托模式:调度一个负责准备工作的subagent(传入锚点、slug、url、
--update
参数);等待完成。 直接模式:按照
./REFERENCE.md
中的准备契约执行操作。若出错,停止运行并报告错误。

Step 3: Search the repo

步骤3:搜索仓库

Delegated: dispatch one or more read-only search subagents with non-overlapping scopes; wait for all. Direct: search the local repo per the Search contract. Cite
path:line
.
委托模式:调度一个或多个具有非重叠范围的只读搜索subagent;等待所有subagent完成。 直接模式:按照搜索契约在本地仓库中进行搜索。引用格式为
path:line

Step 4: Aggregate

步骤4:聚合结果

Merge findings into one answer, dedupe citations. If nothing matched, say so.
将所有发现合并为一个答案,去除重复引用。若无匹配结果,需告知用户。

Step 5: Persist (only if
--persist
)

步骤5:持久化(仅当使用
--persist
参数时执行)

Delegated: dispatch one persist subagent (anchor, slug, url,
local_path
, path to the working dir
AGENTS.md
). Direct: run the Persist contract from
./REFERENCE.md
. Skip when
--persist
is unset.
委托模式:调度一个负责持久化工作的subagent(传入锚点、slug、url、
local_path
以及工作目录中
AGENTS.md
的路径)。 直接模式:按照
./REFERENCE.md
中的持久化契约执行操作。未使用
--persist
参数时跳过此步骤。

Step 6: Report

步骤6:生成报告

In 2-4 sentences: repo, local path, prepare status, persist status, and a high-level search summary.
用2-4句话说明:仓库信息、本地路径、准备状态、持久化状态,以及搜索结果的概要总结。

Constraints

约束条件

  • Never
    git push
    , modify remotes, or commit inside clones (unless the user asks outside this skill).
  • Never infer repo contents from the URL alone.
  • Do not re-clone existing repos unless
    --update
    is passed.
  • Stage barriers hold in both modes: prepare before search, search before persist, exactly one writer for the clone/manifest and one for
    AGENTS.md
    .
  • Delegated mode: the coordinator never clones, pulls, reads repo files, searches repo contents, or edits
    AGENTS.md
    , subagents do that work.
  • 禁止执行
    git push
    、修改远程仓库配置,或在克隆的仓库内提交代码(除非用户在本skill之外提出相关请求)。
  • 绝不能仅通过URL推断仓库内容
  • 除非使用
    --update
    参数,否则不得重新克隆已存在的仓库
  • 两种模式均需遵守阶段限制:先完成准备再进行搜索,先完成搜索再进行持久化;克隆/清单文件和
    AGENTS.md
    各只能有一个写入者。
  • 委托模式:协调者绝不执行克隆、拉取、读取仓库文件、搜索仓库内容或编辑
    AGENTS.md
    的操作,这些工作均由subagent完成。