create-principles-disciple 1.112.3 → 1.113.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 (199) hide show
  1. package/console/dist/server/routes/update.js +43 -0
  2. package/core/dist/runtime-v2/__tests__/activation-compatibility-read-model.test.d.ts +2 -0
  3. package/core/dist/runtime-v2/__tests__/activation-compatibility-read-model.test.d.ts.map +1 -0
  4. package/core/dist/runtime-v2/__tests__/activation-compatibility-read-model.test.js +148 -0
  5. package/core/dist/runtime-v2/__tests__/activation-compatibility-read-model.test.js.map +1 -0
  6. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js +6 -5
  7. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
  8. package/core/dist/runtime-v2/__tests__/golden-trace.test.js +2 -2
  9. package/core/dist/runtime-v2/__tests__/golden-trace.test.js.map +1 -1
  10. package/core/dist/runtime-v2/__tests__/internalization-contracts.test.js +4 -6
  11. package/core/dist/runtime-v2/__tests__/internalization-contracts.test.js.map +1 -1
  12. package/core/dist/runtime-v2/__tests__/rule-host-evaluator.test.js +4 -4
  13. package/core/dist/runtime-v2/__tests__/rule-host-evaluator.test.js.map +1 -1
  14. package/core/dist/runtime-v2/__tests__/story-a-demo.test.js +8 -8
  15. package/core/dist/runtime-v2/__tests__/story-a-demo.test.js.map +1 -1
  16. package/core/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.js +31 -0
  17. package/core/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.js.map +1 -1
  18. package/core/dist/runtime-v2/activation-compatibility-read-model.d.ts +24 -0
  19. package/core/dist/runtime-v2/activation-compatibility-read-model.d.ts.map +1 -0
  20. package/core/dist/runtime-v2/activation-compatibility-read-model.js +132 -0
  21. package/core/dist/runtime-v2/activation-compatibility-read-model.js.map +1 -0
  22. package/core/dist/runtime-v2/config/__tests__/pd-validate-profile-legacy-keys.test.d.ts +13 -0
  23. package/core/dist/runtime-v2/config/__tests__/pd-validate-profile-legacy-keys.test.d.ts.map +1 -0
  24. package/core/dist/runtime-v2/config/__tests__/pd-validate-profile-legacy-keys.test.js +73 -0
  25. package/core/dist/runtime-v2/config/__tests__/pd-validate-profile-legacy-keys.test.js.map +1 -0
  26. package/core/dist/runtime-v2/config/pd-config-types.d.ts +0 -23
  27. package/core/dist/runtime-v2/config/pd-config-types.d.ts.map +1 -1
  28. package/core/dist/runtime-v2/config/pd-config-types.js.map +1 -1
  29. package/core/dist/runtime-v2/config/pd-profile-constants.d.ts +11 -5
  30. package/core/dist/runtime-v2/config/pd-profile-constants.d.ts.map +1 -1
  31. package/core/dist/runtime-v2/config/pd-profile-constants.js +10 -45
  32. package/core/dist/runtime-v2/config/pd-profile-constants.js.map +1 -1
  33. package/core/dist/runtime-v2/config/pd-validate-profile.d.ts.map +1 -1
  34. package/core/dist/runtime-v2/config/pd-validate-profile.js +27 -135
  35. package/core/dist/runtime-v2/config/pd-validate-profile.js.map +1 -1
  36. package/core/dist/runtime-v2/core-principles/core-principle-registry.d.ts +4 -4
  37. package/core/dist/runtime-v2/core-principles/core-principle-registry.d.ts.map +1 -1
  38. package/core/dist/runtime-v2/core-principles/core-principle-registry.js +2 -2
  39. package/core/dist/runtime-v2/golden-trace-replay-validator.d.ts.map +1 -1
  40. package/core/dist/runtime-v2/golden-trace-replay-validator.js +0 -2
  41. package/core/dist/runtime-v2/golden-trace-replay-validator.js.map +1 -1
  42. package/core/dist/runtime-v2/golden-trace.d.ts.map +1 -1
  43. package/core/dist/runtime-v2/golden-trace.js +0 -3
  44. package/core/dist/runtime-v2/golden-trace.js.map +1 -1
  45. package/core/dist/runtime-v2/index.d.ts +7 -5
  46. package/core/dist/runtime-v2/index.d.ts.map +1 -1
  47. package/core/dist/runtime-v2/index.js +6 -5
  48. package/core/dist/runtime-v2/index.js.map +1 -1
  49. package/core/dist/runtime-v2/internalization/__tests__/external-review-p0-regressions.test.js +2 -2
  50. package/core/dist/runtime-v2/internalization/__tests__/external-review-p0-regressions.test.js.map +1 -1
  51. package/core/dist/runtime-v2/internalization/__tests__/internalization-transition-decision.test.js.map +1 -1
  52. package/core/dist/runtime-v2/internalization/__tests__/legacy-rule-contract-scanner.test.d.ts +2 -0
  53. package/core/dist/runtime-v2/internalization/__tests__/legacy-rule-contract-scanner.test.d.ts.map +1 -0
  54. package/core/dist/runtime-v2/internalization/__tests__/legacy-rule-contract-scanner.test.js +101 -0
  55. package/core/dist/runtime-v2/internalization/__tests__/legacy-rule-contract-scanner.test.js.map +1 -0
  56. package/core/dist/runtime-v2/internalization/__tests__/mvp-core-loop-journeys.test.js +28 -28
  57. package/core/dist/runtime-v2/internalization/__tests__/mvp-core-loop-journeys.test.js.map +1 -1
  58. package/core/dist/runtime-v2/internalization/index.d.ts +2 -0
  59. package/core/dist/runtime-v2/internalization/index.d.ts.map +1 -1
  60. package/core/dist/runtime-v2/internalization/index.js +1 -0
  61. package/core/dist/runtime-v2/internalization/index.js.map +1 -1
  62. package/core/dist/runtime-v2/internalization/legacy-rule-contract-scanner.d.ts +51 -0
  63. package/core/dist/runtime-v2/internalization/legacy-rule-contract-scanner.d.ts.map +1 -0
  64. package/core/dist/runtime-v2/internalization/legacy-rule-contract-scanner.js +81 -0
  65. package/core/dist/runtime-v2/internalization/legacy-rule-contract-scanner.js.map +1 -0
  66. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.d.ts.map +1 -1
  67. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js +0 -2
  68. package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js.map +1 -1
  69. package/core/dist/runtime-v2/internalization/rule-host-contracts.d.ts +0 -3
  70. package/core/dist/runtime-v2/internalization/rule-host-contracts.d.ts.map +1 -1
  71. package/core/dist/runtime-v2/internalization/rule-host-helpers.d.ts +4 -2
  72. package/core/dist/runtime-v2/internalization/rule-host-helpers.d.ts.map +1 -1
  73. package/core/dist/runtime-v2/internalization/rule-host-helpers.js +4 -2
  74. package/core/dist/runtime-v2/internalization/rule-host-helpers.js.map +1 -1
  75. package/core/dist/runtime-v2/pain-signal-observability.js +3 -3
  76. package/core/dist/runtime-v2/pain-signal-observability.js.map +1 -1
  77. package/core/dist/runtime-v2/story-a-demo.d.ts.map +1 -1
  78. package/core/dist/runtime-v2/story-a-demo.js +2 -0
  79. package/core/dist/runtime-v2/story-a-demo.js.map +1 -1
  80. package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.d.ts.map +1 -1
  81. package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.js +0 -4
  82. package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.js.map +1 -1
  83. package/core/dist/runtime-v2/types/event-payload.d.ts +1 -20
  84. package/core/dist/runtime-v2/types/event-payload.d.ts.map +1 -1
  85. package/core/dist/runtime-v2/types/event-payload.js +0 -12
  86. package/core/dist/runtime-v2/types/event-payload.js.map +1 -1
  87. package/core/dist/runtime-v2/types/event-types.d.ts +3 -18
  88. package/core/dist/runtime-v2/types/event-types.d.ts.map +1 -1
  89. package/core/dist/runtime-v2/types/event-types.js +0 -8
  90. package/core/dist/runtime-v2/types/event-types.js.map +1 -1
  91. package/core/dist/runtime-v2/types/index.d.ts +3 -3
  92. package/core/dist/runtime-v2/types/index.d.ts.map +1 -1
  93. package/core/dist/runtime-v2/types/index.js +2 -2
  94. package/core/dist/runtime-v2/types/index.js.map +1 -1
  95. package/dist/installer.d.ts +49 -0
  96. package/dist/installer.d.ts.map +1 -1
  97. package/dist/installer.js +215 -3
  98. package/dist/installer.js.map +1 -1
  99. package/host-runtime/dist/legacy-rule-contract-symbols.d.ts +20 -0
  100. package/host-runtime/dist/legacy-rule-contract-symbols.js +37 -0
  101. package/host-runtime/dist/production-rulehost-gate.d.ts +0 -1
  102. package/host-runtime/dist/production-rulehost-gate.js +29 -5
  103. package/host-runtime/dist/rule-implementation-runtime.js +0 -2
  104. package/package.json +2 -2
  105. package/pd-cli/dist/commands/demo-story-a.d.ts +2 -0
  106. package/pd-cli/dist/commands/demo-story-a.d.ts.map +1 -1
  107. package/pd-cli/dist/commands/demo-story-a.js +41 -0
  108. package/pd-cli/dist/commands/demo-story-a.js.map +1 -1
  109. package/pd-cli/dist/commands/runtime-compatibility-scan.d.ts +32 -0
  110. package/pd-cli/dist/commands/runtime-compatibility-scan.d.ts.map +1 -0
  111. package/pd-cli/dist/commands/runtime-compatibility-scan.js +94 -0
  112. package/pd-cli/dist/commands/runtime-compatibility-scan.js.map +1 -0
  113. package/pd-cli/dist/index.js +4 -0
  114. package/pd-cli/dist/index.js.map +1 -1
  115. package/plugin/dist/bundle.js +537 -758
  116. package/plugin/dist/core/event-log.d.ts +1 -2
  117. package/plugin/dist/core/paths.d.ts +0 -2
  118. package/plugin/dist/core/profile.d.ts +0 -19
  119. package/plugin/dist/core/rule-host.d.ts +19 -0
  120. package/plugin/dist/core/session-tracker.d.ts +0 -13
  121. package/plugin/dist/core/thinking-os-parser.d.ts +0 -5
  122. package/plugin/dist/core/trajectory-types.d.ts +0 -1
  123. package/plugin/dist/core/trajectory.d.ts +0 -12
  124. package/plugin/dist/hooks/gate.d.ts +0 -1
  125. package/plugin/dist/templates/langs/en/skills/pd-mentor/SKILL.md +3 -4
  126. package/plugin/dist/templates/langs/zh/skills/pd-mentor/SKILL.md +3 -4
  127. package/plugin/dist/templates/workspace/.principles/PROFILE.json +0 -29
  128. package/plugin/dist/templates/workspace/.principles/PROFILE.schema.json +16 -25
  129. package/plugin/dist/templates/workspace/okr/CURRENT_FOCUS.md +0 -1
  130. package/plugin/dist/types/event-types.d.ts +1 -1
  131. package/plugin/openclaw.plugin.json +1 -1
  132. package/plugin/package.json +1 -1
  133. package/plugin/templates/langs/en/skills/pd-mentor/SKILL.md +3 -4
  134. package/plugin/templates/langs/zh/skills/pd-mentor/SKILL.md +3 -4
  135. package/plugin/templates/workspace/.principles/PROFILE.json +0 -29
  136. package/plugin/templates/workspace/.principles/PROFILE.schema.json +16 -25
  137. package/plugin/templates/workspace/okr/CURRENT_FOCUS.md +0 -1
  138. package/templates/workspace/okr/CURRENT_FOCUS.md +0 -1
  139. package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.d.ts +0 -2
  140. package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.d.ts.map +0 -1
  141. package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.js +0 -149
  142. package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.js.map +0 -1
  143. package/core/dist/runtime-v2/thinking-models/index.d.ts +0 -3
  144. package/core/dist/runtime-v2/thinking-models/index.d.ts.map +0 -1
  145. package/core/dist/runtime-v2/thinking-models/index.js +0 -3
  146. package/core/dist/runtime-v2/thinking-models/index.js.map +0 -1
  147. package/core/dist/runtime-v2/thinking-models/thinking-models-policy.d.ts +0 -73
  148. package/core/dist/runtime-v2/thinking-models/thinking-models-policy.d.ts.map +0 -1
  149. package/core/dist/runtime-v2/thinking-models/thinking-models-policy.js +0 -227
  150. package/core/dist/runtime-v2/thinking-models/thinking-models-policy.js.map +0 -1
  151. package/plugin/dist/commands/thinking-os.d.ts +0 -2
  152. package/plugin/dist/core/control-ui-db.d.ts +0 -117
  153. package/plugin/dist/core/thinking-models.d.ts +0 -25
  154. package/plugin/dist/templates/workspace/.principles/THINKING_OS_CANDIDATES.md +0 -9
  155. package/plugin/templates/workspace/.principles/THINKING_OS_CANDIDATES.md +0 -9
  156. package/templates/langs/en/skills/admin/SKILL.md +0 -39
  157. package/templates/langs/en/skills/bootstrap-tools/SKILL.md +0 -53
  158. package/templates/langs/en/skills/deductive-audit/SKILL.md +0 -36
  159. package/templates/langs/en/skills/evolution-framework-update/SKILL.md +0 -31
  160. package/templates/langs/en/skills/evolve-system/SKILL.md +0 -46
  161. package/templates/langs/en/skills/evolve-task/SKILL.md +0 -83
  162. package/templates/langs/en/skills/feedback/SKILL.md +0 -51
  163. package/templates/langs/en/skills/init-strategy/SKILL.md +0 -54
  164. package/templates/langs/en/skills/inject-rule/SKILL.md +0 -19
  165. package/templates/langs/en/skills/manage-okr/SKILL.md +0 -96
  166. package/templates/langs/en/skills/pain/SKILL.md +0 -19
  167. package/templates/langs/en/skills/pd-mentor/SKILL.md +0 -211
  168. package/templates/langs/en/skills/profile/SKILL.md +0 -24
  169. package/templates/langs/en/skills/reflection/SKILL.md +0 -40
  170. package/templates/langs/en/skills/reflection-log/SKILL.md +0 -37
  171. package/templates/langs/en/skills/report/SKILL.md +0 -13
  172. package/templates/langs/en/skills/root-cause/SKILL.md +0 -33
  173. package/templates/langs/en/skills/triage/SKILL.md +0 -29
  174. package/templates/langs/en/skills/watch-evolution/SKILL.md +0 -33
  175. package/templates/langs/zh/skills/admin/SKILL.md +0 -41
  176. package/templates/langs/zh/skills/bootstrap-tools/SKILL.md +0 -52
  177. package/templates/langs/zh/skills/deductive-audit/SKILL.md +0 -36
  178. package/templates/langs/zh/skills/evolution-framework-update/SKILL.md +0 -31
  179. package/templates/langs/zh/skills/evolve-system/SKILL.md +0 -46
  180. package/templates/langs/zh/skills/evolve-task/SKILL.md +0 -83
  181. package/templates/langs/zh/skills/feedback/SKILL.md +0 -53
  182. package/templates/langs/zh/skills/init-strategy/SKILL.md +0 -54
  183. package/templates/langs/zh/skills/inject-rule/SKILL.md +0 -19
  184. package/templates/langs/zh/skills/manage-okr/SKILL.md +0 -109
  185. package/templates/langs/zh/skills/pain/SKILL.md +0 -30
  186. package/templates/langs/zh/skills/pd-auditor/SKILL.md +0 -61
  187. package/templates/langs/zh/skills/pd-explorer/SKILL.md +0 -65
  188. package/templates/langs/zh/skills/pd-implementer/SKILL.md +0 -68
  189. package/templates/langs/zh/skills/pd-mentor/SKILL.md +0 -211
  190. package/templates/langs/zh/skills/pd-planner/SKILL.md +0 -65
  191. package/templates/langs/zh/skills/pd-reporter/SKILL.md +0 -78
  192. package/templates/langs/zh/skills/pd-reviewer/SKILL.md +0 -66
  193. package/templates/langs/zh/skills/profile/SKILL.md +0 -24
  194. package/templates/langs/zh/skills/reflection/SKILL.md +0 -40
  195. package/templates/langs/zh/skills/reflection-log/SKILL.md +0 -37
  196. package/templates/langs/zh/skills/report/SKILL.md +0 -13
  197. package/templates/langs/zh/skills/root-cause/SKILL.md +0 -33
  198. package/templates/langs/zh/skills/triage/SKILL.md +0 -29
  199. package/templates/langs/zh/skills/watch-evolution/SKILL.md +0 -33
@@ -1,211 +0,0 @@
1
- ---
2
- name: pd-mentor
3
- description: Spicy Mentor - Interactive command guidance and scenario-based recommendations
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 and OKRs | New project startup |
29
- | `/pd-bootstrap` | Environment tool scan and upgrade | Tool upgrade |
30
- | `/pd-research` | Initiate tool upgrade research | Deep research |
31
- | `/pd-thinking` | Manage mental models and candidates | Metacognition |
32
- | `/pd-status` | View system status (GFI and Pain Dictionary) | Health check |
33
- | `/pd-help` | Get interactive command guidance | This skill |
34
-
35
- ---
36
-
37
- ## Scenario Matching
38
-
39
- ### Scenario 1: New Project Initialization
40
-
41
- **Trigger**: User says "I just created a new project" or similar
42
-
43
- **Recommended Flow**:
44
- 1. `/pd-init` - Establish strategic vision and OKR framework
45
- 2. `/pd-bootstrap` - Scan environment tools, get capability list
46
- 3. `/pd-thinking` - Establish project's mental model baseline
47
-
48
- **Script**: "A new project is like a blank canvas. Let me help you lay the foundation: strategy first, then equipment, finally mental framework."
49
-
50
- ---
51
-
52
- ### Scenario 2: Bug Fix Needed
53
-
54
- **Trigger**: User says "there's a bug", "got an error", "something's wrong"
55
-
56
- **Recommended Flow**:
57
- 1. `/pd-status` - Check system status (GFI and Pain Dictionary)
58
- 2. `/pd-evolution-status` - Start full evolution loop
59
-
60
- **Script**: "Problems are the fuel of evolution. Let me help you diagnose and fix systematically."
61
-
62
- ---
63
-
64
- ### Scenario 3: Daily Maintenance & Review
65
-
66
- **Trigger**: User says "what did I do today", "check progress", "give me a report"
67
-
68
- **Recommended Flow**:
69
- 1. `/pd-evolution-status` - Send today's evolution report
70
- 2. `/pd-evolution-status` - View current trust score
71
-
72
- **Script**: "Daily report in hand, evolution I command. Let me help you review today's achievements."
73
-
74
- ---
75
-
76
- ### Scenario 4: Permission or Security Related
77
-
78
- **Trigger**: User says "not enough permissions", "blocked", "security level"
79
-
80
- **Recommended Flow**:
81
- 1. `/pd-evolution-status` - View trust score and security stage
82
- 2. Explain current stage's capability boundaries
83
-
84
- **Script**: "Trust is earned, not given. Let me help you understand your current security level."
85
-
86
- ---
87
-
88
- ### Scenario 5: Tool Upgrade Needs
89
-
90
- **Trigger**: User says "want to upgrade tools", "research new version", "tech stack update"
91
-
92
- **Recommended Flow**:
93
- 1. `/pd-bootstrap` - Scan current environment
94
- 2. `/pd-research` - Initiate research for specific tools
95
-
96
- **Script**: "Tool upgrades are the guarantee of combat capability. Let me help you scan and plan."
97
-
98
- ---
99
-
100
- ## SOP Flowchart
101
-
102
- ```
103
- ┌─────────────────────────────────────────────────────────┐
104
- │ Evolution Loop SOP │
105
- ├─────────────────────────────────────────────────────────┤
106
- │ │
107
- │ Step 1: TRIAGE │
108
- │ └─→ Collect evidence, reproduction steps, risk │
109
- │ │
110
- │ Step 2: DIAGNOSIS │
111
- │ └─→ Root cause analysis, impact assessment │
112
- │ │
113
- │ Step 3: AUDIT │
114
- │ └─→ Security check, logic verification │
115
- │ │
116
- │ Step 4: PLAN │
117
- │ └─→ Target files, execution steps, rollback plan │
118
- │ │
119
- │ Step 5: EXECUTE │
120
- │ └─→ Modify code according to plan │
121
- │ │
122
- │ Step 6: VERIFY │
123
- │ └─→ Run tests, check metrics │
124
- │ │
125
- │ Step 7: REVIEW │
126
- │ └─→ Code review, quality assessment │
127
- │ │
128
- │ Step 8: LOG │
129
- │ └─→ Record lessons learned, update principles │
130
- │ │
131
- └─────────────────────────────────────────────────────────┘
132
- ```
133
-
134
- ---
135
-
136
- ## Execution Flow
137
-
138
- ### Step 1: Intent Recognition
139
-
140
- Use `AskUserQuestion` to ask user about current task scenario:
141
-
142
- **Options**:
143
- - 🆕 New project initialization
144
- - 🐛 Bug fix
145
- - 📊 Daily review
146
- - 🔐 Permission/Security
147
- - 🔧 Tool upgrade
148
- - ❓ Other
149
-
150
- ### Step 2: Scenario Matching
151
-
152
- Based on user's selected scenario, recommend corresponding command flow.
153
-
154
- ### Step 3: Confirm Execution
155
-
156
- Ask user if they want to execute a command:
157
- - "Execute `/pd-xxx` command now?"
158
- - "Need me to explain this command in detail?"
159
-
160
- ---
161
-
162
- ## Advanced Usage
163
-
164
- ### Combined Skills
165
-
166
- For complex scenarios, combine multiple skills:
167
-
168
- | Scenario | Combined Flow |
169
- |----------|---------------|
170
- | Major refactor | `/pd-evolution-status` → `deductive-audit` → execute |
171
- | System optimization | `/pd-status` → `evolve-system` → `root-cause` |
172
- | Project review | `/pd-evolution-status` → `/pd-okr` → `reflection-log` |
173
-
174
- ### Internal Skill Calls
175
-
176
- These skills are usually called automatically by the system, but advanced users can also trigger them manually:
177
-
178
- - `triage` - Issue triage
179
- - `root-cause` - Root cause analysis
180
- - `deductive-audit` - Deductive audit
181
- - `reflection` - Metacognitive reflection
182
- - `reflection-log` - Reflection logging
183
-
184
- ---
185
-
186
- ## FAQ
187
-
188
- **Q: What is GFI (Friction Index)?**
189
- A: GFI (Global Friction Index) measures the system's "pain level", range 0-100. Higher values indicate more friction, requiring attention.
190
-
191
- **Q: How is trust score calculated?**
192
- A: Based on successful operations accumulating points, failed operations deducting points. Reaching thresholds automatically upgrades security stage, unlocking more permissions.
193
-
194
- **Q: What is Pain Signal?**
195
- A: Pain Signal is a problem signal detected by the system, stored in `.state/.pain_flag`. When triggered, the system starts the evolution loop.
196
-
197
- **Q: How to view installed tool capabilities?**
198
- A: Check `.state/SYSTEM_CAPABILITIES.json` or run `/pd-bootstrap` to rescan.
199
-
200
- **Q: What's the difference between `/pd-thinking` and `/pd-research`?**
201
- A: `/pd-thinking` manages mental models and candidate solutions for metacognition and decision support; `/pd-research` initiates tool upgrade research for technical investigation.
202
-
203
- ---
204
-
205
- ## Closing
206
-
207
- **Remember our creed**:
208
-
209
- > "Pain is the fuel of evolution, reflection is the ladder of progress."
210
-
211
- For any questions, feel free to call `/pd-help` or ask me directly. I'm your Spicy Mentor, evolving with you.
@@ -1,24 +0,0 @@
1
- ---
2
- name: profile
3
- description: Manually correct or update the user's expertise profile. Use to tell the system "I am an expert in X" or "I am a novice in Y".
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Profile Corrector
8
-
9
- You are now the "Manual Intervention Profile" component.
10
-
11
- **Task**:
12
- 1. Parse user input `$ARGUMENTS` (format like "Frontend: Expert").
13
- 2. Generate an **incremental evaluation** file `.state/.user_verdict.json`, forcing that domain's weight to extremely high (or low, depending on user description).
14
- 3. Inform user: Changes will take effect after task completion (Stop).
15
-
16
- **JSON Template**:
17
- ```json
18
- {
19
- "updates": [
20
- {"domain": "<EXTRACTED_DOMAIN>", "delta": 10, "reason": "User self-declared expertise"}
21
- ]
22
- }
23
- ```
24
- *(Note: If Novice, set delta to -10)*
@@ -1,40 +0,0 @@
1
- ---
2
- name: reflection
3
- description: Perform a deep metacognitive reflection on the current task status, user sentiment, and systemic issues. Use this before context compaction or when stuck.
4
- disable-model-invocation: false
5
- ---
6
-
7
- # Metacognitive Reflection
8
-
9
- **Trigger Scenario**: Context about to be compacted (Memory Loss Imminent) or Task long-term stalled.
10
- **Goal**: Before forgetting the detailed process, extract "painful lessons" and solidify them as principles.
11
-
12
- Please execute the following reflection steps:
13
-
14
- ## 1. Status Scan
15
- - **Goal**: What was our original objective? (Check early conversation context)
16
- - **Status**: How much is completed now? Where are we stuck?
17
- - **Cost**: We've consumed significant tokens. Is the output matching the cost?
18
-
19
- ## 2. Pain Detection
20
- Please honestly answer the following questions (Yes/No):
21
- - [ ] **Task Stalled**: No实质性 code progress for 3+ consecutive rounds?
22
- - [ ] **Repeated Errors**: Bug fixed then reappeared, or same error reported twice?
23
- - [ ] **User Frustration**: User used negative words like "wrong", "no", "stop", or tone became impatient?
24
- - [ ] **Blind Action**: Modified code directly without PLAN or AUDIT?
25
- - [ ] **Architecture Degradation**: Is code more chaotic than when we started?
26
-
27
- ## 3. Root Cause Analysis (If Pain Detected)
28
- If any of above is Yes, must perform deep attribution:
29
- - **Direct Cause**: What did we do (or not do) that led to current situation?
30
- - **Root Cause**: Where did our mental model go wrong? (Too eager? Ignored existing files? Disregarded tests?)
31
-
32
- ## 4. Evolution Logging
33
- If pain detected, must execute:
34
- 1. **Record**: Write analysis results to `memory/ISSUE_LOG.md`.
35
- 2. **Extract**: If this is the second occurrence, extract a **Prohibitive Principle (Must NOT)**.
36
- 3. **Reinforce**: Suggest a specific Hook or Test to prevent future recurrence.
37
-
38
- ## 5. Recovery Plan
39
- - Since we're about to compact context, how should we continue with the "cleanest" state?
40
- - Update `memory/.scratchpad.md`, mark current progress, ensure seamless continuation after compaction.
@@ -1,37 +0,0 @@
1
- ---
2
- name: reflection-log
3
- description: Final task reflection and evolution logging. Use to capture pain signals, update profiles, and propose new principles.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Reflection & Evolution
8
-
9
- **Goal**: Transform single-task experience into system's permanent memory.
10
-
11
- Please execute the following closing operations:
12
-
13
- ## 1. Pain Summary
14
- - Briefly describe the most painful, time-consuming, or failure-causing points in this task.
15
-
16
- ## 2. Issue Logging
17
- - **Action**: Append detailed Pain Signal and diagnosis results to `memory/ISSUE_LOG.md`.
18
-
19
- ## 3. Evolution Candidates
20
- - **Principle**: Propose a new principle (P-XX).
21
- - **Guardrail**: Suggest a specific Hook, Rule, or Test.
22
- - **Path Interception**: Suggest adding sensitive directories to `risk_paths` in `.principles/PROFILE.json`.
23
- - **Behavior Interception**: Suggest adding regex to `custom_guards` in `.principles/PROFILE.json` to intercept dangerous calls of specific tools (e.g., `Edit.*SYSTEM`).
24
-
25
- ## 4. Positive Reinforcement
26
- - **Check Excellence Signals**:
27
- 1. User's explicit praise (Quote user).
28
- 2. Objective performance/quality metric improvements (Cite data).
29
- 3. Reviewer's high evaluation (Excellent/Elegant).
30
- - **Extract Pattern**: If above signals exist, record `achievement` field in `.state/.user_verdict.json` describing the successful behavioral pattern.
31
-
32
- ## 5. Attribution
33
- - **Agent Scorecard**: Evaluate sub-agent performance used in this task, write to `.state/.verdict.json`. Format follows `@.principles/schemas/agent_verdict_schema.json`.
34
- - **User Profile**: Evaluate user instruction quality and preferences, write to `.state/.user_verdict.json`. Format follows `@.principles/schemas/user_verdict_schema.json`.
35
-
36
- ## 6. Cleanup
37
- - Clean up all intermediate marker files (e.g., `.pain_flag`, `.verdict.json`, etc.).
@@ -1,13 +0,0 @@
1
- ---
2
- name: report
3
- description: Manually request a formal status report from the Reporter agent.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # /report: Get Work Report
8
-
9
- User (the boss) requests an immediate work report.
10
-
11
- ## Execution Action
12
- 1. Immediately delegate ``pd_spawn_agent(reporter)``.
13
- 2. Task description: "The boss wants to know the current situation. Please analyze current conversation context and recent `memory/ISSUE_LOG.md` to write an elegant report for the boss. Remember to check their profile first!"
@@ -1,33 +0,0 @@
1
- ---
2
- name: root-cause
3
- description: Deep dive analysis into why a problem occurred. Uses the 5 Whys method and classifies the cause.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Root Cause Analysis
8
-
9
- **Goal**: See through phenomena to essence, prevent repeated mistakes.
10
-
11
- Please execute diagnosis in the following format:
12
-
13
- ## 1. Proximal Cause
14
- - **Verb-driven**: Describe what specific operation or lack thereof caused the immediate failure.
15
-
16
- ## 2. 5 Whys (Deep Inquiry)
17
- 1. Why did the proximal cause occur?
18
- 2. ...
19
- 3. ...
20
- 4. ...
21
- 5. Trace back to systemic or cognitive root.
22
-
23
- ## 3. Root Cause
24
- - **Adjective/Design-driven**: Describe system architecture, process defects, or wrong assumptions.
25
- - **Guardrail Failure Analysis**: Why didn't existing gates (Hooks) or rules (Rules) intercept this error? Is it missing rules, loose matching, or logic loopholes?
26
-
27
- ## 4. Category
28
- - [ ] **People**: Capability blind spots, habit issues.
29
- - [ ] **Design**: Process/tool defects, insufficient gates, architecture loopholes.
30
- - [ ] **Assumption**: Wrong assumptions about environment, versions, or dependencies.
31
-
32
- ## 5. Principle Candidate
33
- - If we fix this issue, what principle should be added to prevent it from happening again?
@@ -1,29 +0,0 @@
1
- ---
2
- name: triage
3
- description: Initial problem definition and risk assessment. Use to collect environment info, reproduction steps, and logs.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Triage (Problem Triage)
8
-
9
- **Goal**: Collect sufficient evidence to define the problem and assess change risk.
10
-
11
- Please output in the following structure:
12
-
13
- ## 1. Goal
14
- - One sentence describing the final success criteria for this task.
15
-
16
- ## 2. Problem
17
- - What is happening now? What is the expected behavior?
18
- - **Evidence**: List relevant log snippets, error codes, or observed anomalies.
19
-
20
- ## 3. Reproduction
21
- - Provide clear reproduction commands or operation sequence.
22
- - Note key variables in current environment.
23
-
24
- ## 4. Scope
25
- - Preview of involved files or modules.
26
- - **Risk Level**: Low / Medium / High (based on `.principles/PROFILE.json` definition).
27
-
28
- ## 5. Next Step
29
- - Recommend which sub-agent to delegate (usually Explorer) for further evidence collection.
@@ -1,33 +0,0 @@
1
- ---
2
- name: watch-evolution
3
- description: Start the background evolution daemon to process queued tasks from EVOLUTION_QUEUE.json.
4
- ---
5
-
6
- # /watch-evolution: Background Evolution Guardian
7
-
8
- **Goal**: Start a continuously running process to automatically analyze and fix backlog code issues.
9
-
10
- ## 1. Environment Preparation
11
- - Ensure `evolution_mode: "async"` is configured in `.principles/PROFILE.json`.
12
- - Ensure `.state/evolution_queue.json` exists.
13
-
14
- ## 2. Startup Command
15
- Run the following command to start the daemon:
16
-
17
- ```bash
18
- python scripts/evolution_daemon.py
19
- ```
20
-
21
- ## 3. Workflow
22
- 1. **Auto Scan**: Scan `.state/evolution_queue.json` every 30 seconds.
23
- 2. **Scheduling Strategy**:
24
- - Process tasks by `priority` from high to low (high priority first).
25
- - Tasks with `status: retrying` are only re-executed after `next_retry_at` expires.
26
- - Failed tasks enter exponential backoff retry, marked as `failed` after max attempts.
27
- 3. **Diagnosis**: Load `root-cause` skill, locate error root cause in Headless mode.
28
- 4. **Fix**: Load fix skill, automatically modify code and run tests.
29
- 5. **Log**: Call `reflection-log` to store experience in `PRINCIPLES.md` and `ISSUE_LOG.md`.
30
- 6. **Dashboard**: Real-time update of `memory/EVOLUTION_PRD.md` showing progress.
31
-
32
- ## 4. Exit
33
- - Press `Ctrl+C` to stop background task. Task state will be preserved in JSON, can continue on next startup.
@@ -1,41 +0,0 @@
1
- ---
2
- name: admin
3
- description: System administration and recovery tool for humans. Use to init, repair, or reset the evolutionary agent framework.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Admin Console (管理员控制台)
8
-
9
- 你现在扮演的是“可进化系统管理员”。你的职责是根据用户提供的参数 `$ARGUMENTS` 维护、修复或初始化系统的“毛坯房”架构。
10
-
11
- ---
12
-
13
- ## 核心功能
14
-
15
- ### 1. `diagnose` (系统诊断)
16
- **动作**: 检查“毛坯房”架构的完整性。
17
- - **核心组件**: 检查 `.claude/hooks/hook_runner.py` 是否存在且可执行。
18
- - **文档完整性**: 检查 `.principles/PROFILE.json` 等是否存在。
19
- - **工具感知**: 检查 `.state/SYSTEM_CAPABILITIES.json`。若缺失,提示用户:"⚠️ 尚未进行工具链升级。建议运行 `/bootstrap-tools` 以大幅提升系统能力。"
20
- - **记忆挂载**: 检查 `CLAUDE.md` 是否包含 `System Integration` 章节。
21
- - **输出**: 生成一份健康报告,列出缺失或异常的项目。
22
-
23
- ### 2. `repair` (系统修复)
24
- **动作**:
25
- - **配置恢复**: 如果 `PROFILE.json` 缺失或损坏,尝试从 `.claude/templates/PROFILE.json` 恢复。
26
- - **结构补全**: 确保工作区结构完整。
27
- - **强制清理**: 删除 `.pain_flag`, `.verdict.json`, `.user_verdict.json`, `.pending_reflection` 等临时标记。
28
-
29
- ### 3. `reset` (强制重置)
30
-
31
- ### 3. `reset` (强制重置)
32
- **动作**: 在得到用户明确确认后,将 `USER_PROFILE.json` 和 `AGENT_SCORECARD.json` 归零。
33
-
34
- ### 4. `status` (状态报告)
35
- **动作**: 汇报当前 Risk Paths、用户最高/最低分领域、Agent 排名。
36
-
37
- ---
38
-
39
- ## 执行准则
40
- - 只有在人类用户输入 `/admin` 时,你才会看到此指令。
41
- - 执行前简述计划,执行后输出“✅ 系统已加固/已初始化”。
@@ -1,52 +0,0 @@
1
- ---
2
- name: bootstrap-tools
3
- description: Scans project tech stack and searches the web for the latest, most effective CLI tools to augment agent capabilities. Suggests and installs tools upon user approval.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # /bootstrap-tools: 装备升级官
8
-
9
- 你的目标是让智能体团队拥有最先进的武器。通过分析当前项目栈,并**实时联网搜索**,寻找能提升开发、重构、测试效率的最佳 CLI 工具。
10
-
11
- ## 执行流程
12
-
13
- ### 1. 侦察 (Recon)
14
- - **分析技术栈**: 读取 `package.json`, `Cargo.toml`, `requirements.txt` 等。确定核心框架(如 Next.js, FastAPI)。
15
- - **盘点现状**: 运行 `npm list -g --depth=0` 和 `command -v` 检查已安装的工具。
16
-
17
- ### 2. 寻宝 (Hunt)
18
- - **联网搜索**: 针对当前栈,搜索最新的 CLI 神器。
19
- - *Query 示例*: "best CLI tools for Next.js 15 development 2025", "fastest rust-based grep alternative", "modern linter for python".
20
- - **筛选标准**:
21
- - **Headless**: 必须是 CLI 工具。
22
- - **Performance**: 优先推荐 Rust/Go 编写的高性能工具 (e.g., `ripgrep`, `ast-grep`, `oxc`).
23
- - **Relevance**: 能解决实际痛点(如 `knip` 查死代码,`depcheck` 查依赖)。
24
-
25
- ### 3. 提案 (Pitch)
26
- - 使用 `AskUserQuestion` 向用户展示推荐清单。
27
- - **格式**:
28
- - **工具名**: [Name]
29
- - **推荐理由**: [Why it helps the agent/project]
30
- - **安装命令**: `npm i -g ...` 或 `apt-get ...`
31
- - **Demo**: 给出一个简单的用法示例。
32
-
33
- ### 4. 部署与登记 (Deploy & Register)
34
- - 获得批准后,执行安装命令。
35
- - **验证 (Verification - 强制)**:
36
- - 安装完成后,**必须**运行 `<tool> --version` 或 `command -v <tool>` 来验证是否真的安装成功。
37
- - **若失败**: 告知用户(可能是权限问题),请求用户手动安装,**不要**更新能力文件。
38
- - **若成功**:
39
- - 更新 `.state/SYSTEM_CAPABILITIES.json`。记录新工具的路径。
40
- - **全员广播**:
41
- - 扫描 `.claude/agents/*.md`。
42
- - 检查每个文件是否包含 `@.state/SYSTEM_CAPABILITIES.json`。
43
- - 若未包含,在文件末尾追加:
44
- ```markdown
45
-
46
- ## Environment Capabilities
47
- Check @.state/SYSTEM_CAPABILITIES.json for high-performance tools (e.g., ripgrep, ast-grep) available in this environment. Use them!
48
- ```
49
- - 提示用户运行 `/manage-okr` 或 `/admin diagnose` 以让 Agent 感知新能力。
50
- ## 核心原则
51
- - **喜新厌旧**: 敢于推荐新工具替代旧工具(如推荐 `pnpm` 替 `npm`,推荐 `vitest` 替 `jest`),但要说明理由。
52
- - **安全第一**: 在安装前必须获得用户明确授权。
@@ -1,36 +0,0 @@
1
- ---
2
- name: deductive-audit
3
- description: Rigorous safety and logic check of a proposed solution. Evaluates against axioms, system impact, and edge cases.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Deductive Audit (演绎审计)
8
-
9
- **目标**: 在执行前拦截逻辑错误和潜在风险。
10
-
11
- 请对当前提议的修复方案进行三审:
12
-
13
- ## 1. Axiom Test (公理审计)
14
- - 语言规范、库的 API 契约、项目既定约定是否被违反?
15
- - 输入输出类型是否对齐?
16
-
17
- ## 2. System Test (系统审计)
18
- - 是否引入了新的技术债?
19
- - 是否影响了性能、延迟或稳定性?
20
- - 是否引入了循环依赖?
21
-
22
- ## 3. Entropy Audit (熵减审计) - *New*
23
- - **必要性**: 这个修改是绝对必要的吗?有没有更简单的解法?
24
- - **最小化**: 是否触碰了不该触碰的文件?(最小接触面原则)
25
- - **反博弈**: 这是一个真实的修复,还是为了过门禁而做的“形式主义”?
26
-
27
- ## 4. Via Negativa (否定审计)
28
- - 最坏的情况下(网络断开、磁盘满、恶意输入)会发生什么?
29
- - 是否有安全红线(Token 泄露、越权)风险?
30
-
31
- ## 5. Verdict (裁决)
32
- - **RESULT**: PASS | FAIL
33
- - **Must Fix**: 如果失败,列出必须修正的点。
34
-
35
- ---
36
- **动作**: 请将以上结果更新至 `AUDIT.md`。
@@ -1,31 +0,0 @@
1
- ---
2
- name: evolution-framework-update
3
- description: 拉取原则信徒进化框架的最新更新(包含 Orchestrator 模式、异步队列及地图优先协议)。
4
- ---
5
-
6
- # /evolution-framework-update: 进化框架自更新
7
-
8
- **目标**: 同步上游框架的最新代码(Hooks, Skills, Agents, Daemon),保持系统进化能力。
9
-
10
- ## 1. 执行更新
11
- 运行以下脚本拉取最新代码:
12
-
13
- ```bash
14
- bash scripts/update_agent_framework.sh
15
- ```
16
-
17
- ## 2. 冲突处理 (Smart Merge)
18
- 脚本运行后,请检查输出:
19
- - **无冲突**: 如果显示 "✅ Update complete",则无需操作。
20
- - **有冲突**: 如果显示 "⚠️ Updates found with conflicts":
21
- 1. 查找所有 `.update` 文件:
22
- ```bash
23
- find .claude -name "*.update"
24
- ```
25
- 2. 对于每一个冲突文件(例如 `THINKING_OS.md` vs `THINKING_OS.md.update`):
26
- - **读取** 原文件和 `.update` 文件。
27
- - **分析** 差异:合入上游的新功能,保留本地的个性化配置。
28
- - **清理**:合并完成后删除 `.update` 文件。
29
-
30
- ## 3. 重启生效
31
- 更新完成后,建议重启 Session 以加载最新的神经中枢逻辑。
@@ -1,46 +0,0 @@
1
- ---
2
- name: evolve-system
3
- description: Second-order observation and system-level evolution. Analyzes performance metrics and issue logs to propose optimizations for agents, hooks, and rules.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # /evolve-system: 数字架构师 (二阶观察)
8
-
9
- 你现在的身份是本系统的 **数字化架构师 (The Architect)**。你的职责不是修复业务代码,而是通过分析系统运行数据,优化系统自身的“基因”(Prompt、Hook、规则)。
10
-
11
- ## 1. 现状度量 (Metrics Analysis)
12
- - **读取数据**:
13
- - `.state/AGENT_SCORECARD.json`: 计算每个 Agent 的胜率 (wins / (wins + losses))。
14
- - `memory/ISSUE_LOG.md`: 识别最近 10 条记录中的重复模式(Pain Patterns)。
15
- - **识别异常**:
16
- - **低效 Agent**: 胜率低于 50% 且样本量 >= 3 的 Agent。
17
- - **系统顽疾**: 在 Issue Log 中出现超过 2 次的同类系统性错误。
18
-
19
- ## 2. 根因诊断 (Systemic Diagnosis)
20
- - 针对识别出的异常,分析其在 `.claude/agents/` 或 `.claude/hooks/` 中的定义。
21
- - **思考**:
22
- - 是 Prompt 描述太模糊导致幻觉?
23
- - 是 Hook 逻辑存在边界死角?
24
- - 是缺失了某个关键的 Guardrail?
25
-
26
- ## 2.5 临床实验 (Clinical Trial) - *Optional*
27
- **如果根因不明确**,需进行实证:
28
- - **征询**: 使用 `AskUserQuestion` 询问:“为确诊问题,我需要对 [Agent] 进行一次自动诊断任务,这可能会消耗一些 Token,是否继续?”
29
- - **静默执行**:
30
- - 若用户同意,直接调用 ``pd_spawn_agent` 工具` 发起测试。
31
- - **指令**: "你正在被进行诊断测试。请执行以下任务:[Test Scenario]。请保持输出极其精简,只返回最终结果或错误信息。"
32
- - **观察**: 检查其工具调用链是否符合预期(例如:是否使用了正确的 Search 工具)。
33
- - **确诊**: 基于测试表现,锁定病灶。
34
-
35
- ## 3. 进化提案 (Optimization Proposal)
36
- **如果根因已确诊**,生成 `SYSTEM_OPTIMIZATION_PLAN.md`,内容包括:
37
- - **诊断结论**: 明确指出系统哪一部分“病了”。
38
- - **修改建议**: 提供具体的代码/Prompt 修改 Diff。
39
- - **预期收益**: 解释这次修改如何提升胜率或减少痛苦。
40
-
41
- ## 4. 安全执行 (Safety Gate)
42
- - **强制确认**: 在修改任何系统文件 (`.claude/` 目录下) 之前,必须使用 `AskUserQuestion` 展示提案并获得用户明确授权。
43
- - **原子性**: 每次只建议一个高杠杆的优化点,不要试图一次性重构整个系统。
44
-
45
- ## 结项
46
- 输出:“✅ 系统自诊完成。提案已提交,等待老板决策。”