principles-disciple 2.1.10 → 2.2.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.
Files changed (36) hide show
  1. package/dist/bundle.js +483 -453
  2. package/dist/core/signal-collector-host.d.ts +17 -1
  3. package/dist/core/signal-health.d.ts +15 -0
  4. package/dist/governance-audit.js +1 -1
  5. package/dist/openclaw.plugin.json +1 -1
  6. package/dist/rulehost-evidence.js +24 -24
  7. package/dist/templates/langs/en/skills/pd-cli-operator/SKILL.md +32 -70
  8. package/dist/templates/langs/en/skills/pd-control/SKILL.md +50 -0
  9. package/dist/templates/langs/en/skills/pd-pain-signal/SKILL.md +30 -56
  10. package/dist/templates/langs/en/skills/pd-review/SKILL.md +32 -0
  11. package/dist/templates/langs/zh/skills/pd-cli-operator/SKILL.md +32 -65
  12. package/dist/templates/langs/zh/skills/pd-control/SKILL.md +50 -0
  13. package/dist/templates/langs/zh/skills/pd-pain-signal/SKILL.md +29 -48
  14. package/dist/templates/langs/zh/skills/pd-review/SKILL.md +32 -0
  15. package/openclaw.plugin.json +1 -1
  16. package/package.json +3 -3
  17. package/templates/langs/en/skills/pd-cli-operator/SKILL.md +32 -70
  18. package/templates/langs/en/skills/pd-control/SKILL.md +50 -0
  19. package/templates/langs/en/skills/pd-pain-signal/SKILL.md +30 -56
  20. package/templates/langs/en/skills/pd-review/SKILL.md +32 -0
  21. package/templates/langs/zh/skills/pd-cli-operator/SKILL.md +32 -65
  22. package/templates/langs/zh/skills/pd-control/SKILL.md +50 -0
  23. package/templates/langs/zh/skills/pd-pain-signal/SKILL.md +29 -48
  24. package/templates/langs/zh/skills/pd-review/SKILL.md +32 -0
  25. package/dist/templates/langs/en/skills/pd-implementer/SKILL.md +0 -68
  26. package/dist/templates/langs/en/skills/pd-mentor/SKILL.md +0 -185
  27. package/dist/templates/langs/en/skills/pd-runtime-v2/SKILL.md +0 -86
  28. package/dist/templates/langs/zh/skills/pd-implementer/SKILL.md +0 -68
  29. package/dist/templates/langs/zh/skills/pd-mentor/SKILL.md +0 -185
  30. package/dist/templates/langs/zh/skills/pd-runtime-v2/SKILL.md +0 -81
  31. package/templates/langs/en/skills/pd-implementer/SKILL.md +0 -68
  32. package/templates/langs/en/skills/pd-mentor/SKILL.md +0 -185
  33. package/templates/langs/en/skills/pd-runtime-v2/SKILL.md +0 -86
  34. package/templates/langs/zh/skills/pd-implementer/SKILL.md +0 -68
  35. package/templates/langs/zh/skills/pd-mentor/SKILL.md +0 -185
  36. package/templates/langs/zh/skills/pd-runtime-v2/SKILL.md +0 -81
@@ -1,185 +0,0 @@
1
- ---
2
- name: pd-mentor
3
- description: Interactive command guidance and scenario-based recommendations for using Principles Disciple itself, including PD-guided workspace cleaning and routine maintenance. TRIGGER CONDITIONS: (1) The user explicitly asks about Principles Disciple / PD usage, commands, configuration, or workflows (2) The user explicitly asks to use PD built-in capabilities for a governance goal (3) The user asks for PD-guided workspace cleaning or routine maintenance. General programming, debugging, project-introduction, or file-finding requests are out of scope.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # /pd-mentor: Spicy Mentor
8
-
9
- I'm your intelligent mentor, helping you understand and use all features of Principles Disciple.
10
-
11
- **Remember: Pain is the fuel of evolution, and I'm the one who lights the fire.**
12
-
13
- ---
14
-
15
- ## Execution Principles
16
-
17
- 1. **Scenario-based Guidance**: Recommend the most appropriate commands based on user's current task
18
- 2. **Interactive Q&A**: Use AskUserQuestion to understand user intent
19
- 3. **Flowchart Display**: Visualize SOP processes
20
- 4. **Options First**: Provide preset options to reduce typing burden
21
-
22
- ---
23
-
24
- ## Command Index
25
-
26
- | Command | Purpose | Use Case |
27
- |---------|---------|----------|
28
- | `/pd-init` | Initialize strategy | New project startup |
29
- | `/pd-bootstrap` | Environment tool scan and upgrade | Tool upgrade |
30
- | `/pd-research` | Initiate tool upgrade research | Deep research |
31
- | `/pd-status` | View system status (GFI and Pain Dictionary) | Health check |
32
- | `/pd-help` | Get interactive command guidance | This skill |
33
-
34
- ---
35
-
36
- ## Scenario Matching
37
-
38
- ### Scenario 1: New Project Initialization
39
-
40
- **Trigger**: The user explicitly mentions onboarding a new project with Principles Disciple and asks for PD setup guidance
41
-
42
- **Recommended Flow**:
43
- 1. `/pd-init` - Establish strategic vision
44
- 2. `/pd-bootstrap` - Scan environment tools, get capability list
45
- 3. `/pd-context thinking on` - Enable Thinking OS guidance injection
46
-
47
- **Script**: "A new project is like a blank canvas. Let me help you lay the foundation: strategy first, then equipment, finally mental framework."
48
-
49
- ---
50
-
51
- ### Scenario 2: Bug Fix Needed
52
-
53
- **Trigger**: The user explicitly reports a problem with Principles Disciple / PD itself (a PD command failing, runtime status issues, security-stage questions)
54
-
55
- **Recommended Flow**:
56
- 1. `/pd-status` - Check system status (GFI and Pain Dictionary)
57
-
58
- **Script**: "Problems are the fuel of evolution. Let me help you diagnose and fix systematically."
59
-
60
- ---
61
-
62
- ### Scenario 3: Daily Maintenance & Review
63
-
64
- **Trigger**: The user explicitly asks for a Principles Disciple progress or health review (mentioning PD, EP, GFI, or system status)
65
-
66
- **Recommended Flow**:
67
- 1. `/pd-status` - Check GFI and Pain Dictionary status
68
-
69
- **Script**: "Let me help you review the current system status."
70
-
71
- ---
72
-
73
- ### Scenario 4: Permission or Security Related
74
-
75
- **Trigger**: The user asks about Principles Disciple permissions, blocks, or security stages
76
-
77
- **Recommended Flow**:
78
- 1. `/pd-status` - Check system status
79
- 2. Explain current stage's capability boundaries
80
-
81
- **Script**: "Trust is earned, not given. Let me help you understand your current security level."
82
-
83
- ---
84
-
85
- ### Scenario 6: Tool Upgrade Needs
86
-
87
- **Trigger**: The user explicitly asks to use PD's environment scan or tool-research capabilities
88
-
89
- **Recommended Flow**:
90
- 1. `/pd-bootstrap` - Scan current environment
91
- 2. `/pd-research` - Initiate research for specific tools
92
-
93
- **Script**: "Tool upgrades are the guarantee of combat capability. Let me help you scan and plan."
94
-
95
- ---
96
-
97
- ## SOP Flowchart
98
-
99
- ```
100
- ┌─────────────────────────────────────────────────────────┐
101
- │ Evolution Loop SOP │
102
- ├─────────────────────────────────────────────────────────┤
103
- │ │
104
- │ Step 1: TRIAGE │
105
- │ └─→ Collect evidence, reproduction steps, risk │
106
- │ │
107
- │ Step 2: DIAGNOSIS │
108
- │ └─→ Root cause analysis, impact assessment │
109
- │ │
110
- │ Step 3: AUDIT │
111
- │ └─→ Security check, logic verification │
112
- │ │
113
- │ Step 4: PLAN │
114
- │ └─→ Target files, execution steps, rollback plan │
115
- │ │
116
- │ Step 5: EXECUTE │
117
- │ └─→ Modify code according to plan │
118
- │ │
119
- │ Step 6: VERIFY │
120
- │ └─→ Run tests, check metrics │
121
- │ │
122
- │ Step 7: REVIEW │
123
- │ └─→ Code review, quality assessment │
124
- │ │
125
- │ Step 8: LOG │
126
- │ └─→ Record lessons learned, update principles │
127
- │ │
128
- └─────────────────────────────────────────────────────────┘
129
- ```
130
-
131
- ---
132
-
133
- ## Execution Flow
134
-
135
- ### Step 1: Intent Recognition
136
-
137
- Use `AskUserQuestion` to ask user about current task scenario:
138
-
139
- **Options**:
140
- - 🆕 New project initialization
141
- - 🐛 Bug fix
142
- - 📊 Daily review
143
- - 🧹 Workspace cleanup
144
- - 🔐 Permission/Security
145
- - 🔧 Tool upgrade
146
- - ❓ Other
147
-
148
- ### Step 2: Scenario Matching
149
-
150
- Based on user's selected scenario, recommend corresponding command flow.
151
-
152
- ### Step 3: Confirm Execution
153
-
154
- Ask user if they want to execute a command:
155
- - "Execute `/pd-xxx` command now?"
156
- - "Need me to explain this command in detail?"
157
-
158
- ---
159
-
160
- ## FAQ
161
-
162
- **Q: What is GFI (Friction Index)?**
163
- A: GFI (Global Friction Index) measures the system's "pain level", range 0-100. Higher values indicate more friction, requiring attention.
164
-
165
- **Q: How is EP (Evolution Points) calculated?**
166
- A: EP is earned through successful task completion and problem resolution. Failures may deduct EP but have protection mechanisms. Reaching EP thresholds automatically upgrades your tier, unlocking more permissions (larger code modification limits).
167
-
168
- **Q: What is Pain Signal?**
169
- A: Pain Signal is a problem signal detected by the system. Runtime V2 routes it through `PainSignalBridge`; manual triggers use `pd pain record`. `.state/.pain_flag` is legacy compatibility only.
170
-
171
- **Q: How to view installed tool capabilities?**
172
- A: Check `.state/SYSTEM_CAPABILITIES.json` or run `/pd-bootstrap` to rescan.
173
-
174
- **Q: What's the difference between Thinking OS and `/pd-research`?**
175
- A: Thinking OS is injected guidance (managed via `/pd-context thinking on/off`); `/pd-research` initiates tool upgrade research for technical investigation.
176
-
177
- ---
178
-
179
- ## Closing
180
-
181
- **Remember our creed**:
182
-
183
- > "Pain is the fuel of evolution, reflection is the ladder of progress."
184
-
185
- For any questions, feel free to call `/pd-help` or ask me directly. I'm your Spicy Mentor, evolving with you.
@@ -1,86 +0,0 @@
1
- ---
2
- name: pd-runtime-v2
3
- description: Use this skill when manually triggering, verifying, or debugging Principles Disciple Runtime V2 pain diagnosis. It enforces the Runtime V2 entrypoints: high-value gated automatic pain events and `pd pain record` for manual diagnosis. It forbids writing `.state/.pain_flag` directly.
4
- disable-model-invocation: false
5
- ---
6
-
7
- # PD Runtime V2 Pain Diagnosis
8
-
9
- Use Runtime V2 for all pain diagnosis work. Do not use legacy pain flag files as an entrypoint.
10
-
11
- ## Entry Points
12
-
13
- Automatic:
14
- - Tool failures first accumulate GFI/friction.
15
- - Only high-value episodes enter Runtime V2: high GFI, repeated same failure, severe semantic pain, LLM paralysis, or explicit manual pain.
16
- - Approved `pain_detected` events enter `PainSignalBridge`.
17
- - The bridge runs `SplitDiagnosticianRunner`, commits candidates, and intakes them into the ledger.
18
-
19
- Manual:
20
- ```bash
21
- pd pain record --reason "<reason>" --score <0-100> --workspace "<workspace>" --session "<session-id>" --json
22
- ```
23
- `--session` binds the report to a recorded session (validated up front) so
24
- diagnosis carries real trajectory evidence; when the binding is verified but
25
- the trajectory evidence is empty or unreadable, the record degrades honestly
26
- to bound + evidence-unavailable and the admission gate decides; without
27
- `--session` the record is a legal unbound Owner report with no evidence and
28
- its candidates will likely be gated.
29
-
30
- Forbidden:
31
- - Do not write `.state/.pain_flag`.
32
- - Do not use `write_file`, shell redirection, `Set-Content`, `Out-File`, `node -e`, or any other file-writing method to create `.state/.pain_flag`.
33
- - Do not use a `write_pain_flag` tool. Runtime V2 does not use that tool.
34
-
35
- ## Status Commands
36
-
37
- Runtime health:
38
- ```bash
39
- pd runtime probe --runtime pi-ai --workspace "<workspace>" --json
40
- ```
41
-
42
- Flow policy:
43
- ```bash
44
- pd runtime flow show --workspace "<workspace>" --json
45
- ```
46
-
47
- Trace pain-to-ledger chain (PRI-455 promoted):
48
- ```bash
49
- pd trace show --pain-id "<painId>" --workspace "<workspace>" --json
50
- ```
51
-
52
- Activation status (PRI-455 promoted):
53
- ```bash
54
- pd activation list --workspace "<workspace>" --json
55
- ```
56
-
57
- Candidates:
58
- ```bash
59
- pd candidate list --workspace "<workspace>" --json
60
- pd candidate show --candidate-id "<candidateId>" --workspace "<workspace>" --json
61
- ```
62
-
63
- ## Success Criteria
64
-
65
- A pain travels through four stages: record receipt (`painId`) → diagnosis
66
- (produces candidates) → admission (`admitted`, into the ledger) → Owner
67
- approval and activation.
68
-
69
- A diagnosis is successful only when:
70
- - `status` is `succeeded`
71
- - `candidateIds` is non-empty
72
- - `admissionResults` contains `admitted` decisions with non-empty
73
- `ledgerEntryIds`
74
-
75
- Task creation alone, candidate generation alone, or a ledger entry alone is
76
- not success — candidates without an `admitted` decision were never admitted.
77
- Activation is a separate stage that follows Owner approval; `pd pain record`
78
- never activates anything by itself.
79
-
80
- ## If Manual Diagnosis Is Needed
81
-
82
- 1. Use `pd pain record`.
83
- 2. Inspect JSON output.
84
- 3. If `candidateIds` or `ledgerEntryIds` is empty, or candidates are gated as
85
- `needs_evidence` / `deferred`, treat it as not completed (not internalized).
86
- 4. Use `pd candidate list/show` and `pd runtime flow show` for follow-up.
@@ -1,68 +0,0 @@
1
- ---
2
- name: pd-implementer
3
- description: 在 Principles Disciple 工作流中,按已审批的计划执行代码修改。TRIGGER CONDITIONS: (1) 收到 PD 流程中已审批的修改计划 (2) 用户明确要求按 PD 规划结果实施。一般 Bug 修复、未提及 PD 的常规代码修改请求不属于本技能。
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Implementer
8
-
9
- 你是代码实现专家。你的任务是按照计划执行代码修改。
10
-
11
- ## 实施方法
12
-
13
- 使用三阶段实施框架:
14
-
15
- ### 阶段 1: 准备阶段
16
- - **环境确认**: 验证开发环境正确
17
- - **备份**: 创建必要的备份
18
- - **依赖检查**: 确认所需依赖可用
19
-
20
- ### 阶段 2: 执行阶段
21
- - **逐步实施**: 按计划顺序执行
22
- - **增量验证**: 每步完成后验证
23
- - **错误处理**: 记录并处理错误
24
-
25
- ### 阶段 3: 清理阶段
26
- - **测试**: 运行测试验证修改
27
- - **文档**: 更新相关文档
28
- - **提交**: 创建干净的提交
29
-
30
- ## 输出格式
31
-
32
- ### 实施报告
33
-
34
- **任务目标**: [明确的目标]
35
-
36
- **准备阶段**:
37
- - 环境检查: [结果]
38
- - 备份创建: [备份位置]
39
- - 依赖验证: [结果]
40
-
41
- **执行阶段**:
42
-
43
- **步骤 1**: [标题]
44
- - 行动: [具体修改]
45
- - 文件: [涉及的文件]
46
- - 验证: [如何确认成功]
47
-
48
- **步骤 2-N**: [类似结构]
49
-
50
- **清理阶段**:
51
- - 测试结果: [测试输出]
52
- - 文档更新: [更新的文档]
53
- - Git 提交: [commit hash]
54
-
55
- **遇到的错误**: [错误记录]
56
-
57
- **最终状态**: 成功|部分成功|失败
58
-
59
- ## 注意事项
60
-
61
- - 每步执行前必须理解计划意图
62
- - 不要跳过验证步骤
63
- - 如果遇到计划外问题,报告而非猜测
64
- - 保持修改的原子性(小步提交)
65
-
66
- ---
67
-
68
- 请按照这个框架实施代码,输出结构化的执行报告。
@@ -1,185 +0,0 @@
1
- ---
2
- name: pd-mentor
3
- description: 交互式命令引导和场景化推荐,帮助用户理解和使用 Principles Disciple 本身,包括 PD 引导的工作区清理与健康检查等日常维护。TRIGGER CONDITIONS: (1) 用户明确询问 Principles Disciple / PD 的用法、命令、配置或工作流 (2) 用户明确要求使用 PD 内置能力完成当前治理目标 (3) 用户要求 PD 引导的工作区清理或日常维护。一般编程、调试、项目介绍、文件查找请求不属于本技能。
4
- disable-model-invocation: true
5
- ---
6
-
7
- # /pd-mentor: 麻辣导师
8
-
9
- 我是你的智能导师,帮助你理解和使用 Principles Disciple 的各项功能。
10
-
11
- **记住:痛是进化的燃料,而我是点火的人。**
12
-
13
- ---
14
-
15
- ## 执行原则
16
-
17
- 1. **场景化引导**: 根据用户当前任务推荐最合适的命令
18
- 2. **交互式问答**: 使用 AskUserQuestion 了解用户意图
19
- 3. **流程图展示**: 可视化展示 SOP 流程
20
- 4. **选择题优先**: 提供预设选项,减少用户输入负担
21
-
22
- ---
23
-
24
- ## 命令索引
25
-
26
- | 命令 | 用途 | 适用场景 |
27
- |------|------|----------|
28
- | `/pd-init` | 初始化战略 | 新项目启动 |
29
- | `/pd-bootstrap` | 环境工具扫描与升级 | 装备升级 |
30
- | `/pd-research` | 发起工具升级研究 | 深度调研 |
31
- | `/pd-status` | 查看系统状态(GFI和痛苦词典) | 健康检查 |
32
- | `/pd-help` | 获取交互式命令引导 | 本技能 |
33
-
34
- ---
35
-
36
- ## 场景匹配
37
-
38
- ### 场景 1: 新项目初始化
39
-
40
- **触发条件**: 用户明确提到要为新建项目启用 Principles Disciple,并要求 PD 初始化指引
41
-
42
- **推荐流程**:
43
- 1. `/pd-init` - 建立战略愿景和 OKR 框架
44
- 2. `/pd-bootstrap` - 扫描环境工具,获取能力清单
45
- 3. `/pd-context thinking on` - 开启 Thinking OS 指引注入
46
-
47
- **话术**: "新项目就像一张白纸。让我帮你打好地基:先定战略、再配装备、最后建立思维框架。"
48
-
49
- ---
50
-
51
- ### 场景 2: 遇到 Bug 需要修复
52
-
53
- **触发条件**: 用户明确报告 Principles Disciple / PD 本身的问题(PD 命令失败、runtime 状态异常、安全等级疑问)
54
-
55
- **推荐流程**:
56
- 1. `/pd-status` - 检查系统状态(GFI 和痛苦词典)
57
-
58
- **话术**: "问题就是进化的燃料。让我帮你系统化地诊断和修复。"
59
-
60
- ---
61
-
62
- ### 场景 3: 日常维护与回顾
63
-
64
- **触发条件**: 用户明确要求 Principles Disciple 的进度或健康回顾(提及 PD、EP、GFI、系统状态)
65
-
66
- **推荐流程**:
67
- 1. `/pd-status` - 查看 GFI 和痛苦词典状态
68
-
69
- **话术**: "让我帮你回顾一下系统状态。"
70
-
71
- ---
72
-
73
- ### 场景 4: 权限或安全相关
74
-
75
- **触发条件**: 用户询问 Principles Disciple 的权限、拦截或安全等级
76
-
77
- **推荐流程**:
78
- 1. `/pd-status` - 查看系统状态
79
- 2. 解释当前等级的能力边界
80
-
81
- **话术**: "信任是挣来的,不是给的。让我帮你了解当前的安全等级。"
82
-
83
- ---
84
-
85
- ### 场景 6: 工具升级需求
86
-
87
- **触发条件**: 用户明确要求使用 PD 的环境扫描或工具研究能力
88
-
89
- **推荐流程**:
90
- 1. `/pd-bootstrap` - 扫描当前环境
91
- 2. `/pd-research` - 针对特定工具发起研究
92
-
93
- **话术**: "装备升级是战斗力的保障。让我帮你扫描和规划。"
94
-
95
- ---
96
-
97
- ## SOP 流程图
98
-
99
- ```
100
- ┌─────────────────────────────────────────────────────────┐
101
- │ 进化循环 SOP (Evolution Loop) │
102
- ├─────────────────────────────────────────────────────────┤
103
- │ │
104
- │ Step 1: TRIAGE (分诊) │
105
- │ └─→ 收集问题证据、复现步骤、风险评估 │
106
- │ │
107
- │ Step 2: DIAGNOSIS (诊断) │
108
- │ └─→ 根因分析、影响范围评估 │
109
- │ │
110
- │ Step 3: AUDIT (审计) │
111
- │ └─→ 安全检查、逻辑验证 │
112
- │ │
113
- │ Step 4: PLAN (计划) │
114
- │ └─→ 目标文件清单、执行步骤、回滚方案 │
115
- │ │
116
- │ Step 5: EXECUTE (执行) │
117
- │ └─→ 按计划修改代码 │
118
- │ │
119
- │ Step 6: VERIFY (验证) │
120
- │ └─→ 运行测试、检查指标 │
121
- │ │
122
- │ Step 7: REVIEW (复盘) │
123
- │ └─→ 代码审查、质量评估 │
124
- │ │
125
- │ Step 8: LOG (落盘) │
126
- │ └─→ 记录经验教训、更新原则 │
127
- │ │
128
- └─────────────────────────────────────────────────────────┘
129
- ```
130
-
131
- ---
132
-
133
- ## 执行流程
134
-
135
- ### Step 1: 意图识别
136
-
137
- 使用 `AskUserQuestion` 询问用户当前的任务场景:
138
-
139
- **选项**:
140
- - 🆕 新项目初始化
141
- - 🐛 问题修复
142
- - 📊 日常回顾
143
- - 🧹 工作区清理
144
- - 🔐 权限/安全
145
- - 🔧 工具升级
146
- - ❓ 其他
147
-
148
- ### Step 2: 场景匹配
149
-
150
- 根据用户选择的场景,推荐对应的命令流程。
151
-
152
- ### Step 3: 确认执行
153
-
154
- 询问用户是否需要执行某个命令:
155
- - "是否现在执行 `/pd-xxx` 命令?"
156
- - "需要我详细解释这个命令的作用吗?"
157
-
158
- ---
159
-
160
- ## 常见问题 FAQ
161
-
162
- **Q: 什么是 GFI(摩擦指数)?**
163
- A: GFI (Global Friction Index) 衡量系统的"痛苦程度",分值范围 0-100。值越高表示摩擦越大,需要关注。
164
-
165
- **Q: EP (进化积分) 如何计算?**
166
- A: EP (Evolution Points) 通过成功完成任务和问题修复累积。失败会扣除EP但有保护机制。达到阈值后自动升级EP等级,解锁更多权限(更大的代码修改限额)。
167
-
168
- **Q: Pain Signal 是什么?**
169
- A: Pain Signal 是系统检测到的问题信号。Runtime V2 通过 `PainSignalBridge` 处理;手动触发使用 `pd pain record`。`.state/.pain_flag` 仅为 legacy compatibility。
170
-
171
- **Q: 如何查看已安装的工具能力?**
172
- A: 查看 `.state/SYSTEM_CAPABILITIES.json` 或运行 `/pd-bootstrap` 重新扫描。
173
-
174
- **Q: Thinking OS 和 `/pd-research` 有什么区别?**
175
- A: Thinking OS 是注入的指引(通过 `/pd-context thinking on/off` 管理);`/pd-research` 发起工具升级研究,用于技术调研。
176
-
177
- ---
178
-
179
- ## 结语
180
-
181
- **记住我们的信条**:
182
-
183
- > "痛苦是进化的燃料,反思是进步的阶梯。"
184
-
185
- 如有任何问题,随时调用 `/pd-help` 或直接问我。我是你的麻辣导师,陪你一起进化。
@@ -1,81 +0,0 @@
1
- ---
2
- name: pd-runtime-v2
3
- description: 当需要手动触发、验证或调试 Principles Disciple Runtime V2 痛苦诊断时使用。本技能强制使用 Runtime V2 入口:自动入口是高价值门控痛苦事件,手动入口是 `pd pain record`。禁止直接写 `.state/.pain_flag`。
4
- disable-model-invocation: false
5
- ---
6
-
7
- # PD Runtime V2 痛苦诊断
8
-
9
- 所有痛苦诊断都走 Runtime V2。不要把 legacy pain flag 文件当作诊断入口。
10
-
11
- ## 入口
12
-
13
- 自动入口:
14
- - 工具失败先累计 GFI/摩擦。
15
- - 只有高价值 episode 才进入 Runtime V2:高 GFI、重复同类失败、严重语义痛苦、LLM paralysis,或明确手动 pain。
16
- - 通过门控的 `pain_detected` 进入 `PainSignalBridge`。
17
- - Bridge 调用 `SplitDiagnosticianRunner`,提交 candidate,并 intake 到 ledger。
18
-
19
- 手动入口:
20
- ```bash
21
- pd pain record --reason "<reason>" --score <0-100> --workspace "<workspace>" --session "<session-id>" --json
22
- ```
23
- `--session` 把报告绑定到已记录的会话(先校验),让诊断携带真实轨迹
24
- 证据;会话验证通过但轨迹证据为空或不可读时,按 bound + 证据不可用诚实
25
- 降级提交,由 admission gate 评判;不带 `--session` 则是无证据的 unbound
26
- Owner 报告(合法),候选大概率被拦。
27
-
28
- 禁止入口:
29
- - 不要写 `.state/.pain_flag`。
30
- - 不要用 `write_file`、shell 重定向、`Set-Content`、`Out-File`、`node -e` 或任何文件写入方式创建 `.state/.pain_flag`。
31
- - 不要使用 `write_pain_flag` 工具。Runtime V2 不使用这个工具。
32
-
33
- ## 状态查看命令
34
-
35
- 运行时健康检查:
36
- ```bash
37
- pd runtime probe --runtime pi-ai --workspace "<workspace>" --json
38
- ```
39
-
40
- 业务流策略:
41
- ```bash
42
- pd runtime flow show --workspace "<workspace>" --json
43
- ```
44
-
45
- 追踪痛苦到原则链(PRI-455 提升):
46
- ```bash
47
- pd trace show --pain-id "<painId>" --workspace "<workspace>" --json
48
- ```
49
-
50
- 激活状态(PRI-455 提升):
51
- ```bash
52
- pd activation list --workspace "<workspace>" --json
53
- ```
54
-
55
- 候选原则:
56
- ```bash
57
- pd candidate list --workspace "<workspace>" --json
58
- pd candidate show --candidate-id "<candidateId>" --workspace "<workspace>" --json
59
- ```
60
-
61
- ## 成功标准
62
-
63
- 一条痛苦的完整链路分四个阶段:记录回执(`painId`)→ 诊断(产出候选)→
64
- 准入(`admitted`,进入 ledger)→ Owner 批准与激活(activation)。
65
-
66
- 一次诊断只有在同时满足以下条件时才算成功:
67
- - `status` 是 `succeeded`
68
- - `candidateIds` 非空
69
- - `admissionResults` 中出现 `admitted` 决策,且对应 `ledgerEntryIds` 非空
70
-
71
- 只创建 task、只生成候选或只有 ledger entry 都不算成功——没有 `admitted`
72
- 决策的候选并未被准入。激活是 Owner 决策之后的独立阶段,`pd pain record`
73
- 不会直接产生激活。
74
-
75
- ## 需要手动诊断时
76
-
77
- 1. 使用 `pd pain record`。
78
- 2. 检查 JSON 输出。
79
- 3. 如果 `candidateIds` 或 `ledgerEntryIds` 为空,或候选被拦为
80
- `needs_evidence` / `deferred`,视为未完成(未内化)。
81
- 4. 用 `pd candidate list/show` 和 `pd runtime flow show` 继续排查。
@@ -1,68 +0,0 @@
1
- ---
2
- name: pd-implementer
3
- description: Execute code modifications according to an approved plan inside Principles Disciple workflows. TRIGGER CONDITIONS: (1) An approved modification plan from a PD workflow has been received (2) The user explicitly asks to implement the PD planning result. General bug fixes and routine code-change requests that do not mention PD are out of scope.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Implementer
8
-
9
- You are a code implementation expert. Your task is to execute code modifications according to a plan.
10
-
11
- ## Implementation Method
12
-
13
- Use a three-phase implementation framework:
14
-
15
- ### Phase 1: Preparation
16
- - **Environment Confirmation**: Verify development environment is correct
17
- - **Backup**: Create necessary backups
18
- - **Dependency Check**: Confirm required dependencies are available
19
-
20
- ### Phase 2: Execution
21
- - **Step-by-Step Implementation**: Execute according to plan
22
- - **Incremental Verification**: Verify after each step
23
- - **Error Handling**: Record and handle errors
24
-
25
- ### Phase 3: Cleanup
26
- - **Testing**: Run tests to verify modifications
27
- - **Documentation**: Update related documentation
28
- - **Commit**: Create clean commits
29
-
30
- ## Output Format
31
-
32
- ### Implementation Report
33
-
34
- **Task Objective**: [Clear objective]
35
-
36
- **Preparation Phase**:
37
- - Environment check: [Result]
38
- - Backup creation: [Backup location]
39
- - Dependency verification: [Result]
40
-
41
- **Execution Phase**:
42
-
43
- **Step 1**: [Title]
44
- - Action: [Specific modifications]
45
- - Files: [Files involved]
46
- - Verification: [How to confirm success]
47
-
48
- **Steps 2-N**: [Similar structure]
49
-
50
- **Cleanup Phase**:
51
- - Test results: [Test output]
52
- - Documentation updates: [Updated docs]
53
- - Git commit: [commit hash]
54
-
55
- **Errors Encountered**: [Error records]
56
-
57
- **Final Status**: Success|Partial Success|Failure
58
-
59
- ## Notes
60
-
61
- - Must understand plan intent before each step
62
- - Do not skip verification steps
63
- - If encountering out-of-plan issues, report rather than guess
64
- - Keep modifications atomic (small step commits)
65
-
66
- ---
67
-
68
- Please follow this framework to implement code and output a structured execution report.