chore(marketplace 正本): 正本移至 plugins/meta(升版 0.0.5) #7
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jsc-log",
|
"name": "jsc-log",
|
||||||
"version": "0.0.1",
|
"version": "0.0.2",
|
||||||
"description": "工作日誌(LOG_* wiki 頁)與技能使用統計",
|
"description": "工作日誌(LOG_{HASH} wiki 頁)與技能使用統計",
|
||||||
"skills": "./skills",
|
"skills": "./skills",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "JSC"
|
"name": "JSC"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jsc-log",
|
"name": "jsc-log",
|
||||||
"version": "0.0.1",
|
"version": "0.0.2",
|
||||||
"description": "工作日誌(LOG_* wiki 頁)與技能使用統計",
|
"description": "工作日誌(LOG_{HASH} wiki 頁)與技能使用統計",
|
||||||
"skills": "./skills"
|
"skills": "./skills"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# jsc-log — 給 AI 助理的指引
|
# jsc-log — 給 AI 助理的指引
|
||||||
|
|
||||||
本 repo 是 jsc 技能組的 `log` domain(工作日誌與技能使用統計,寫入 LOG_* wiki 頁),Claude Code / Codex / Copilot / Antigravity / Kiro 都能安裝使用。
|
本 repo 是 jsc 技能組的 `log` domain(工作日誌與技能使用統計,寫入 `LOG_{HASH}` wiki 頁),Claude Code / Codex / Copilot / Antigravity / Kiro 都能安裝使用。
|
||||||
|
|
||||||
## 規則
|
## 規則
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# jsc-log — 工作日誌與統計
|
# jsc-log — 工作日誌與統計
|
||||||
|
|
||||||
jsc 技能組的 log domain:工作完成後把十項資訊寫入 wiki 日誌頁(`LOG_{yyyyMM}_W{週數}`,週數依週五日期計算),並統計技能使用次數與呼叫鏈次數。
|
jsc 技能組的 log domain:工作完成後把十項資訊寫入 wiki 日誌頁(`LOG_{HASH}`,`HASH` 依共享規則計算;首碼若是數字或 `A`/`B`/`C`,改成 `H` 加上原前 7 碼;頁內仍按工作週週五整理),並統計技能使用次數與呼叫鏈次數。
|
||||||
|
|
||||||
## 安裝、更新、移除
|
## 安裝、更新、移除
|
||||||
|
|
||||||
@@ -21,6 +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` |
|
||||||
|
|
||||||
## Skills 目錄
|
## Skills 目錄
|
||||||
|
|
||||||
@@ -30,7 +31,7 @@ Marketplace 統一為 `jsc`(https://gitea.jsc.idv.tw/plugins/jsc.git),安
|
|||||||
|
|
||||||
### `worklog`
|
### `worklog`
|
||||||
|
|
||||||
工作完成後蒐集十項資訊(存取庫、分支、計畫連結、工作包連結、花費時間、token 用量、任務狀態、執行細節、困難與解決、PR 目標分支),套範本附加到 `LOG_{yyyyMM}_W{週數}` 與 `LOG_CONTENTS`。
|
工作完成後蒐集十項資訊(存取庫、分支、計畫連結、工作包連結、花費時間、token 用量、任務狀態、執行細節、困難與解決、PR 目標分支),用 `tools/worklog-target.sh` 產生目標頁,再套範本附加到 `LOG_{HASH}` 與 `LOG_CONTENTS`。
|
||||||
|
|
||||||
### `stats`
|
### `stats`
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jsc-log",
|
"name": "jsc-log",
|
||||||
"version": "0.0.1",
|
"version": "0.0.2",
|
||||||
"description": "工作日誌(LOG_* wiki 頁)與技能使用統計",
|
"description": "工作日誌(LOG_{HASH} wiki 頁)與技能使用統計",
|
||||||
"skills": "./skills/"
|
"skills": "./skills/"
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-12
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: worklog
|
name: worklog
|
||||||
description: After finishing a work package, collect ten facts (repo, branch, plan link, work package link, elapsed time from session-timer, token usage per CLI, status, details, difficulties, PR target) and append a templated entry to wiki LOG_{yyyyMM}_W{week} plus LOG_CONTENTS. Week number is derived from the Friday of the work week. Trigger at the end of implement or maintain; not for planning notes.
|
description: After finishing a work package, collect ten facts (repo, branch, plan link, work package link, elapsed time from session-timer, token usage per CLI, status, details, difficulties, PR target) and append a templated entry to wiki LOG_{HASH} plus LOG_CONTENTS. HASH follows the shared 8-char rule with the H-prefix fallback, and the work-week Friday still drives the page content. Trigger at the end of implement or maintain; not for planning notes.
|
||||||
---
|
---
|
||||||
|
|
||||||
# worklog — work log
|
# worklog — work log
|
||||||
@@ -13,8 +13,8 @@ After work completes, collect the ten items below and append a `templates/log-en
|
|||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| 1 | Repository name | Parse `{owner}/{repo}` from `git remote get-url origin` |
|
| 1 | Repository name | Parse `{owner}/{repo}` from `git remote get-url origin` |
|
||||||
| 2 | Branch name | `git branch --show-current` |
|
| 2 | Branch name | `git branch --show-current` |
|
||||||
| 3 | Plan name | Link to the plan page `[[PLAN_{...}]]` |
|
| 3 | Plan name | Link to the plan page `[[PLAN_{HASH}]]` |
|
||||||
| 4 | Work package id | Link to the work package heading on the analyze page `[[ANALYZE_{...}#WP-xx]]` |
|
| 4 | Work package id | Link to the work package heading on the analyze page `[[ANALYZE_{HASH}#WP-xx]]` |
|
||||||
| 5 | Elapsed time | `jsc-hooks/hooks/session-timer.sh report {session_id}` (seconds; convert to h/m) |
|
| 5 | Elapsed time | `jsc-hooks/hooks/session-timer.sh report {session_id}` (seconds; convert to h/m) |
|
||||||
| 6 | Token usage | See the table below; per-CLI methods differ. Fill `N/A` when unavailable |
|
| 6 | Token usage | See the table below; per-CLI methods differ. Fill `N/A` when unavailable |
|
||||||
| 7 | Task status | One of the literal values 「完成」、「部分完成」、「阻塞」 (with reason when blocked) |
|
| 7 | Task status | One of the literal values 「完成」、「部分完成」、「阻塞」 (with reason when blocked) |
|
||||||
@@ -32,14 +32,10 @@ After work completes, collect the ten items below and append a `templates/log-en
|
|||||||
| antigravity | Value shown in the UI; `N/A` when unreadable |
|
| antigravity | Value shown in the UI; `N/A` when unreadable |
|
||||||
| kiro | No public source; fill `N/A` |
|
| kiro | No public source; fill `N/A` |
|
||||||
|
|
||||||
## Target page and week number
|
## Target page and work week
|
||||||
|
|
||||||
- Page name: `LOG_{yyyyMM}_W{週數}`. Both values come from the Friday of the current work week:
|
- Page name: `LOG_{HASH}`.
|
||||||
```sh
|
- Compute the target page by running `tools/worklog-target.sh "{owner}/{repo}" all`. Use `PAGE` for `LOG_{HASH}` and `CONTENTS` for `LOG_CONTENTS`.
|
||||||
dow=$(date +%u)
|
- The work-week Friday still drives the page content and the row dates.
|
||||||
if [ "$dow" -ge 6 ]; then f=$(date -d 'last friday' +%Y%m%d); else f=$(date -d 'friday' +%Y%m%d); fi
|
|
||||||
yyyyMM=$(printf '%s' "$f" | cut -c1-6)
|
|
||||||
W=$(( ( $(printf '%s' "$f" | cut -c7-8 | sed 's/^0//') - 1 ) / 7 + 1 )) # which Friday of the month
|
|
||||||
```
|
|
||||||
- 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 week's row if missing).
|
- Update `LOG_CONTENTS` in the same pass (apply `templates/log-contents.md`; add the row if missing).
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# 日誌目錄
|
# 日誌目錄
|
||||||
|
|
||||||
> 由 `jsc-log:worklog` 維護。每個日誌頁一列;週數 = 該週五是當月第幾個週五。
|
> 由 `jsc-log:worklog` 維護。每個日誌頁一列;頁名使用共享 `HASH` 規則,頁內仍依該週五日期整理。
|
||||||
|
|
||||||
| 日誌頁 | 週五日期 | 條目數 | 最後更新 |
|
| 日誌頁 | 週五日期 | 條目數 | 最後更新 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| [[LOG_{yyyyMM}_W{週數}]] | {yyyy-MM-dd} | {n} | {yyyy-MM-dd HH:mm} |
|
| [[LOG_{HASH}]] | {yyyy-MM-dd} | {n} | {yyyy-MM-dd HH:mm} |
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# 工作日誌頁 — LOG_{yyyyMM}_W{週數}
|
# 工作日誌頁 — LOG_{HASH}
|
||||||
|
|
||||||
> 由 `jsc-log:worklog` 維護。每完成一項工作附加一個條目在文末。
|
> 由 `jsc-log:worklog` 維護。每完成一項工作附加一個條目在文末。
|
||||||
> `{yyyyMM}` 與 `{週數}` 取自本工作週的週五:週數 = 該週五是當月第幾個週五。
|
> `HASH` 依共享規則計算;頁名不再寫入年月週數,但頁內仍依本工作週的週五整理內容。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
| --- | --- |
|
| --- | --- |
|
||||||
| 存取庫名稱 | {owner}/{repo} |
|
| 存取庫名稱 | {owner}/{repo} |
|
||||||
| 分支名稱 | {branch} |
|
| 分支名稱 | {branch} |
|
||||||
| 計畫名稱 | [[PLAN_{yyyyMMdd}_{HHmmss}_{HASH}|{計畫名稱}]] |
|
| 計畫名稱 | [[PLAN_{HASH}|{計畫名稱}]] |
|
||||||
| 工作包編號 | [[ANALYZE_{yyyyMMdd}_{HHmmss}_{HASH}#wp-{編號}|WP-{編號} {工作包標題}]] |
|
| 工作包編號 | [[ANALYZE_{HASH}#wp-{編號}|WP-{編號} {工作包標題}]] |
|
||||||
| 花費時間 | {h} 小時 {m} 分(session-timer report) |
|
| 花費時間 | {h} 小時 {m} 分(session-timer report) |
|
||||||
| token 用量 | {CLI}: {input}/{output}(不可得填 N/A) |
|
| token 用量 | {CLI}: {input}/{output}(不可得填 N/A) |
|
||||||
| 任務狀態 | 完成、部分完成、阻塞({原因})三選一 |
|
| 任務狀態 | 完成、部分完成、阻塞({原因})三選一 |
|
||||||
|
|||||||
Executable
+49
@@ -0,0 +1,49 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
# worklog-target.sh: 產生 worklog wiki 目標頁。
|
||||||
|
# 用法:
|
||||||
|
# worklog-target.sh <owner/repo> [hash|page|contents|all]
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo 'usage: worklog-target.sh <owner/repo> [hash|page|contents|all]' >&2
|
||||||
|
exit 2
|
||||||
|
}
|
||||||
|
|
||||||
|
[ "$#" -ge 1 ] || usage
|
||||||
|
[ "$#" -le 2 ] || usage
|
||||||
|
|
||||||
|
repo=$1
|
||||||
|
field=${2:-page}
|
||||||
|
|
||||||
|
if [ -z "$repo" ]; then
|
||||||
|
usage
|
||||||
|
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}"
|
||||||
|
contents='LOG_CONTENTS'
|
||||||
|
|
||||||
|
case "$field" in
|
||||||
|
hash) printf '%s\n' "$hash" ;;
|
||||||
|
page) printf '%s\n' "$page" ;;
|
||||||
|
contents) printf '%s\n' "$contents" ;;
|
||||||
|
all)
|
||||||
|
printf 'HASH=%s\n' "$hash"
|
||||||
|
printf 'PAGE=%s\n' "$page"
|
||||||
|
printf 'CONTENTS=%s\n' "$contents"
|
||||||
|
;;
|
||||||
|
*) usage ;;
|
||||||
|
esac
|
||||||
Reference in New Issue
Block a user