Files
msd-core/docs/zh-CN/references/phase-argument-parsing.md
Tom Boucher b2f4aa9435 docs(#2420): clean stale get-shit-done/ path refs in translated docs (#2421)
After the package/repo rename in #604, the English docs were updated to
use gsd-core/... paths, but the four translated doc trees (ja-JP, zh-CN,
ko-KR, pt-BR) and .changeset/README.md were never updated and still
referenced the pre-rename get-shit-done/ runtime directory, which no
longer exists.

This commit brings the translations in line with the English docs:

  - docs/{ja-JP,zh-CN,ko-KR,pt-BR}/**/*.md (57 files):
      get-shit-done/ -> gsd-core/  (path references)
      #references-get-shit-donereferencesmd -> #references-gsd-corereferencesmd
                                            (anchor in INVENTORY -> ARCHITECTURE links)
  - .changeset/README.md:9 issue URL:
      open-gsd/get-shit-done-redux -> open-gsd/gsd-core

Legacy references intentionally preserved (historical record):
  - CHANGELOG.md, .changeset/archived/*, docs/RELEASE-NOTES-LEGACY.md
  - docs/cleanup-get-shit-done-cc.md, docs/adr/*, docs/research/*
  - docs/{ja-JP,ko-KR}/superpowers/plans/2026-03-18-* (developer's local paths)
  - docs/{INVENTORY,README,FEATURES,installer-migrations}.md (rename-history
    descriptions, some tagged <!-- gsd-allow-legacy-name -->)
  - Code/tests implementing or testing legacy-cleanup logic
    (bin/install.js, gsd-core/bin/lib/legacy-cleanup.cjs,
    scripts/lint-legacy-dir-name.cjs, migration sources/tests)

No source code changes — documentation only.

Fixes #2420
2026-07-18 23:11:15 -04:00

61 lines
1.5 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.
# 阶段参数解析
为操作阶段的命令解析和规范化阶段参数。
## 提取
从 `$ARGUMENTS` 中:
- 提取阶段编号(第一个数字参数)
- 提取标志(以 `--` 为前缀)
- 剩余文本为描述(用于 insert/add 命令)
## 使用 gsd-tools
`find-phase` 命令一步完成规范化和验证:
```bash
PHASE_INFO=$(node "$HOME/.claude/gsd-core/bin/gsd-tools.cjs" find-phase "${PHASE}")
```
返回 JSON 包含:
- `found`: true/false
- `directory`: 阶段目录的完整路径
- `phase_number`: 规范化的编号(如 "06"、"06.1")
- `phase_name`: 名称部分(如 "foundation")
- `plans`: PLAN.md 文件数组
- `summaries`: SUMMARY.md 文件数组
## 手动规范化(遗留)
将整数阶段补零到 2 位。保留小数后缀。
```bash
# 规范化阶段编号
if [[ "$PHASE" =~ ^[0-9]+$ ]]; then
# 整数: 8 → 08
PHASE=$(printf "%02d" "$PHASE")
elif [[ "$PHASE" =~ ^([0-9]+)\.([0-9]+)$ ]]; then
# 小数: 2.1 → 02.1
PHASE=$(printf "%02d.%s" "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}")
fi
```
## 验证
使用 `roadmap get-phase` 验证阶段存在:
```bash
PHASE_CHECK=$(node "$HOME/.claude/gsd-core/bin/gsd-tools.cjs" roadmap get-phase "${PHASE}")
if [ "$(printf '%s\n' "$PHASE_CHECK" | jq -r '.found')" = "false" ]; then
echo "ERROR: Phase ${PHASE} not found in roadmap"
exit 1
fi
```
## 目录查找
使用 `find-phase` 进行目录查找:
```bash
PHASE_DIR=$(node "$HOME/.claude/gsd-core/bin/gsd-tools.cjs" find-phase "${PHASE}" --raw)
```