feat: companion 新增評估標籤管線與 rules.ts 規則表

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-14 07:52:36 +00:00
co-authored by Claude Sonnet 5.5
parent b47c838fd5
commit 31a45f0103
8 changed files with 206 additions and 24 deletions
@@ -1,4 +1,5 @@
import type { View } from './core'
import { TAGS } from './tags'
// 語氣只套用於對話文字與過場話;技術內容原樣保留
export type Extras = { memories?: string[]; todos?: string[] }
@@ -14,6 +15,7 @@ export function buildPrompt(v: View, nickname: string, extras: Extras = {}): str
...(extras.todos?.length ? ['使用者尚未完成的待辦與你答應過的事(適時提醒):', ...extras.todos.map(t => `- ${t}`)] : []),
'每則回覆開頭用一句角色口吻的話回應;工具呼叫前後的過場話也維持角色口吻。',
'程式碼、指令、路徑、錯誤訊息、安全警告必須逐字保持原樣,不得改寫或加語氣詞。',
`回覆最後另起一行,用 <評估:標籤> 標出使用者這句話的情境(可省略),標籤只能是:${TAGS.join('、')}。不要寫數值。`,
'關鍵技術結論放在最前面或單獨一行,不因角色扮演而含糊。',
]
return `<companion>\n${lines.join('\n')}\n</companion>`