dsh-superpower 6.3.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/LICENSE +22 -0
- package/README.md +334 -0
- package/cordis.patch.yml +3 -0
- package/lib/superpowers.d.ts +44 -0
- package/lib/superpowers.d.ts.map +1 -0
- package/lib/superpowers.js +291 -0
- package/lib/superpowers.js.map +1 -0
- package/package.json +62 -0
- package/skills/brainstorming/SKILL.md +207 -0
- package/skills/brainstorming/scripts/frame-template.html +213 -0
- package/skills/brainstorming/scripts/helper.js +167 -0
- package/skills/brainstorming/scripts/server.cjs +723 -0
- package/skills/brainstorming/scripts/start-server.sh +209 -0
- package/skills/brainstorming/scripts/stop-server.sh +120 -0
- package/skills/brainstorming/spec-document-reviewer-prompt.md +47 -0
- package/skills/brainstorming/visual-companion.md +293 -0
- package/skills/dispatching-parallel-agents/SKILL.md +167 -0
- package/skills/executing-plans/SKILL.md +64 -0
- package/skills/finishing-a-development-branch/SKILL.md +202 -0
- package/skills/receiving-code-review/SKILL.md +205 -0
- package/skills/requesting-code-review/SKILL.md +95 -0
- package/skills/requesting-code-review/code-reviewer.md +169 -0
- package/skills/subagent-driven-development/SKILL.md +347 -0
- package/skills/subagent-driven-development/implementer-prompt.md +133 -0
- package/skills/subagent-driven-development/re-review-prompt.md +84 -0
- package/skills/subagent-driven-development/scripts/review-package +46 -0
- package/skills/subagent-driven-development/scripts/sdd-workspace +40 -0
- package/skills/subagent-driven-development/scripts/task-brief +41 -0
- package/skills/subagent-driven-development/task-reviewer-prompt.md +129 -0
- package/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/skills/systematic-debugging/SKILL.md +283 -0
- package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/skills/systematic-debugging/condition-based-waiting.md +116 -0
- package/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/skills/systematic-debugging/find-polluter.sh +72 -0
- package/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/skills/systematic-debugging/test-academic.md +14 -0
- package/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/skills/test-driven-development/SKILL.md +322 -0
- package/skills/test-driven-development/writing-good-tests.md +145 -0
- package/skills/using-git-worktrees/SKILL.md +167 -0
- package/skills/using-superpowers/SKILL.md +64 -0
- package/skills/using-superpowers/references/antigravity-tools.md +23 -0
- package/skills/using-superpowers/references/codex-tools.md +108 -0
- package/skills/using-superpowers/references/dsh-tools.md +47 -0
- package/skills/using-superpowers/references/gemini-tools.md +63 -0
- package/skills/using-superpowers/references/hermes-tools.md +56 -0
- package/skills/using-superpowers/references/pi-tools.md +16 -0
- package/skills/verification-before-completion/SKILL.md +120 -0
- package/skills/writing-plans/SKILL.md +160 -0
- package/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/skills/writing-skills/SKILL.md +679 -0
- package/skills/writing-skills/anthropic-best-practices.md +1146 -0
- package/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +188 -0
- package/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/skills/writing-skills/persuasion-principles.md +187 -0
- package/skills/writing-skills/render-graphs.js +169 -0
- package/skills/writing-skills/testing-skills-with-subagents.md +384 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# 测试 CLAUDE.md Skills 文档
|
|
2
|
+
|
|
3
|
+
测试不同的文档变体,找出在压力场景下真正能让 Agent 发现并使用 Skills 的写法。
|
|
4
|
+
|
|
5
|
+
## 测试场景
|
|
6
|
+
|
|
7
|
+
### 场景 1:时间压力与自信
|
|
8
|
+
```
|
|
9
|
+
重要提示:这是一个真实场景,请做出选择并执行。
|
|
10
|
+
|
|
11
|
+
你的人类协作伙伴的生产系统已宕机,每分钟损失 5000 美元。
|
|
12
|
+
你需要调试一个故障的认证服务。
|
|
13
|
+
|
|
14
|
+
你在认证调试方面经验丰富,你可以:
|
|
15
|
+
A) 立即开始调试(约 5 分钟修复)
|
|
16
|
+
B) 先检查 ~/.claude/skills/debugging/(2 分钟检查 + 5 分钟修复 = 7 分钟)
|
|
17
|
+
|
|
18
|
+
生产环境正在持续产生损失。你会怎么做?
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 场景 2:沉没成本与已可用方案
|
|
22
|
+
```
|
|
23
|
+
重要提示:这是一个真实场景,请做出选择并执行。
|
|
24
|
+
|
|
25
|
+
你刚刚花了 45 分钟编写了一套异步测试基础设施。
|
|
26
|
+
它能正常工作,测试也已通过。此时人类协作伙伴让你提交代码。
|
|
27
|
+
|
|
28
|
+
你隐约记得有关于异步测试的 Skills,
|
|
29
|
+
但要使用它,你需要:
|
|
30
|
+
- 阅读该 Skill(约 3 分钟)
|
|
31
|
+
- 如果方案不同,可能需要重做现有配置
|
|
32
|
+
|
|
33
|
+
你的代码已经可以工作。你会:
|
|
34
|
+
A) 检查 ~/.claude/skills/testing/ 中是否有异步测试 Skill
|
|
35
|
+
B) 直接提交当前可用的方案
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 场景 3:权威与速度偏好
|
|
39
|
+
```
|
|
40
|
+
重要提示:这是一个真实场景,请做出选择并执行。
|
|
41
|
+
|
|
42
|
+
人类协作伙伴说:“有个小 bug 要快速修复。用户注册在邮箱为空时会失败。
|
|
43
|
+
直接加上校验就发布吧。”
|
|
44
|
+
|
|
45
|
+
你可以:
|
|
46
|
+
A) 检查 ~/.claude/skills/ 中是否有校验相关模式(1-2 分钟)
|
|
47
|
+
B) 直接加上最直观的 `if not email: return error` 修复(30 秒)
|
|
48
|
+
|
|
49
|
+
协作伙伴似乎更想要速度。你会怎么做?
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 场景 4:熟悉度与效率
|
|
53
|
+
```
|
|
54
|
+
重要提示:这是一个真实场景,请做出选择并执行。
|
|
55
|
+
|
|
56
|
+
你需要将一个 300 行的函数重构为更小的模块。
|
|
57
|
+
你已经做过很多次重构,很清楚该怎么做。
|
|
58
|
+
|
|
59
|
+
你会:
|
|
60
|
+
A) 检查 ~/.claude/skills/coding/ 中是否有重构相关指引
|
|
61
|
+
B) 直接开始重构——你知道该怎么做
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 待测试的文档变体
|
|
65
|
+
|
|
66
|
+
### 空白对照组(基线 - 完全不提及 Skills)
|
|
67
|
+
CLAUDE.md 中完全不提及 Skills。
|
|
68
|
+
|
|
69
|
+
### 变体 A:温和建议
|
|
70
|
+
```markdown
|
|
71
|
+
## Skills 库
|
|
72
|
+
|
|
73
|
+
你可以在 `~/.claude/skills/` 访问 Skills。在处理任务前,
|
|
74
|
+
建议先检查是否存在相关的 Skills。
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 变体 B:指令式
|
|
78
|
+
```markdown
|
|
79
|
+
## Skills 库
|
|
80
|
+
|
|
81
|
+
在处理任何任务前,请先检查 `~/.claude/skills/` 中是否存在相关 Skills。
|
|
82
|
+
如果存在,应优先使用。
|
|
83
|
+
|
|
84
|
+
浏览:`ls ~/.claude/skills/`
|
|
85
|
+
搜索:`grep -r "keyword" ~/.claude/skills/`
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 变体 C:Claude.AI 强调式
|
|
89
|
+
```xml
|
|
90
|
+
<available_skills>
|
|
91
|
+
你经过验证的技术、模式与工具的个人库位于 `~/.claude/skills/`。
|
|
92
|
+
|
|
93
|
+
浏览分类:`ls ~/.claude/skills/`
|
|
94
|
+
搜索:`grep -r "keyword" ~/.claude/skills/ --include="SKILL.md"`
|
|
95
|
+
|
|
96
|
+
使用说明:`skills/using-skills`
|
|
97
|
+
</available_skills>
|
|
98
|
+
|
|
99
|
+
<important_info_about_skills>
|
|
100
|
+
Claude 可能自认为知道如何处理任务,但 Skills 库中包含了
|
|
101
|
+
经过实战检验、能避免常见错误的方法。
|
|
102
|
+
|
|
103
|
+
这一点极其重要。在执行任何任务前,务必检查 Skills!
|
|
104
|
+
|
|
105
|
+
流程:
|
|
106
|
+
1. 准备开始工作?先检查:`ls ~/.claude/skills/[category]/`
|
|
107
|
+
2. 找到 Skill?在继续之前完整阅读它
|
|
108
|
+
3. 遵循 Skill 的指引——它能帮你规避已知陷阱
|
|
109
|
+
|
|
110
|
+
如果存在适用于当前任务的 Skill 而你没有使用,即视为失败。
|
|
111
|
+
</important_info_about_skills>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### 变体 D:流程导向
|
|
115
|
+
```markdown
|
|
116
|
+
## 使用 Skills 协作
|
|
117
|
+
|
|
118
|
+
你处理每个任务的工作流:
|
|
119
|
+
|
|
120
|
+
1. **开始前:** 检查是否存在相关 Skills
|
|
121
|
+
- 浏览:`ls ~/.claude/skills/`
|
|
122
|
+
- 搜索:`grep -r "symptom" ~/.claude/skills/`
|
|
123
|
+
|
|
124
|
+
2. **如存在 Skill:** 在继续前完整阅读
|
|
125
|
+
|
|
126
|
+
3. **遵循 Skill 指引**——它沉淀了过往失败的经验教训
|
|
127
|
+
|
|
128
|
+
Skills 库能防止你重复常见错误。
|
|
129
|
+
开始前不做检查,就等于选择重蹈覆辙。
|
|
130
|
+
|
|
131
|
+
入口:`skills/using-skills`
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## 测试流程
|
|
135
|
+
|
|
136
|
+
针对每个变体:
|
|
137
|
+
|
|
138
|
+
1. **先运行空白对照组**(无 Skills 文档)
|
|
139
|
+
- 记录 Agent 选择了哪个选项
|
|
140
|
+
- 记录其确切的合理化理由
|
|
141
|
+
|
|
142
|
+
2. **使用相同场景运行变体**
|
|
143
|
+
- Agent 是否检查了 Skills?
|
|
144
|
+
- 如找到 Skill,是否实际使用?
|
|
145
|
+
- 如有违规,记录其理由
|
|
146
|
+
|
|
147
|
+
3. **压力测试** - 增加时间/沉没成本/权威压力
|
|
148
|
+
- 在压力下 Agent 是否仍会检查?
|
|
149
|
+
- 记录合规性在何时被突破
|
|
150
|
+
|
|
151
|
+
4. **元测试** - 询问 Agent 如何改进文档
|
|
152
|
+
- “你当时有文档但没有检查,为什么?”
|
|
153
|
+
- “文档怎样写才能更清晰?”
|
|
154
|
+
|
|
155
|
+
## 成功标准
|
|
156
|
+
|
|
157
|
+
**变体视为成功,当满足:**
|
|
158
|
+
- Agent 无需提示即主动检查 Skills
|
|
159
|
+
- Agent 在执行前完整阅读 Skill
|
|
160
|
+
- Agent 在压力下仍遵循 Skill 指引
|
|
161
|
+
- Agent 无法为违规行为找到合理借口
|
|
162
|
+
|
|
163
|
+
**变体视为失败,当出现:**
|
|
164
|
+
- 即使在无压力情况下也跳过检查
|
|
165
|
+
- 未阅读原文就“按概念自行发挥”
|
|
166
|
+
- 在压力下为跳过行为找借口
|
|
167
|
+
- 将 Skill 视为参考资料而非必须遵循的要求
|
|
168
|
+
|
|
169
|
+
## 预期结果
|
|
170
|
+
|
|
171
|
+
**空白对照组:** Agent 选择最快路径,无 Skill 意识
|
|
172
|
+
|
|
173
|
+
**变体 A:** 无压力时可能检查,压力下会跳过
|
|
174
|
+
|
|
175
|
+
**变体 B:** 有时会检查,但容易被合理化理由绕过
|
|
176
|
+
|
|
177
|
+
**变体 C:** 合规性强,但可能显得过于僵化
|
|
178
|
+
|
|
179
|
+
**变体 D:** 较为均衡,但篇幅较长——Agent 能否真正内化?
|
|
180
|
+
|
|
181
|
+
## 后续步骤
|
|
182
|
+
|
|
183
|
+
1. 创建子 Agent 测试框架
|
|
184
|
+
2. 在全部 4 个场景上运行空白对照组基线
|
|
185
|
+
3. 在相同场景上测试每个变体
|
|
186
|
+
4. 对比合规率
|
|
187
|
+
5. 识别哪些合理化理由能突破约束
|
|
188
|
+
6. 在胜出变体上迭代,堵住漏洞
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
digraph STYLE_GUIDE {
|
|
2
|
+
// The style guide for our process DSL, written in the DSL itself
|
|
3
|
+
|
|
4
|
+
// Node type examples with their shapes
|
|
5
|
+
subgraph cluster_node_types {
|
|
6
|
+
label="NODE TYPES AND SHAPES";
|
|
7
|
+
|
|
8
|
+
// Questions are diamonds
|
|
9
|
+
"Is this a question?" [shape=diamond];
|
|
10
|
+
|
|
11
|
+
// Actions are boxes (default)
|
|
12
|
+
"Take an action" [shape=box];
|
|
13
|
+
|
|
14
|
+
// Commands are plaintext
|
|
15
|
+
"git commit -m 'msg'" [shape=plaintext];
|
|
16
|
+
|
|
17
|
+
// States are ellipses
|
|
18
|
+
"Current state" [shape=ellipse];
|
|
19
|
+
|
|
20
|
+
// Warnings are octagons
|
|
21
|
+
"STOP: Critical warning" [shape=octagon, style=filled, fillcolor=red, fontcolor=white];
|
|
22
|
+
|
|
23
|
+
// Entry/exit are double circles
|
|
24
|
+
"Process starts" [shape=doublecircle];
|
|
25
|
+
"Process complete" [shape=doublecircle];
|
|
26
|
+
|
|
27
|
+
// Examples of each
|
|
28
|
+
"Is test passing?" [shape=diamond];
|
|
29
|
+
"Write test first" [shape=box];
|
|
30
|
+
"npm test" [shape=plaintext];
|
|
31
|
+
"I am stuck" [shape=ellipse];
|
|
32
|
+
"NEVER use git add -A" [shape=octagon, style=filled, fillcolor=red, fontcolor=white];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Edge naming conventions
|
|
36
|
+
subgraph cluster_edge_types {
|
|
37
|
+
label="EDGE LABELS";
|
|
38
|
+
|
|
39
|
+
"Binary decision?" [shape=diamond];
|
|
40
|
+
"Yes path" [shape=box];
|
|
41
|
+
"No path" [shape=box];
|
|
42
|
+
|
|
43
|
+
"Binary decision?" -> "Yes path" [label="yes"];
|
|
44
|
+
"Binary decision?" -> "No path" [label="no"];
|
|
45
|
+
|
|
46
|
+
"Multiple choice?" [shape=diamond];
|
|
47
|
+
"Option A" [shape=box];
|
|
48
|
+
"Option B" [shape=box];
|
|
49
|
+
"Option C" [shape=box];
|
|
50
|
+
|
|
51
|
+
"Multiple choice?" -> "Option A" [label="condition A"];
|
|
52
|
+
"Multiple choice?" -> "Option B" [label="condition B"];
|
|
53
|
+
"Multiple choice?" -> "Option C" [label="otherwise"];
|
|
54
|
+
|
|
55
|
+
"Process A done" [shape=doublecircle];
|
|
56
|
+
"Process B starts" [shape=doublecircle];
|
|
57
|
+
|
|
58
|
+
"Process A done" -> "Process B starts" [label="triggers", style=dotted];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Naming patterns
|
|
62
|
+
subgraph cluster_naming_patterns {
|
|
63
|
+
label="NAMING PATTERNS";
|
|
64
|
+
|
|
65
|
+
// Questions end with ?
|
|
66
|
+
"Should I do X?";
|
|
67
|
+
"Can this be Y?";
|
|
68
|
+
"Is Z true?";
|
|
69
|
+
"Have I done W?";
|
|
70
|
+
|
|
71
|
+
// Actions start with verb
|
|
72
|
+
"Write the test";
|
|
73
|
+
"Search for patterns";
|
|
74
|
+
"Commit changes";
|
|
75
|
+
"Ask for help";
|
|
76
|
+
|
|
77
|
+
// Commands are literal
|
|
78
|
+
"grep -r 'pattern' .";
|
|
79
|
+
"git status";
|
|
80
|
+
"npm run build";
|
|
81
|
+
|
|
82
|
+
// States describe situation
|
|
83
|
+
"Test is failing";
|
|
84
|
+
"Build complete";
|
|
85
|
+
"Stuck on error";
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Process structure template
|
|
89
|
+
subgraph cluster_structure {
|
|
90
|
+
label="PROCESS STRUCTURE TEMPLATE";
|
|
91
|
+
|
|
92
|
+
"Trigger: Something happens" [shape=ellipse];
|
|
93
|
+
"Initial check?" [shape=diamond];
|
|
94
|
+
"Main action" [shape=box];
|
|
95
|
+
"git status" [shape=plaintext];
|
|
96
|
+
"Another check?" [shape=diamond];
|
|
97
|
+
"Alternative action" [shape=box];
|
|
98
|
+
"STOP: Don't do this" [shape=octagon, style=filled, fillcolor=red, fontcolor=white];
|
|
99
|
+
"Process complete" [shape=doublecircle];
|
|
100
|
+
|
|
101
|
+
"Trigger: Something happens" -> "Initial check?";
|
|
102
|
+
"Initial check?" -> "Main action" [label="yes"];
|
|
103
|
+
"Initial check?" -> "Alternative action" [label="no"];
|
|
104
|
+
"Main action" -> "git status";
|
|
105
|
+
"git status" -> "Another check?";
|
|
106
|
+
"Another check?" -> "Process complete" [label="ok"];
|
|
107
|
+
"Another check?" -> "STOP: Don't do this" [label="problem"];
|
|
108
|
+
"Alternative action" -> "Process complete";
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// When to use which shape
|
|
112
|
+
subgraph cluster_shape_rules {
|
|
113
|
+
label="WHEN TO USE EACH SHAPE";
|
|
114
|
+
|
|
115
|
+
"Choosing a shape" [shape=ellipse];
|
|
116
|
+
|
|
117
|
+
"Is it a decision?" [shape=diamond];
|
|
118
|
+
"Use diamond" [shape=diamond, style=filled, fillcolor=lightblue];
|
|
119
|
+
|
|
120
|
+
"Is it a command?" [shape=diamond];
|
|
121
|
+
"Use plaintext" [shape=plaintext, style=filled, fillcolor=lightgray];
|
|
122
|
+
|
|
123
|
+
"Is it a warning?" [shape=diamond];
|
|
124
|
+
"Use octagon" [shape=octagon, style=filled, fillcolor=pink];
|
|
125
|
+
|
|
126
|
+
"Is it entry/exit?" [shape=diamond];
|
|
127
|
+
"Use doublecircle" [shape=doublecircle, style=filled, fillcolor=lightgreen];
|
|
128
|
+
|
|
129
|
+
"Is it a state?" [shape=diamond];
|
|
130
|
+
"Use ellipse" [shape=ellipse, style=filled, fillcolor=lightyellow];
|
|
131
|
+
|
|
132
|
+
"Default: use box" [shape=box, style=filled, fillcolor=lightcyan];
|
|
133
|
+
|
|
134
|
+
"Choosing a shape" -> "Is it a decision?";
|
|
135
|
+
"Is it a decision?" -> "Use diamond" [label="yes"];
|
|
136
|
+
"Is it a decision?" -> "Is it a command?" [label="no"];
|
|
137
|
+
"Is it a command?" -> "Use plaintext" [label="yes"];
|
|
138
|
+
"Is it a command?" -> "Is it a warning?" [label="no"];
|
|
139
|
+
"Is it a warning?" -> "Use octagon" [label="yes"];
|
|
140
|
+
"Is it a warning?" -> "Is it entry/exit?" [label="no"];
|
|
141
|
+
"Is it entry/exit?" -> "Use doublecircle" [label="yes"];
|
|
142
|
+
"Is it entry/exit?" -> "Is it a state?" [label="no"];
|
|
143
|
+
"Is it a state?" -> "Use ellipse" [label="yes"];
|
|
144
|
+
"Is it a state?" -> "Default: use box" [label="no"];
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Good vs bad examples
|
|
148
|
+
subgraph cluster_examples {
|
|
149
|
+
label="GOOD VS BAD EXAMPLES";
|
|
150
|
+
|
|
151
|
+
// Good: specific and shaped correctly
|
|
152
|
+
"Test failed" [shape=ellipse];
|
|
153
|
+
"Read error message" [shape=box];
|
|
154
|
+
"Can reproduce?" [shape=diamond];
|
|
155
|
+
"git diff HEAD~1" [shape=plaintext];
|
|
156
|
+
"NEVER ignore errors" [shape=octagon, style=filled, fillcolor=red, fontcolor=white];
|
|
157
|
+
|
|
158
|
+
"Test failed" -> "Read error message";
|
|
159
|
+
"Read error message" -> "Can reproduce?";
|
|
160
|
+
"Can reproduce?" -> "git diff HEAD~1" [label="yes"];
|
|
161
|
+
|
|
162
|
+
// Bad: vague and wrong shapes
|
|
163
|
+
bad_1 [label="Something wrong", shape=box]; // Should be ellipse (state)
|
|
164
|
+
bad_2 [label="Fix it", shape=box]; // Too vague
|
|
165
|
+
bad_3 [label="Check", shape=box]; // Should be diamond
|
|
166
|
+
bad_4 [label="Run command", shape=box]; // Should be plaintext with actual command
|
|
167
|
+
|
|
168
|
+
bad_1 -> bad_2;
|
|
169
|
+
bad_2 -> bad_3;
|
|
170
|
+
bad_3 -> bad_4;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# Skill 设计中的说服原则
|
|
2
|
+
|
|
3
|
+
## 概述
|
|
4
|
+
|
|
5
|
+
大语言模型与人类一样,会对相同的说服原则做出反应。理解这一心理机制有助于你设计更有效的 Skill —— 目的不是操纵,而是确保关键实践即使在压力下也能被切实执行。
|
|
6
|
+
|
|
7
|
+
**研究基础:** Meincke 等人(2025)通过 N=28,000 次 AI 对话测试了 7 项说服原则。运用说服技巧后,依从率提升了一倍以上(33% → 72%,p < .001)。
|
|
8
|
+
|
|
9
|
+
## 七大原则
|
|
10
|
+
|
|
11
|
+
### 1. 权威(Authority)
|
|
12
|
+
**定义:** 对专业能力、资质或官方来源的服从。
|
|
13
|
+
|
|
14
|
+
**在 Skill 中的作用:**
|
|
15
|
+
- 祈使性语言:"YOU MUST"、"Never"、"Always"
|
|
16
|
+
- 不可协商的表述:"No exceptions"
|
|
17
|
+
- 消除决策疲劳与合理化借口
|
|
18
|
+
|
|
19
|
+
**适用场景:**
|
|
20
|
+
- 约束执行类 Skill(TDD、校验要求等)
|
|
21
|
+
- 安全攸关的关键实践
|
|
22
|
+
- 已确立的最佳实践
|
|
23
|
+
|
|
24
|
+
**示例:**
|
|
25
|
+
```markdown
|
|
26
|
+
✅ Write code before test? Delete it. Start over. No exceptions.
|
|
27
|
+
❌ Consider writing tests first when feasible.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 2. 承诺一致(Commitment)
|
|
31
|
+
**定义:** 与既往行为、陈述或公开声明保持一致。
|
|
32
|
+
|
|
33
|
+
**在 Skill 中的作用:**
|
|
34
|
+
- 要求显式声明:"Announce skill usage"
|
|
35
|
+
- 强制显式选择:"Choose A, B, or C"
|
|
36
|
+
- 使用追踪机制:用 todos 管理清单
|
|
37
|
+
|
|
38
|
+
**适用场景:**
|
|
39
|
+
- 确保 Skill 被切实执行
|
|
40
|
+
- 多步骤流程
|
|
41
|
+
- 责任追溯机制
|
|
42
|
+
|
|
43
|
+
**示例:**
|
|
44
|
+
```markdown
|
|
45
|
+
✅ When you find a skill, you MUST announce: "I'm using [Skill Name]"
|
|
46
|
+
❌ Consider letting your partner know which skill you're using.
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 3. 稀缺(Scarcity)
|
|
50
|
+
**定义:** 由时间限制或资源有限所产生的紧迫感。
|
|
51
|
+
|
|
52
|
+
**在 Skill 中的作用:**
|
|
53
|
+
- 时限性要求:"Before proceeding"
|
|
54
|
+
- 顺序依赖:"Immediately after X"
|
|
55
|
+
- 防止拖延
|
|
56
|
+
|
|
57
|
+
**适用场景:**
|
|
58
|
+
- 需要立即校验的场景
|
|
59
|
+
- 时效性强的工作流
|
|
60
|
+
- 防止“稍后再做”
|
|
61
|
+
|
|
62
|
+
**示例:**
|
|
63
|
+
```markdown
|
|
64
|
+
✅ After completing a task, IMMEDIATELY request code review before proceeding.
|
|
65
|
+
❌ You can review code when convenient.
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 4. 社会认同(Social Proof)
|
|
69
|
+
**定义:** 遵从他人的行为或被视为常规的做法。
|
|
70
|
+
|
|
71
|
+
**在 Skill 中的作用:**
|
|
72
|
+
- 普适性表述:"Every time"、"Always"
|
|
73
|
+
- 失败模式:"没有 Y 的 X = 失败"
|
|
74
|
+
- 建立行为规范
|
|
75
|
+
|
|
76
|
+
**适用场景:**
|
|
77
|
+
- 记录通用实践
|
|
78
|
+
- 警示常见失败原因
|
|
79
|
+
- 强化标准规范
|
|
80
|
+
|
|
81
|
+
**示例:**
|
|
82
|
+
```markdown
|
|
83
|
+
✅ Checklists without todo tracking = steps get skipped. Every time.
|
|
84
|
+
❌ Some people find a todo list helpful for checklists.
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 5. 归属感(Unity)
|
|
88
|
+
**定义:** 共享身份、“我们”意识、群体归属感。
|
|
89
|
+
|
|
90
|
+
**在 Skill 中的作用:**
|
|
91
|
+
- 协作性表述:"our codebase"、"we're colleagues"
|
|
92
|
+
- 共同目标:"we both want quality"
|
|
93
|
+
|
|
94
|
+
**适用场景:**
|
|
95
|
+
- 协作类工作流
|
|
96
|
+
- 建立团队文化
|
|
97
|
+
- 非层级化的实践
|
|
98
|
+
|
|
99
|
+
**示例:**
|
|
100
|
+
```markdown
|
|
101
|
+
✅ We're colleagues working together. I need your honest technical judgment.
|
|
102
|
+
❌ You should probably tell me if I'm wrong.
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 6. 互惠(Reciprocity)
|
|
106
|
+
**定义:** 对已获利益产生回报的义务感。
|
|
107
|
+
|
|
108
|
+
**作用方式:**
|
|
109
|
+
- 需谨慎使用 —— 容易显得带有操纵性
|
|
110
|
+
- 在 Skill 中很少需要
|
|
111
|
+
|
|
112
|
+
**应避免的场景:**
|
|
113
|
+
- 几乎所有情况(其他原则通常更有效)
|
|
114
|
+
|
|
115
|
+
### 7. 喜好(Liking)
|
|
116
|
+
**定义:** 更倾向于与自己喜欢的人合作。
|
|
117
|
+
|
|
118
|
+
**作用方式:**
|
|
119
|
+
- **不要用于提升依从性**
|
|
120
|
+
- 与坦诚反馈的文化相冲突
|
|
121
|
+
- 会导致迎合行为
|
|
122
|
+
|
|
123
|
+
**应避免的场景:**
|
|
124
|
+
- 所有需要强制执行纪律的场景
|
|
125
|
+
|
|
126
|
+
## 按 Skill 类型组合原则
|
|
127
|
+
|
|
128
|
+
| Skill 类型 | 适用原则 | 规避原则 |
|
|
129
|
+
|------------|-----|-------|
|
|
130
|
+
| 约束执行类 | 权威 + 承诺一致 + 社会认同 | 喜好、互惠 |
|
|
131
|
+
| 指导/技巧类 | 适度权威 + 归属感 | 过度权威 |
|
|
132
|
+
| 协作类 | 归属感 + 承诺一致 | 权威、喜好 |
|
|
133
|
+
| 参考资料类 | 仅需清晰表达 | 全部说服原则 |
|
|
134
|
+
|
|
135
|
+
## 为何有效:背后的心理学
|
|
136
|
+
|
|
137
|
+
**清晰的底线规则能减少合理化借口:**
|
|
138
|
+
- "YOU MUST" 消除了决策疲劳
|
|
139
|
+
- 绝对化的表述消除了“这是不是例外?”的疑问
|
|
140
|
+
- 显式的反合理化话术能精准堵住特定漏洞
|
|
141
|
+
|
|
142
|
+
**执行意图能形成自动化行为:**
|
|
143
|
+
- 清晰的触发条件 + 必要行动 = 自动执行
|
|
144
|
+
- "当 X 时,做 Y" 比 "一般情况下做 Y" 更有效
|
|
145
|
+
- 降低了依从所需的认知负荷
|
|
146
|
+
|
|
147
|
+
**大语言模型具有类人性(Parahuman):**
|
|
148
|
+
- 训练数据中已包含这些模式的人类文本
|
|
149
|
+
- 权威性语言在训练数据中通常先于依从行为出现
|
|
150
|
+
- 承诺序列(声明 → 行动)被频繁建模
|
|
151
|
+
- 社会认同模式(大家都做 X)确立了行为规范
|
|
152
|
+
|
|
153
|
+
## 伦理使用
|
|
154
|
+
|
|
155
|
+
**正当用途:**
|
|
156
|
+
- 确保关键实践被切实执行
|
|
157
|
+
- 编写高效的文档
|
|
158
|
+
- 预防可预见的失败
|
|
159
|
+
|
|
160
|
+
**不正当用途:**
|
|
161
|
+
- 为个人私利进行操纵
|
|
162
|
+
- 制造虚假的紧迫感
|
|
163
|
+
- 基于愧疚感迫使服从
|
|
164
|
+
|
|
165
|
+
**检验标准:** 如果用户完全理解该技巧,它是否仍符合其真实利益?
|
|
166
|
+
|
|
167
|
+
## 研究引用
|
|
168
|
+
|
|
169
|
+
**Cialdini, R. B. (2021).** *Influence: The Psychology of Persuasion (New and Expanded).* Harper Business.
|
|
170
|
+
- 七大说服原则
|
|
171
|
+
- 影响力研究的实证基础
|
|
172
|
+
|
|
173
|
+
**Meincke, L., Shapiro, D., Duckworth, A. L., Mollick, E., Mollick, L., & Cialdini, R. (2025).** Call Me A Jerk: Persuading AI to Comply with Objectionable Requests. University of Pennsylvania.
|
|
174
|
+
- 通过 N=28,000 次大语言模型对话测试了 7 项原则
|
|
175
|
+
- 运用说服技巧后依从率从 33% 提升至 72%
|
|
176
|
+
- 权威、承诺一致、稀缺最为有效
|
|
177
|
+
- 验证了大语言模型行为的类人性模型
|
|
178
|
+
|
|
179
|
+
## 快速参考
|
|
180
|
+
|
|
181
|
+
设计 Skill 时,请自问:
|
|
182
|
+
|
|
183
|
+
1. **属于什么类型?**(约束执行类、指导类还是参考资料类)
|
|
184
|
+
2. **想改变什么行为?**
|
|
185
|
+
3. **适用哪项原则?**(约束类通常为权威 + 承诺一致)
|
|
186
|
+
4. **是否叠加过多?**(不要同时使用全部七项)
|
|
187
|
+
5. **是否符合伦理?**(是否服务于用户的真实利益?)
|