skill-system-insight

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill System Insight

技能系统洞察

This skill turns sessions into structured, explainable behavioral insights ("facets"), and uses those facets to evolve a user's Soul state over time.
The intent is pragmatic: collaborate better by learning the user's working style, not by inventing a persona.
该技能将会话转化为结构化、可解释的行为洞察(即“facet”),并利用这些facet逐步演化用户的Soul状态。
其核心目标务实:通过了解用户的工作方式而非构建虚拟角色,实现更高效的协作。

Architecture: Hybrid 3-Layer System

架构:混合三层系统

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.
Layer 2 is the ground truth. Layer 3 is a readable projection.
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.
Layer 2 是基准真值,Layer 3 是可读性更强的投影版本。

Data Model

数据模型

  • Facets (per-session extraction):
    schema/facet.yaml
  • Soul state (dual matrix + counters/buffers):
    schema/soul-state.yaml
Storage uses the Postgres
agent_memories
table:
  • Facets:
    memory_type='episodic'
    ,
    category='insight-facet'
  • Soul state:
    memory_type='semantic'
    ,
    category='soul-state'
  • Facets(每会话提取):
    schema/facet.yaml
  • Soul状态(双矩阵 + 计数器/缓冲器):
    schema/soul-state.yaml
存储使用Postgres的
agent_memories
表:
  • Facets:
    memory_type='episodic'
    category='insight-facet'
  • Soul状态:
    memory_type='semantic'
    category='soul-state'

Pipeline

流程

Trigger (manual or suggested) -> Extract Facet -> Update Matrix -> (optional) Synthesize Profile
References:
  • Facet extraction prompt:
    prompts/facet-extraction.md
  • Soul synthesis prompt:
    prompts/soul-synthesis.md
  • Extraction procedure:
    scripts/extract-facets.md
  • Matrix update algorithm:
    scripts/update-matrix.md
  • Profile regeneration procedure:
    scripts/synthesize-profile.md
Trigger (manual or suggested) -> Extract Facet -> Update Matrix -> (optional) Synthesize Profile
参考资料:
  • Facet提取提示词:
    prompts/facet-extraction.md
  • Soul合成提示词:
    prompts/soul-synthesis.md
  • 提取流程:
    scripts/extract-facets.md
  • 矩阵更新算法:
    scripts/update-matrix.md
  • 档案再生流程:
    scripts/synthesize-profile.md

How To Trigger

触发方式

This is a manual workflow.
  • User can ask explicitly: "insight", "extract facets", "learn my preferences", "update my profile".
  • Router suggestion pattern (lightweight, non-pushy):
    • "Want me to run an insight pass to learn from this session? (stores a facet + may update your matrix)"
When the user asks (or agrees), run:
  1. scripts/extract-facets.md
  2. scripts/update-matrix.md
  3. If the synthesis trigger fires:
    scripts/synthesize-profile.md
这是一个手动工作流。
  • 用户可明确发起请求:“insight”、“extract facets”、“learn my preferences”、“update my profile”。
  • 路由建议模式(轻量化、非强制):
    • “是否需要我运行洞察流程,从本次会话中学习?(将存储一个facet并可能更新您的矩阵)”
当用户发起请求(或同意建议)时,执行以下步骤:
  1. scripts/extract-facets.md
  2. scripts/update-matrix.md
  3. 若触发合成条件:
    scripts/synthesize-profile.md

Constraints (Non-Negotiable)

约束条件(不可协商)

Transparency

透明度

Always explain what was learned and why.
  • Facets must contain evidence strings tied to concrete moments.
  • Matrix updates must add short context lines explaining each applied adjustment.
始终说明所学到的内容及原因。
  • Facet必须包含与具体时刻绑定的证据字符串。
  • 矩阵更新必须添加简短的上下文说明,解释每一项调整的依据。

Rate limiting

频率限制

Max 3 facets per user per rolling 24 hours.
If over limit: do not store a new facet. Instead, write a short note to the user summarizing what you would have captured, and ask them to pick 1 session to record.
每个用户每24小时最多提取3个facet。
若超出限制:不存储新的facet,而是向用户发送简短说明,概述原本会记录的内容,并请用户选择1个会话进行记录。

Confidence threshold

置信度阈值

Do not change matrix values on a single observation.
  • Threshold: 3+ similar observations in the same direction.
  • Personality step size: +/- 0.05 per qualifying adjustment.
  • Emotion baseline step size: +/- 0.1 per qualifying adjustment.
Accumulation should be tracked (buffers) so the threshold is testable and explainable.
不得仅凭单次观察更改矩阵值。
  • 阈值:同一方向的3次及以上相似观察。
  • 人格矩阵步长:每次符合条件的调整±0.05。
  • 情绪基准步长:每次符合条件的调整±0.1。
需跟踪积累情况(缓冲器),以便阈值可验证、可解释。

Where Layer 1 and Layer 3 Live

Layer 1和Layer 3的存储位置

  • Base profile (Layer 1):
    skill/skills/skill-system-soul/profiles/balanced.md
  • Synthesized user profile (Layer 3):
    skill/skills/skill-system-soul/profiles/<user>.md
The synthesis step should preserve the 6-section format used by
balanced.md
:
  1. Identity
  2. Decision Heuristics
  3. Communication Style
  4. Quality Bar
  5. Tool Preferences
  6. Anti-Patterns
  • 基础档案(Layer 1):
    skill/skills/skill-system-soul/profiles/balanced.md
  • 合成用户档案(Layer 3):
    skill/skills/skill-system-soul/profiles/<user>.md
合成步骤需保留
balanced.md
使用的6-section格式:
  1. 身份(Identity)
  2. 决策启发式(Decision Heuristics)
  3. 沟通风格(Communication Style)
  4. 质量标准(Quality Bar)
  5. 工具偏好(Tool Preferences)
  6. 反模式(Anti-Patterns)

Storage Pattern (agent_memories)

存储模式(agent_memories)

Example SQL templates (copy/paste and substitute values):
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
);

-- Query recent facets
SELECT * FROM search_memories('insight-facet user:arthu', NULL, NULL, NULL, NULL, 0.0, 50);
示例SQL模板(复制粘贴并替换值):
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
);

-- Query recent facets
SELECT * FROM search_memories('insight-facet user:arthu', NULL, NULL, NULL, NULL, 0.0, 50);

Operational Notes

操作说明

  • Facet extraction should be completable in one pass. If you cannot justify an adjustment with concrete evidence, propose no adjustment.
  • Users may communicate in Chinese; treat that as a signal about comfort, not as a personality dimension.
  • Keep values clamped to [0.0, 1.0].
skill
{
  "schema_version": "2.0",
  "id": "skill-system-insight",
  "version": "1.0.0",
  "capabilities": ["insight-extract", "insight-matrix-update", "insight-synthesize"],
  "effects": ["db.read", "db.write", "fs.write"],
  "operations": {
    "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 (no executable script)"
      }
    },
    "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.",
      "input": {
        "user": { "type": "string", "required": true, "description": "User handle" }
      },
      "output": {
        "description": "User profile written to skill-system-soul/profiles/<user>.md",
        "fields": { "status": "ok | error", "profile_path": "string" }
      },
      "entrypoints": {
        "agent": "Follow scripts/synthesize-profile.md procedure"
      }
    }
  },
  "stdout_contract": {
    "last_line_json": false,
    "note": "Agent-executed procedures; output is structured YAML stored to DB, not stdout."
  }
}
  • Facet提取应一次完成。若无法用具体证据证明调整的合理性,则不提议任何调整。
  • 用户可能使用中文沟通;这应视为用户对语言舒适度的信号,而非人格维度。
  • 数值需限制在[0.0, 1.0]范围内。
skill
{
  "schema_version": "2.0",
  "id": "skill-system-insight",
  "version": "1.0.0",
  "capabilities": ["insight-extract", "insight-matrix-update", "insight-synthesize"],
  "effects": ["db.read", "db.write", "fs.write"],
  "operations": {
    "extract-facets": {
      "description": "从会话记录中提取每会话facet。每个用户每24小时最多3次。",
      "input": {
        "session_id": { "type": "string", "required": true, "description": "待分析的会话ID" },
        "user": { "type": "string", "required": true, "description": "用户标识" }
      },
      "output": {
        "description": "Facet YAML存储至agent_memories",
        "fields": { "status": "ok | error", "memory_id": "integer" }
      },
      "entrypoints": {
        "agent": "遵循scripts/extract-facets.md流程(无可执行脚本)"
      }
    },
    "update-matrix": {
      "description": "基于存储的facet更新双矩阵,带有置信度校验。",
      "input": {
        "user": { "type": "string", "required": true, "description": "用户标识" }
      },
      "output": {
        "description": "更新后的soul-state YAML存储至agent_memories",
        "fields": { "status": "ok | error", "values_changed": "boolean" }
      },
      "entrypoints": {
        "agent": "遵循scripts/update-matrix.md流程"
      }
    },
    "synthesize-profile": {
      "description": "基于矩阵和近期facet重新生成Layer 3 Soul档案。",
      "input": {
        "user": { "type": "string", "required": true, "description": "用户标识" }
      },
      "output": {
        "description": "用户档案写入skill-system-soul/profiles/<user>.md",
        "fields": { "status": "ok | error", "profile_path": "string" }
      },
      "entrypoints": {
        "agent": "遵循scripts/synthesize-profile.md流程"
      }
    }
  },
  "stdout_contract": {
    "last_line_json": false,
    "note": "由Agent执行的流程;输出为存储至数据库的结构化YAML,而非标准输出。"
  }
}
```",