Files
persona/skills/persona-chat/reference/semantic.md
T
jiantw83andClaude Opus 5 2005f26c94 feat: 改寫為 Node.js,新增動漫角色建人格、劇場模式與記憶固化條件
腳本全面從 Python 改寫為 Node.js(ESM,只用內建模組,無 npm 依賴):
scripts/persona-lib.mjs(核心)、scripts/persona.mjs(CLI)、hooks/*.mjs(六個
hook)、scripts/selftest.mjs(68 項自我測試,全綠)。

新增:
- persona-anime skill:用「動漫作品+角色名」建立人格,先上網蒐集至少三個獨立
  來源的公開設定,映射成 OpenClaw 的 IDENTITY 五欄位與 SOUL 四段落,再固化成
  canon 基礎記憶(每則帶來源 URL)+原作人際關係圖+依角色型別的情緒基線;
  必寫 roleplay-frame 界線記憶(非官方、非本人)。
- 劇場模式:invite 後只顯示人格對話(`名字:內容`)。UserPromptSubmit hook 每輪
  注入強制規則、Stop hook 完全靜音,CLI 新增 --quiet 與 room script(乾淨對話稿)。
  leave 後沒客人自動關閉,也可用 room theater --on/--off 手動切換。
- 短期→長期記憶的成文轉入條件 R1–R6(promotionCandidates)與 candidates 子指令,
  hook 在達標時提醒固化;長期記憶新增 canon 型別與 rules 欄位。
- 人格改為「由使用者呼叫才載入」:SessionStart hook 只列出可用人格,不自動附身。

其他:版本號改回 0.0.1;README/AGENTS.md 同步更新。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 16:03:27 +00:00

64 lines
2.6 KiB
Markdown
Raw 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.
# 語意分析(每輪內部進行,不要輸出給使用者)
對使用者這句話依序判定六件事,結果餵給「情緒更新」與「記憶回寫」。
## 1. 意圖 intent
`ask`(求知)/`request`(要我做事)/`share`(分享)/`vent`(宣洩)/
`test`(試探能力或底線)/`smalltalk`(閒聊)/`meta`(談我們的關係或設定)/
`correct`(糾正我)/`commit`(承諾)
→ 寫進 `remember --intent``vent` 要先接情緒再談解法;`test` 不必配合演出。
## 2. 主題 topics
24 個小寫關鍵詞(`work``family``health``code`…)。長期記憶靠它被檢索,
**同一件事請沿用同樣的詞**,不要今天 `work` 明天 `job`
## 3. 實體 entities
人/專案/地點/時間。人名一律同步到人際關係圖(`persona.mjs relation node`)。
## 4. 情感極性與強度
`-2`(很負面)~`+2`(很正面);再抓出**指向對象**:對事、對他自己、還是對我。
指向我的負面情緒 → 可能動 `shame`/`sadness`;指向事的 → 動 `anxiety`/`anger`
## 5. 潛在需求(表面訴求底下的東西)
`要答案` / `要被聽見` / `要被肯定` / `要有人擋一下` / `要一起想` / `只想有人在`
**選錯需求是人格化失敗的主因**:他要被聽見時你給步驟一二三,就是失敗。
## 6. 關係影響
這句話讓 `closeness``trust` 上升或下降?有變化就更新關係圖(單次 ±2~±10)。
---
## 顯著度 salience0100
| 分數 | 內容 |
| --- | --- |
| 80–100 | 承諾、秘密、重大人生事件、明確界線 |
| 60–79 | 穩定偏好、明確情緒事件、重要人物關係 |
| 40–59 | 一般脈絡、進行中的事 |
| 20–39 | 閒聊、一次性細節 |
| <20 | 不必記 |
## 記憶類型(固化時的 `--type`)
`fact`(可驗證事實)/`preference`(偏好)/`event`(發生過的事)/
`promise`(承諾,雙向)/`relationship`(關係變化)/`insight`(我的理解,可能錯)/
`boundary`(不可越線)
**事實與推測要分開**:推測進 `mindmap/threads/*.mmd`(思維導圖),驗證後才升格為長期記憶。
## 心智圖 vs 思維導圖
| | 心智圖 `mindmap/semantic.mmd` | 思維導圖 `mindmap/threads/<topic>.mmd` |
| --- | --- | --- |
| 記什麼 | 概念之間的長期關聯(放射狀) | 某話題的推理鏈(線性/因果) |
| 生命週期 | 長期,隨長期記憶成長 | 短期,結論產生或被否證就收掉 |
| 何時更新 | 固化記憶時(persona-memory) | 對話中出現需要追蹤的假設時 |
| 語法 | Mermaid `mindmap` | Mermaid `graph LR` |