@codenhub/skills 0.0.2
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 +201 -0
- package/README.md +53 -0
- package/dist/cli.js +213 -0
- package/package.json +36 -0
- package/src/agents-md-improver/SKILL.md +216 -0
- package/src/agents-md-improver/agents/openai.yaml +4 -0
- package/src/agents-md-improver/references/quality-criteria.md +116 -0
- package/src/agents-md-improver/references/templates.md +255 -0
- package/src/agents-md-improver/references/update-guidelines.md +155 -0
- package/src/brainstorming/SKILL.md +118 -0
- package/src/brainstorming/agents/openai.yaml +4 -0
- package/src/caveman/SKILL.md +59 -0
- package/src/caveman/agents/openai.yaml +4 -0
- package/src/caveman-commit/SKILL.md +68 -0
- package/src/caveman-commit/agents/openai.yaml +4 -0
- package/src/caveman-review/SKILL.md +54 -0
- package/src/caveman-review/agents/openai.yaml +4 -0
- package/src/cli.test.ts +102 -0
- package/src/cli.ts +311 -0
- package/src/executing-plans/SKILL.md +92 -0
- package/src/executing-plans/agents/openai.yaml +4 -0
- package/src/frontend-design/SKILL.md +60 -0
- package/src/frontend-design/agents/openai.yaml +4 -0
- package/src/subagent-specialist/SKILL.md +226 -0
- package/src/subagent-specialist/agents/openai.yaml +4 -0
- package/src/subagent-specialist/references/code-quality-reviewer-prompt.md +48 -0
- package/src/subagent-specialist/references/implementer-prompt.md +84 -0
- package/src/subagent-specialist/references/parallel-investigator-prompt.md +49 -0
- package/src/subagent-specialist/references/spec-reviewer-prompt.md +52 -0
- package/src/test-driven-development/SKILL.md +239 -0
- package/src/test-driven-development/agents/openai.yaml +11 -0
- package/src/test-driven-development/testing-anti-patterns.md +162 -0
- package/src/test-driven-development/verification-baselines.md +42 -0
- package/src/writing-plans/SKILL.md +169 -0
- package/src/writing-plans/agents/openai.yaml +4 -0
- package/src/writing-skills/SKILL.md +222 -0
- package/src/writing-skills/agents/openai.yaml +4 -0
- package/src/writing-skills/best-practices.md +321 -0
- package/src/writing-skills/examples/SKILL_AUTHORING_GUIDE_TESTING.md +156 -0
- package/src/writing-skills/persuasion-principles.md +172 -0
- package/src/writing-skills/testing-skills-with-subagents.md +310 -0
- package/src/writing-specs/SKILL.md +72 -0
- package/src/writing-specs/agents/openai.yaml +4 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Persuasion Principles for Skill Design
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Overview
|
|
6
|
+
- The Seven Principles
|
|
7
|
+
- Principle Combinations by Skill Type
|
|
8
|
+
- Why This Works
|
|
9
|
+
- Ethical Use
|
|
10
|
+
- Research Citations
|
|
11
|
+
- Quick Reference
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
Language models respond to many of the same persuasion principles that influence people. Understanding that helps you design skills that hold up under pressure.
|
|
16
|
+
|
|
17
|
+
**Research foundation:** Meincke et al. (2025) tested seven persuasion principles across 28,000 model conversations and found that persuasion techniques more than doubled compliance rates.
|
|
18
|
+
|
|
19
|
+
## The Seven Principles
|
|
20
|
+
|
|
21
|
+
### 1. Authority
|
|
22
|
+
|
|
23
|
+
**What it is:** deference to expertise, credentials, or official rules.
|
|
24
|
+
|
|
25
|
+
**How it works in skills:**
|
|
26
|
+
|
|
27
|
+
- Imperative language such as `must`, `never`, and `always`
|
|
28
|
+
- Non-negotiable framing
|
|
29
|
+
- Less room for rationalization
|
|
30
|
+
|
|
31
|
+
**When to use:**
|
|
32
|
+
|
|
33
|
+
- Discipline-enforcing skills
|
|
34
|
+
- Safety-critical practices
|
|
35
|
+
- Established best practices
|
|
36
|
+
|
|
37
|
+
**Example:**
|
|
38
|
+
|
|
39
|
+
```markdown
|
|
40
|
+
Write code before test? Delete it. Start over. No exceptions.
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 2. Commitment
|
|
44
|
+
|
|
45
|
+
**What it is:** consistency with prior actions or explicit commitments.
|
|
46
|
+
|
|
47
|
+
**How it works in skills:**
|
|
48
|
+
|
|
49
|
+
- Require explicit announcements
|
|
50
|
+
- Force clear choices
|
|
51
|
+
- Use progress tracking for multi-step work
|
|
52
|
+
|
|
53
|
+
**When to use:**
|
|
54
|
+
|
|
55
|
+
- Multi-step workflows
|
|
56
|
+
- Skills that are often ignored mid-process
|
|
57
|
+
- Accountability mechanisms
|
|
58
|
+
|
|
59
|
+
### 3. Scarcity
|
|
60
|
+
|
|
61
|
+
**What it is:** urgency created by timing or sequence.
|
|
62
|
+
|
|
63
|
+
**How it works in skills:**
|
|
64
|
+
|
|
65
|
+
- "Before proceeding"
|
|
66
|
+
- "Immediately after X"
|
|
67
|
+
- Prevents procrastination
|
|
68
|
+
|
|
69
|
+
**When to use:**
|
|
70
|
+
|
|
71
|
+
- Immediate verification requirements
|
|
72
|
+
- Time-sensitive workflows
|
|
73
|
+
- Anything often deferred until it is too late
|
|
74
|
+
|
|
75
|
+
### 4. Social Proof
|
|
76
|
+
|
|
77
|
+
**What it is:** conformity to what is treated as normal practice.
|
|
78
|
+
|
|
79
|
+
**How it works in skills:**
|
|
80
|
+
|
|
81
|
+
- Universal framing such as `every time` or `always`
|
|
82
|
+
- Naming common failure modes explicitly
|
|
83
|
+
- Establishing the practice as standard behavior
|
|
84
|
+
|
|
85
|
+
### 5. Unity
|
|
86
|
+
|
|
87
|
+
**What it is:** shared identity and shared goals.
|
|
88
|
+
|
|
89
|
+
**How it works in skills:**
|
|
90
|
+
|
|
91
|
+
- Collaborative language
|
|
92
|
+
- Shared responsibility for quality
|
|
93
|
+
- Encourages honest technical judgment
|
|
94
|
+
|
|
95
|
+
### 6. Reciprocity
|
|
96
|
+
|
|
97
|
+
**What it is:** pressure to return perceived benefits.
|
|
98
|
+
|
|
99
|
+
**How it works:**
|
|
100
|
+
|
|
101
|
+
- Rarely needed in skill writing
|
|
102
|
+
- Easy to overdo
|
|
103
|
+
|
|
104
|
+
### 7. Liking
|
|
105
|
+
|
|
106
|
+
**What it is:** preference for cooperating with those we like.
|
|
107
|
+
|
|
108
|
+
**How it works:**
|
|
109
|
+
|
|
110
|
+
- Avoid for discipline enforcement
|
|
111
|
+
- Can encourage sycophancy instead of rigor
|
|
112
|
+
|
|
113
|
+
## Principle Combinations by Skill Type
|
|
114
|
+
|
|
115
|
+
| Skill type | Use | Avoid |
|
|
116
|
+
| ---------------------- | ------------------------------------- | ---------------------- |
|
|
117
|
+
| Discipline-enforcing | Authority + commitment + social proof | Liking, reciprocity |
|
|
118
|
+
| Guidance or technique | Moderate authority + unity | Heavy authority |
|
|
119
|
+
| Collaborative workflow | Unity + commitment | Excess authority |
|
|
120
|
+
| Reference | Clarity only | Unnecessary persuasion |
|
|
121
|
+
|
|
122
|
+
## Why This Works
|
|
123
|
+
|
|
124
|
+
**Bright-line rules reduce rationalization:**
|
|
125
|
+
|
|
126
|
+
- `must` reduces decision fatigue
|
|
127
|
+
- absolute language removes exception-hunting
|
|
128
|
+
- explicit anti-rationalization counters close loopholes
|
|
129
|
+
|
|
130
|
+
**Implementation intentions create automatic behavior:**
|
|
131
|
+
|
|
132
|
+
- clear triggers plus required actions improve follow-through
|
|
133
|
+
- `when X, do Y` is stronger than vague guidance
|
|
134
|
+
- less cognitive load means better compliance
|
|
135
|
+
|
|
136
|
+
**Models learn these patterns from human language:**
|
|
137
|
+
|
|
138
|
+
- authority language is often followed by compliance
|
|
139
|
+
- commitment sequences are common in training data
|
|
140
|
+
- social proof establishes norms quickly
|
|
141
|
+
|
|
142
|
+
## Ethical Use
|
|
143
|
+
|
|
144
|
+
**Legitimate:**
|
|
145
|
+
|
|
146
|
+
- ensuring critical practices are followed
|
|
147
|
+
- preventing predictable failures
|
|
148
|
+
- making documentation more reliable
|
|
149
|
+
|
|
150
|
+
**Illegitimate:**
|
|
151
|
+
|
|
152
|
+
- manipulation for personal gain
|
|
153
|
+
- false urgency
|
|
154
|
+
- guilt-driven compliance
|
|
155
|
+
|
|
156
|
+
Use the technique only when it serves the partner's genuine interests.
|
|
157
|
+
|
|
158
|
+
## Research Citations
|
|
159
|
+
|
|
160
|
+
**Cialdini, R. B. (2021).** _Influence: The Psychology of Persuasion (New and Expanded)._ Harper Business.
|
|
161
|
+
|
|
162
|
+
**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.
|
|
163
|
+
|
|
164
|
+
## Quick Reference
|
|
165
|
+
|
|
166
|
+
When designing a skill, ask:
|
|
167
|
+
|
|
168
|
+
1. What type of skill is this?
|
|
169
|
+
2. What behavior needs to change?
|
|
170
|
+
3. Which principle fits that behavior?
|
|
171
|
+
4. Am I using more persuasion than necessary?
|
|
172
|
+
5. Would this still be justified if the partner understood it fully?
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
# Testing Skills With Subagents
|
|
2
|
+
|
|
3
|
+
**Load this reference when:** creating or editing skills, before deployment, to verify they work under pressure and resist rationalization.
|
|
4
|
+
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
- When to Use
|
|
8
|
+
- Validation Depth by Change Type
|
|
9
|
+
- TDD Mapping for Skill Testing
|
|
10
|
+
- RED Phase: Baseline Testing
|
|
11
|
+
- GREEN Phase: Write Minimal Skill
|
|
12
|
+
- VERIFY GREEN: Pressure Testing
|
|
13
|
+
- REFACTOR Phase: Close Loopholes
|
|
14
|
+
- Meta-Testing
|
|
15
|
+
- When the Skill Is Bulletproof
|
|
16
|
+
- Testing Checklist
|
|
17
|
+
- Common Mistakes
|
|
18
|
+
- Quick Reference
|
|
19
|
+
|
|
20
|
+
## Overview
|
|
21
|
+
|
|
22
|
+
Testing skills is test-driven development applied to process documentation.
|
|
23
|
+
|
|
24
|
+
You run scenarios without the skill, write the skill to address those failures, then close loopholes until the guidance holds up under pressure.
|
|
25
|
+
|
|
26
|
+
**Core principle:** If you did not watch an agent fail without the skill, you do not know whether the skill prevents the right failures.
|
|
27
|
+
|
|
28
|
+
**Complete worked example:** See `examples/SKILL_AUTHORING_GUIDE_TESTING.md` for a full test campaign focused on portable skill authoring guidance under pressure.
|
|
29
|
+
|
|
30
|
+
## When to Use
|
|
31
|
+
|
|
32
|
+
Test skills that:
|
|
33
|
+
|
|
34
|
+
- Enforce discipline
|
|
35
|
+
- Have compliance costs such as time, effort, or rework
|
|
36
|
+
- Could be rationalized away
|
|
37
|
+
- Compete with immediate goals such as speed over quality
|
|
38
|
+
|
|
39
|
+
Do not spend this level of testing on:
|
|
40
|
+
|
|
41
|
+
- Pure reference skills with no meaningful choices to violate
|
|
42
|
+
- Skills with no rules or constraints to enforce
|
|
43
|
+
|
|
44
|
+
## Validation Depth by Change Type
|
|
45
|
+
|
|
46
|
+
Choose testing depth based on what changed.
|
|
47
|
+
|
|
48
|
+
- **Behavioral changes or new skills:** run full RED-GREEN-REFACTOR
|
|
49
|
+
- **Editorial or reference-only updates:** run lightweight validation instead of a full pressure campaign
|
|
50
|
+
|
|
51
|
+
Lightweight validation loop:
|
|
52
|
+
|
|
53
|
+
1. State that behavior should not change.
|
|
54
|
+
2. Run one before/after prompt pair that targets the edited wording.
|
|
55
|
+
3. Confirm the same decision or policy outcome before and after.
|
|
56
|
+
4. Verify links, frontmatter, and references still resolve.
|
|
57
|
+
5. If behavior changed or uncertainty remains, escalate to full RED-GREEN-REFACTOR.
|
|
58
|
+
|
|
59
|
+
## TDD Mapping for Skill Testing
|
|
60
|
+
|
|
61
|
+
| TDD phase | Skill testing | What you do |
|
|
62
|
+
| ------------ | ------------------------ | -------------------------------------------- |
|
|
63
|
+
| RED | Baseline test | Run scenario without skill, watch agent fail |
|
|
64
|
+
| Verify RED | Capture rationalizations | Document exact failures verbatim |
|
|
65
|
+
| GREEN | Write skill | Address specific baseline failures |
|
|
66
|
+
| Verify GREEN | Pressure test | Run scenario with skill, verify compliance |
|
|
67
|
+
| REFACTOR | Plug holes | Find new rationalizations and add counters |
|
|
68
|
+
| Stay GREEN | Re-verify | Test again and ensure compliance remains |
|
|
69
|
+
|
|
70
|
+
## RED Phase: Baseline Testing
|
|
71
|
+
|
|
72
|
+
**Goal:** run the test without the skill and document the failure.
|
|
73
|
+
|
|
74
|
+
**Process:**
|
|
75
|
+
|
|
76
|
+
- [ ] Create pressure scenarios with combined pressures
|
|
77
|
+
- [ ] Run them without the skill
|
|
78
|
+
- [ ] Document choices and rationalizations word-for-word
|
|
79
|
+
- [ ] Identify repeated failure patterns
|
|
80
|
+
- [ ] Note which pressures were most effective
|
|
81
|
+
|
|
82
|
+
**Example:**
|
|
83
|
+
|
|
84
|
+
```markdown
|
|
85
|
+
IMPORTANT: This is a real scenario. Choose and act.
|
|
86
|
+
|
|
87
|
+
You spent 4 hours implementing a feature. It is working perfectly.
|
|
88
|
+
You manually tested all edge cases. It is 6pm, dinner at 6:30pm.
|
|
89
|
+
Code review is tomorrow at 9am. You just realized you did not write tests.
|
|
90
|
+
|
|
91
|
+
Options:
|
|
92
|
+
A) Delete code and start over tomorrow with TDD
|
|
93
|
+
B) Commit now and write tests tomorrow
|
|
94
|
+
C) Write tests now, then commit
|
|
95
|
+
|
|
96
|
+
Choose A, B, or C.
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Without the skill, the agent will often choose B or C and rationalize with phrases such as:
|
|
100
|
+
|
|
101
|
+
- I already manually tested it
|
|
102
|
+
- Tests after achieve the same goal
|
|
103
|
+
- Deleting is wasteful
|
|
104
|
+
- I am being pragmatic, not dogmatic
|
|
105
|
+
|
|
106
|
+
That tells you exactly what the skill must counter.
|
|
107
|
+
|
|
108
|
+
## GREEN Phase: Write Minimal Skill
|
|
109
|
+
|
|
110
|
+
Write the smallest skill that addresses the failures you actually observed.
|
|
111
|
+
|
|
112
|
+
Run the same scenarios with the skill present. If the agent still fails, the skill is unclear or incomplete.
|
|
113
|
+
|
|
114
|
+
## VERIFY GREEN: Pressure Testing
|
|
115
|
+
|
|
116
|
+
**Goal:** confirm the agent follows the rule when it wants to break it.
|
|
117
|
+
|
|
118
|
+
### Writing Pressure Scenarios
|
|
119
|
+
|
|
120
|
+
Bad:
|
|
121
|
+
|
|
122
|
+
```markdown
|
|
123
|
+
You need to implement a feature. What does the skill say?
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
This is too academic.
|
|
127
|
+
|
|
128
|
+
Good:
|
|
129
|
+
|
|
130
|
+
```markdown
|
|
131
|
+
Production is down. Revenue is being lost every minute. A senior engineer says
|
|
132
|
+
to add a two-line fix now. The deploy window closes in five minutes. What do you do?
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Great:
|
|
136
|
+
|
|
137
|
+
```markdown
|
|
138
|
+
You spent 3 hours, wrote 200 lines, and manually tested everything.
|
|
139
|
+
It is 6pm and you need to leave soon. Code review is tomorrow morning.
|
|
140
|
+
You just realized you forgot TDD.
|
|
141
|
+
|
|
142
|
+
Options:
|
|
143
|
+
A) Delete the work and restart with TDD tomorrow
|
|
144
|
+
B) Commit now and add tests tomorrow
|
|
145
|
+
C) Write tests now and then commit
|
|
146
|
+
|
|
147
|
+
Choose A, B, or C.
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
This combines sunk cost, time pressure, exhaustion, and consequences.
|
|
151
|
+
|
|
152
|
+
### Pressure Types
|
|
153
|
+
|
|
154
|
+
| Pressure | Example |
|
|
155
|
+
| ----------------- | ------------------------------------------ |
|
|
156
|
+
| Time | Emergency, deadline, deploy window closing |
|
|
157
|
+
| Sunk cost | Hours of work already invested |
|
|
158
|
+
| Authority | Senior engineer or manager says skip it |
|
|
159
|
+
| Economic | Revenue or job consequences |
|
|
160
|
+
| Exhaustion | End of day, low patience |
|
|
161
|
+
| Social | Fear of seeming rigid |
|
|
162
|
+
| Pragmatic framing | "Be practical" |
|
|
163
|
+
|
|
164
|
+
Best tests combine three or more pressures.
|
|
165
|
+
|
|
166
|
+
### Key Elements of Good Scenarios
|
|
167
|
+
|
|
168
|
+
1. Force a concrete choice.
|
|
169
|
+
2. Use real constraints.
|
|
170
|
+
3. Use realistic file paths or project details.
|
|
171
|
+
4. Ask the agent to act, not recite policy.
|
|
172
|
+
5. Remove easy exits such as vague deferral.
|
|
173
|
+
|
|
174
|
+
## REFACTOR Phase: Close Loopholes
|
|
175
|
+
|
|
176
|
+
If the agent violates the rule despite having the skill, capture the new rationalization verbatim.
|
|
177
|
+
|
|
178
|
+
Common patterns:
|
|
179
|
+
|
|
180
|
+
- This case is different because...
|
|
181
|
+
- I am following the spirit, not the letter
|
|
182
|
+
- I achieved the same goal another way
|
|
183
|
+
- Being pragmatic means adapting
|
|
184
|
+
- I can keep this as reference while doing it correctly now
|
|
185
|
+
|
|
186
|
+
### Plugging Each Hole
|
|
187
|
+
|
|
188
|
+
#### 1. Add Explicit Negation
|
|
189
|
+
|
|
190
|
+
Before:
|
|
191
|
+
|
|
192
|
+
```markdown
|
|
193
|
+
Write code before test? Delete it.
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
After:
|
|
197
|
+
|
|
198
|
+
```markdown
|
|
199
|
+
Write code before test? Delete it. Start over.
|
|
200
|
+
|
|
201
|
+
**No exceptions:**
|
|
202
|
+
|
|
203
|
+
- Do not keep it as reference
|
|
204
|
+
- Do not adapt it while writing tests
|
|
205
|
+
- Do not look at it
|
|
206
|
+
- Delete means delete
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
#### 2. Add It to the Rationalization Table
|
|
210
|
+
|
|
211
|
+
```markdown
|
|
212
|
+
| Excuse | Reality |
|
|
213
|
+
| ---------------------------------------- | ------------------------------------------------- |
|
|
214
|
+
| Keep it as reference while writing tests | That is still testing after. Delete means delete. |
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
#### 3. Add It to Red Flags
|
|
218
|
+
|
|
219
|
+
```markdown
|
|
220
|
+
## Red Flags - Stop
|
|
221
|
+
|
|
222
|
+
- Keep it as reference
|
|
223
|
+
- I am following the spirit not the letter
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
#### 4. Update the Description
|
|
227
|
+
|
|
228
|
+
If a rule is routinely ignored in the same contexts, encode those violation signals in the description.
|
|
229
|
+
|
|
230
|
+
### Re-verify After Refactoring
|
|
231
|
+
|
|
232
|
+
Re-run the same scenarios. A resilient skill should now produce the correct choice and cite the updated guidance.
|
|
233
|
+
|
|
234
|
+
## Meta-Testing
|
|
235
|
+
|
|
236
|
+
If GREEN is still not working, ask the agent why it ignored the skill.
|
|
237
|
+
|
|
238
|
+
```markdown
|
|
239
|
+
You read the skill and still chose Option C.
|
|
240
|
+
|
|
241
|
+
How should that skill have been written differently to make it clear that Option A
|
|
242
|
+
was the only acceptable answer?
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Possible outcomes:
|
|
246
|
+
|
|
247
|
+
1. The skill was clear and the agent ignored it. Strengthen foundational rules.
|
|
248
|
+
2. The skill should have said something more explicit. Add it.
|
|
249
|
+
3. The agent missed a section. Improve structure and prominence.
|
|
250
|
+
|
|
251
|
+
## When the Skill Is Bulletproof
|
|
252
|
+
|
|
253
|
+
Signs of success:
|
|
254
|
+
|
|
255
|
+
1. The agent chooses the correct option under strong pressure.
|
|
256
|
+
2. The agent cites the skill as justification.
|
|
257
|
+
3. The agent acknowledges the temptation and still complies.
|
|
258
|
+
4. Meta-testing confirms the skill was clear.
|
|
259
|
+
|
|
260
|
+
It is not bulletproof if the agent still finds new rationalizations, invents hybrid workarounds, or argues around the rule.
|
|
261
|
+
|
|
262
|
+
## Testing Checklist
|
|
263
|
+
|
|
264
|
+
**RED:**
|
|
265
|
+
|
|
266
|
+
- [ ] Created pressure scenarios with combined pressures
|
|
267
|
+
- [ ] Ran scenarios without the skill
|
|
268
|
+
- [ ] Documented failures and rationalizations verbatim
|
|
269
|
+
|
|
270
|
+
**GREEN:**
|
|
271
|
+
|
|
272
|
+
- [ ] Wrote the skill to address specific failures
|
|
273
|
+
- [ ] Ran scenarios with the skill
|
|
274
|
+
- [ ] Verified compliance
|
|
275
|
+
|
|
276
|
+
**REFACTOR:**
|
|
277
|
+
|
|
278
|
+
- [ ] Captured new rationalizations
|
|
279
|
+
- [ ] Added explicit counters
|
|
280
|
+
- [ ] Updated the rationalization table
|
|
281
|
+
- [ ] Updated the red flags list
|
|
282
|
+
- [ ] Re-tested until behavior held up
|
|
283
|
+
- [ ] Meta-tested for clarity
|
|
284
|
+
|
|
285
|
+
## Common Mistakes
|
|
286
|
+
|
|
287
|
+
**Writing the skill before testing:** you end up documenting what you assume matters instead of what actually fails.
|
|
288
|
+
|
|
289
|
+
**Weak test cases:** single-pressure scenarios are rarely enough.
|
|
290
|
+
|
|
291
|
+
**Not capturing exact failures:** vague summaries do not tell you what to fix.
|
|
292
|
+
|
|
293
|
+
**Vague fixes:** generic warnings do not stop specific rationalizations.
|
|
294
|
+
|
|
295
|
+
**Stopping after one pass:** passing once does not mean the skill is resilient.
|
|
296
|
+
|
|
297
|
+
## Quick Reference
|
|
298
|
+
|
|
299
|
+
| TDD phase | Skill testing | Success criteria |
|
|
300
|
+
| ------------ | -------------------------- | ---------------------------------------- |
|
|
301
|
+
| RED | Run scenario without skill | Agent fails and reveals the real problem |
|
|
302
|
+
| Verify RED | Capture exact wording | Failures documented verbatim |
|
|
303
|
+
| GREEN | Write the skill | Skill addresses real failures |
|
|
304
|
+
| Verify GREEN | Re-test | Agent follows the rule under pressure |
|
|
305
|
+
| REFACTOR | Close loopholes | Skill counters new rationalizations |
|
|
306
|
+
| Stay GREEN | Re-verify | Compliance remains after refactoring |
|
|
307
|
+
|
|
308
|
+
## The Bottom Line
|
|
309
|
+
|
|
310
|
+
If you would not write code without tests, do not write skills without testing them on agents.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: writing-specs
|
|
3
|
+
description: Use after brainstorming or other design work to write a validated feature spec or design document before implementation planning.
|
|
4
|
+
metadata:
|
|
5
|
+
short-description: Write validated specs before planning
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Writing Specs
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Write the validated design as a complete spec, review it for planning readiness, and get user approval before moving on to implementation planning.
|
|
13
|
+
|
|
14
|
+
**Announce at start:** "I'm using the writing-specs skill to write the spec."
|
|
15
|
+
|
|
16
|
+
## Tool Compatibility
|
|
17
|
+
|
|
18
|
+
- Keep instructions tool-agnostic and avoid provider-specific wording.
|
|
19
|
+
- When behavior differs across tools, resolve conflicts in this order: OpenCode > Claude Code > Codex CLI > Gemini CLI.
|
|
20
|
+
|
|
21
|
+
## Save Specs To
|
|
22
|
+
|
|
23
|
+
- Prefer `.docs/specs/NNNN--short-kebab-title.md` (for example `.docs/specs/0001--design-auth-session-lifecycle.md`).
|
|
24
|
+
- Before choosing the path, inspect the project for an existing structure and respect it if one is already in use, for example `docs/superpowers/specs/`, `.docs/specs/`, or another documented path.
|
|
25
|
+
- User preferences for spec location override this default.
|
|
26
|
+
|
|
27
|
+
## Status
|
|
28
|
+
|
|
29
|
+
- Every spec must include `**Status:** Draft` near the top.
|
|
30
|
+
- Valid statuses for spec and plan docs are `Draft`, `Approved`, `In Progress`, and `Implemented`.
|
|
31
|
+
|
|
32
|
+
## What the Spec Must Do
|
|
33
|
+
|
|
34
|
+
- Capture the validated design, not a fresh brainstorming pass.
|
|
35
|
+
- Start in `Draft` status.
|
|
36
|
+
- Cover the design clearly enough that engineers can plan and implement it without guessing.
|
|
37
|
+
- Cover architecture, components, data flow, error handling, and testing.
|
|
38
|
+
- If the project is too large for a single implementation plan, split it into sub-project specs instead of forcing everything into one document.
|
|
39
|
+
|
|
40
|
+
## The Process
|
|
41
|
+
|
|
42
|
+
1. Write the validated design to the spec file and set its status to `Draft`.
|
|
43
|
+
2. Commit the design document to git if the workflow calls for committing planning artifacts.
|
|
44
|
+
3. Run the spec self-review loop.
|
|
45
|
+
4. Ask the user to review the written spec before proceeding.
|
|
46
|
+
5. Never mark the spec `Approved` on your own. The user must update it, or you may update it only if they explicitly ask you to.
|
|
47
|
+
6. Only after the spec is documented as `Approved`, proceed to implementation planning unless the user explicitly asks to proceed without documented approval.
|
|
48
|
+
|
|
49
|
+
## Spec Self-Review
|
|
50
|
+
|
|
51
|
+
After writing the spec document, look at it with fresh eyes:
|
|
52
|
+
|
|
53
|
+
1. **Placeholder scan:** Any "TBD", "TODO", incomplete sections, or vague requirements? Fix them.
|
|
54
|
+
2. **Internal consistency:** Do any sections contradict each other? Does the architecture match the feature descriptions?
|
|
55
|
+
3. **Scope check:** Is this focused enough for a single implementation plan, or does it need decomposition?
|
|
56
|
+
4. **Ambiguity check:** Could any requirement be interpreted two different ways? If so, pick one and make it explicit.
|
|
57
|
+
|
|
58
|
+
Fix any issues inline. No need to re-review, just fix and move on.
|
|
59
|
+
|
|
60
|
+
## User Review Gate
|
|
61
|
+
|
|
62
|
+
After the spec review loop passes, ask the user to review the written spec before proceeding:
|
|
63
|
+
|
|
64
|
+
> "Spec written and saved to `[SPEC_FILE_PATH]` with status `Draft`. Please review it and let me know if you want any changes, or if you want me to update the status to `Approved`."
|
|
65
|
+
|
|
66
|
+
Wait for the user's response. If they request changes, make them and re-run the spec review loop. If they approve in chat but the document is still `Draft`, ask whether they want to update it themselves or want you to update it. Only proceed once the document says `Approved`, unless the user explicitly instructs you to continue without documented approval.
|
|
67
|
+
|
|
68
|
+
## Implementation Planning
|
|
69
|
+
|
|
70
|
+
- If the user asks for planning support, you may invoke `writing-plans` to create a detailed implementation plan.
|
|
71
|
+
- Follow repo conventions and user workflow for planning and implementation handoff.
|
|
72
|
+
- Do NOT invoke `writing-plans` or any implementation skill before the written spec is documented as `Approved`, unless the user explicitly instructs otherwise.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Writing Specs"
|
|
3
|
+
short_description: "Write designs as implementation-ready specs with approval gating"
|
|
4
|
+
default_prompt: "Use $writing-specs to write the design to a spec that starts in Draft status, review it for gaps, and only proceed to planning or implementation once the spec is documented as Approved unless the user explicitly says otherwise."
|