What:新增 tools/stage-report.sh 與 references/stage-report.md,四支階段技能各加一步收尾回報:模型能力標籤判定、工作日誌連結、所有寫入的 wiki 連結;實作階段再加工作目錄與來源、工作、目標三條分支。 Why:階段跑完該交代什麼是固定的,寫在內文靠模型自己記,少一項看不出來。沒寫工作日誌更是如此——內容只留在對話裡,換一個工作階段就沒了。 How:彙整搬到程式層。頁名換絕對網址、commit 數與推送狀態由 git 現查、來源分支在不在遠端也由腳本判定;模型閘門那一列只轉述 sdlc-gate.sh report,不自評。沒有工作日誌就警告使用者檢查,並把內容交給 jsc-log 的暫存區,下次寫日誌一併寫入。結束碼 1 是警告不是阻擋,提前停下來也要回報。 Who:跑 SDLC 四階段的人,以及接手看紀錄的人。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
4.4 KiB
name: maintain description: SDLC maintenance stage. Gate on capability tags enforced in code by sdlc-gate (maintenance requires no specific tag, but the actual model id must be determinable from the transcript), read projects still inside their maintenance window from MAINTAIN_CONTENTS, then run one sub agent per project: switch to develop or master, propose at least five maintenance actions, commit to a new branch, push, and PR. Update the last-maintained timestamp afterward, then close with tools/stage-report.sh - model tag verdict, worklog link, every wiki link written. Use for periodic upkeep of delivered projects inside their maintenance window; not for projects still mid-implementation or not yet registered in MAINTAIN_CONTENTS.
maintain
Goal: run routine maintenance for every project in the maintenance contents page.
All wiki reads and writes go through jsc-gitea:wiki.
Steps
- Model gate and stage lock — run
jsc-cli/tools/model-tags.sh sync, thenjsc-hooks/hooks/sdlc-gate.sh lock maintain. This stage requires no specific capability tag; the gate passes as long as the script can determine the actual model id. Rules:references/model-gate.md. Completion condition: the script exited 0, and you have reported the stage, the required tag, the actual model id it read from the transcript, and the verdict. - Read
MAINTAIN_CONTENTSviajsc-gitea:wikiand filter projects still inside their maintenance window: start date ≤ today, and (end date is NULL or ≥ today). Completion condition: you have listed every in-window project with its{owner}/{repo}and window dates, or reported that none is in window and stopped. - Every project MUST run as a sub agent with this flow. Completion condition: every project listed in step 2 has its sub agent finished, and each one ends in either a PR link or a recorded skip reason.
-
Run
git fetch --prune origin, then put the project on its maintenance branch and align it withorigin/{branch}. Which branch that is, the remote-is-the-basis rule, the diverged case and the never-pull-never-reset rule all live inreferences/branch.md; never guess the branch name. Completion condition: the project's HEAD points at the same commit asorigin/{branch}, or you have reported the gap and skipped this project. -
Propose at least five maintenance methods, then let the user pick per
jsc-ask:askrules — every option states its impact scope (which files it touches, whether it can break the build, how much review it costs). Candidates:- dependency updates (reuse
jsc-pkg:pkg-update) - security vulnerability scan and patching
- dead code and stale comment cleanup
- test coverage reinforcement
- docs and README synchronization
- build warning elimination
Completion condition: the user has picked the methods to apply, and every picked method is either applied or reported with the reason it could not be.
- dependency updates (reuse
-
Commit the changes to a new branch per
jsc-git:commit, push, then open a PR perjsc-git:prback to the branch of step 3.1, passing it explicitly as the base. Completion condition: the PR exists, and you have reported its URL and number. -
Update the project's last-maintained field (the zh-TW column 「前次維護時間」) in
MAINTAIN_CONTENTSto today. Completion condition:MAINTAIN_CONTENTSshows today's date in 「前次維護時間」 for that project, saved on the wiki.
-
- The main agent reports the summary: maintenance methods applied per project, PR links, and failure reasons. The report and all generated wiki content, commits, and PR descriptions stay Traditional Chinese per the STE100 rule. Completion condition: the summary names every project read in step 2, each with its applied methods and either a PR link or the reason it was skipped.
- Stage report — the last thing this stage does, including when no project was in window. Run
tools/stage-report.sh maintainwith one--page MAINTAIN:{page}per wiki page this run wrote (MAINTAIN_CONTENTScounts), plus--worklogand--worklog-headingwhen a work log entry exists. No work log yet: write this stage's log content to a file and pass--pending-file {file} --log-hash {HASH}so it is held for the nextjsc-log:worklogrun. Rules and exit codes:references/stage-report.md. Exit 1 is a warning, never a block. Completion condition: the script's output is reported to the user verbatim, and every wiki page this run wrote appears in it.