sync

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Output style (plain words, no dashes, no hyphens)

输出风格(直白表述,无破折号、无连字符)

<!-- OUTPUT-STYLE:START -->
Write everything this skill produces, files and messages alike, in plain simple language. Keep technical terms that carry real meaning; explain each in plain words. Never use a dash or a hyphen as punctuation: no em dash, no en dash, and no hyphenated compounds. Write
read only
, not
read-only
. Say it in simple words, or reword the sentence. Code, file paths, command flags, and values other skills match on keep their hyphens. Use short sentences, commas, or parentheses. Clear beats clever.
<!-- OUTPUT-STYLE:END -->
<!-- OUTPUT-STYLE:START -->
此技能生成的所有内容(包括文件和消息)都需使用简洁直白的语言撰写。保留具有实际意义的技术术语,并以直白语言解释每个术语。绝不使用破折号或连字符作为标点:不使用em破折号、en破折号,也不使用连字符构成的复合词。撰写
read only
,而非
read-only
。用简单的语言表达,或改写句子。代码、文件路径、命令标志以及其他技能匹配的数值保留其连字符。使用短句、逗号或括号。清晰优于巧妙。
<!-- OUTPUT-STYLE:END -->

What this skill does

此技能的功能

Closes the loop on a completed change: syncs AGENTS.md files, the scope, and linked spec
**Status**:
lines to what the repo now shows, and flags what it must not edit (stale specs, curated prose). The Boundaries table below is the exact contract.
agent-prompt.md
is the single source of truth for the maintenance rules; SKILL.md covers only orchestration. The main thread reads it and does the maintenance itself (see Step 3).
Canonical file: durable context lives in the tool agnostic
AGENTS.md
;
CLAUDE.md
is only a pointer
to it. /sync edits/creates both, treating them only as targets, never as a change source.
完成变更的闭环:同步 AGENTS.md 文件、范围以及关联规格的
**Status**:
行,使其与仓库当前状态一致,并标记不可编辑的内容(过时规格、人工整理的文本)。下方的边界表是明确的约定。
agent-prompt.md
是维护规则的唯一可信来源;SKILL.md 仅涵盖编排逻辑。主线程会读取该文件并自行执行维护操作(见步骤3)。
标准文件: 持久化上下文存储于与工具无关的
AGENTS.md
中;
CLAUDE.md
仅作为指向它的指针
。/sync 会编辑/创建这两个文件,但仅将它们作为目标,而非变更来源。

Boundaries (these keep the skill from sprawling)

边界(防止技能功能蔓延)

Action/syncOwner
Edit existing root/nested AGENTS.md✅ maintains/sync
Reconcile root AGENTS.md's
## Build approach
line to the scope header's approach (surgical single line edit, like the stack)
✅ maintains; flags a curated divergence/sync
Add a one line pointer to
design.md
(the UI design system) in the nearest AGENTS.md when a change establishes one
✅ maintains (pointer only)/sync
Create nested
<area>/AGENTS.md
for an area net new in this change
✅ creates (diff = full area context) + adds root pointer/sync
Create nested doc for an already existing undocumented area (only sliced by the diff)❌ flags "run /audit"/audit
Create or restructure the root AGENTS.md❌ flags "run /audit"/audit
Reconcile a spec's
**Status**:
line to its feature's scope status (
planned
Proposed
,
in-progress
In Progress
,
done
Accepted
)
✅ Status line only/sync
Edit a spec's content / supersede it❌ flags as stale/architect
Reconcile the scope, for the relevant workspace's scope file only (not all of
docs/scope/
), tick any completed sub task from repo evidence (code, tests, AGENTS.md), advance status
✅ corrects/sync
Add / reorder features or sub tasks in the scope❌ leaves alone/scope
Overwrite or rewrite curated AGENTS.md prose❌ flags conflict insteadhuman
The dividing line on creation is context, not policy: create only when this change shows you the whole area; defer to /audit when the area predates the change and you've seen only a slice. When unsure, flag instead of creating.
操作/sync所有者
编辑现有根目录/嵌套目录下的 AGENTS.md✅ 维护/sync
将根目录 AGENTS.md 的
## Build approach
行与范围标题中的方法协调(精准单行编辑,类似技术栈)
✅ 维护;标记人工整理的差异/sync
当变更确立了
design.md
(UI设计系统)时,在最近的 AGENTS.md 中添加一行指向它的指针
✅ 维护(仅添加指针)/sync
为此变更中全新的区域创建嵌套的
<area>/AGENTS.md
✅ 创建(差异=完整区域上下文)+ 添加根指针/sync
已存在但未记录的区域创建嵌套文档(仅由差异分割)❌ 标记「运行 /audit」/audit
创建或重构根目录的 AGENTS.md❌ 标记「运行 /audit」/audit
将规格的
**Status**:
行与其功能的范围状态协调(
planned
Proposed
in-progress
In Progress
done
Accepted
✅ 仅修改Status行/sync
编辑规格的内容 / 替换规格❌ 标记为过时/architect
协调范围,仅针对相关工作区的范围文件(并非所有
docs/scope/
),根据仓库证据(代码、测试、AGENTS.md)勾选任何已完成的子任务,更新状态
✅ 修正/sync
在范围中添加/重新排序功能或子任务❌ 不做修改/scope
覆盖或重写人工整理的 AGENTS.md 文本❌ 标记冲突人工
创建操作的分界线是上下文,而非策略:仅当此变更展示了完整区域时才创建;若区域早于变更且仅能看到部分内容,则交由 /audit 处理。若不确定,标记而非创建

Asks vs acts

请求与操作

Acts. Pauses only when there is nothing to sync (empty change set). Every edit to curated files is listed in the report so you can review or revert.
操作:仅当无内容可同步(空变更集)时才暂停。对人工整理文件的每一处编辑都会列在报告中,供你审核或回滚。

Artifact ownership

工件所有权

Owns exactly what the Boundaries table grants and writes nothing else. As the universal sub task reconciler it ticks any scope sub task it can verify from repo evidence (sweeping the
/test
/
/audit
/
/sync
sub tasks other skills don't tick) and advances feature status; exact rules in
agent-prompt.md
.
Artifact base. specs and the scope live under
docs/
by default, or
.workflow/
if
docs/
is a published docs site; use whichever base exists in the repo (paths here assume
docs/
).

仅拥有边界表授予的权限,不写入其他内容。作为通用子任务协调器,它会根据仓库证据勾选所有可验证的范围子任务(清理其他技能未勾选的
/test
/
/audit
/
/sync
子任务)并更新功能状态;具体规则见
agent-prompt.md
工件基础:规格和范围默认位于
docs/
下,若
docs/
是已发布的文档站点,则位于
.workflow/
下;使用仓库中存在的任意基础路径(此处路径假设为
docs/
)。

Portability (any OS, any agent)

可移植性(任意操作系统、任意Agent)

  • Commands:
    git
    is the only required CLI and behaves the same on every OS, run the
    git
    lines as shown. Other shell snippets are POSIX reference, not literal scripts: don't assume
    find
    ,
    grep
    ,
    sed
    ,
    cat
    ,
    test
    /
    [ ]
    ,
    ls
    , or
    xargs
    exist; use your agent's cross platform file tools and apply branching logic yourself rather than shell
    if
    /variables/redirects.
  • Bundled files: referenced by paths relative to this skill's folder. Resolve the folder to an absolute path (you already resolve these relative paths) and read
    agent-prompt.md
    yourself at write time (Step 3), not during the earlier steps.
  • The whole maintenance runs inline on the main thread, following the exact rules in
    agent-prompt.md
    (authoritative).
  • 命令
    git
    是唯一必需的CLI,且在所有操作系统上行为一致,按所示运行
    git
    命令。其他Shell代码段是POSIX参考,而非字面脚本:不要假设
    find
    grep
    sed
    cat
    test
    /
    [ ]
    ls
    xargs
    存在;使用Agent的跨平台文件工具,自行应用分支逻辑,而非Shell的
    if
    /变量/重定向。
  • 捆绑文件:通过相对于此技能文件夹的路径引用。将文件夹解析为绝对路径(你已能解析这些相对路径),并在写入时(步骤3)自行读取
    agent-prompt.md
    ,而非在早期步骤中读取。
  • 整个维护流程在主线程中内联运行,严格遵循**
    agent-prompt.md
    **中的规则(权威性)。

Execution

执行流程

1. Scope the change set (cheap, with per file status)

1. 确定变更集范围(低成本,含每个文件的状态)

Freshness first (teams):
git fetch --quiet
; if
git rev-list --count HEAD..origin/$BASE
> 0 you are behind
origin/$BASE
, warn the engineer to pull first, a teammate may have already synced these docs.
Base:
main
if
git rev-parse --verify main
succeeds, else
master
. Current branch:
git rev-parse --abbrev-ref HEAD
. Use
--name-status
(not
--name-only
); the net new area and orphan cleanup logic need Added vs Modified vs Deleted per file.
  • Current branch is the base, mode
    uncommitted
    :
    git diff --name-status HEAD
    .
  • Otherwise, mode
    branch
    :
    git merge-base "$BASE" HEAD
    , then
    git diff --name-status <merge-base>
    .
Either way, add untracked files from
git ls-files --others --exclude-standard
, each prefixed with an
A
status (matching the
--name-status
format). Note the mode, base, and merge base for the write step.
Remove duplicates, then filter to source files to sync from:
  • Drop documentation and config (
    AGENTS.md
    at any level,
    docs/**
    ,
    *.md
    ,
    test-preferences.json
    , lock files, generated output); /sync reads these as targets/context, never as a change source.
  • Drop test files (
    *.test.*
    ,
    *.spec.*
    ,
    __tests__/
    , etc.); tests aren't durable area conventions.
  • Keep the
    D
    (deleted) entries
    in a separate list; they drive orphan cleanup (Step 3) though they aren't synced from.
  • Keep dependency manifest changes in a separate list for tool discovery, even if they are config rather than source:
    package.json
    ,
    pyproject.toml
    ,
    requirements*.txt
    ,
    go.mod
    ,
    Cargo.toml
    ,
    composer.json
    ,
    Gemfile
    ,
    pubspec.yaml
    ,
    mix.exs
    ,
    *.csproj
    , and equivalent package manifests. Lock files are signals only; do not pass lockfile contents.
If no source files and no dependency manifest changes remain (only docs/tests/lock/generated files changed), stop, nothing to sync. Do not spawn.
优先保证新鲜度(团队场景)
git fetch --quiet
;若
git rev-list --count HEAD..origin/$BASE
> 0,说明你落后于
origin/$BASE
,提醒工程师先拉取代码,可能已有队友同步过这些文档。
基准分支:若
git rev-parse --verify main
执行成功则为
main
,否则为
master
。当前分支:
git rev-parse --abbrev-ref HEAD
。使用
--name-status
(而非
--name-only
);全新区域和孤儿清理逻辑需要每个文件的Added、Modified、Deleted状态。
  • 当前分支就是基准分支,模式为
    uncommitted
    git diff --name-status HEAD
  • 否则,模式为
    branch
    git merge-base "$BASE" HEAD
    ,然后
    git diff --name-status <merge-base>
无论哪种情况,添加
git ls-files --others --exclude-standard
中的未跟踪文件,每个文件前缀为
A
状态(匹配
--name-status
格式)。记录模式、基准分支和合并基准分支,供写入步骤使用。
移除重复项,然后过滤出要同步的源文件
  • 排除文档和配置文件(任意层级的AGENTS.md、
    docs/**
    *.md
    test-preferences.json
    、锁文件、生成的输出);/sync 将这些文件作为目标/上下文读取,绝不作为变更来源。
  • 排除测试文件
    *.test.*
    *.spec.*
    __tests__/
    等);测试不属于持久化区域约定。
  • 保留
    D
    (已删除)条目
    到单独列表中;它们会驱动孤儿清理(步骤3),尽管不会作为同步来源。
  • 保留依赖清单变更到单独列表用于工具发现,即使它们是配置而非源文件:
    package.json
    pyproject.toml
    requirements*.txt
    go.mod
    Cargo.toml
    composer.json
    Gemfile
    pubspec.yaml
    mix.exs
    *.csproj
    及等效的包清单。锁文件仅作为信号;不要传递锁文件内容。
若剩余源文件和依赖清单变更均为空(仅修改了文档/测试/锁文件/生成文件),停止执行,无内容可同步。无需生成子进程。

2. Locate the context files and specs (paths only, do NOT read them here)

2. 定位上下文文件和规格(仅路径,请勿在此处读取)

Using your agent's file search/glob tools:
  • Note whether a root
    AGENTS.md
    exists.
  • Find every
    AGENTS.md
    (root + nested), excluding
    node_modules/
    and
    .git/
    .
  • Find all specs under
    docs/specs/
    whose names start with a digit, sorted.
  • Find the scope file(s) whose workspace/features the diff actually touches (in a monorepo, a changed file's workspace
    apps/<x>/…
    selects
    docs/scope/<x>/
    ); never read or pass all of
    docs/scope/
    .
Note the paths plus the changed file list and diff command; read the files at write time. Read root AGENTS.md contents now (short and useful to anchor on). For each changed file, note its nearest enclosing directory with a
AGENTS.md
(root or nested); that's the context file most likely to need an update.
使用Agent的文件搜索/通配符工具:
  • 记录根目录是否存在AGENTS.md。
  • 查找所有AGENTS.md(根目录+嵌套目录),排除
    node_modules/
    .git/
  • 查找
    docs/specs/
    下所有名称以数字开头的规格文件,排序。
  • 查找差异实际涉及的工作区/功能对应的范围文件(在单体仓库中,变更文件的工作区
    apps/<x>/…
    对应
    docs/scope/<x>/
    );绝不读取或传递所有
    docs/scope/
    文件。
记录路径以及变更文件列表和diff命令;在写入时读取文件。现在读取根目录AGENTS.md的内容(简短且有助于锚定)。对于每个变更文件,记录其最近的包含AGENTS.md的父目录(根目录或嵌套目录);这是最可能需要更新的上下文文件。

2.5 Discover Agent Skills and optional MCPs for newly added tools

2.5 为新增工具发现Agent Skills和可选MCP

Run only when dependency manifests changed or the diff clearly adds a significant external tool. Skip ordinary utility libraries unless they define a durable workflow or integration.
  • Identify newly added significant packages/tools from the manifest diff, not the full lockfile: framework, router, styling/UI kit, database, ORM/query layer, auth/session, payments, email/notifications, storage/uploads, search, queue/background jobs, AI provider/vector DB, browser/runtime testing, observability, hosting/deploy. Include package names and common aliases from manifests. Do not stop after the first technology.
  • Filter out anything already covered by installed skills, connected MCPs, or
    AGENTS.md
    declined entries.
  • Ask before you search.
    <!-- TOOL-CONSENT:START (identical in /architect, /audit and /sync; edit all or none) -->
    Asking is mandatory. Searching is not. Nothing is searched, fetched, installed, or spawned for Agent Skill and MCP discovery until the engineer has picked. Offer four choices: find them for me, I will name the ones I want, no and record the decline, or not now. Only the first may run a search command. Never silently skip the offer, and never run a search before the engineer agrees to one.
    <!-- TOOL-CONSENT:END -->
    Name the tools this change added, say in one line that an Agent Skill gives the agent that tool's real conventions and an MCP server gives it live access to the real system, then ask: "Want me to find Agent Skills and MCP servers for the tools this change added?" (header
    Agent skills
    ), with
    Yes, find them for me
    (recommended) ·
    I'll name the ones I want
    ·
    No, skip it
    ·
    Not now, later
    . On
    Yes
    continue below. On
    I'll name the ones I want
    , take the list and go straight to the install step, searching for nothing. On
    No, skip it
    run nothing and record the decline. On
    Not now, later
    run nothing and note the candidate tools in the report.
  • Isolate the searches in a read only subagent (capability first, only after
    Yes
    ).
    Hand the remaining set to a discovery subagent rather than searching on the main thread: spawn it in the background (it does not block) if your agent supports that, else blocking; set its model explicitly to a fast, low cost tier (do not inherit the session model; on Claude Code spawn it as the
    researcher
    subagent type, which pins the model); it returns only the compact candidate list. This keeps the search output out of
    /sync
    's bounded context. No subagent → search inline; no search capability → skip and note it. The offer panel stays on the main thread.
  • For each remaining item, run
    npx skills find <tool-or-package>
    ; if weak, retry aliases from package/org names. Collect every credible Agent Skill candidate and confirm with
    npx skills add <owner>/<repo> --list
    when practical. If the CLI is interactive/unavailable, search
    "<tool>" "agent skill"
    and confirm before offering.
  • MCP search is optional: connector list first, else
    "<tool>" "MCP server"
    per item. MCP is recommended upside, not required.
  • Keep discovery capped and cacheable: max 5 web searches and 8 fetched pages total, official registry/docs first. Reuse
    docs/.agent-cache/tool-discovery/<slug>.md
    when under 30 days old, after filtering installed/declined items.
  • Offer all Agent Skill matches in one multi select panel, grouped by technology: "Install relevant Agent Skills for newly added tools?" plus skip/decline. Then offer MCPs separately: "Optional MCP servers that could help these tools" plus skip/decline. Never install or connect automatically.
  • Install selected skills with
    npx skills add <owner>/<repo> -y
    . For MCPs, point to the user's connector/MCP settings; once connected the tools are used automatically.
  • Carry the result as
    INSTALLED_SKILLS_OR_NONE
    ,
    MCP_SERVERS_OR_NONE
    , and
    DECLINED_TOOLS_OR_NONE
    and record durable lines in the right
    AGENTS.md
    file when you write. If nothing was found or no capability exists, treat as
    none
    .
仅当依赖清单变更或差异明确添加了重要外部工具时运行。普通工具库除非定义了持久化工作流或集成,否则跳过。
  • 从清单差异中识别新增的重要包/工具,而非完整锁文件:框架、路由、样式/UI套件、数据库、ORM/查询层、认证/会话、支付、邮件/通知、存储/上传、搜索、队列/后台任务、AI提供商/向量数据库、浏览器/运行时测试、可观测性、托管/部署。包含清单中的包名称和常用别名。不要在找到第一个技术后停止。
  • 过滤掉已被已安装技能、连接的MCP或AGENTS.md中已拒绝条目覆盖的内容。
  • 搜索前需询问
    <!-- TOOL-CONSENT:START (identical in /architect, /audit and /sync; edit all or none) -->
    询问是强制性的。搜索不是。 在工程师选择前,不会为Agent Skill和MCP发现进行任何搜索、获取、安装或生成操作。提供四个选项:帮我查找、我会指定想要的、不并记录拒绝、现在不用。只有第一个选项可运行搜索命令。绝不要静默跳过此提议,也绝不要在工程师同意前运行搜索。
    <!-- TOOL-CONSENT:END -->
    列出此变更添加的工具,用一句话说明Agent Skill可为Agent提供该工具的实际约定,MCP服务器可为Agent提供对真实系统的实时访问,然后询问:"需要我为此变更添加的工具查找Agent Skills和MCP服务器吗?"(标题
    Agent skills
    ),选项为
    Yes, find them for me
    (推荐)·
    I'll name the ones I want
    ·
    No, skip it
    ·
    Not now, later
    。选择
    Yes
    则继续下方操作。选择
    I'll name the ones I want
    ,接收列表后直接进入安装步骤,不进行搜索。选择
    No, skip it
    则不运行任何操作并记录拒绝。选择
    Not now, later
    则不运行任何操作并在报告中记录候选工具。
  • 在只读子Agent中隔离搜索(能力优先,仅在
    Yes
    后执行)
    。将剩余集合交给发现子Agent而非在主线程中搜索:若Agent支持,在后台生成它(不阻塞),否则阻塞执行;明确将其模型设置为快速、低成本的层级(不要继承会话模型;在Claude Code中,将其生成为
    researcher
    子Agent类型,固定模型);它仅返回紧凑的候选列表。这样可将搜索输出排除在/sync的有限上下文之外。若无子Agent则内联搜索;若无搜索能力则跳过并记录。提议面板保留在主线程中。
  • 对于每个剩余项,运行
    npx skills find <tool-or-package>
    ;若结果不理想,重试包/组织名称的别名。收集所有可信的Agent Skill候选,并在可行时用
    npx skills add <owner>/<repo> --list
    确认。若CLI是交互式/不可用,搜索
    "<tool>" "agent skill"
    并在提供前确认。
  • MCP搜索是可选的:优先查看连接器列表,否则为每个项搜索
    "<tool>" "MCP server"
    。MCP是推荐的增值项,非必需。
  • 限制发现次数并支持缓存:最多5次网页搜索和8次页面获取,优先官方注册表/文档。若
    docs/.agent-cache/tool-discovery/<slug>.md
    在30天内,过滤已安装/已拒绝项后复用。
  • 在一个多选面板中按技术分组提供所有Agent Skill匹配项:"为新增工具安装相关Agent Skills?"以及跳过/拒绝选项。然后单独提供MCP选项:"可辅助这些工具的可选MCP服务器"以及跳过/拒绝选项。绝不自动安装或连接。
  • 使用
    npx skills add <owner>/<repo> -y
    安装选中的技能。对于MCP,指向用户的连接器/MCP设置;连接后工具会自动使用。
  • 将结果记录为
    INSTALLED_SKILLS_OR_NONE
    MCP_SERVERS_OR_NONE
    DECLINED_TOOLS_OR_NONE
    ,并在写入时在对应的AGENTS.md文件中记录持久化行。若无结果或无对应能力,视为
    none

3. Do the maintenance (main thread)

3. 执行维护(主线程)

The main thread does the maintenance itself; it never hands the
AGENTS.md
/ scope / spec status edits to a subagent. Read
agent-prompt.md
now (only now, at write time) and follow it exactly; it is authoritative for the maintenance rules. The diff reading is the one thing you may offload, and only for a large change set, to a read only
scout
subagent on the cheapest model (Claude Code:
haiku
) that returns a compact map. Stay within the same boundaries the old tool grant expressed:
Edit
existing docs, scope, and spec
**Status**:
lines;
Write
strictly for a net new area nested AGENTS.md; no root creation, no spec content edits (Status line only), no shallow nested docs for established areas (these are rules in
agent-prompt.md
).
The inputs to apply:
  1. MODE
    ,
    BASE
    ,
    MERGE_BASE
    ,
    CHANGED_FILES
    (name status changed source list),
    DIFF_COMMAND
    (exact
    git diff
    command)
  2. DELETED_PATHS
    (deleted paths, for orphan cleanup)
  3. ROOT_AGENTS_MD
    (root AGENTS.md contents),
    NESTED_PATHS
    (nested AGENTS.md paths)
  4. SPEC_PATHS
    (all spec paths, for Status line reconciliation and staleness flagging)
  5. FILE_TO_CONTEXT_MAP
    (changed file → nearest context file)
  6. SCOPE_PATH_OR_NONE
    (relevant workspace scope path(s), not all of
    docs/scope/
    ; also the source of each linked feature's status for spec Status line reconciliation)
  7. INSTALLED_SKILLS_OR_NONE
    ,
    MCP_SERVERS_OR_NONE
    ,
    DECLINED_TOOLS_OR_NONE
    from Step 2.5
主线程自行执行维护操作;绝不将AGENTS.md/范围/规格Status行的编辑交给子Agent。现在(仅在写入时)读取
agent-prompt.md
并严格遵循;它是维护规则的权威来源。差异读取是唯一可卸载的操作,且仅针对大型变更集,交给最便宜模型的只读
scout
子Agent(Claude Code:
haiku
),返回紧凑的映射。保持在旧工具授权的边界内:
Edit
现有文档、范围和规格的
**Status**:
行;
Write
仅针对全新区域的嵌套AGENTS.md;不创建根目录文档,不编辑规格内容(仅Status行),不为已建立区域创建浅层嵌套文档(这些是
agent-prompt.md
中的规则)。
要应用的输入:
  1. MODE
    BASE
    MERGE_BASE
    CHANGED_FILES
    (带状态的变更源文件列表)、
    DIFF_COMMAND
    (精确的
    git diff
    命令)
  2. DELETED_PATHS
    (已删除路径,用于孤儿清理)
  3. ROOT_AGENTS_MD
    (根目录AGENTS.md内容)、
    NESTED_PATHS
    (嵌套AGENTS.md路径)
  4. SPEC_PATHS
    (所有规格路径,用于Status行协调和过时标记)
  5. FILE_TO_CONTEXT_MAP
    (变更文件→最近的上下文文件)
  6. SCOPE_PATH_OR_NONE
    (相关工作区的范围路径,并非所有
    docs/scope/
    ;也是关联功能状态的来源,用于规格Status行协调)
  7. 步骤2.5的
    INSTALLED_SKILLS_OR_NONE
    MCP_SERVERS_OR_NONE
    DECLINED_TOOLS_OR_NONE

4. Relay the result

4. 传递结果

If the maintenance failed or produced no parseable summary, report that and do it again, don't fabricate a result (a genuine
NOTHING_TO_SYNC
is a valid success; a crash or empty output is not). Otherwise relay the compact summary:
undefined
若维护失败或未生成可解析的摘要,报告此情况并重试,不要编造结果(真正的
NOTHING_TO_SYNC
是有效的成功;崩溃或空输出则不是)。否则传递紧凑的摘要:
undefined

/sync complete

/sync 完成

Scope: <N> changed files
AGENTS.md updated:
  • <path>
    , <what was added/corrected, one line> (or "no updates needed")
AGENTS.md created (new area):
  • <area>/AGENTS.md
    , <what conventions it captures> (+ root pointer added)
Orphans cleaned (after deletions):
  • <path>
    , <removed orphaned nested doc / fixed broken pointer>
Scope reconciled (relevant workspace):
  • <feature>
    , <ticked sub-tasks / status planned→in-progress→done to match the diff> (or "no scope, or already accurate")
Spec statuses reconciled (Status line only):
  • docs/specs/<file>
    , <Status Proposed→In Progress→Accepted to match the feature's scope status>
Specs flagged stale (run /architect to update or supersede):
  • docs/specs/<file>
    , <why the change makes it stale, or status mismatch sync couldn't safely resolve>
Context gaps (run /audit, area too established for /sync to document from the diff alone):
  • <area>
    , <pre-existing undocumented area only sliced by this change>
Conflicts left for you (not auto-edited):
  • <path>
    , <curated content that would need rewriting; decide manually>

Omit any section with no items. If everything was already current and nothing is stale, say so in one line. /sync does not run /architect or /audit for you; it points, you decide.

---
范围<N> 个变更文件
AGENTS.md 已更新:
  • <path>
    ,<添加/修正的内容,一行描述> (或"无需更新")
AGENTS.md 已创建(新区域):
  • <area>/AGENTS.md
    ,<捕获的约定内容>(+ 添加根指针)
已清理孤儿内容(删除后):
  • <path>
    ,<移除孤立的嵌套文档 / 修复损坏的指针>
范围已协调(相关工作区):
  • <feature>
    ,<勾选子任务 / 状态从planned→in-progress→done以匹配差异> (或"无范围,或已准确")
规格状态已协调(仅Status行):
  • docs/specs/<file>
    ,<状态从Proposed→In Progress→Accepted以匹配功能的范围状态>
标记为过时的规格(运行/architect更新或替换):
  • docs/specs/<file>
    ,<变更导致其过时的原因,或无法安全解决的状态不匹配>
上下文缺口(运行/audit,区域已成熟,无法仅通过差异由/sync记录):
  • <area>
    ,<已存在但未记录的区域,仅由此次变更分割>
留给你的冲突(未自动编辑):
  • <path>
    ,<需要重写的人工整理内容;请手动决定>

省略无内容的章节。若所有内容已为最新且无过时项,用一句话说明。/sync不会为你运行/architect或/audit;仅提供指引,由你决定。

---

Subagent prompt template

子Agent提示模板

See
agent-prompt.md
.
agent-prompt.md