Files
jiantw83andClaude Sonnet 5 1030f9d403 feat(shared): 新增14個共用spec、models/todo工具與樣板產生器,收斂跨repo重複規範
依 todo.md 執行的規範治理專案:新增 spec-preflight 等 14 個共用規範(含
conventional-commit/pull-request/git-push/issue-read/todo-list/ask-user/
subagent/no-scratch-files/skill-invocation/script-path/action-scaffold/
node-src-layout/plugin-cli/model),擴充 spec-git-safety 與 spec-gitea(token
優先序、機密遮蔽、Wiki 頁名轉義規則);新增可執行 skill `models`(模型能力
查詢與標籤)與 `todo`(依指定模型產生/附加 todo.md);新增 plugin.meta.json
單一事實來源與 gen-plugin-files.mjs 樣板產生器,統一四個 repo 的 manifest/
README/AGENTS.md 並移除寫死的本機使用者路徑;新增 shared/scripts/lib 的
log/機密遮蔽三語言參考實作。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-11 06:02:30 +00:00

34 lines
1.7 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# ==============================================================================
# 用途:時間戳與 log 格式的參考實作(bash 版)。對應 /jsc-shared:spec-time-log
# 規範:更新時間一律 Asia/Taipei、固定 yyyy/MM/dd HH:mm:ss;輸出訊息一律
# [時間][階段][等級]: 訊息、一行一則、走 stderr。本檔案不會被其他 repo
# 跨 repo 直接 source/呼叫,純供其他 repo 的腳本對照複製或標註對應關係
# (原始寫法見 doc/scripts/worklog/worklog.sh 第23-33行附近)。
# 更新時間:2026/08/11 00:00:00
# 相依:bash、coreutils date(需支援 TZ 環境變數)。
# ==============================================================================
# ------------------------------------------------------------------------------
# now_taipei:回傳 Asia/Taipei 時區的 yyyy/MM/dd HH:mm:ss 時間字串
# ------------------------------------------------------------------------------
now_taipei() {
TZ='Asia/Taipei' date +'%Y/%m/%d %H:%M:%S'
}
# ------------------------------------------------------------------------------
# log:輸出統一格式訊息([時間][階段][等級]: 訊息,一行一則),一律走 stderr
# $1 = level(INF/WRN/ERR/TRC/DBG)
# $2 = message
# $3 = stage(選填;空則不輸出 [階段] 區塊)
# ------------------------------------------------------------------------------
log() {
local level="$1" message="$2" stage="${3:-}" stamp
stamp="$(now_taipei)"
if [ -n "$stage" ]; then
printf '[%s][%s][%s]: %s\n' "$stamp" "$stage" "$level" "$message" >&2
else
printf '[%s][%s]: %s\n' "$stamp" "$level" "$message" >&2
fi
}