feat(persona): 時區改為+08:00等值轉換、補機密遮蔽,並接上shared共用規範
依 todo.md 執行的規範治理專案: - persona-lib.mjs 的 iso()/nowIso() 改為輸出 +08:00 offset(等值瞬間轉換, 非加8小時),新增 nowDisplay()(人讀顯示格式)與 todayTaipei()(台北曆日 日期鍵),修正 11 處原本用 UTC 字串切片產生日期鍵的錯誤用法;新增 redactSecrets() 並套用到 persona-gitea.mjs 的 Gitea 錯誤路徑,避免機密 外洩。 - 新增一次性遷移腳本 scripts/migrate-tz.mjs(備份/dry-run/冪等/衝突偵測 中止),供之後有真實人格資料需要轉換時使用。 - persona 13 個 skill 與 AGENTS.md 接上 /jsc-shared 共用規範(spec-output、 spec-script-path、spec-subagent、spec-gitea、spec-git-safety、 spec-skill-invocation 等),不再各自重抄,且完全未變動人格行為本身的規範 (情緒模型、記憶衰減、劇場模式、鎖與隔離機制等逐字保留)。 - selftest 全數通過(788/788,含本次新增的時區邊界/冪等性測試)。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -919,129 +919,22 @@ node scripts/expression-check.mjs # G2/G3 表達驗收(人工看,不判
|
||||
|
||||
## 安裝 / 更新 / 移除(各助理)
|
||||
|
||||
> 指令中的 repo 網址換成你的:`https://gitea.jsc.idv.tw/plugins/persona.git`
|
||||
> 本 plugin 的 marketplace 名是 `persona`(= repo 名),plugin 名是 `jsc-persona`,安裝 token 為 `jsc-persona@persona`。
|
||||
>
|
||||
> **Claude / Codex 從 git URL 安裝(會 clone 遠端),請先把本 repo `push` 到 gitea。**
|
||||
> **Antigravity 的 `agy plugin install <url>` 目前只支援 github.com**;gitea 請改用「clone + 本地路徑」(見 Antigravity 節)。
|
||||
> 本機/離線:Claude 可用本地路徑加 marketplace;Antigravity 用本地路徑安裝。
|
||||
> **⚠ 若本機還留著更早的 `jsc-persona@jsc-plugins` 安裝**,那是舊版命名的殘影,請先移除舊鍵再重裝新 token。
|
||||
>
|
||||
> 本 plugin 的 marketplace 名是 **`persona`**(= repo 名),plugin 名是 **`jsc-persona`**,安裝 token 為 `jsc-persona@persona`。
|
||||
|
||||
> **⚠ 這版的正式 marketplace 名是 `persona`。** `jsc-persona@persona` 才是現在的安裝 token。
|
||||
> 如果你本機還留著更早的 `jsc-persona@jsc-plugins`,那只是舊安裝殘影,請先移除舊鍵再重裝新 token。
|
||||
> **人格資料不受影響**:人格倉庫在 `~/.claude/personas/`(或 `PERSONA_HOME`),不在 plugin 目錄裡,移除/重裝 plugin 不會動到情緒、記憶與關係圖。Antigravity/OpenCode 是本地路徑/目錄安裝,沒有 marketplace 名,不受此命名影響。
|
||||
>
|
||||
> **人格資料不受影響**:人格倉庫在 `~/.claude/personas/`(或 `PERSONA_HOME`),不在 plugin 目錄裡,
|
||||
> 移除/重裝 plugin 不會動到情緒、記憶與關係圖。Antigravity/OpenCode 是本地路徑/目錄安裝,沒有 marketplace 名,不受此命名影響。
|
||||
|
||||
### Claude Code
|
||||
|
||||
```bash
|
||||
# 安裝
|
||||
claude plugin marketplace add https://gitea.jsc.idv.tw/plugins/persona.git
|
||||
claude plugin install jsc-persona@persona
|
||||
|
||||
# 更新
|
||||
claude plugin marketplace update persona
|
||||
claude plugin update jsc-persona@persona
|
||||
|
||||
# 移除
|
||||
claude plugin uninstall jsc-persona@persona
|
||||
claude plugin marketplace remove persona
|
||||
```
|
||||
|
||||
- 工作階段內 slash 版(等價):把 `claude plugin` 換成 `/plugin`。
|
||||
- 本機開發(免 push):`claude plugin marketplace add /home/coder/plugins/persona`(本地路徑)後再 install。
|
||||
- 安裝後**重啟工作階段**讓 hooks 生效;用 `/hooks` 確認六個 hook 都在。
|
||||
- **呼叫**:`/jsc-persona:<name>`(例 `/jsc-persona:persona-chat`)。
|
||||
|
||||
### Codex
|
||||
|
||||
```bash
|
||||
# 安裝
|
||||
codex plugin marketplace add https://gitea.jsc.idv.tw/plugins/persona.git
|
||||
codex plugin add jsc-persona@persona
|
||||
|
||||
# 更新(重新抓取 marketplace 的 git 快照)
|
||||
codex plugin marketplace upgrade persona
|
||||
|
||||
# 移除
|
||||
codex plugin remove jsc-persona@persona
|
||||
codex plugin marketplace remove persona
|
||||
```
|
||||
|
||||
- 安裝 token `jsc-persona@persona` = plugin 名(`.codex-plugin/plugin.json` 的 `name`)@ marketplace 名(`.agents/plugins/marketplace.json` 的 `name`)。
|
||||
- 本 repo 的 Codex marketplace 以 `url` 來源指向自己,故 Codex **一律從 gitea 安裝**(需先 push);安裝後重啟 Codex。
|
||||
- **呼叫**:`$<name>`(例 `$persona-chat`),或用 `/skills` 選單。
|
||||
- Codex 沒有 hook:鎖與隔離只剩 CLI 層的自律檢查。
|
||||
|
||||
### Antigravity(`agy`)
|
||||
|
||||
> `agy plugin install <url>` 目前**只支援 github.com**;gitea 等自架 git 不支援 URL 安裝,請先 `git clone` 再用**本地路徑**安裝。
|
||||
|
||||
```bash
|
||||
# 安裝:clone 後用本地路徑
|
||||
git clone https://gitea.jsc.idv.tw/plugins/persona.git ~/plugins/persona
|
||||
agy plugin install ~/plugins/persona
|
||||
|
||||
# 更新(agy 無 update 子指令 → git pull 後重裝)
|
||||
git -C ~/plugins/persona pull
|
||||
agy plugin uninstall jsc-persona
|
||||
agy plugin install ~/plugins/persona
|
||||
|
||||
# 移除
|
||||
agy plugin uninstall jsc-persona
|
||||
```
|
||||
|
||||
- 若把 skills 放到 GitHub,則可直接 `agy plugin install https://github.com/<owner>/<repo>`。
|
||||
- 其他:`agy plugin list`、`agy plugin enable jsc-persona` / `disable jsc-persona`、`agy plugin validate <path>`。安裝後重啟工作階段。
|
||||
- **呼叫**:`/jsc-persona:<name>`(例 `/jsc-persona:persona-chat`)或依描述自動觸發。
|
||||
|
||||
### OpenCode
|
||||
|
||||
OpenCode 的「plugin」是 TypeScript/npm 套件,不適用於 skill 包;skills 改用**目錄安裝**。
|
||||
OpenCode 會讀 `~/.config/opencode/skills/`(也會讀 `~/.claude/skills/`、`~/.agents/skills/`)。
|
||||
|
||||
```bash
|
||||
# 安裝
|
||||
git clone https://gitea.jsc.idv.tw/plugins/persona.git ~/plugins/persona
|
||||
mkdir -p ~/.config/opencode/skills
|
||||
cp -r ~/plugins/persona/skills/* ~/.config/opencode/skills/
|
||||
|
||||
# 更新
|
||||
git -C ~/plugins/persona pull
|
||||
cp -r ~/plugins/persona/skills/* ~/.config/opencode/skills/
|
||||
|
||||
# 移除
|
||||
rm -rf ~/.config/opencode/skills/{persona-anime,persona-chat,persona-create,persona-icon,persona-invite,persona-memory,persona-relation,persona-sleep,persona-status,persona-story,persona-sync,persona-therapist,persona-transfer}
|
||||
```
|
||||
|
||||
> **Windows PowerShell**:`cp -r A B` → `Copy-Item A B -Recurse -Force`、`rm -rf X` → `Remove-Item X -Recurse -Force`、`~` → `$HOME`。
|
||||
|
||||
- 目錄安裝**不會帶入 `scripts/` 與 `hooks/`**;`persona.mjs` 不在,等於整套狀態操作都不可用。要在 OpenCode 用本 plugin,請另外 clone 本 repo 並自行呼叫 `scripts/persona.mjs`。
|
||||
- **呼叫**:直接描述需求,模型會依 skill 描述自動透過 skill 工具呼叫。
|
||||
|
||||
### GitHub Copilot CLI
|
||||
|
||||
Copilot CLI 支援與 Claude Code 類似的原生 plugin / marketplace 指令,可直接從 marketplace 安裝、更新與移除本 plugin。
|
||||
|
||||
```bash
|
||||
# 安裝
|
||||
copilot plugin marketplace add https://gitea.jsc.idv.tw/plugins/persona.git
|
||||
copilot plugin install jsc-persona@persona
|
||||
|
||||
# 更新
|
||||
copilot plugin marketplace update persona
|
||||
copilot plugin update jsc-persona@persona
|
||||
|
||||
# 移除
|
||||
copilot plugin uninstall jsc-persona@persona
|
||||
copilot plugin marketplace remove persona
|
||||
```
|
||||
|
||||
- 安裝 token `jsc-persona@persona` = plugin 名(plugin manifest 的 `name`)@ marketplace 名。
|
||||
- `copilot plugin marketplace add` 支援 GitHub `owner/repo`、git URL 與本地路徑;Gitea repo 可用上方 HTTPS URL。
|
||||
- Copilot CLI 沒有 hook:鎖與隔離同樣只剩 CLI 層的自律檢查。
|
||||
- **呼叫**:在 Copilot CLI 中用自然語言描述需求,例如 `copilot -i "用 lumi 這個人格跟我聊聊"`。
|
||||
> 完整的安裝/更新/移除指令(Claude Code、Codex、Antigravity、OpenCode、GitHub Copilot CLI 五種助理),一律以 [`/jsc-shared:spec-plugin-cli`](https://gitea.jsc.idv.tw/plugins/shared/src/branch/master/skills/spec-plugin-cli/SKILL.md) 為唯一權威版本,套用時代入下列佔位符:
|
||||
>
|
||||
> | 佔位符 | 值 |
|
||||
> | --- | --- |
|
||||
> | `<host>` | `gitea.jsc.idv.tw` |
|
||||
> | `<name>` | `persona` |
|
||||
> | `<plugin>` | `jsc-persona` |
|
||||
> | `<marketplace>` | `persona` |
|
||||
> | `<token>`(= `<plugin>@<marketplace>`) | `jsc-persona@persona` |
|
||||
> | `<url>` | `https://gitea.jsc.idv.tw/plugins/persona.git` |
|
||||
|
||||
---
|
||||
|
||||
@@ -1085,3 +978,4 @@ copilot plugin marketplace remove persona
|
||||
3. 動到隔離規則 → 一定要在 `selftest.mjs` 的第 ③(隔離)/⑧(guest 與劇場模式)區加對應案例,跑到全綠。
|
||||
4. 把 skill 補進上方「Skills 目錄」區塊。
|
||||
5. bump `.claude-plugin/plugin.json`、`.codex-plugin/plugin.json`、`plugin.json` 三處 `version`,commit 後 push。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user