docs(sdlc-plan,sdlc-analyze): 兩份正本各自起停自己的錶

起錶與停錶寫在同一份正本裡成對出現,讀的人一眼看得出這段計時涵蓋到哪;兩份各加一節
「計時範圍」把兩端指出來。

sdlc-plan 記兩段:議題建立之前那段在第一步記下開始時間、議題建立之後以補登記上去;
之後起錶,回報那一步停錶。補登排在議題建立之後、起錶之前,順序反過來的話補登會被
time-log 當成「這一步做過了」而跳過。

sdlc-analyze 在它分析的那顆需求議題上起錶,起點放在第一段開頭——分析最耗時的正是
共識之前那一段,從第二段才起的話那段時間永遠是零。因此「共識摘要之前不對 Gitea
產生任何寫入」改寫成「不寫入任何**內容**」,並把碼錶明文除外、寫上理由:它記的是
工時,不是內容。這一條與 repo 擁有者確認過。

sdlc-feat 的「碼錶一律由使用者自己停」收斂成「**別顆議題上的**錶一律由使用者自己停」
——它原本讀起來像全域規則,而現在每道指令都會停自己起的那一支。

正本之間改以步驟**名稱**互指,不用編號:編號會整批位移,名字不會。測試跟著改用新的
promptStep 輔助函式,以名字框出某一步的內容,別人插一步時不會無聲地框到另一段上。

議題 #57

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-17 19:32:37 +08:00
co-authored by Claude Opus 5
parent 81d02bffcf
commit 7ee050de2f
9 changed files with 246 additions and 36 deletions
+7 -5
View File
@@ -3,13 +3,15 @@
*/
import test from 'node:test';
import assert from 'node:assert/strict';
import { readPrompt, readTemplateFile } from './helpers/prompt-doc.js';
import { promptStep, readPrompt, readTemplateFile } from './helpers/prompt-doc.js';
const template = readTemplateFile('overview-artifact.html');
const planPrompt = readPrompt('sdlc-plan');
const analyzePrompt = readPrompt('sdlc-analyze');
/** 只看產生總覽那一步,避免拿整份正本的任何一處來充數 */
const planStep = planPrompt.slice(planPrompt.indexOf('### 6.'), planPrompt.indexOf('### 7.'));
const planStep = promptStep(planPrompt, '產生圖解版總覽');
/** 分析版的那一步,同樣只看它自己 */
const analyzeStep = promptStep(analyzePrompt, '產生分析版的圖解總覽');
/** 模板要填的欄位 */
const PLACEHOLDERS = ['標題', '來源議題', '總覽', '目標', '流程圖', '工作包全景', '頁尾'];
@@ -86,7 +88,7 @@ test('正本說明這份網頁是給非技術的人看的', () => {
// ── sdlc-analyze 的步驟 ────────────────────────────────────────────
test('分析正本的全景圖用 graph TD,並畫出相依與時程', () => {
const step = analyzePrompt.slice(analyzePrompt.indexOf('### 11.'));
const step = analyzeStep;
assert.match(step, /graph TD/);
assert.match(step, /相依/);
assert.match(step, /截止日/);
@@ -97,13 +99,13 @@ test('分析正本沿用同一份模板,不另立一份', () => {
});
test('全景圖一樣有節點上限,超過時的做法有交代', () => {
const step = analyzePrompt.slice(analyzePrompt.indexOf('### 11.'));
const step = analyzeStep;
assert.match(step, /12/);
assert.match(step, /最長路徑/);
});
test('分析正本說明重跑會就地更新,不會留下兩個連結', () => {
const step = analyzePrompt.slice(analyzePrompt.indexOf('### 11.'));
const step = analyzeStep;
assert.match(step, /就地更新/);
assert.match(step, /只掛一個總覽網址/);
});