Mechanical rename produced by scripts/msd-rename.cjs: gsd/Gsd/GSD -> msd/Msd/MSD across contents and paths, upstream package/repo coordinates -> @golem15/msd-core and golem15com/msd-core. Deep links into upstream history, sibling upstream packages, the GSD-2 import feature, CHANGELOG.md and .changeset/ are kept as-is. Hand edits on top: MSD block-letter banner and logos, LICENSE copyright line, package/plugin identity, regenerated lockfile, install-tree fixtures, derived registries and benchmark baseline; migration checksum baseline re-locked (MSD keeps its own install state, so no install had applied the old sums); sort-order and regex-escaped expectations in tests adjusted.
65 lines
1.2 KiB
Markdown
65 lines
1.2 KiB
Markdown
# 小数阶段计算
|
|
|
|
为紧急插入计算下一个小数阶段编号。
|
|
|
|
## 使用 msd-tools.cjs query
|
|
|
|
```bash
|
|
# 获取阶段 6 之后的下一个小数阶段
|
|
msd-tools.cjs query phase.next-decimal 6
|
|
```
|
|
|
|
输出:
|
|
```json
|
|
{
|
|
"found": true,
|
|
"base_phase": "06",
|
|
"next": "06.1",
|
|
"existing": []
|
|
}
|
|
```
|
|
|
|
已有小数时:
|
|
```json
|
|
{
|
|
"found": true,
|
|
"base_phase": "06",
|
|
"next": "06.3",
|
|
"existing": ["06.1", "06.2"]
|
|
}
|
|
```
|
|
|
|
## 提取值
|
|
|
|
```bash
|
|
DECIMAL_PHASE=$(msd-tools.cjs query phase.next-decimal "${AFTER_PHASE}" --pick next)
|
|
BASE_PHASE=$(msd-tools.cjs query phase.next-decimal "${AFTER_PHASE}" --pick base_phase)
|
|
```
|
|
|
|
或使用 --raw 标志:
|
|
```bash
|
|
DECIMAL_PHASE=$(msd-tools.cjs query phase.next-decimal "${AFTER_PHASE}" --raw)
|
|
# 返回: 06.1
|
|
```
|
|
|
|
## 示例
|
|
|
|
| 已有阶段 | 下一个阶段 |
|
|
|----------|------------|
|
|
| 仅 06 | 06.1 |
|
|
| 06, 06.1 | 06.2 |
|
|
| 06, 06.1, 06.2 | 06.3 |
|
|
| 06, 06.1, 06.3(有空缺)| 06.4 |
|
|
|
|
## 目录命名
|
|
|
|
小数阶段目录使用完整的小数编号:
|
|
|
|
```bash
|
|
SLUG=$(msd-tools.cjs query generate-slug "$DESCRIPTION" --raw)
|
|
PHASE_DIR=".planning/phases/${DECIMAL_PHASE}-${SLUG}"
|
|
mkdir -p "$PHASE_DIR"
|
|
```
|
|
|
|
示例:`.planning/phases/06.1-fix-critical-auth-bug/`
|