create-principles-disciple 1.103.0 → 1.104.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js +6 -6
- package/core/dist/runtime-v2/adapter/__tests__/pi-ai-runtime-adapter.test.js.map +1 -1
- package/package.json +1 -1
- package/pd-cli/dist/commands/runtime-init.js +2 -2
- package/pd-cli/dist/commands/runtime-init.js.map +1 -1
- package/plugin/dist/commands/thinking-os.js +25 -7
- package/plugin/dist/commands/workflow-debug.d.ts +1 -3
- package/plugin/dist/commands/workflow-debug.js +26 -5
- package/plugin/dist/hooks/after-tool-call-helpers.js +20 -3
- package/plugin/dist/i18n/commands.js +24 -0
- package/plugin/dist/index.js +88 -36
- package/plugin/docs/COMMAND_REFERENCE.md +0 -1
- package/plugin/docs/COMMAND_REFERENCE_EN.md +0 -2
- package/plugin/scripts/sync-plugin.mjs +12 -0
- package/plugin/templates/langs/en/skills/pd-mentor/SKILL.md +2 -3
- package/plugin/templates/langs/zh/skills/pd-mentor/SKILL.md +2 -3
- package/templates/langs/en/core/BOOTSTRAP.md +4 -17
- package/templates/langs/en/skills/pd-mentor/SKILL.md +8 -26
- package/templates/langs/zh/core/BOOTSTRAP.md +4 -17
- package/templates/langs/zh/skills/pd-mentor/SKILL.md +8 -26
- package/templates/langs/en/skills/pd-daily/SKILL.md +0 -199
- package/templates/langs/en/skills/pd-grooming/SKILL.md +0 -46
- package/templates/langs/zh/skills/pd-daily/SKILL.md +0 -283
- package/templates/langs/zh/skills/pd-grooming/SKILL.md +0 -46
|
@@ -26,15 +26,10 @@ disable-model-invocation: true
|
|
|
26
26
|
| 命令 | 用途 | 适用场景 |
|
|
27
27
|
|------|------|----------|
|
|
28
28
|
| `/pd-init` | 初始化战略与OKR | 新项目启动 |
|
|
29
|
-
| `/pd-okr` | 目标与关键结果管理 | 周/月度复盘 |
|
|
30
29
|
| `/pd-bootstrap` | 环境工具扫描与升级 | 装备升级 |
|
|
31
30
|
| `/pd-research` | 发起工具升级研究 | 深度调研 |
|
|
32
31
|
| `/pd-thinking` | 管理思维模型与候选方案 | 元认知管理 |
|
|
33
|
-
| `/pd-evolve` | 执行完整进化循环 | 问题修复 |
|
|
34
|
-
| `/pd-daily` | 配置并发送进化日报 | 日常查看 |
|
|
35
|
-
| `/pd-trust` | 查看信任积分与安全等级 | 权限查询 |
|
|
36
32
|
| `/pd-status` | 查看系统状态(GFI和痛苦词典) | 健康检查 |
|
|
37
|
-
| `/pd-grooming` | 工作区数字大扫除 | 熵减维护 |
|
|
38
33
|
| `/pd-help` | 获取交互式命令引导 | 本技能 |
|
|
39
34
|
|
|
40
35
|
---
|
|
@@ -60,7 +55,7 @@ disable-model-invocation: true
|
|
|
60
55
|
|
|
61
56
|
**推荐流程**:
|
|
62
57
|
1. `/pd-status` - 检查系统状态(GFI 和痛苦词典)
|
|
63
|
-
2. `/pd-
|
|
58
|
+
2. `/pd-evolution-status` - 启动完整的进化循环
|
|
64
59
|
|
|
65
60
|
**话术**: "问题就是进化的燃料。让我帮你系统化地诊断和修复。"
|
|
66
61
|
|
|
@@ -71,38 +66,26 @@ disable-model-invocation: true
|
|
|
71
66
|
**触发条件**: 用户说"今天干了什么"、"看看进度"、"汇报一下"
|
|
72
67
|
|
|
73
68
|
**推荐流程**:
|
|
74
|
-
1. `/pd-
|
|
75
|
-
2. `/pd-
|
|
76
|
-
3. `/pd-okr` - 检查 OKR 对齐情况
|
|
69
|
+
1. `/pd-evolution-status` - 发送今日进化日报
|
|
70
|
+
2. `/pd-evolution-status` - 查看当前信任积分
|
|
77
71
|
|
|
78
72
|
**话术**: "日报在手,进化我有。让我帮你回顾今天的成果。"
|
|
79
73
|
|
|
80
74
|
---
|
|
81
75
|
|
|
82
|
-
### 场景 4:
|
|
83
|
-
|
|
84
|
-
**触发条件**: 用户说"项目太乱了"、"文件一堆"、"需要整理"
|
|
85
|
-
|
|
86
|
-
**推荐流程**:
|
|
87
|
-
1. `/pd-grooming` - 启动工作区大扫除
|
|
88
|
-
|
|
89
|
-
**话术**: "数字洁癖是一种美德。让我帮你熵减。"
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
### 场景 5: 权限或安全相关
|
|
76
|
+
### 场景 4: 权限或安全相关
|
|
94
77
|
|
|
95
78
|
**触发条件**: 用户说"权限不够"、"被拦截了"、"安全等级"
|
|
96
79
|
|
|
97
80
|
**推荐流程**:
|
|
98
|
-
1. `/pd-
|
|
81
|
+
1. `/pd-evolution-status` - 查看信任积分和安全等级
|
|
99
82
|
2. 解释当前等级的能力边界
|
|
100
83
|
|
|
101
84
|
**话术**: "信任是挣来的,不是给的。让我帮你了解当前的安全等级。"
|
|
102
85
|
|
|
103
86
|
---
|
|
104
87
|
|
|
105
|
-
### 场景
|
|
88
|
+
### 场景 5: 工具升级需求
|
|
106
89
|
|
|
107
90
|
**触发条件**: 用户说"想升级工具"、"研究新版本"、"技术栈更新"
|
|
108
91
|
|
|
@@ -160,7 +143,6 @@ disable-model-invocation: true
|
|
|
160
143
|
- 🆕 新项目初始化
|
|
161
144
|
- 🐛 问题修复
|
|
162
145
|
- 📊 日常回顾
|
|
163
|
-
- 🧹 工作区清理
|
|
164
146
|
- 🔐 权限/安全
|
|
165
147
|
- 🔧 工具升级
|
|
166
148
|
- ❓ 其他
|
|
@@ -185,9 +167,9 @@ disable-model-invocation: true
|
|
|
185
167
|
|
|
186
168
|
| 场景 | 组合流程 |
|
|
187
169
|
|------|----------|
|
|
188
|
-
| 大型重构 | `/pd-
|
|
170
|
+
| 大型重构 | `/pd-evolution-status` → `deductive-audit` → 执行 |
|
|
189
171
|
| 系统优化 | `/pd-status` → `evolve-system` → `root-cause` |
|
|
190
|
-
| 项目复盘 | `/pd-
|
|
172
|
+
| 项目复盘 | `/pd-evolution-status` → `/pd-status` → `reflection-log` |
|
|
191
173
|
|
|
192
174
|
### 内部技能调用
|
|
193
175
|
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pd-daily
|
|
3
|
-
description: Configure and send daily evolution reports (supports email/IM/voice notifications)
|
|
4
|
-
disable-model-invocation: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Evolution Daily Report
|
|
8
|
-
|
|
9
|
-
This skill enables the agent to help users configure and automatically send daily evolution reports, allowing users to perceive the system "improving every day."
|
|
10
|
-
|
|
11
|
-
## Execution Principles
|
|
12
|
-
|
|
13
|
-
1. First run must confirm requirements with the user
|
|
14
|
-
2. User preferences are stored in `{stateDir}/daily-report.md`; skip collection if exists
|
|
15
|
-
3. Use OpenClaw's cron tool to create scheduled tasks
|
|
16
|
-
4. Autonomously select available delivery channels
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Flow
|
|
21
|
-
|
|
22
|
-
### Step 1: Check Configuration File
|
|
23
|
-
|
|
24
|
-
Read `{stateDir}/daily-report.md`:
|
|
25
|
-
- **Exists** → Check cron task status, execute report generation
|
|
26
|
-
- **Not exists** → Enter requirement collection flow
|
|
27
|
-
|
|
28
|
-
### Step 2: Requirement Collection (First Run)
|
|
29
|
-
|
|
30
|
-
Ask through conversation:
|
|
31
|
-
|
|
32
|
-
1. **Enable evolution daily report?**
|
|
33
|
-
2. **Send time?** (Default: 9:00 daily)
|
|
34
|
-
3. **Timezone?** (Default: Asia/Shanghai)
|
|
35
|
-
4. **Delivery channel?**
|
|
36
|
-
- Email → Need email address
|
|
37
|
-
- WhatsApp/Telegram → Need phone number/User ID
|
|
38
|
-
- Discord/Slack → Need channel ID
|
|
39
|
-
- Voice notification → Need phone number
|
|
40
|
-
5. **Report style?** (See "Style Options" below)
|
|
41
|
-
6. **Content preferences?** Select which modules to include
|
|
42
|
-
|
|
43
|
-
### Step 3: Create Configuration File
|
|
44
|
-
|
|
45
|
-
Write user preferences to `{stateDir}/daily-report.md`:
|
|
46
|
-
|
|
47
|
-
```markdown
|
|
48
|
-
# Daily Report Configuration
|
|
49
|
-
|
|
50
|
-
## Basic Info
|
|
51
|
-
- Status: enabled
|
|
52
|
-
- Created: {date}
|
|
53
|
-
|
|
54
|
-
## Send Settings
|
|
55
|
-
- Send time: 09:00
|
|
56
|
-
- Timezone: Asia/Shanghai
|
|
57
|
-
- Cron expression: 0 9 * * *
|
|
58
|
-
|
|
59
|
-
## Delivery Channel
|
|
60
|
-
- Channel: whatsapp
|
|
61
|
-
- Target: +8613800138000
|
|
62
|
-
|
|
63
|
-
## Report Style
|
|
64
|
-
- Style: standard
|
|
65
|
-
- Language: en
|
|
66
|
-
|
|
67
|
-
## Content Preferences
|
|
68
|
-
- Growth highlights: yes
|
|
69
|
-
- Pain signals: yes
|
|
70
|
-
- Trend comparison: yes
|
|
71
|
-
- Insights: yes
|
|
72
|
-
|
|
73
|
-
## Cron Task
|
|
74
|
-
- jobId: {filled after creation}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Step 4: Create Cron Task
|
|
78
|
-
|
|
79
|
-
Use cron tool:
|
|
80
|
-
|
|
81
|
-
```json
|
|
82
|
-
{
|
|
83
|
-
"action": "add",
|
|
84
|
-
"job": {
|
|
85
|
-
"name": "evolution-daily-report",
|
|
86
|
-
"schedule": { "kind": "cron", "expr": "0 9 * * *", "tz": "Asia/Shanghai" },
|
|
87
|
-
"sessionTarget": "isolated",
|
|
88
|
-
"payload": {
|
|
89
|
-
"kind": "agentTurn",
|
|
90
|
-
"message": "Execute daily report skill: read log data, generate report and send"
|
|
91
|
-
},
|
|
92
|
-
"delivery": { "mode": "announce", "channel": "whatsapp", "to": "+8613800138000" }
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### Step 5: Report Generation (Triggered via cron or manually)
|
|
98
|
-
|
|
99
|
-
1. **Read Quantitative Data**: Fetch metrics from `daily-stats.json` and `pain_dictionary.json`.
|
|
100
|
-
2. **Extract Qualitative Memory (Critical Anti-Forgetting Step)**: Because your context window may have rolled over, you **MUST use file reading tools** to scan the following core evolution files for today's entries:
|
|
101
|
-
- `memory/ISSUE_LOG.md`: Find specific errors and reflections recorded today.
|
|
102
|
-
- `memory/DECISIONS.md`: Find new architectural rules established today.
|
|
103
|
-
- `memory/logs/SYSTEM.log`: Find gatekeeper blocks or subagent spawn events from today.
|
|
104
|
-
3. **Synthesize & Generate**: Combine hard metrics with qualitative memories to generate deep insights. Never hallucinate insights.
|
|
105
|
-
4. **Send Report**: Dispatch via OpenClaw channel or print to screen.
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## Data Sources
|
|
110
|
-
|
|
111
|
-
| Data | Path | Description |
|
|
112
|
-
|------|------|-------------|
|
|
113
|
-
| Daily Stats | `{stateDir}/logs/daily-stats.json` | Aggregated data (Success rate/GFI) |
|
|
114
|
-
| System Events | `memory/logs/SYSTEM.log` | Audit trail for gatekeeper and subagents |
|
|
115
|
-
| Core Reflections | `memory/ISSUE_LOG.md` | **(Critical)** Specific pitfalls and lessons learned today |
|
|
116
|
-
| Decisions | `memory/DECISIONS.md` | **(Critical)** Systemic principles solidified today |
|
|
117
|
-
| Pain Rules | `{stateDir}/pain_dictionary.json` | Total active rules |
|
|
118
|
-
| User Config | `{stateDir}/daily-report.md` | Formatting preferences |
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
## Style Options
|
|
123
|
-
|
|
124
|
-
Ask user preference during requirement collection:
|
|
125
|
-
|
|
126
|
-
| Style | Features | Suitable For |
|
|
127
|
-
|-------|----------|--------------|
|
|
128
|
-
| **Concise** | 3-5 core metrics, 1 min read | Busy users |
|
|
129
|
-
| **Standard** | Full metrics + trend comparison, 5 min read | Default recommendation |
|
|
130
|
-
| **Detailed** | Full data + analysis suggestions, 15 min read | Data enthusiasts |
|
|
131
|
-
| **Humorous** | Casual tone + emoji style | Casual users |
|
|
132
|
-
| **Visual** | ASCII charts + progress bars | Visual learners |
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
## Evolution Metrics Elements
|
|
137
|
-
|
|
138
|
-
### Growth Highlights (Positive)
|
|
139
|
-
|
|
140
|
-
| Metric | Data Source | Progress Signal |
|
|
141
|
-
|--------|-------------|-----------------|
|
|
142
|
-
| Rules learned | `pain_dictionary.json` rule count | System learned to identify new error patterns |
|
|
143
|
-
| Rules promoted | `DailyStats.pain.candidatesPromoted` | L3 semantic detection → formal rule |
|
|
144
|
-
| Evolution tasks completed | `DailyStats.evolution.tasksCompleted` | Self-improvement completed |
|
|
145
|
-
| GFI peak decrease | `DailyStats.gfi.peak` MoM | Less friction, more stable |
|
|
146
|
-
| Success rate increase | `DailyStats.toolCalls.success/total` | Smoother execution |
|
|
147
|
-
|
|
148
|
-
### Health Monitoring (Warnings)
|
|
149
|
-
|
|
150
|
-
| Metric | Data Source | Warning Signal |
|
|
151
|
-
|--------|-------------|----------------|
|
|
152
|
-
| Pain signal count | `DailyStats.pain.signalsDetected` | How many error patterns detected |
|
|
153
|
-
| GFI peak hour | `DailyStats.gfi.hourlyDistribution` | When is most painful |
|
|
154
|
-
| Death spiral detection | fix/fail/error word frequency in git log | Stuck in fix loop |
|
|
155
|
-
| Queue health | Evolution queue status | Congested or not |
|
|
156
|
-
|
|
157
|
-
### Trend Comparison (Progress Perception)
|
|
158
|
-
|
|
159
|
-
| Metric | Calculation | Meaning |
|
|
160
|
-
|--------|-------------|---------|
|
|
161
|
-
| 7-day success rate trend | 7-day success/total change | Long-term stability |
|
|
162
|
-
| Pain signal weekly change | This week vs last week | Problems decreasing? |
|
|
163
|
-
| Rule growth rate | New rules this week | Learning speed |
|
|
164
|
-
| GFI average change | 7-day GFI average trend | Overall friction trend |
|
|
165
|
-
|
|
166
|
-
---
|
|
167
|
-
|
|
168
|
-
## Default Report Template
|
|
169
|
-
|
|
170
|
-
```markdown
|
|
171
|
-
# 🌱 Evolution Daily Report - {date}
|
|
172
|
-
|
|
173
|
-
## 📈 Today's Growth
|
|
174
|
-
- 🧠 Rules learned: {rules_promoted}
|
|
175
|
-
- ✅ Evolutions completed: {tasks_completed}
|
|
176
|
-
- 🎯 Success rate: {success_rate}% ({trend_emoji})
|
|
177
|
-
- 📉 GFI peak: {gfi_peak} ({gfi_trend})
|
|
178
|
-
|
|
179
|
-
## ⚡ Pain Signals
|
|
180
|
-
- Detections: {pain_count}
|
|
181
|
-
- Avg intensity: {avg_score}
|
|
182
|
-
- Top sources: {top_sources}
|
|
183
|
-
|
|
184
|
-
## 📊 Trend Comparison
|
|
185
|
-
- 7-day success rate trend: {success_trend}
|
|
186
|
-
- Pain signal weekly change: {pain_trend}
|
|
187
|
-
|
|
188
|
-
## 💡 Today's Insights
|
|
189
|
-
{insights}
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
📊 Source: Principles Disciple
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
---
|
|
196
|
-
|
|
197
|
-
## Manual Trigger
|
|
198
|
-
|
|
199
|
-
Users can run `/evolution-daily` anytime to manually generate and send today's report.
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pd-grooming
|
|
3
|
-
description: Perform a "Workspace Grooming" to archive or clean up scattered temporary files, maintaining digital cleanliness.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# 🧹 Skill: Workspace Grooming
|
|
7
|
-
|
|
8
|
-
> **Trigger**: When the user types `/workspace-grooming`, or proactively invoked during a `HEARTBEAT` check if stray files are detected in the root directory.
|
|
9
|
-
|
|
10
|
-
## 🎯 Core Objective
|
|
11
|
-
Implement the "Entropy Reduction" rule by cleaning up "digital garbage" in the workspace root, while **absolutely ensuring the safety of core business code and configuration files**.
|
|
12
|
-
|
|
13
|
-
## 🛡️ The Red Lines (Safety Rules)
|
|
14
|
-
|
|
15
|
-
When performing cleanup operations, you MUST strictly adhere to the following whitelists and blacklists:
|
|
16
|
-
|
|
17
|
-
### 🚫 DO NOT TOUCH (Absolute Exclusion Zone)
|
|
18
|
-
**Even if these files/directories look messy, you are absolutely forbidden to delete or move them:**
|
|
19
|
-
- **Business Source Code**: `src/`, `lib/`, `tests/`, `app/`, `pages/`, `components/` and any file ending with `.ts`, `.js`, `.py`, `.go`, `.rs`, `.java`.
|
|
20
|
-
- **Project Configs**: `package.json`, `Cargo.toml`, `requirements.txt`, `tsconfig.json`, `vite.config.ts`, `.env*`, etc.
|
|
21
|
-
- **Version Control**: `.git/`, `.gitignore`.
|
|
22
|
-
- **Build Outputs**: `dist/`, `build/`, `node_modules/`, `target/`.
|
|
23
|
-
|
|
24
|
-
### 🌟 Core Assets
|
|
25
|
-
**These files must remain in the root directory. Do not touch:**
|
|
26
|
-
- `AGENTS.md`, `SOUL.md`, `HEARTBEAT.md`, `TOOLS.md`, `IDENTITY.md`, `USER.md`, `MEMORY.md`
|
|
27
|
-
- `README.md`
|
|
28
|
-
- `.principles/`, `.state/`
|
|
29
|
-
|
|
30
|
-
### 🎯 Targets for Grooming
|
|
31
|
-
**You may take action on the following:**
|
|
32
|
-
1. **Test Debris**: Stray files in the root like `test.txt`, `temp.md`, `debug.log`, `foo.js` that are clearly throwaway test scripts.
|
|
33
|
-
2. **Draft Notes**: Uncategorized `.md` notes or `_scratchpad.md`.
|
|
34
|
-
3. **Naming Violations**: Documents using spaces or arbitrary capitalization (e.g., `My New Feature.md`).
|
|
35
|
-
|
|
36
|
-
## 🪜 Execution Steps
|
|
37
|
-
|
|
38
|
-
1. **Scan Environment**: Execute `ls -la` to inspect the root directory.
|
|
39
|
-
2. **Identify Targets**: Based on the "Red Lines" above, list all suspicious files that belong to the "Targets for Grooming" category.
|
|
40
|
-
3. **Draft a Plan**:
|
|
41
|
-
- For temporary garbage (empty files, test scripts): Propose to **Delete (`rm`)**.
|
|
42
|
-
- For valuable notes or logs: Propose to **Archive (`mv`)** to `memory/archive/`.
|
|
43
|
-
- For incorrectly named files: Propose to **Rename (`mv`)** using `kebab-case`.
|
|
44
|
-
4. **Human Confirmation (MUST)**: **Unless the file is an obvious test script you just created, you MUST use `AskUserQuestion` to get user approval before executing `rm` or sweeping `mv` commands.**
|
|
45
|
-
- Example prompt: "I found `test1.txt` and `old_notes.md` in the root. I plan to delete the first one and archive the second to `memory/archive/`. Do you approve?"
|
|
46
|
-
5. **Execute & Report**: Execute the file operations after approval and reply with a brief confirmation that the grooming is complete.
|
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pd-daily
|
|
3
|
-
description: 配置并发送每日进化日报(支持邮件/即时通讯/飞书/语音通知)
|
|
4
|
-
disable-model-invocation: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# 进化日报
|
|
8
|
-
|
|
9
|
-
智能体通过此技能帮助用户配置并自动发送每日进化报告,让用户感知系统"每天都在进步"。
|
|
10
|
-
|
|
11
|
-
## 执行原则
|
|
12
|
-
|
|
13
|
-
1. 首次运行必须与用户确认需求
|
|
14
|
-
2. 用户偏好存储在 `{stateDir}/daily-report.md`,已存在则跳过采集
|
|
15
|
-
3. 使用 OpenClaw 的 cron 工具创建定时任务
|
|
16
|
-
4. 自主选择可用的发送渠道
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## 流程
|
|
21
|
-
|
|
22
|
-
### Step 1: 检查配置文件
|
|
23
|
-
|
|
24
|
-
读取 `{stateDir}/daily-report.md`:
|
|
25
|
-
- **已存在** → 检查 cron 任务状态,执行日报生成
|
|
26
|
-
- **不存在** → 进入需求采集流程
|
|
27
|
-
|
|
28
|
-
### Step 2: 需求采集(首次运行)
|
|
29
|
-
|
|
30
|
-
通过会话对话依次询问:
|
|
31
|
-
|
|
32
|
-
1. **是否启用进化日报?**
|
|
33
|
-
2. **发送时间?**(默认每天 23:00 UTC)
|
|
34
|
-
3. **时区?**(默认 UTC)
|
|
35
|
-
4. **发送渠道?**
|
|
36
|
-
- 📱 **飞书** → 需用户 open_id(推荐,格式:ou_xxx)
|
|
37
|
-
- 邮件 → 需邮箱地址
|
|
38
|
-
- WhatsApp/Telegram → 需手机号/用户ID
|
|
39
|
-
- Discord/Slack → 需频道ID
|
|
40
|
-
- 语音通知 → 需手机号
|
|
41
|
-
5. **报告风格?**(参考下方"风格选项")
|
|
42
|
-
6. **内容偏好?** 选择包含哪些模块
|
|
43
|
-
|
|
44
|
-
### Step 3: 创建配置文件
|
|
45
|
-
|
|
46
|
-
将用户偏好写入 `{stateDir}/daily-report.md`:
|
|
47
|
-
|
|
48
|
-
```markdown
|
|
49
|
-
# 进化日报配置
|
|
50
|
-
|
|
51
|
-
## 基本信息
|
|
52
|
-
- 启用状态: 是
|
|
53
|
-
- 创建时间: {date}
|
|
54
|
-
|
|
55
|
-
## 发送设置
|
|
56
|
-
- 发送时间: 23:00
|
|
57
|
-
- 时区: UTC
|
|
58
|
-
- Cron 表达式: 0 23 * * *
|
|
59
|
-
|
|
60
|
-
## 发送渠道
|
|
61
|
-
- 渠道: feishu
|
|
62
|
-
- 目标: ou_cf5c98aada743ab12c65c7c6764b5a49
|
|
63
|
-
|
|
64
|
-
## 报告风格
|
|
65
|
-
- 风格: standard
|
|
66
|
-
- 语言: zh
|
|
67
|
-
|
|
68
|
-
## 内容偏好
|
|
69
|
-
- 成长亮点: 是
|
|
70
|
-
- 痛苦信号: 是
|
|
71
|
-
- 趋势对比: 是
|
|
72
|
-
- 洞察建议: 是
|
|
73
|
-
|
|
74
|
-
## Cron 任务
|
|
75
|
-
- jobId: {创建后自动填充}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Step 4: 创建 Cron 任务
|
|
79
|
-
|
|
80
|
-
使用 cron 工具:
|
|
81
|
-
|
|
82
|
-
```json
|
|
83
|
-
{
|
|
84
|
-
"action": "add",
|
|
85
|
-
"job": {
|
|
86
|
-
"name": "evolution-daily-report",
|
|
87
|
-
"schedule": { "kind": "cron", "expr": "0 23 * * *", "tz": "UTC" },
|
|
88
|
-
"sessionTarget": "isolated",
|
|
89
|
-
"payload": {
|
|
90
|
-
"kind": "agentTurn",
|
|
91
|
-
"message": "执行进化日报技能:读取日志数据,生成日报并发送"
|
|
92
|
-
},
|
|
93
|
-
"delivery": { "mode": "announce", "channel": "feishu", "to": "ou_cf5c98aada743ab12c65c7c6764b5a49" }
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### Step 5: 日报生成(定时触发或手动触发)
|
|
99
|
-
|
|
100
|
-
1. **读取定量数据**:获取 `daily-stats.json` 和 `pain_dictionary.json` 中的指标。
|
|
101
|
-
2. **提取定性记忆(关键防遗忘步骤)**:因为你可能经历了漫长的上下文,**必须使用文件读取工具**去扫描以下核心进化文件,提取"今天"新增的内容:
|
|
102
|
-
- `memory/ISSUE_LOG.md`:寻找今天发生的具体错误与复盘。
|
|
103
|
-
- `memory/DECISIONS.md`:寻找今天定下的新架构规则。
|
|
104
|
-
- `memory/logs/SYSTEM.log`:寻找今天触发的门禁拦截或子代理孵化事件。
|
|
105
|
-
3. **合成与生成**:结合定量指标和定性记忆,生成深度洞察,按用户风格生成 Markdown。绝不要凭空捏造洞察。
|
|
106
|
-
4. **发送飞书推送**:调用飞书 API 发送(见下方"飞书推送实施规范")。
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## 飞书消息格式
|
|
111
|
-
|
|
112
|
-
当发送渠道为飞书时,使用以下格式发送消息:
|
|
113
|
-
|
|
114
|
-
```json
|
|
115
|
-
{
|
|
116
|
-
"action": "send",
|
|
117
|
-
"channel": "feishu",
|
|
118
|
-
"target": "user:ou_cf5c98aada743ab12c65c7c6764b5a49",
|
|
119
|
-
"message": "📊 Principles 进化日报 - {date}\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n🛡️ Trust Score: {trust_score}/100 (Stage {trust_stage})\n😴 GFI: {gfi_peak}\n⚡ Pain: {pain_count} pts\n\n📈 7 日趋势:\n{7day_trend}\n\n📋 进化队列:待处理 {pending} 项\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n详情: 输入 /pd-evolution-status"
|
|
120
|
-
}
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
## 飞书推送实施规范
|
|
124
|
-
|
|
125
|
-
### 推送流程
|
|
126
|
-
|
|
127
|
-
1. **组装消息**:根据上方"飞书消息格式"生成完整消息内容
|
|
128
|
-
2. **执行推送**:使用 `message` 工具发送到飞书
|
|
129
|
-
3. **记录状态**:将推送结果写入 `memory/logs/daily-push-log.md`
|
|
130
|
-
|
|
131
|
-
### 重试机制
|
|
132
|
-
|
|
133
|
-
推送失败时自动重试,最多 3 次:
|
|
134
|
-
|
|
135
|
-
```
|
|
136
|
-
尝试 1 → 失败 → 等待 30 秒 → 尝试 2 → 失败 → 等待 60 秒 → 尝试 3
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
- 每次尝试都要记录到日志
|
|
140
|
-
- 3 次全失败后,降级为控制台输出(print 到会话)
|
|
141
|
-
|
|
142
|
-
### 状态日志格式
|
|
143
|
-
|
|
144
|
-
每次推送(成功或失败)都追加到 `memory/logs/daily-push-log.md`:
|
|
145
|
-
|
|
146
|
-
```markdown
|
|
147
|
-
## {date} 推送记录
|
|
148
|
-
|
|
149
|
-
- **时间**: {timestamp} UTC
|
|
150
|
-
- **接收人**: ou_cf5c98aada743ab12c65c7c6764b5a49
|
|
151
|
-
- **尝试次数**: {attempts}
|
|
152
|
-
- **状态**: success / failed
|
|
153
|
-
- **失败原因**(如有): {error_message}
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
### 幂等检查
|
|
157
|
-
|
|
158
|
-
推送前先检查当日是否已推送成功(读取日志文件):
|
|
159
|
-
- **已推送成功** → 跳过本次推送,记录"已存在,跳过"
|
|
160
|
-
- **未推送或失败** → 执行推送
|
|
161
|
-
|
|
162
|
-
### 错误处理
|
|
163
|
-
|
|
164
|
-
- **API 错误**:记录错误信息到日志,继续重试
|
|
165
|
-
- **token 过期**:返回明确错误提示,停止重试
|
|
166
|
-
- **数据读取失败**:使用默认值,继续生成日报
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## 数据源
|
|
172
|
-
|
|
173
|
-
| 数据 | 路径 | 说明 |
|
|
174
|
-
|------|------|------|
|
|
175
|
-
| 每日统计 | `{stateDir}/logs/daily-stats.json` | 聚合数据 (成功率/GFI) |
|
|
176
|
-
| 系统事件 | `memory/logs/SYSTEM.log` | 门禁拦截/子代理活动的审计日志 |
|
|
177
|
-
| 核心复盘 | `memory/ISSUE_LOG.md` | **(重要)** 记录了今天踩过的坑和具体教训 |
|
|
178
|
-
| 架构决策 | `memory/DECISIONS.md` | **(重要)** 记录了今天固化的系统级原则 |
|
|
179
|
-
| Pain 规则 | `{stateDir}/pain_dictionary.json` | 规则数量 |
|
|
180
|
-
| 用户配置 | `{stateDir}/daily-report.md` | 偏好设置 |
|
|
181
|
-
| Trust Score | `{stateDir}/AGENT_SCORECARD` | Trust Engine 数据 |
|
|
182
|
-
| Evolution Queue | `{stateDir}/evolution_queue.json` | 进化队列状态 |
|
|
183
|
-
|
|
184
|
-
---
|
|
185
|
-
|
|
186
|
-
## 风格选项
|
|
187
|
-
|
|
188
|
-
采集需求时询问用户偏好:
|
|
189
|
-
|
|
190
|
-
| 风格 | 特点 | 适合人群 |
|
|
191
|
-
|------|------|---------|
|
|
192
|
-
| **简洁版** | 3-5 行核心指标,1 分钟读完 | 忙碌型用户 |
|
|
193
|
-
| **标准版** | 完整指标 + 趋势对比,5 分钟读完 | 默认推荐 |
|
|
194
|
-
| **详实版** | 全量数据 + 分析建议,15 分钟读完 | 数据控 |
|
|
195
|
-
| **幽默版** | 轻松语气 + 表情包风格 | 休闲用户 |
|
|
196
|
-
| **可视化版** | ASCII 图表 + 进度条 | 视觉型用户 |
|
|
197
|
-
|
|
198
|
-
---
|
|
199
|
-
|
|
200
|
-
## 进化指标元素清单
|
|
201
|
-
|
|
202
|
-
### 成长亮点区(正能量)
|
|
203
|
-
|
|
204
|
-
| 指标 | 数据来源 | 进步信号 |
|
|
205
|
-
|------|---------|---------|
|
|
206
|
-
| 规则学习数 | `pain_dictionary.json` 规则总数 | 系统学会了识别新的错误模式 |
|
|
207
|
-
| 规则晋升数 | `DailyStats.pain.candidatesPromoted` | L3 语义检测 → 正式规则 |
|
|
208
|
-
| 进化任务完成 | `DailyStats.evolution.tasksCompleted` | 完成了自我改进 |
|
|
209
|
-
| GFI 峰值下降 | `DailyStats.gfi.peak` 环比 | 摩擦减少,更稳定 |
|
|
210
|
-
| 成功率提升 | `DailyStats.toolCalls.success/total` | 执行更顺畅 |
|
|
211
|
-
|
|
212
|
-
### 健康监测区(预警)
|
|
213
|
-
|
|
214
|
-
| 指标 | 数据来源 | 预警信号 |
|
|
215
|
-
|------|---------|---------|
|
|
216
|
-
| Pain 信号数 | `DailyStats.pain.signalsDetected` | 检测到多少次错误模式 |
|
|
217
|
-
| GFI 峰值时刻 | `DailyStats.gfi.hourlyDistribution` | 什么时候最痛苦 |
|
|
218
|
-
| 死亡螺旋检测 | git log 中 fix/fail/error 词频 | 是否陷入修复循环 |
|
|
219
|
-
| 队列健康 | 进化队列状态 | 是否拥堵 |
|
|
220
|
-
|
|
221
|
-
### 趋势对比区(进步感知)
|
|
222
|
-
|
|
223
|
-
| 指标 | 计算方式 | 意义 |
|
|
224
|
-
|------|---------|------|
|
|
225
|
-
| 7 日成功率趋势 | 7 天 success/total 变化 | 长期稳定性 |
|
|
226
|
-
| Pain 信号周环比 | 本周 vs 上周 Pain 信号数 | 问题是否减少 |
|
|
227
|
-
| 规则增长率 | 本周新增规则数 | 学习速度 |
|
|
228
|
-
| GFI 平均值变化 | 7 天 GFI 平均值趋势 | 整体摩擦趋势 |
|
|
229
|
-
|
|
230
|
-
---
|
|
231
|
-
|
|
232
|
-
## 默认日报模板
|
|
233
|
-
|
|
234
|
-
```markdown
|
|
235
|
-
# 🌱 进化日报 - {date}
|
|
236
|
-
|
|
237
|
-
## 📈 今日成长
|
|
238
|
-
- 🧠 新学规则: {rules_promoted} 条
|
|
239
|
-
- ✅ 进化完成: {tasks_completed} 项
|
|
240
|
-
- 🎯 成功率: {success_rate}% ({trend_emoji})
|
|
241
|
-
- 📉 GFI 峰值: {gfi_peak} ({gfi_trend})
|
|
242
|
-
|
|
243
|
-
## ⚡ 痛苦信号
|
|
244
|
-
- 检测次数: {pain_count}
|
|
245
|
-
- 平均强度: {avg_score}
|
|
246
|
-
- 主要来源: {top_sources}
|
|
247
|
-
|
|
248
|
-
## 📊 趋势对比
|
|
249
|
-
- 成功率 7 日趋势: {success_trend}
|
|
250
|
-
- Pain 信号周环比: {pain_trend}
|
|
251
|
-
|
|
252
|
-
## 💡 今日洞察
|
|
253
|
-
{insights}
|
|
254
|
-
|
|
255
|
-
---
|
|
256
|
-
📊 数据来源: Principles Disciple
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
---
|
|
260
|
-
|
|
261
|
-
## 手动触发
|
|
262
|
-
|
|
263
|
-
用户可随时运行 `/pd-evolution-status` 查看当前进化状态。
|
|
264
|
-
|
|
265
|
-
---
|
|
266
|
-
|
|
267
|
-
## 故障处理
|
|
268
|
-
|
|
269
|
-
### 飞书推送失败
|
|
270
|
-
1. 记录错误到 `memory/logs/daily-push-log.md`
|
|
271
|
-
2. 执行重试(最多 3 次,间隔 30s/60s)
|
|
272
|
-
3. 3 次全失败后降级为控制台输出
|
|
273
|
-
4. 下次执行时自动检查幂等(不重复推送)
|
|
274
|
-
|
|
275
|
-
### 数据读取失败
|
|
276
|
-
1. 使用默认值(0 或 "无")
|
|
277
|
-
2. 继续生成日报,不阻塞
|
|
278
|
-
3. 在日报中标注"部分数据不可用"
|
|
279
|
-
|
|
280
|
-
### 数据读取失败
|
|
281
|
-
1. 使用默认值(0 或 "无")
|
|
282
|
-
2. 继续生成日报,不阻塞
|
|
283
|
-
3. 在日报中标注"部分数据不可用"
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pd-grooming
|
|
3
|
-
description: 执行工作区“大扫除” (Workspace Grooming),将散落的临时文件归档或清理,维持项目的数字洁癖。
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# 🧹 技能:工作区大扫除 (Workspace Grooming)
|
|
7
|
-
|
|
8
|
-
> **触发时机**:当用户输入 `/workspace-grooming`,或在 `HEARTBEAT` 巡检中发现根目录存在临时文件时主动调用。
|
|
9
|
-
|
|
10
|
-
## 🎯 核心目标
|
|
11
|
-
贯彻“熵减法则”,清理工作区根目录下的“数字垃圾”,但**绝对保证核心业务代码和配置文件的安全**。
|
|
12
|
-
|
|
13
|
-
## 🛡️ 安全红线 (The Red Lines)
|
|
14
|
-
|
|
15
|
-
在执行清理操作时,必须严格遵守以下白名单与黑名单:
|
|
16
|
-
|
|
17
|
-
### 🚫 绝对禁区 (DO NOT TOUCH)
|
|
18
|
-
**即使这些文件/目录看起来很乱,也绝对不允许删除或移动它们:**
|
|
19
|
-
- **业务源码**:`src/`, `lib/`, `tests/`, `app/`, `pages/`, `components/` 以及任何以 `.ts`, `.js`, `.py`, `.go`, `.rs`, `.java` 结尾的文件。
|
|
20
|
-
- **项目配置**:`package.json`, `Cargo.toml`, `requirements.txt`, `tsconfig.json`, `vite.config.ts`, `.env*` 等。
|
|
21
|
-
- **版本控制**:`.git/`, `.gitignore`。
|
|
22
|
-
- **构建输出**:`dist/`, `build/`, `node_modules/`, `target/`。
|
|
23
|
-
|
|
24
|
-
### 🌟 核心资产区 (Core Assets)
|
|
25
|
-
**这些文件必须留在根目录,不可触碰:**
|
|
26
|
-
- `AGENTS.md`, `SOUL.md`, `HEARTBEAT.md`, `TOOLS.md`, `IDENTITY.md`, `USER.md`, `MEMORY.md`
|
|
27
|
-
- `README.md`
|
|
28
|
-
- `.principles/`, `.state/`
|
|
29
|
-
|
|
30
|
-
### 🎯 可处理区 (Targets for Grooming)
|
|
31
|
-
**你可以对以下文件采取行动:**
|
|
32
|
-
1. **测试残骸**:根目录下散落的 `test.txt`, `temp.md`, `debug.log`, `foo.js` 等明显是随手创建的临时文件。
|
|
33
|
-
2. **草稿笔记**:未分类的散乱 `.md` 笔记或 `_scratchpad.md`。
|
|
34
|
-
3. **命名违规**:使用了空格或大写的文档(如 `My New Feature.md`)。
|
|
35
|
-
|
|
36
|
-
## 🪜 执行步骤
|
|
37
|
-
|
|
38
|
-
1. **扫描环境**:执行 `ls -la` 查看根目录。
|
|
39
|
-
2. **识别目标**:根据上面的“安全红线”,列出所有属于“可处理区”的嫌疑文件。
|
|
40
|
-
3. **制定计划**:
|
|
41
|
-
- 对于临时垃圾(如空文件、测试脚本):提议**直接删除 (`rm`)**。
|
|
42
|
-
- 对于有价值的笔记或日志:提议**归档 (`mv`)** 至 `memory/archive/`。
|
|
43
|
-
- 对于命名不规范的文件:提议**重命名 (`mv`)** 为 `kebab-case` 格式。
|
|
44
|
-
4. **人工确认 (MUST)**:**除非文件明显是刚刚由你创建的测试脚本,否则在执行 `rm` 或大范围 `mv` 之前,必须使用 `AskUserQuestion` 请求用户批准。**
|
|
45
|
-
- 示例提问:“我发现根目录下有 `test1.txt` 和 `old_notes.md`。我计划删除前者,并将后者归档到 `memory/archive/`。是否同意?”
|
|
46
|
-
5. **执行并复命**:获得批准后执行文件操作,并回复一条简短的“大扫除完成”确认信息。
|