
Roadmap: Example【免费下载链接】get-shit-doneA light-weight and powerful meta-prompting, context engineering and spec-driven development system for Claude Code by TÂCHES.项目地址: https://gitcode.com/GitHub_Trending/getshi/get-shit-donev2.0 Active Milestone (Phases 2–5)Phase 2: Foundation(5/5 plans) — completedPhase 3: Pipeline(8/8 plans) — completedPhase 4: Next— pendingPhase 5: Final— pending v2.1 (Planned — Not Yet Scoped)Candidates pending milestone selection.Phase DetailsPhase 2: FoundationGoal: Foundation goal.Phase 3: PipelineGoal: Pipeline goal.Phase 4: NextGoal: Next goal.Phase 5: FinalGoal: Final goal.配合 STATE.md 中 milestone: v2.0修复前调用 extractCurrentMilestone 得到的切片止于 ### v2.1 标题行四个 ### Phase N: 详情全部丢失。 ## 三、源码级修复方案把尾部 Phase Details 块追加进切片 修复代码位于 [roadmap.ts](https://link.gitcode.com/i/1883c9c9aa5e3dae1ca56c3b6e22529e)核心思路是主切片照旧、尾部块补拼 **第一步定位通用标题。** 在主切片边界 sectionEnd 之后afterEnd content.slice(sectionEnd)用如下正则查找通用 Phase Details 标题 ts const genericPhaseDetailsRegex /^(#{1,3})\sPhase\sDetails\b[^\n]*$/im;要点只匹配字面标签Phase DetailsGSD ROADMAP 模板的规范写法标题级别限定 13 级捕获级别用于后续边界计算。注释明确说明只匹配Phase Details标签本身其他任何标题仍按原规则终结切片因此不会放大到任意标题。第二步为尾部块确定结束边界。从 Phase Details 标题行之后扫描下一个真实里程碑边界roadmap.tsconst nextRealMilestoneRegex new RegExp( ^#{1,${pdLevel}}\\s(?!Phase\\s\\S)(?!Phase\\sDetails\\b)(?:.*v(\\d(?:\\.\\d))[^\\n]*|.*(?:✅|||)), gmi );这个正则复用并叠加了三道守卫(?!Phase\s\S)#2619排除### Phase 12: …这类阶段标题被当作里程碑边界(?!Phase\sDetails\b)#3493 新增排除兄弟 Phase Details 标题提前终结当前块同版本continue带版本号的边界若与当前版本相同则跳过。扫描到的位置即为pdEnd未扫到则取 EOF。中间夹着的计划里程碑内容如### v2.1的正文自然被排除在追加块之外——正如 changeset 所说intervening planned-milestone content is skipped so it does not leak in。第三步有界追加并返回。phaseDetailsTail \n content.slice(pdStart, pdEnd); // ... return content.slice(sectionStart, sectionEnd) phaseDetailsTail;实现特意bounded to a single append——只做一次追加防止畸形 ROADMAP 触发循环同时该分支仅在sectionEnd content.length即主切片未已延伸到 EOF时激活避免重复拼接。四、故障链的另一端phaseInsert 为何依赖切片phase-lifecycle.ts 中的phaseInsert处理器展示了这个 bug 的最终爆炸点await readModifyWriteRoadmapMd(projectDir, async (rawContent) { const content await extractCurrentMilestone(rawContent, projectDir); // 在切片内匹配目标阶段的详情标题 const targetPattern new RegExp(#{2,4}\\s*Phase\\s0*${afterPhaseEscaped}:, i); if (!targetPattern.test(content)) { // 仅当切片里只有清单条目、没有详情段时给出更精确的提示#3098 parity ... throw new GSDError(Phase ${afterPhase} not found in ROADMAP.md, ErrorClassification.Validation); }【免费下载链接】get-shit-doneA light-weight and powerful meta-prompting, context engineering and spec-driven development system for Claude Code by TÂCHES.项目地址: https://gitcode.com/GitHub_Trending/getshi/get-shit-done创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考