Files
meta/skills/ste100-sync/SKILL.md
T
jiantw83 5aa4a3da57 feat(skills): 新增技能盤點頁與共用部署驗證流程,並把技能驗證移到新行程
技能盤點以前只回到對話裡,換一台機器就得重跑才知道裝了什麼。
現在新增技能盤點這個 wiki 頁類型,雜湊取「主機、工具名稱、登入帳號」三段。
每支 CLI 各有自己的 plugin 集合,也各有自己的 hook 接線,那是互相獨立的事實。
少了工具名稱那一段,同一台機器上五支 CLI 會算出同一個雜湊,五份盤點互相覆蓋,
讀的人還看不出被蓋掉。技能盤點新增寫入這兩頁的步驟,整步規定必須開 sub agent。
兩份樣板刻意分開:內容頁每次盤點覆寫整頁,目錄頁只更新自己那一列,
兩者的寫入語意剛好相反,合成一份遲早有人把別台機器的紀錄刪掉。

四支異動技能原本在部署完的同一個工作階段,就叫用剛做好的技能。
部署收尾自己立起重啟閘門,那支技能必被擋下,驗證做不完。
解法不是把它加進豁免清單。豁免擋得住閘門,擋不住「行程還載著舊版」這件事,
硬過關驗到的是舊版行為,等於假通過。所以把判路線、部署、驗證、失敗分流
抽成一份共用說明,驗證一律另開 CLI 行程執行,四支技能只留一行指標指過去。

新增腳本檢查工具,一次做完語法、執行權限與結束碼宣告三項檢查,
只被 source 的函式庫豁免後兩項,而且逐支記在錯誤輸出,不靜默略過。
新增部署路線判定工具,判定改動有沒有進存取庫的預設分支,
取代四支技能各抄一段、各自漂移的散文;判不出來就回報停下,不自己挑路線走。

同時把四支技能裡的中文段落抽到共用說明、指標改回英文,
修正六處相對路徑,把技能盤點的模糊描述改成查得出來的條件,
並讓 manifest 同步的每一個呼叫端逐碼分流。

七支技能改為併行執行:例行稽核從九步併成七步,技能盤點併成六步。
技能盤點不再重跑盤點腳本內部已經跑過的三支腳本,
而那三支原本兼作獨立交叉檢查,拿掉就少一層保護,
所以把少掉的是什麼、風險由誰擋住,明白寫進 Notes,不當作沒發生。
2026-08-31 11:11:12 +08:00

35 lines
5.5 KiB
Markdown

---
name: ste100-sync
description: Sync the STE100 language rules with upstream speak-human-tw. Compare the pinned upstream version in references/ste100.md against the raw upstream frontmatter version before cloning anything, distill applicable changes and confirm each one via decision tree, refresh ste100-lint.sh patterns and jsc-hooks simplified.txt, re-lint all jsc repos in parallel, then open a PR via jsc-git pr. Use on periodic maintenance or when upstream releases a new version; not for editing local-only rules.
---
# ste100-sync
Keep `references/ste100.md` in sync with its upstream source, [speak-human-tw](https://github.com/Raymondhou0917/speak-human-tw) (MIT).
## Steps
1. Compare versions before fetching anything large — the common case is that upstream has no new release, and a clone done first is then wasted every time:
1. Read the pinned version from the「上游版本」line in `references/ste100.md`. Completion condition: the pinned version string is in hand.
2. Read the upstream `version` from the raw `SKILL.md` frontmatter over HTTPS, without cloning. When the raw read fails — network error, a moved path, or no `version` line in the frontmatter — fall back to the `--depth 1` clone and read the same field from the working copy. Completion condition: the upstream version string is in hand, and the report names which route produced it, raw or clone.
3. Same version: report「上游沒有新版」and stop, without cloning. Completion condition: either the run stops here, or the upstream version is newer than the pinned one.
2. Newer version — get the changelog. Clone the upstream repo (`--depth 1`) when step 1.2 did not already clone it, and read the `changelog` field in its `SKILL.md` frontmatter. Completion condition: the changelog entries newer than the pinned version are in hand.
3. Distill the changes into a change list. **MUST run as a sub agent**:
- Walk the changelog entries newer than the pinned version.
- Keep only changes that apply to technical documents and conversation: Taiwan term replacements, punctuation rules, de-AI patterns, humanize targets.
- Drop marketing-copy scenes, eval material, and workflow-mode changes.
- Decide nothing and edit no file. Report one line per candidate change: the rule, the upstream wording, and what it would change in `references/ste100.md` or in the lint patterns.
Completion condition: every kept changelog entry appears as one line in the distilled list.
4. Present the distilled list via the `jsc-ask:ask` decision tree, one question per change (adopt / drop / adapt). Every option states its impact scope (example: adopting a term replacement changes the `TERMS` pattern, so every repo re-linted in step 7 can gain new hits). `references/ste100.md` is the single source of truth for the whole skill set, so no change lands without a recorded decision. Completion condition: every distilled change has a recorded decision.
5. Apply the adopted and adapted changes to `references/ste100.md`. Keep its trimmed structure. Update the「上游版本」line. Completion condition: every adopted change is visible in the file and the「上游版本」line shows the new upstream version.
6. If the replacement table or the cliché list changed, update the `TERMS`, `CLICHES` and `SIMPLIFIED_FALLBACK` patterns in `tools/ste100-lint.sh`. `SIMPLIFIED` is the runtime variable the lint builds from the shared character table, not an editable pattern: the real source is `jsc-hooks/hooks/simplified.txt`, which `ste100-guard.sh` reads too, and `SIMPLIFIED_FALLBACK` is only the built-in backup for machines without `jsc-hooks`. A simplified-character change therefore lands in `simplified.txt` first and in `SIMPLIFIED_FALLBACK` second — editing the lint alone leaves the hook enforcing the old table. Completion condition: `sh -n tools/ste100-lint.sh` passes, each newly adopted term hits on a test string, and any simplified-character change is in `jsc-hooks/hooks/simplified.txt` as well.
7. Run `tools/ste100-lint.sh` over every jsc repo (`tools/sync-domains.sh` prints the repo paths). The repos are independent, so lint them **in parallel**, one run per repo. Route each exit code: 0 — that repo is clean; 1 — hits printed as `{檔案}:{行號}:{類別}:{命中內容}`; 2 — no target was given, so fix the arguments and rerun, never read it as clean. Fix hits in files this repo owns. Completion condition: the lint exits 0 for this repo, and hits in other repos are reported with `file:line` for their owners.
8. Run `tools/sync-skill-manifest.sh .` to sync the README's 「Skills 目錄」 section and bump the manifests. Route each exit code: 0 — the README block and all three manifests are synced; 1 — `skills/`, `README.md`, the `JSC-SKILLS` markers, a `SKILL.md`, a manifest, or a manifest `version` field is missing, so fix the named cause on stderr and rerun; 2 — usage error, the script takes exactly one argument; any other code — the script runs under `set -e`, so treat it as an environment fault and stop, never as a successful sync. Completion condition: all three manifests show the same new version.
9. Open a PR via `jsc-git:pr`. Completion condition: a PR URL comes back and is reported with the table format in [`../../references/pr-report.md`](../../references/pr-report.md).
## Notes
- Generated wiki content, commit messages, and PR descriptions stay in Traditional Chinese per the guidelines; only the rule distillation is at stake here.
- This skill fits the maintenance flow: list it as a maintenance method for the `plugins/meta` repo in `jsc-sdlc:maintain`.