fix/marketplace-sync-worklog-hash-refactor #5

Merged
admin merged 2 commits from fix/marketplace-sync-worklog-hash-refactor into develop 2026-08-24 07:58:59 +00:00
8 changed files with 37 additions and 37 deletions
+24 -10
View File
@@ -1,75 +1,89 @@
{ {
"name": "jsc", "name": "jsc",
"description": "jsc 跨 AI 助理技能組的統一 marketplace(claude / codex / copilot / antigravity / kiro)。",
"owner": {
"name": "JSC"
},
"plugins": [ "plugins": [
{ {
"name": "jsc-ask", "name": "jsc-ask",
"source": { "source": {
"source": "url", "source": "url",
"url": "https://gitea.jsc.idv.tw/plugins/ask.git" "url": "https://gitea.jsc.idv.tw/plugins/ask.git"
} },
"description": "決策樹問詢與問詢紀錄(QUESTION_* wiki 頁)"
}, },
{ {
"name": "jsc-cli", "name": "jsc-cli",
"source": { "source": {
"source": "url", "source": "url",
"url": "https://gitea.jsc.idv.tw/plugins/cli.git" "url": "https://gitea.jsc.idv.tw/plugins/cli.git"
} },
"description": "CLI 偵測、模型能力標籤與技能庫批次部署"
}, },
{ {
"name": "jsc-git", "name": "jsc-git",
"source": { "source": {
"source": "url", "source": "url",
"url": "https://gitea.jsc.idv.tw/plugins/git.git" "url": "https://gitea.jsc.idv.tw/plugins/git.git"
} },
"description": "Commit 分組認可與 Push Request 建立"
}, },
{ {
"name": "jsc-gitea", "name": "jsc-gitea",
"source": { "source": {
"source": "url", "source": "url",
"url": "https://gitea.jsc.idv.tw/plugins/gitea.git" "url": "https://gitea.jsc.idv.tw/plugins/gitea.git"
} },
"description": "Gitea API 工具、Wiki 讀寫與存取庫批次同步"
}, },
{ {
"name": "jsc-hooks", "name": "jsc-hooks",
"source": { "source": {
"source": "url", "source": "url",
"url": "https://gitea.jsc.idv.tw/plugins/hooks.git" "url": "https://gitea.jsc.idv.tw/plugins/hooks.git"
} },
"description": "跨 CLI hooks:STE100 語言強制、工時計時、技能用量記錄"
}, },
{ {
"name": "jsc-log", "name": "jsc-log",
"source": { "source": {
"source": "url", "source": "url",
"url": "https://gitea.jsc.idv.tw/plugins/log.git" "url": "https://gitea.jsc.idv.tw/plugins/log.git"
} },
"description": "工作日誌(LOG_* wiki 頁)與技能使用統計"
}, },
{ {
"name": "jsc-meta", "name": "jsc-meta",
"source": { "source": {
"source": "url", "source": "url",
"url": "https://gitea.jsc.idv.tw/plugins/meta.git" "url": "https://gitea.jsc.idv.tw/plugins/meta.git"
} },
"description": "技能組自我管理:新建、更新、刪除技能與技能準則"
}, },
{ {
"name": "jsc-pkg", "name": "jsc-pkg",
"source": { "source": {
"source": "url", "source": "url",
"url": "https://gitea.jsc.idv.tw/plugins/pkg.git" "url": "https://gitea.jsc.idv.tw/plugins/pkg.git"
} },
"description": "套件批次更新(nodejs/python/dotnet),失敗還原"
}, },
{ {
"name": "jsc-review", "name": "jsc-review",
"source": { "source": {
"source": "url", "source": "url",
"url": "https://gitea.jsc.idv.tw/plugins/review.git" "url": "https://gitea.jsc.idv.tw/plugins/review.git"
} },
"description": "程式碼審查:Refactoring 壞味道六組 + 註解規範 + 淺模組"
}, },
{ {
"name": "jsc-sdlc", "name": "jsc-sdlc",
"source": { "source": {
"source": "url", "source": "url",
"url": "https://gitea.jsc.idv.tw/plugins/sdlc.git" "url": "https://gitea.jsc.idv.tw/plugins/sdlc.git"
} },
"description": "開發生命週期:規劃/分析/實作/維護(wiki 追蹤)"
} }
] ]
} }
+1 -1
View File
@@ -59,7 +59,7 @@
"source": "url", "source": "url",
"url": "https://gitea.jsc.idv.tw/plugins/meta.git" "url": "https://gitea.jsc.idv.tw/plugins/meta.git"
}, },
"description": "技能組自我管理:新建/更新/刪除技能與技能準則" "description": "技能組自我管理:新建、更新、刪除技能與技能準則"
}, },
{ {
"name": "jsc-pkg", "name": "jsc-pkg",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "jsc-log", "name": "jsc-log",
"version": "0.0.3", "version": "0.0.4",
"description": "工作日誌(LOG_{HASH} wiki 頁)、技能使用統計與教訓紀錄(LEARN_{HASH} wiki 頁)", "description": "工作日誌(LOG_{HASH} wiki 頁)、技能使用統計與教訓紀錄(LEARN_{HASH} wiki 頁)",
"skills": "./skills", "skills": "./skills",
"author": { "author": {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "jsc-log", "name": "jsc-log",
"version": "0.0.3", "version": "0.0.4",
"description": "工作日誌(LOG_{HASH} wiki 頁)、技能使用統計與教訓紀錄(LEARN_{HASH} wiki 頁)", "description": "工作日誌(LOG_{HASH} wiki 頁)、技能使用統計與教訓紀錄(LEARN_{HASH} wiki 頁)",
"skills": "./skills" "skills": "./skills"
} }
+1 -1
View File
@@ -21,7 +21,7 @@ Marketplace 統一為 `jsc`(https://gitea.jsc.idv.tw/plugins/jsc.git),安
| 工具 | 用途 | | 工具 | 用途 |
| --- | --- | | --- | --- |
| `tools/usage-stats.sh` | 聚合 `$JSC_HOME/usage/*.jsonl`:`skills` 列技能使用次數、`chains` 列呼叫鏈次數(皆降冪),`--cli <name>` 過濾 | | `tools/usage-stats.sh` | 聚合 `$JSC_HOME/usage/*.jsonl`:`skills` 列技能使用次數、`chains` 列呼叫鏈次數(皆降冪),`--cli <name>` 過濾 |
| `tools/worklog-target.sh` | 依 `{owner}/{repo}` 產生 `LOG_{HASH}`、`LOG_CONTENTS` 與符合共享規則的 `HASH` | | `tools/worklog-target.sh` | 接收已由 `jsc-gitea/tools/hash-id` 算好的 `HASH`,組出 `LOG_{HASH}`、`LOG_CONTENTS`(本身不再計算 SHA-1) |
## Skills 目錄 ## Skills 目錄
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "jsc-log", "name": "jsc-log",
"version": "0.0.3", "version": "0.0.4",
"description": "工作日誌(LOG_{HASH} wiki 頁)、技能使用統計與教訓紀錄(LEARN_{HASH} wiki 頁)", "description": "工作日誌(LOG_{HASH} wiki 頁)、技能使用統計與教訓紀錄(LEARN_{HASH} wiki 頁)",
"skills": "./skills/" "skills": "./skills/"
} }
+2 -1
View File
@@ -35,7 +35,8 @@ After work completes, collect the ten items below and append a `templates/log-en
## Target page and work week ## Target page and work week
- Page name: `LOG_{HASH}`. - Page name: `LOG_{HASH}`.
- Compute the target page by running `tools/worklog-target.sh "{owner}/{repo}" all`. Use `PAGE` for `LOG_{HASH}` and `CONTENTS` for `LOG_CONTENTS`. - Compute `{HASH}` from `{owner}/{repo}` with `jsc-gitea/tools/hash-id` (shared wiki hash rule: first 8 uppercase SHA-1 hex chars; `H` plus the first 7 chars when the raw hash starts with `0-9`, `A`, `B`, or `C`).
- Compute the target page by running `tools/worklog-target.sh "{HASH}" all`. Use `PAGE` for `LOG_{HASH}` and `CONTENTS` for `LOG_CONTENTS`.
- The work-week Friday still drives the page content and the row dates. - The work-week Friday still drives the page content and the row dates.
- Read the page via `jsc-gitea:wiki`. If it does not exist, create it with the structure described in `templates/log-contents.md`; otherwise APPEND the new entry at the end. - Read the page via `jsc-gitea:wiki`. If it does not exist, create it with the structure described in `templates/log-contents.md`; otherwise APPEND the new entry at the end.
- Update `LOG_CONTENTS` in the same pass (apply `templates/log-contents.md`; add the row if missing). - Update `LOG_CONTENTS` in the same pass (apply `templates/log-contents.md`; add the row if missing).
+6 -21
View File
@@ -1,47 +1,32 @@
#!/usr/bin/env sh #!/usr/bin/env sh
# worklog-target.sh: 產生 worklog wiki 目標頁。 # worklog-target.sh: 由已算好的 hash 組出 worklog wiki 目標頁名稱。
# hash 一律由 jsc-gitea/tools/hash-id 算出後傳入,本腳本不再自行計算 SHA-1。
# 用法: # 用法:
# worklog-target.sh <owner/repo> [hash|page|contents|all] # worklog-target.sh <hash> [page|contents|all]
set -eu set -eu
usage() { usage() {
echo 'usage: worklog-target.sh <owner/repo> [hash|page|contents|all]' >&2 echo 'usage: worklog-target.sh <hash> [page|contents|all]' >&2
exit 2 exit 2
} }
[ "$#" -ge 1 ] || usage [ "$#" -ge 1 ] || usage
[ "$#" -le 2 ] || usage [ "$#" -le 2 ] || usage
repo=$1 hash=$1
field=${2:-page} field=${2:-page}
if [ -z "$repo" ]; then if [ -z "$hash" ]; then
usage usage
fi fi
if command -v sha1sum >/dev/null 2>&1; then
raw=$(printf '%s' "$repo" | sha1sum | awk '{print $1}')
elif command -v shasum >/dev/null 2>&1; then
raw=$(printf '%s' "$repo" | shasum -a 1 | awk '{print $1}')
else
echo 'no SHA-1 helper found' >&2
exit 1
fi
hash=$(printf '%s' "$raw" | cut -c1-8 | tr a-f A-F)
case "$hash" in
[0-9ABC]*) hash="H$(printf '%s' "$hash" | cut -c1-7)" ;;
esac
page="LOG_${hash}" page="LOG_${hash}"
contents='LOG_CONTENTS' contents='LOG_CONTENTS'
case "$field" in case "$field" in
hash) printf '%s\n' "$hash" ;;
page) printf '%s\n' "$page" ;; page) printf '%s\n' "$page" ;;
contents) printf '%s\n' "$contents" ;; contents) printf '%s\n' "$contents" ;;
all) all)
printf 'HASH=%s\n' "$hash"
printf 'PAGE=%s\n' "$page" printf 'PAGE=%s\n' "$page"
printf 'CONTENTS=%s\n' "$contents" printf 'CONTENTS=%s\n' "$contents"
;; ;;