[feature] 自訂銷售階段+domain know-how 可編輯+MCP 編輯介面(S23)#156
Merged
Conversation
Closes #155。使用者自己維護 sales know-how、用自己的 Claude 改板。 - schema v2(stage-bundles.json):overrides 之外新增 stages 自訂階段 (id slug/name/insertAfter/bundle),know-how 寫進 bundle 即進 prompt(萃取/聚焦/建議問法同一條注入路徑);v1 向後相容;slot id 階段前綴為硬性驗證(#146 sentinel 依賴);壞資料逐筆防禦性丟棄 - 純驗證層 bundleFile.ts(零 tauri):schema+內建 bundles+解析+ 排序,app 與 MCP server 共用同一套規則 - SalesStage 放寬為 string(內建六階仍為排序基準);UI 全面改吃動態 StageSet(順序+有效 bundle+名稱):StageStepper/MiniStages/ ThreadPage 指南/MeetingLinkSection/live StageBoard;stale 自訂階段 fallback pipeline 起點 - MCP stdio server(mcp/stage-bundles-server.ts,bun):list/get/ upsert-override/add/update/remove-custom-stage,直接讀寫 config 檔 (app 免開;live 每輪 fresh 重讀、UI 10s TTL);原子寫入; docs/mcp-stage-bundles.md 使用說明 - 測試 +10(bundleFile v2 解析/排序/驗證),全套 175 綠;瀏覽器現場 驗證自訂階段上 stepper+板身切換正確 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Brandon 回饋 MCP-only 編輯面不夠直覺、要能在 UI 上自己編。P3 的 Settings 編輯器提前進本票: - 設定視窗新增「銷售階段」分頁:pipeline 全序列表(自訂/已修改 badge)、點開就地編輯——階段名稱(自訂限定)、目標、要收集什麼 (一列=板上一格:格名+提示)、退場條件(一行一條) - 儲存語意:內建階段→整階段覆寫(S9),保留表單沒露出的進階欄位 (query/coachRules/solidAt)與既有 slot id(卡片標籤不斷); 「還原出廠」移除覆寫;自訂階段可改名/刪除(兩段式確認) - 新增階段:名稱+插在哪一階之後,id 自動產生(使用者不碰 slug) - Rust 補 write_stage_bundles(鏡射 write_accounts);瀏覽器 dev fallback localStorage;寫入後失效讀取快取 - bundleFile 補 serializeBundleFile(編輯器/MCP/測試共用同一序列化 形狀)+round-trip 測試;i18n zh/en 全數補齊 現場驗證(瀏覽器):列表渲染(含 seed 的自訂階段)→ 展開編輯 → 改 hint → 儲存 → v2 檔正確落地、slot id 保留。176 測試綠、cargo ✓。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
追加 |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes #155。base 為 main(前一疊 #152→#153→#154 已全數 merge)。
Brandon 需求:sales 的 domain know-how 要能由使用者自己維護+能用自己的 Claude 透過 MCP 直接編輯(例:把陌生開發 cold call 拆成獨立階段)。
1. Schema v2+自訂階段
stage-bundles.json升 v2:overrides(S9 整階段覆寫)之外新增stages自訂階段:{ id, name, insertAfter?, bundle }SalesStage放寬為 string(BUILTIN_SALES_STAGES六階仍為排序基準);自訂階段名稱/goal 為 bundle 資料、不走 i18n2. 架構:純驗證層抽出
bundleFile.ts(零 tauri):schema、內建 bundles、解析、stageOrder——app 與 MCP server 共用同一套驗證bundles.ts收斂為 IO+組合層:readStageBundleFile(UI 10s TTL、live 迴圈 fresh)、buildStageSet(順序+有效 bundle+名稱+customized 集)、stageGuideView(未動過的內建維持 i18n 文案 verbatim;自訂/覆寫由 bundle 派生)3. UI 動態化
StageStepper/MiniStages/ThreadPage 指南/MeetingLinkSection/live StageBoard 全面改吃
useStageSet();stale 自訂階段(定義被移除)fallback pipeline 起點,不炸板。4. MCP 編輯面(
mcp/stage-bundles-server.ts)@modelcontextprotocol/sdk),直接讀寫 config-dir 檔案——app 免開;開著時 live 每輪萃取 fresh 重讀(≤30s 生效)list_stages/get_stage(有效 bundle)/upsert_stage_override/remove_stage_override/add_custom_stage/update_custom_stage/remove_custom_stage;原子寫入(tmp+rename)claude mcp add parley-bundles -- bun run <repo>/mcp/stage-bundles-server.ts;詳見docs/mcp-stage-bundles.md驗證
tsc✓/vitest175 passed(+10 bundleFile 解析/排序/驗證)/bun run build✓(Rust 零改動)備註
🤖 Generated with Claude Code