skills/connect/SKILL.md
TwinMind link engine for manual connections. Use when the user explicitly asks to link or unlink two specific cards (e.g. '把 X 和 Y 連起來', 'link X to Y', 'disconnect X from Y'). Handles relationship type classification, bidirectional link writing, and index updates. Not for automatic link inference during card creation — that's handled by twinmind:capture.
npx skillsauth add VolderLu/TwinMind connectInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
處理使用者明確要求的手動連結操作——建立或解除兩張卡片之間的連結。與 twinmind:capture 的自動連結推理不同,這裡是使用者主動指定要連結哪兩張卡片。
關係類型、分類規則、Connections 格式和反向對照表的完整定義,請讀取 twinmind:capture skill 的 references/link-inference.md (與 capture 共用同一套連結系統;該 references 檔案位於 plugin 內,可從 .claude/twinmind/config.json 的 pluginRoot 取得 plugin 路徑後再讀)。
一致性驗證由 PostToolUse hooks 自動處理。完成操作後透過 Bash tool 執行 node .claude/twinmind/bin/tm-post-op.mjs --layer knowledge 觸發 post-op pipeline。
透過 Bash tool 執行:
node .claude/twinmind/bin/tm-post-op.mjs --layer knowledge --event '{"event_type":"<LINK_CREATED|LINK_REMOVED>","event_context":{"source_title":"<title>","target_title":"<title>","relation":"<type>","domains":["<domain>"]}}'
腳本同步執行。exit code 0 成功,exit code 1 失敗(stderr 印出錯誤訊息)。
啟動後立即回應使用者。Subagent 執行 changelog(append-only 至 changelog-YYYY-MM.md)+ MOC 閾值檢查(使用 payload config 和 domain_counts,不重新讀取 config.md 或 vault-index.json)+ Home.md 重建(使用 payload recent_notes,不重新讀取 vault-index.json 取最新卡片)。
當使用者要求連結兩張卡片時(如「把 Rust Ownership 和 RAII 連起來」):
vault-index.json 的 notes 以 title/keyword 找到兩張目標卡片twinmind:capture skill 的 references/link-inference.md 的分類優先序自動推斷twinmind:capture skill 的 references/link-inference.md 的「建立連結程序」):
Connections 格式:- <符號> [[<slug>|<title>]] — <一句話說明為何連結>(slug 為目標卡片檔名,不含 .md)
寫入源卡片 ## Connections(移除 placeholder 若有)
寫入目標卡片反向連結(依反向對照表)
透過 Bash tool 執行程式化索引更新(不得直接 Edit vault-index.json):
node .claude/twinmind/bin/tm-update-index.mjs add-link '{"source":"<source_id>","target":"<target_id>"}'
腳本自動處理:雙向更新 links_to/linked_from、重算兩方 link_count、遞增 stats.total_links、更新 stats.last_updated
node .claude/twinmind/bin/tm-post-op.mjs --layer knowledge --event '...',event_type: LINK_CREATED)當使用者要求解除兩張卡片的連結時:
vault-index.json 找到兩張目標卡片links_to/linked_from)## Connections 移除含目標卡片 wiki-link 的行。若移除後無連結,恢復 (尚無連結)## Connections 移除含源卡片 wiki-link 的行。同上vault-index.json(單次 Edit):old_string 涵蓋源 note entry、目標 note entry 和 stats 物件的連續 JSON 區塊;new_string 包含移除連結後的完整版本(links_to/linked_from 移除對應 ID、重算兩方 link_count、重算 stats.total_links、更新 stats.last_updated)。此操作 SHALL 為單次 Edit tool invocationnode .claude/twinmind/bin/tm-post-op.mjs --layer knowledge --event '...',event_type: LINK_REMOVED)testing
TwinMind task engine — manages standalone tasks (life chores, errands, quick todos). Use this skill when the user mentions a simple, concrete thing they need to do that doesn't belong to any project or action. Classic triggers: short imperative sentences like '買牛奶', '繳電費', '回覆 email', '預約牙醫', or explicit task operations like '加個待辦', 'add task', 'task done', '完成 task', '刪除 task', 'delete task', '列出 tasks', 'list tasks', '待辦清單'. The distinguishing feature of a standalone task is that it's too small for an Action and not tied to any project. If the user mentions a project name, route to twinmind:project. If it's a multi-step endeavor, consider twinmind:action instead.
tools
Initialize a new TwinMind vault in the current directory. Creates TwinMind.md configuration and vault directory structure from templates. Use when starting a fresh knowledge vault or setting up TwinMind in a new project.
development
Classifies user knowledge-base input into one of 9 intent categories (capture, inbox, query, project, action, task, area, review, connect) using signal words, priority rules, compound intent handling, and fuzzy fallback matching. Invoke BEFORE dispatching to any twinmind:* skill when the user provides knowledge-base input. Do NOT skip this step — the session startup skeleton only has a summary table; this skill has the complete rules needed for accurate classification.
development
TwinMind review and maintenance engine. Use for vault health checks, seed card review, index verification/rebuild, MOC management, and vault status summaries. Triggers on: 'vault status', '知識庫狀況', 'health report', '健康報告', 'verify index', '檢查索引', 'rebuild index', '重建索引', 'review seeds', '有哪些 seed', 'update MOC', or any request about knowledge base maintenance and overview.