Files
msd-core/docs/zh-CN/how-to/run-phases-autonomously.md
Tom Boucher 3bb2f8f1c5 docs: rebrand to GSD Core and restructure docs with Diataxis (#605)
* chore: wire docs/agents config into AGENTS.md Agent skills section

Add the `## Agent skills` discovery block pointing the engineering
skills at the existing docs/agents/{issue-tracker,triage-labels,domain}.md
files (issue tracker, triage label mapping, single-context domain docs).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs: rebrand to GSD Core and restructure docs with Diataxis

Reorganise the root README and docs/ around the Diataxis framework
(tutorials, how-to guides, reference, explanation), add new how-to
guides and schema references (STATE.md / CONTEXT.md / PLAN.md /
planning artifacts), and cross-link the whole set. Update the lone
legacy gsd-build reference to open-gsd; keep internal get-shit-done/
filesystem paths unchanged (directory rename tracked separately in
open-gsd/gsd-core#604). Regenerate the ja-JP, ko-KR, pt-BR and zh-CN
localised trees to mirror the new structure.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs: backfill changeset PR number (#605)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 08:13:09 -04:00

125 lines
4.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 如何自主运行阶段
无需人工干预地运行所有剩余阶段——或指定范围内的阶段——GSD 将自动完成每个阶段的讨论 → 规划 → 执行流程。
有关自主运行期间阶段循环的工作原理,请参阅[阶段循环](../explanation/the-phase-loop.md)。
---
## 前提条件
- 已有包含 `.planning/ROADMAP.md` 和 `.planning/STATE.md` 的活跃项目
- 所有要运行的阶段必须处于自主模式可驱动的状态(待处理或进行中;非已完成状态)
- 您关心的所有设计决策应已记录在 `PROJECT.md` 中,或通过之前的 `/gsd-discuss-phase` 捕获——自主模式仅在使用 `--interactive` 时才能交互式地处理灰色地带
---
## 运行所有剩余阶段
```bash
/gsd-autonomous
```
GSD 读取 `ROADMAP.md`,按数字顺序发现所有未完成的阶段,并对每个阶段执行讨论 → 规划 → 执行。所有阶段完成后,它会自动运行里程碑生命周期:审计 → 完成 → 清理。
---
## 运行特定范围的阶段
使用 `--from` 和 `--to` 来限定运行范围。两个标志都接受十进制阶段编号(例如 `3.1`)。
```bash
/gsd-autonomous --from 3 # 阶段 3、4、5 …(跳过已完成的阶段 1 和 2)
/gsd-autonomous --to 5 # 直到并包括阶段 5
/gsd-autonomous --from 3 --to 5 # 恰好是阶段 3、4 和 5
```
到达 `--to` 时,生命周期步骤会被跳过,因为并非所有里程碑阶段都已完成。完成横幅会告诉您如何继续:
```text
Resume with: /gsd-autonomous --from 6
```
---
## 以交互式讨论模式运行
默认情况下,自主模式使用智能讨论(批量表格提案)自动回答讨论问题。如果您希望自己回答设计问题,同时将规划和执行保持在主上下文之外:
```bash
/gsd-autonomous --interactive
```
交互模式下:
- `/gsd-discuss-phase` 内联运行并等待您的回答
- 规划和执行作为后台代理分发,以便您在讨论下一阶段时当前阶段仍在构建
- 主上下文保持精简——只有讨论对话会累积
---
## 哪些安全门控仍然适用
自主模式不会绕过 GSD 的质量流水线。每个阶段仍然会:
- 在执行前运行计划检查器
- 执行后读取 `VERIFICATION.md` 并根据结果进行路由
- 当验证状态为 `human_needed` 或 `gaps_found` 时暂停并询问您的处理意见
- 任何步骤失败时停止并提供选项(修复并重试、跳过阶段或停止)
与手动执行的唯一区别是:`passed` 状态的验证会自动推进——除非需要做出决策,否则不会在阶段间提示您。
包合法性门控也保持激活。如果计划中包含针对可疑包的 `checkpoint:human-verify` 任务,执行器将停止并显示检查点。自主模式不会静默安装被标记的包。
---
## 何时不使用自主模式
以下情况请勿使用 `/gsd-autonomous`:
- **阶段存在未解决的设计决策。** 如果您尚未运行 `/gsd-discuss-phase` 且 `PROJECT.md` 未捕获您的偏好,智能讨论将做出您可能不认同的自主选择。请先交互式地运行讨论,或使用 `--interactive`。
- **您需要对单个阶段进行精细控制。** 对于单个阶段,`/gsd-execute-phase N` 会提供逐步输出并允许您在继续之前做出反应。自主模式专为批量无人值守运行而设计。
- **阶段包含新颖或高风险的工作。** 自主模式除非遇到阻碍,否则会跳过暂停。对于预期有意外情况的阶段,请通过手动执行保持在循环中。
- **您正处于已部分执行的阶段中途。** 自主模式可以接管未完成的阶段,但不会恢复部分执行的波次。使用 `/gsd-execute-phase N` 完成已在进行中的阶段。
如果运行中途停止,请参阅[调试失败的执行](debug-a-failed-execution.md)了解如何诊断问题所在。
---
## 运行期间检查进度
自主模式在每个阶段前打印进度横幅:
```text
GSD ► AUTONOMOUS ▸ Phase 3/7: Auth Middleware [████░░░░] 28%
```
如果您需要在会话中途查看运行进度,请打开另一个终端并运行:
```bash
/gsd-progress
```
---
## 停止后恢复
如果自主模式停止——无论是您从阻碍提示中选择了"停止自主模式",还是会话被中断——请从停止处继续:
```bash
/gsd-autonomous --from 4 # 将 4 替换为第一个未完成的阶段编号
```
GSD 会自动跳过已完成的阶段,因此如果您不确定运行在何处停止,从较早的阶段编号重新运行是安全的。
---
## 相关内容
- [执行阶段](execute-a-phase.md)
- [调试失败的执行](debug-a-failed-execution.md)
- [命令](../COMMANDS.md)
- [文档索引](../README.md)