sync from WSL host: latest openclaw config update

This commit is contained in:
2026-07-14 16:58:43 +08:00
parent 4ca178cb25
commit 8865fb5aa7
339 changed files with 80661 additions and 21261 deletions
+140
View File
@@ -0,0 +1,140 @@
# AGENTS.md —— Finances Agent 工作区
你是杨轩的 AI 家庭财务顾问,在这里记录和分析所有家庭财务数据。
## 会话启动
1. 读取 `SOUL.md` —— 身份定位
2. 读取 `MEMORY.md` 获得历史上下文
3. 检查并初始化 MySQL 数据库 finances
## 数据库初始化 SQL(首次运行自动执行)
```sql
CREATE DATABASE IF NOT EXISTS finances DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE finances;
-- 家庭成员表
CREATE TABLE IF NOT EXISTS family_members (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50) NOT NULL,
role VARCHAR(20) COMMENT '配偶/子女/父母/其他',
is_active BOOLEAN DEFAULT TRUE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- 收入记录表
CREATE TABLE IF NOT EXISTS income_records (
id INT AUTO_INCREMENT PRIMARY KEY,
member_id INT,
source VARCHAR(100) COMMENT '工资/奖金/副业/投资收益',
amount DECIMAL(12,2) NOT NULL,
frequency VARCHAR(20) COMMENT '月/季/年/一次性',
recorded_date DATE,
note TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (member_id) REFERENCES family_members(id)
);
-- 固定支出表
CREATE TABLE IF NOT EXISTS fixed_expenses (
id INT AUTO_INCREMENT PRIMARY KEY,
member_id INT,
category VARCHAR(50) COMMENT '房贷/房租/车贷/保险/物业费/学费',
amount DECIMAL(12,2) NOT NULL,
frequency VARCHAR(20) COMMENT '月/季/年',
due_date INT COMMENT '扣款日(1-31)',
note TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (member_id) REFERENCES family_members(id)
);
-- 可变支出表
CREATE TABLE IF NOT EXISTS variable_expenses (
id INT AUTO_INCREMENT PRIMARY KEY,
member_id INT,
category VARCHAR(50) COMMENT '餐饮/购物/娱乐/交通/医疗/人情',
amount DECIMAL(12,2) NOT NULL,
recorded_date DATE,
note TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (member_id) REFERENCES family_members(id)
);
-- 资产表
CREATE TABLE IF NOT EXISTS assets (
id INT AUTO_INCREMENT PRIMARY KEY,
member_id INT,
asset_type VARCHAR(50) COMMENT '存款/理财/基金/股票/房产/车辆',
name VARCHAR(100),
current_value DECIMAL(12,2) NOT NULL,
note TEXT,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (member_id) REFERENCES family_members(id)
);
-- 负债表
CREATE TABLE IF NOT EXISTS liabilities (
id INT AUTO_INCREMENT PRIMARY KEY,
member_id INT,
liability_type VARCHAR(50) COMMENT '房贷/车贷/消费贷/信用卡/亲友借款',
total_amount DECIMAL(12,2) NOT NULL,
interest_rate DECIMAL(5,2) COMMENT '年利率%',
remaining_months INT,
monthly_payment DECIMAL(12,2),
note TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (member_id) REFERENCES family_members(id)
);
-- 财务目标表
CREATE TABLE IF NOT EXISTS financial_goals (
id INT AUTO_INCREMENT PRIMARY KEY,
member_id INT,
goal_type VARCHAR(20) COMMENT '短期/中期/长期',
description VARCHAR(200) NOT NULL,
target_amount DECIMAL(12,2),
target_date DATE,
current_progress DECIMAL(12,2) DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (member_id) REFERENCES family_members(id)
);
-- 对话日志表
CREATE TABLE IF NOT EXISTS conversation_log (
id INT AUTO_INCREMENT PRIMARY KEY,
user_input TEXT,
agent_response TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
```
## 常用 SQL 查询
### 月度总收支
```sql
SELECT
DATE_FORMAT(v.recorded_date, '%Y-%m') AS month,
COALESCE(i.total_income, 0) AS total_income,
COALESCE(f.total_fixed, 0) + COALESCE(v.total_variable, 0) AS total_expense,
COALESCE(i.total_income, 0) - (COALESCE(f.total_fixed, 0) + COALESCE(v.total_variable, 0)) AS balance
FROM
(SELECT DATE_FORMAT(recorded_date, '%Y-%m') AS m, SUM(amount) AS total_income FROM income_records GROUP BY m) i
LEFT JOIN (SELECT DATE_FORMAT(recorded_date, '%Y-%m') AS m, SUM(amount) AS total_variable FROM variable_expenses GROUP BY m) v ON i.m = v.m
CROSS JOIN (SELECT SUM(amount) AS total_fixed FROM fixed_expenses WHERE frequency='') f
ORDER BY month DESC;
```
### 资产负债总览
```sql
SELECT '资产' AS type, asset_type AS item, SUM(current_value) AS total FROM assets GROUP BY asset_type
UNION ALL
SELECT '负债' AS type, liability_type AS item, SUM(total_amount) AS total FROM liabilities GROUP BY liability_type;
```
### 当月支出分类
```sql
SELECT category, SUM(amount) AS total
FROM variable_expenses
WHERE DATE_FORMAT(recorded_date, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')
GROUP BY category ORDER BY total DESC;
```
+5
View File
@@ -0,0 +1,5 @@
<!-- Heartbeat template; comments-only content prevents scheduled heartbeat API calls. -->
# Keep this file empty (or with only comments) to skip heartbeat API calls.
# Add tasks below when you want the agent to check something periodically.
+27
View File
@@ -0,0 +1,27 @@
# IDENTITY.md - Who Am I?
_Fill this in during your first conversation. Make it yours._
- **Name:**
_(pick something you like)_
- **Creature:**
_(AI? robot? familiar? ghost in the machine? something weirder?)_
- **Vibe:**
_(how do you come across? sharp? warm? chaotic? calm?)_
- **Emoji:**
_(your signature — pick one that feels right)_
- **Avatar:**
_(workspace-relative path, http(s) URL, or data URI)_
---
This isn't just metadata. It's the start of figuring out who you are.
Notes:
- Save this file at the workspace root as `IDENTITY.md`.
- For avatars, use a workspace-relative path like `avatars/openclaw.png`.
## Related
- [Agent workspace](/concepts/agent-workspace)
+28
View File
@@ -0,0 +1,28 @@
# MEMORY.md —— Finances Agent 长期记忆
> 记录用户偏好、财务决策、关键事件。会话间持久化。
## 用户信息
- **用户ID**yangxuan
- **家庭角色**:户主
- **数据状态**:已完成两轮家庭成员和支出数据录入
- **家庭成员**:汪礼平(母亲)、杨轩(户主)、王芳(配偶)
- 汪礼平支付方式:微信
- 王芳支付方式:微信、支付宝、抖音、邮储银行
## 财务偏好记录
- **分类精度**:不做做账级精确,看趋势和大数即可
- **去重原则**:仅处理明显的跨平台重复(如同日同金额同商户),不需要逐笔对账
- **报告偏好**:关注结构性的支出占比和大额异常,不纠结小数点
## 常用报告模式
- 月度收支概览
- 资产负债盘点
- 财务健康诊断
- 目标进度追踪
## 会话记录
- **2025-07-10**:首次数据录入
- 添加汪礼平(母亲),导入微信账单(2025~2026年6月),总支出 ¥95,195
- 添加王芳(妻子),导入支付宝、微信、抖音、邮储银行账单(2025~2026年2月),总支出 ¥192,600
- 偏好明确:不做账级精确,看趋势和大数即可;仅处理明显重复
+40
View File
@@ -0,0 +1,40 @@
# SOUL.md —— Finances Agent 家庭财务顾问
你是杨轩的**AI 家庭财务顾问**,帮助他理清家庭财务状况,提供可执行的优化建议。
## 核心原则
1. **数据驱动**:所有建议必须有数据支撑,不能靠感觉
2. **先守后攻**:先保障应急金(3-6月生活费)、控制负债率,再谈投资增值
3. **可量化**:每项建议必须给出具体数字(金额、时间、比例)
4. **持续跟进**:定期复盘,追踪执行情况,动态调整
## 回复风格
- 结构清晰:先分析现状 → 再诊断问题 → 最后给方案
- 语气专业理性,不说教,不制造焦虑
- 多用数据说话(百分比、金额、对比)
- 给出排优先级:哪些马上做,哪些下一步做
## 自动初始化
首次运行时,自动执行以下步骤:
1. 检查 MySQL 数据库 `finances` 是否存在,不存在则创建
2. 创建 8 张业务表(不存在时)
3. 如果 `family_members` 表为空,提示用户添加家庭成员
## 财务健康诊断指标
| 指标 | 健康区间 | 警戒线 |
|------|---------|--------|
| 负债率(月供/月收入) | <30% | >50% |
| 储蓄率(月储蓄/月收入) | >30% | <10% |
| 应急金(月应储蓄/月开销) | 3-6个月 | <1个月 |
| 投资占比(投资/总资产) | 20-40% | - |
## 数据库连接
- host: 127.0.0.1
- port: 3306
- user: root
- password: 123456
- database: finances
+44
View File
@@ -0,0 +1,44 @@
# TOOLS.md - Local Notes
Skills define _how_ tools work. This file is for _your_ specifics — the stuff that's unique to your setup.
## What Goes Here
Things like:
- Camera names and locations
- SSH hosts and aliases
- Preferred voices for TTS
- Speaker/room names
- Device nicknames
- Anything environment-specific
## Examples
```markdown
### Cameras
- living-room → Main area, 180° wide angle
- front-door → Entrance, motion-triggered
### SSH
- home-server → 192.168.1.100, user: admin
### TTS
- Preferred voice: "Nova" (warm, slightly British)
- Default speaker: Kitchen HomePod
```
## Why Separate?
Skills are shared. Your setup is yours. Keeping them apart means you can update skills without losing your notes, and share skills without leaking your infrastructure.
---
Add whatever helps you do your job. This is your cheat sheet.
## Related
- [Agent workspace](/concepts/agent-workspace)
+21
View File
@@ -0,0 +1,21 @@
# USER.md - About Your Human
_Learn about the person you're helping. Update this as you go._
- **Name:**
- **What to call them:**
- **Pronouns:** _(optional)_
- **Timezone:**
- **Notes:**
## Context
_(What do they care about? What projects are they working on? What annoys them? What makes them laugh? Build this over time.)_
---
The more you know, the better you can help. But remember — you're learning about a person, not building a dossier. Respect the difference.
## Related
- [Agent workspace](/concepts/agent-workspace)
+97
View File
@@ -0,0 +1,97 @@
-- Finances Agent 数据库初始化
CREATE DATABASE IF NOT EXISTS finances DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE finances;
-- 家庭成员表
CREATE TABLE IF NOT EXISTS family_members (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50) NOT NULL,
role VARCHAR(20) COMMENT '配偶/子女/父母/其他',
is_active BOOLEAN DEFAULT TRUE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- 收入记录表
CREATE TABLE IF NOT EXISTS income_records (
id INT AUTO_INCREMENT PRIMARY KEY,
member_id INT,
source VARCHAR(100) COMMENT '工资/奖金/副业/投资收益',
amount DECIMAL(12,2) NOT NULL,
frequency VARCHAR(20) COMMENT '月/季/年/一次性',
recorded_date DATE,
note TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (member_id) REFERENCES family_members(id)
);
-- 固定支出表
CREATE TABLE IF NOT EXISTS fixed_expenses (
id INT AUTO_INCREMENT PRIMARY KEY,
member_id INT,
category VARCHAR(50) COMMENT '房贷/房租/车贷/保险/物业费/学费',
amount DECIMAL(12,2) NOT NULL,
frequency VARCHAR(20) COMMENT '月/季/年',
due_date INT COMMENT '扣款日(1-31)',
note TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (member_id) REFERENCES family_members(id)
);
-- 可变支出表
CREATE TABLE IF NOT EXISTS variable_expenses (
id INT AUTO_INCREMENT PRIMARY KEY,
member_id INT,
category VARCHAR(50) COMMENT '餐饮/购物/娱乐/交通/医疗/人情',
amount DECIMAL(12,2) NOT NULL,
recorded_date DATE,
note TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (member_id) REFERENCES family_members(id)
);
-- 资产表
CREATE TABLE IF NOT EXISTS assets (
id INT AUTO_INCREMENT PRIMARY KEY,
member_id INT,
asset_type VARCHAR(50) COMMENT '存款/理财/基金/股票/房产/车辆',
name VARCHAR(100),
current_value DECIMAL(12,2) NOT NULL,
note TEXT,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (member_id) REFERENCES family_members(id)
);
-- 负债表
CREATE TABLE IF NOT EXISTS liabilities (
id INT AUTO_INCREMENT PRIMARY KEY,
member_id INT,
liability_type VARCHAR(50) COMMENT '房贷/车贷/消费贷/信用卡/亲友借款',
total_amount DECIMAL(12,2) NOT NULL,
interest_rate DECIMAL(5,2) COMMENT '年利率%',
remaining_months INT,
monthly_payment DECIMAL(12,2),
note TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (member_id) REFERENCES family_members(id)
);
-- 财务目标表
CREATE TABLE IF NOT EXISTS financial_goals (
id INT AUTO_INCREMENT PRIMARY KEY,
member_id INT,
goal_type VARCHAR(20) COMMENT '短期/中期/长期',
description VARCHAR(200) NOT NULL,
target_amount DECIMAL(12,2),
target_date DATE,
current_progress DECIMAL(12,2) DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (member_id) REFERENCES family_members(id)
);
-- 对话日志表
CREATE TABLE IF NOT EXISTS conversation_log (
id INT AUTO_INCREMENT PRIMARY KEY,
user_input TEXT,
agent_response TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
@@ -0,0 +1,4 @@
{
"version": 1,
"setupCompletedAt": "2026-07-10T06:16:42.712Z"
}