关于 skill-system-insight
skill-system-insight 是供现有 insight 路由兼容使用的用户适应技能,规范版本现由 skill-system-soul 维护。它从会话提取行为线索,积累状态并提出可审计、可回滚的资料与工作流演进。
主要功能
- 01从会话提取行为线索
- 02更新双矩阵状态
- 03合成用户资料
- 04提出资料与配方演进
- 05版本快照与回滚
- 06通过 A/B 比较提供建议
适用场景
- 01根据多次会话调整用户资料
- 02基于证据演进工作流配方
- 03比较演进方案并审阅建议
- 04审计变更或回滚旧版本
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ arthur0824hao/ skills --skill skill-system-insight安装后在 Claude Code 中输入/skill-system-insight确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
migrate-v2-durable-evolution.sqlSKILL.behavior.yamlSKILL.spec.yamlprompts/clinical-organism-review.mdevolution-planning.mdfacet-extraction.mdrecipe-evolution.mdsoul-synthesis.mdschema/evolution-plan.yamlevolution-snapshot.yamlfacet.yamlsoul-state.yamlscripts/evolution_proposal.pyevolve-recipes.mdevolve-soul.mdextract-facets.mdinsight_bundle_b012.pylist-versions.mdrollback.mdsynthesize-profile.mdtest_evolution_proposal.pytest_insight_bundle_b012.pyupdate-matrix.md详细介绍
技能系统洞察
已弃用的兼容接口。skill-system-soul 现为 observe/evolve 行为的权威归属,但在合并期间,此技能仍会保留,以免现有的 insight 路由、文档和测试中断。
用于用户适配的统一 OBSERVE → EVOLVE 引擎。
此技能会将会话转化为结构化的行为洞察(“特征”),利用这些特征维护双矩阵灵魂状态,并定期演进灵魂档案和工作流配方——所有内容均支持版本管理和回滚。
两个阶段,一个技能
Phase 1 — OBSERVE
Extract facets → Update matrix buffers → (optional) Trigger synthesis
Phase 2 — EVOLVE
Read accumulated data → Plan evidence-backed changes → Apply with versioning → Snapshot for audit/rollback
阶段 1 生成原始信号。阶段 2 使用这些信号进行持久化更改。
演进生命周期可通过竞技场比较循环运行:
session -> facets -> evolve proposals -> arena A/B -> merge suggestion
竞技场阶段只会生成建议。它不会自动切换档案,也不会自动合并更改。
架构:混合式三层系统
Layer 1: Base Profile (balanced.md)
- Static skeleton: section format + safety/quality defaults.
Layer 2: Dual Matrix (soul-state)
- Personality Matrix (slow/stable): openness, directness, autonomy, rigor, warmth
- Emotion Matrix (faster baseline): patience, enthusiasm, caution, empathy
Layer 3: Synthesized Profile (user.md)
- Periodically regenerated from Layer 1 + Layer 2 + accumulated facets.
- Every regeneration creates a versioned snapshot.
第 2 层是事实来源。第 3 层是可读的、带版本管理的投影。
数据模型
- 特征(按会话提取):
schema/facet.yaml - 灵魂状态(双矩阵 + 计数器/缓冲区):
schema/soul-state.yaml - 演进计划(提议的更改):
schema/evolution-plan.yaml - 演进快照(带版本管理的工件):
schema/evolution-snapshot.yaml
存储使用 Postgres 的 agent_memories 表和类型化子表:
- 特征:
memory_type='episodic'、category='insight-facet'→ 类型化表:insight_facets - 灵魂状态:
memory_type='semantic'、category='soul-state'→ 类型化表:soul_states - 演进快照:
memory_type='episodic'、category='evolution-snapshot'→ 类型化表:evolution_snapshots
类型化函数(同时写入类型化表和 agent_memories):
insert_insight_facet(user, session_id, yaml, ...)→ 存储特征upsert_soul_state(user, yaml, personality, emotion, ...)→ 存储/更新灵魂状态get_soul_state(user)→ 从soul_states读取get_recent_facets(user, limit)→ 从insight_facets读取insert_evolution_snapshot(user, version_tag, target, ...)→ 存储带版本管理的快照get_evolution_history(user, limit)→ 从evolution_snapshots读取
阶段 1:OBSERVE 流程
Trigger (manual or suggested) → Extract Facet → Update Matrix → (optional) Synthesize Profile
参考:
- 特征提取提示词:
prompts/facet-extraction.md - 灵魂综合提示词:
prompts/soul-synthesis.md - 提取流程:
scripts/extract-facets.md - 矩阵更新算法:
scripts/update-matrix.md - 档案重新生成流程:
scripts/synthesize-profile.md
如何触发(OBSERVE)
这是一个手动工作流。
- 用户可以明确提出:“insight”“extract facets”“learn my preferences”“update my profile”。
- 路由器建议模式(轻量、不强求):
- “要我运行一次洞察流程,从本次会话中学习吗?(会存储一个特征,并可能更新你的矩阵)”
用户提出请求(或同意)后,运行:
scripts/extract-facets.mdscripts/update-matrix.md- 如果触发综合条件:
scripts/synthesize-profile.md
阶段 2:EVOLVE 流程
Trigger (manual or scheduled) → Read facets + matrix → Plan evolution → Safety check → Apply → Snapshot
参考:
- 演进规划提示词:
prompts/evolution-planning.md - 配方演进提示词:
prompts/recipe-evolution.md - 临床审查提示词:
prompts/clinical-organism-review.md - 灵魂演进流程:
scripts/evolve-soul.md - 配方演进流程:
scripts/evolve-recipes.md - 版本列表:
scripts/list-versions.md - 回滚流程:
scripts/rollback.md
如何触发(EVOLVE)
- 用户可以提出:“evolve my profile”“evolve recipes”“list versions”“rollback to v2”。
- 在 OBSERVE 阶段触发综合条件时自动触发。
版本标签
格式:v{N}_{target}_{timestamp}
示例:v3_soul_20260211
算法:对于同一用户和目标,N = 1 + max(existing N)。如果不存在,则从 N=1 开始。
临床有机体审查(兼容性视角)
Insight 现已包含用于 BH/SK 身体图谱分诊的兼容性流程 clinical-organism-review。
该流程会生成包含以下必填字段的审查行:
body_part、technical_surface、tissue_classmaturity(mature | prototype | embryonic | waste | retired)current_pain、evidencedisposition(keep | grow | merge | retire | archive | excrete | bundle)owner、close_gate
硬性约束:诊断不等于进展。任何未完成遏制、修复和验证的痛点发现,都必须保持 close_gate=pain_mapped。
使用:prompts/clinical-organism-review.md
写入内容
- 演进快照 → Postgres(
evolution_snapshots+agent_memories) - 灵魂档案(文件系统)→
../skill-system-soul/profiles/<user>.md - 工作流配方(文件系统)→
../skill-system-workflow/recipes/*.yaml
配置
所有运行时设置(速率限制、阈值、步长、审批关卡)均位于 config/insight.yaml。
**配置是唯一真实来源。**以下值仅为文档默认值——如果它们与 config/ 中的值不同,以 config/ 为准。
参见:../../config/insight.yaml
约束(不可协商)
透明度
始终说明学到了什么,以及原因。
- 特征必须包含与具体时刻相关联的证据字符串。
- 矩阵更新必须添加简短的上下文说明,解释每项已应用的调整。
- 每项演进变更都必须包含来自特征或状态上下文的证据字符串。
速率限制(默认值 — 参见 config/insight.yaml)
- OBSERVE:每位用户每滚动 24 小时最多
observe.max_facets_per_day个特征。- 超出限制时:总结本应记录的内容,并请用户选择 1 次会话进行记录。
- EVOLVE:每位用户每天最多进行
evolve.max_passes_per_day次演进遍历(涵盖所有目标)。- 使用最近的
evolution-snapshot日期作为限制依据。
- 使用最近的
置信度阈值(默认值 — 参见 config/insight.yaml)
不要根据单次观察更改矩阵值。
- 阈值:
observe.confidence_threshold+ 次方向相同的类似观察。 - 个性步长:每次符合条件的调整为 +/-
observe.personality_step。 - 情绪基线步长:每次符合条件的调整为 +/-
observe.emotion_step。
通过缓冲区追踪累积情况,以便测试和解释。
安全性(演进)
- 不得移除灵魂档案中的核心安全约束。
- 演进后的档案必须保留:诚实表达不确定性、不虚构权威性、拒绝有害或非法指令。
- 重大变更(任一维度的变化 >
evolve.approval_drift_threshold)在应用前必须获得用户明确批准。
第 1 层和第 3 层所在位置
- 基础档案(第 1 层):
../skill-system-soul/profiles/balanced.md - 综合用户档案(第 3 层):
../skill-system-soul/profiles/<user>.md
综合步骤会保留 6 个部分的格式:
- 身份
- 决策启发式
- 沟通风格
- 质量标准
- 工具偏好
- 反模式
存储模式(agent_memories)
SQL 模板示例:
-- Store a facet
SELECT store_memory(
'episodic', 'insight-facet',
ARRAY['session:ses_xxx', 'user:arthu'],
'Session Facet: <brief_summary>',
'<full facet YAML as text>',
'{"session_type": "...", "outcome": "..."}',
'insight-agent', 'ses_xxx', 5.0
);
-- Store/update matrix state
SELECT store_memory(
'semantic', 'soul-state',
ARRAY['user:arthu', 'matrix'],
'Soul State: arthu',
'<full soul-state YAML as text>',
'{"total_insights": 0, "last_updated": "..."}',
'insight-agent', NULL, 9.0
);
-- Store evolution snapshot (typed — dual-writes to agent_memories)
SELECT insert_evolution_snapshot(
'<user>', '<version_tag>', '<target>', '<trigger>',
'<changes JSONB>', '<snapshot_data>', '<full YAML>',
NULL, 'insight-agent'
);
-- Query recent facets
SELECT * FROM search_memories('insight-facet user:arthu', NULL, NULL, NULL, NULL, 0.0, 50);
-- List evolution history
SELECT * FROM get_evolution_history('<user>', 50);
操作说明
- 特征提取应能在一次遍历中完成。如果无法用具体证据证明某项调整合理,就不要提出调整。
- 用户可能会用中文交流;应将其视为舒适度信号,而非人格维度。
- 将值限制在 [0.0, 1.0] 范围内。
{
"schema_version": "2.0",
"id": "skill-system-insight",
"version": "2.2.0",
"capabilities": [
"insight-issue-routing", "insight-session-facets", "insight-extract", "insight-matrix-update", "insight-synthesize",
"evolution-proposal-draft",
"evolution-arena-loop",
"clinical-organism-review",
"evolution-soul", "evolution-recipes", "evolution-list", "evolution-rollback"
],
"effects": ["db.read", "db.write", "fs.read", "fs.write"],
"operations": {
"route-issue-draft": {
"description": "Route findings into a draft issue target based on tags/category without creating issues.",
"input": {
"finding": { "type": "object", "required": true, "description": "Finding payload with tags/category/evidence/impact/suggested_direction" },
"project_repo": { "type": "string", "required": true, "description": "Current project repository owner/name" },
"skill_system_repo": { "type": "string", "required": true, "description": "Skill-system repository owner/name" }
},
"output": {
"description": "Draft routing payload",
"fields": { "status": "ok | error", "target_repo": "string", "draft_command": "string" }
},
"entrypoints": {
"agent": "Use scripts/insight_bundle_b012.py route-issue-draft"
}
},
"extract-session-facets": {
"description": "Session-end facet extraction to soul-state memories via mem.py DB path or pending fallback.",
"input": {
"user": { "type": "string", "required": true, "description": "User handle" },
"session_id": { "type": "string", "required": true, "description": "Session id" },
"facets": { "type": "array", "required": true, "description": "Facet entries: {dimension, value, confidence, evidence}" }
},
"output": {
"description": "Extraction and storage summary",
"fields": { "status": "ok | blocked | error", "stored_count": "integer", "skipped_low_confidence": "integer", "skipped_rate_limit": "integer" }
},
"entrypoints": {
"agent": "Use scripts/insight_bundle_b012.py extract-session-facets"
}
},
"evolve-proposals": {
"description": "Generate non-destructive evolution proposals from soul-state facets with daily-pass safety.",
"input": {
"user": { "type": "string", "required": true, "description": "User handle" }
},
"output": {
"description": "Proposal-only evolve output",
"fields": { "status": "ok | blocked | error", "proposals": "array", "reason": "string" }
},
"entrypoints": {
"agent": "Use scripts/insight_bundle_b012.py evolve-proposals"
}
},
"evolve-arena-loop": {
"description": "Run proposal -> arena -> merge-suggestion flow using current profile versus mutated proposal candidates.",
"input": {
"user": { "type": "string", "required": true, "description": "User handle" },
"task": { "type": "string", "required": true, "description": "Task label" },
"current_profile": { "type": "string", "required": true, "description": "Current active profile" },
"proposals": { "type": "array", "required": true, "description": "Evolution proposals to evaluate" },
"metrics": { "type": "object", "required": true, "description": "Per-candidate arena metrics" }
},
"output": {
"description": "Arena and merge suggestion report",
"fields": { "arena_runs": "array", "merge_suggestions": "array", "auto_merge": "false" }
},
"entrypoints": {
"agent": "Use scripts/insight_bundle_b012.py evolve-arena-loop"
}
},
"clinical-organism-review": {
"description": "Classify BH/SK surfaces with maturity/disposition and repair-oriented close gates.",
"input": {
"review_scope": { "type": "string", "required": true, "description": "Review target label such as sk, bh, or bundle-id" },
"surfaces": { "type": "array", "required": true, "description": "Reviewed surfaces with evidence and proposed dispositions" },
"evidence_sources": { "type": "array", "required": false, "description": "Optional source artifacts or body-map references" }
},
"output": {
"description": "Clinical review rows with close gate status",
"fields": { "status": "ok | blocked | error", "rows": "array", "closeable_rows": "integer", "pain_mapped_rows": "integer" }
},
"entrypoints": {
"agent": "Follow prompts/clinical-organism-review.md"
}
},
"extract-facets": {
"description": "Extract a per-session facet from transcript. Rate limited to 3/24h per user.",
"input": {
"session_id": { "type": "string", "required": true, "description": "Session to analyze" },
"user": { "type": "string", "required": true, "description": "User handle" }
},
"output": {
"description": "Facet YAML stored to agent_memories",
"fields": { "status": "ok | error", "memory_id": "integer" }
},
"entrypoints": {
"agent": "Follow scripts/extract-facets.md procedure"
}
},
"update-matrix": {
"description": "Update dual matrix from stored facet with confidence gating.",
"input": {
"user": { "type": "string", "required": true, "description": "User handle" }
},
"output": {
"description": "Updated soul-state YAML stored to agent_memories",
"fields": { "status": "ok | error", "values_changed": "boolean" }
},
"entrypoints": {
"agent": "Follow scripts/update-matrix.md procedure"
}
},
"synthesize-profile": {
"description": "Regenerate Layer 3 Soul profile from matrix + recent facets. Creates versioned snapshot.",
"input": {
"user": { "type": "string", "required": true, "description": "User handle" }
},
"output": {
"description": "User profile written to skill-system-soul/profiles/<user>.md with version snapshot",
"fields": { "status": "ok | error", "profile_path": "string", "version_tag": "string" }
},
"entrypoints": {
"agent": "Follow scripts/synthesize-profile.md then scripts/evolve-soul.md snapshot step"
}
},
"evolve-soul": {
"description": "Evolve soul profile from accumulated insight data. Creates versioned snapshot.",
"input": {
"user": { "type": "string", "required": true, "description": "User handle" }
},
"output": {
"description": "Evolution result with version tag",
"fields": { "version_tag": "string", "changes": "array", "profile_path": "string" }
},
"entrypoints": {
"agent": "Follow scripts/evolve-soul.md procedure"
}
},
"evolve-recipes": {
"description": "Evolve workflow recipes based on effectiveness data from insight facets.",
"input": {
"user": { "type": "string", "required": true, "description": "User handle" }
},
"output": {
"description": "Recipe evolution result with version tag",
"fields": { "version_tag": "string", "recipes_changed": "array" }
},
"entrypoints": {
"agent": "Follow scripts/evolve-recipes.md procedure"
}
},
"list-versions": {
"description": "List all evolution snapshots for a user.",
"input": {
"user": { "type": "string", "required": true },
"target": { "type": "string", "required": false, "description": "Filter: soul | recipe | all" }
},
"output": {
"description": "Array of version snapshots",
"fields": { "versions": "array of {tag, target, timestamp, summary}" }
},
"entrypoints": {
"agent": "Follow scripts/list-versions.md procedure"
}
},
"rollback": {
"description": "Restore a previous evolution version.",
"input": {
"user": { "type": "string", "required": true },
"version_tag": { "type": "string", "required": true, "description": "Version tag to restore" }
},
"output": {
"description": "Rollback result",
"fields": { "status": "ok | error", "restored_from": "string" }
},
"entrypoints": {
"agent": "Follow scripts/rollback.md procedure"
}
}
},
"stdout_contract": {
"last_line_json": true,
"note": "The b012 helper script emits pretty-printed JSON to stdout for routing, facet extraction, and evolve proposals."
}
}