@simplysm/sd-claude 13.0.69 → 13.0.71

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 (78) hide show
  1. package/README.md +12 -601
  2. package/claude/agents/sd-api-reviewer.md +0 -1
  3. package/claude/agents/sd-code-reviewer.md +0 -1
  4. package/claude/agents/sd-code-simplifier.md +1 -1
  5. package/claude/agents/sd-security-reviewer.md +0 -1
  6. package/claude/refs/sd-angular.md +26 -26
  7. package/claude/refs/sd-orm-v12.md +17 -17
  8. package/claude/rules/sd-refs-linker.md +14 -14
  9. package/claude/sd-statusline.js +21 -21
  10. package/claude/skills/sd-api-name-review/SKILL.md +1 -2
  11. package/claude/skills/sd-brainstorm/SKILL.md +3 -4
  12. package/claude/skills/sd-check/SKILL.md +1 -2
  13. package/claude/skills/sd-commit/SKILL.md +2 -3
  14. package/claude/skills/sd-debug/SKILL.md +1 -2
  15. package/claude/skills/sd-discuss/SKILL.md +1 -3
  16. package/claude/skills/sd-document/SKILL.md +99 -0
  17. package/claude/skills/sd-document/extract_docx.py +92 -0
  18. package/claude/skills/sd-document/extract_pdf.py +102 -0
  19. package/claude/skills/sd-document/extract_pptx.py +77 -0
  20. package/claude/skills/sd-document/extract_xlsx.py +83 -0
  21. package/claude/skills/sd-email-analyze/SKILL.md +6 -6
  22. package/claude/skills/sd-plan/SKILL.md +1 -3
  23. package/claude/skills/sd-plan-dev/SKILL.md +94 -111
  24. package/claude/skills/sd-plan-dev/code-quality-reviewer-prompt.md +1 -1
  25. package/claude/skills/sd-plan-dev/final-review-prompt.md +1 -1
  26. package/claude/skills/sd-plan-dev/spec-reviewer-prompt.md +1 -1
  27. package/claude/skills/sd-readme/SKILL.md +107 -88
  28. package/claude/skills/sd-review/SKILL.md +14 -16
  29. package/claude/skills/sd-skill/SKILL.md +6 -317
  30. package/claude/skills/sd-skill/cso-guide.md +161 -0
  31. package/claude/skills/sd-skill/writing-guide.md +163 -0
  32. package/claude/skills/sd-tdd/SKILL.md +1 -3
  33. package/claude/skills/sd-use/SKILL.md +1 -3
  34. package/claude/skills/sd-worktree/SKILL.md +52 -2
  35. package/dist/commands/auth-add.d.ts +2 -0
  36. package/dist/commands/auth-add.d.ts.map +1 -0
  37. package/dist/commands/auth-add.js +32 -0
  38. package/dist/commands/auth-add.js.map +6 -0
  39. package/dist/commands/auth-list.d.ts +2 -0
  40. package/dist/commands/auth-list.d.ts.map +1 -0
  41. package/dist/commands/auth-list.js +37 -0
  42. package/dist/commands/auth-list.js.map +6 -0
  43. package/dist/commands/auth-remove.d.ts +2 -0
  44. package/dist/commands/auth-remove.d.ts.map +1 -0
  45. package/dist/commands/auth-remove.js +22 -0
  46. package/dist/commands/auth-remove.js.map +6 -0
  47. package/dist/commands/auth-use.d.ts +2 -0
  48. package/dist/commands/auth-use.d.ts.map +1 -0
  49. package/dist/commands/auth-use.js +33 -0
  50. package/dist/commands/auth-use.js.map +6 -0
  51. package/dist/commands/auth-utils.d.ts +11 -0
  52. package/dist/commands/auth-utils.d.ts.map +1 -0
  53. package/dist/commands/auth-utils.js +57 -0
  54. package/dist/commands/auth-utils.js.map +6 -0
  55. package/dist/commands/install.js +3 -3
  56. package/dist/commands/install.js.map +1 -1
  57. package/dist/index.d.ts +5 -0
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.js +5 -0
  60. package/dist/index.js.map +1 -1
  61. package/dist/sd-claude.js +68 -3
  62. package/dist/sd-claude.js.map +1 -1
  63. package/package.json +3 -2
  64. package/scripts/sync-claude-assets.mjs +1 -1
  65. package/src/commands/auth-add.ts +36 -0
  66. package/src/commands/auth-list.ts +44 -0
  67. package/src/commands/auth-remove.ts +26 -0
  68. package/src/commands/auth-use.ts +53 -0
  69. package/src/commands/auth-utils.ts +65 -0
  70. package/src/commands/install.ts +19 -19
  71. package/src/index.ts +5 -0
  72. package/src/sd-claude.ts +81 -3
  73. package/tests/auth-add.spec.ts +74 -0
  74. package/tests/auth-list.spec.ts +175 -0
  75. package/tests/auth-remove.spec.ts +74 -0
  76. package/tests/auth-use.spec.ts +153 -0
  77. package/tests/auth-utils.spec.ts +173 -0
  78. package/claude/skills/sd-explore/SKILL.md +0 -78
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: sd-skill
3
- description: Skill creation and editing with TDD methodology
4
- disable-model-invocation: true
5
- model: opus
3
+ description: "Skill creation and editing (explicit invocation only)"
6
4
  ---
7
5
 
8
6
  # Writing Skills
@@ -106,7 +104,7 @@ skills/
106
104
  - `description`: Third-person, describes ONLY when to use (NOT what it does)
107
105
  - Start with "Use when..." to focus on triggering conditions
108
106
  - Include specific symptoms, situations, and contexts
109
- - **NEVER summarize the skill's process or workflow** (see CSO section for why)
107
+ - **NEVER summarize the skill's process or workflow** (see cso-guide.md for why)
110
108
  - Keep under 500 characters if possible
111
109
 
112
110
  ```markdown
@@ -152,248 +150,11 @@ Concrete results
152
150
 
153
151
  ## Claude Search Optimization (CSO)
154
152
 
155
- **Critical for discovery:** Future Claude needs to FIND your skill
153
+ **Critical for discovery.** See **cso-guide.md** for the complete guide covering description fields, keyword coverage, naming, token efficiency, and cross-referencing.
156
154
 
157
- ### 1. Rich Description Field
155
+ ## Writing Guidelines
158
156
 
159
- **Purpose:** Claude reads description to decide which skills to load for a given task. Make it answer: "Should I read this skill right now?"
160
-
161
- **Format:** Start with "Use when..." to focus on triggering conditions
162
-
163
- **CRITICAL: Description = When to Use, NOT What the Skill Does**
164
-
165
- The description should ONLY describe triggering conditions. Do NOT summarize the skill's process or workflow in the description.
166
-
167
- **Why this matters:** Testing revealed that when a description summarizes the skill's workflow, Claude may follow the description instead of reading the full skill content. A description saying "code review between tasks" caused Claude to do ONE review, even though the skill's flowchart clearly showed TWO reviews (spec compliance then code quality).
168
-
169
- When the description was changed to just "Use when executing implementation plans with independent tasks" (no workflow summary), Claude correctly read the flowchart and followed the two-stage review process.
170
-
171
- **The trap:** Descriptions that summarize workflow create a shortcut Claude will take. The skill body becomes documentation Claude skips.
172
-
173
- ```yaml
174
- # ❌ BAD: Summarizes workflow - Claude may follow this instead of reading skill
175
- description: Use when executing plans - dispatches subagent per task with code review between tasks
176
-
177
- # ❌ BAD: Too much process detail
178
- description: Use for TDD - write test first, watch it fail, write minimal code, refactor
179
-
180
- # ✅ GOOD: Just triggering conditions, no workflow summary
181
- description: Use when executing implementation plans with independent tasks in the current session
182
-
183
- # ✅ GOOD: Triggering conditions only
184
- description: Use when implementing any feature or bugfix, before writing implementation code
185
- ```
186
-
187
- **Content:**
188
-
189
- - Use concrete triggers, symptoms, and situations that signal this skill applies
190
- - Describe the _problem_ (race conditions, inconsistent behavior) not _language-specific symptoms_ (setTimeout, sleep)
191
- - Keep triggers technology-agnostic unless the skill itself is technology-specific
192
- - If skill is technology-specific, make that explicit in the trigger
193
- - Write in third person (injected into system prompt)
194
- - **NEVER summarize the skill's process or workflow**
195
-
196
- ```yaml
197
- # ❌ BAD: Too abstract, vague, doesn't include when to use
198
- description: For async testing
199
-
200
- # ❌ BAD: First person
201
- description: I can help you with async tests when they're flaky
202
-
203
- # ❌ BAD: Mentions technology but skill isn't specific to it
204
- description: Use when tests use setTimeout/sleep and are flaky
205
-
206
- # ✅ GOOD: Starts with "Use when", describes problem, no workflow
207
- description: Use when tests have race conditions, timing dependencies, or pass/fail inconsistently
208
-
209
- # ✅ GOOD: Technology-specific skill with explicit trigger
210
- description: Use when using React Router and handling authentication redirects
211
- ```
212
-
213
- ### 2. Keyword Coverage
214
-
215
- Use words Claude would search for:
216
-
217
- - Error messages: "Hook timed out", "ENOTEMPTY", "race condition"
218
- - Symptoms: "flaky", "hanging", "zombie", "pollution"
219
- - Synonyms: "timeout/hang/freeze", "cleanup/teardown/afterEach"
220
- - Tools: Actual commands, library names, file types
221
-
222
- ### 3. Descriptive Naming
223
-
224
- **Use active voice, verb-first:**
225
-
226
- - ✅ `creating-skills` not `skill-creation`
227
- - ✅ `condition-based-waiting` not `async-test-helpers`
228
-
229
- ### 4. Token Efficiency (Critical)
230
-
231
- **Problem:** getting-started and frequently-referenced skills load into EVERY conversation. Every token counts.
232
-
233
- **Target word counts:**
234
-
235
- - getting-started workflows: <150 words each
236
- - Frequently-loaded skills: <200 words total
237
- - Other skills: <500 words (still be concise)
238
-
239
- **Techniques:**
240
-
241
- **Move details to tool help:**
242
-
243
- ```bash
244
- # ❌ BAD: Document all flags in SKILL.md
245
- search-conversations supports --text, --both, --after DATE, --before DATE, --limit N
246
-
247
- # ✅ GOOD: Reference --help
248
- search-conversations supports multiple modes and filters. Run --help for details.
249
- ```
250
-
251
- **Use cross-references:**
252
-
253
- ```markdown
254
- # ❌ BAD: Repeat workflow details
255
-
256
- When searching, dispatch subagent with template...
257
- [20 lines of repeated instructions]
258
-
259
- # ✅ GOOD: Reference other skill
260
-
261
- Always use subagents (50-100x context savings). REQUIRED: Use [other-skill-name] for workflow.
262
- ```
263
-
264
- **Compress examples:**
265
-
266
- ```markdown
267
- # ❌ BAD: Verbose example (42 words)
268
-
269
- your human partner: "How did we handle authentication errors in React Router before?"
270
- You: I'll search past conversations for React Router authentication patterns.
271
- [Dispatch subagent with search query: "React Router authentication error handling 401"]
272
-
273
- # ✅ GOOD: Minimal example (20 words)
274
-
275
- Partner: "How did we handle auth errors in React Router?"
276
- You: Searching...
277
- [Dispatch subagent → synthesis]
278
- ```
279
-
280
- **Eliminate redundancy:**
281
-
282
- - Don't repeat what's in cross-referenced skills
283
- - Don't explain what's obvious from command
284
- - Don't include multiple examples of same pattern
285
-
286
- **Name by what you DO or core insight:**
287
-
288
- - ✅ `condition-based-waiting` > `async-test-helpers`
289
- - ✅ `using-skills` not `skill-usage`
290
- - ✅ `flatten-with-flags` > `data-structure-refactoring`
291
- - ✅ `root-cause-tracing` > `debugging-techniques`
292
-
293
- **Gerunds (-ing) work well for processes:**
294
-
295
- - `creating-skills`, `testing-skills`, `debugging-with-logs`
296
- - Active, describes the action you're taking
297
-
298
- ### 4. Cross-Referencing Other Skills
299
-
300
- **When writing documentation that references other skills:**
301
-
302
- Use skill name only, with explicit requirement markers:
303
-
304
- - ✅ Good: `**REQUIRED SUB-SKILL:** Use sd-tdd`
305
- - ✅ Good: `**REQUIRED BACKGROUND:** You MUST understand sd-tdd`
306
- - ❌ Bad: `See skills/testing/test-driven-development` (unclear if required)
307
- - ❌ Bad: `@skills/testing/test-driven-development/SKILL.md` (force-loads, burns context)
308
-
309
- **Why no @ links:** `@` syntax force-loads files immediately, consuming 200k+ context before you need them.
310
-
311
- ## Flowchart Usage
312
-
313
- ```dot
314
- digraph when_flowchart {
315
- "Need to show information?" [shape=diamond];
316
- "Decision where I might go wrong?" [shape=diamond];
317
- "Use markdown" [shape=box];
318
- "Small inline flowchart" [shape=box];
319
-
320
- "Need to show information?" -> "Decision where I might go wrong?" [label="yes"];
321
- "Decision where I might go wrong?" -> "Small inline flowchart" [label="yes"];
322
- "Decision where I might go wrong?" -> "Use markdown" [label="no"];
323
- }
324
- ```
325
-
326
- **Use flowcharts ONLY for:**
327
-
328
- - Non-obvious decision points
329
- - Process loops where you might stop too early
330
- - "When to use A vs B" decisions
331
-
332
- **Never use flowcharts for:**
333
-
334
- - Reference material → Tables, lists
335
- - Code examples → Markdown blocks
336
- - Linear instructions → Numbered lists
337
- - Labels without semantic meaning (step1, helper2)
338
-
339
- ## Code Examples
340
-
341
- **One excellent example beats many mediocre ones**
342
-
343
- Choose most relevant language:
344
-
345
- - Testing techniques → TypeScript/JavaScript
346
- - System debugging → Shell/Python
347
- - Data processing → Python
348
-
349
- **Good example:**
350
-
351
- - Complete and runnable
352
- - Well-commented explaining WHY
353
- - From real scenario
354
- - Shows pattern clearly
355
- - Ready to adapt (not generic template)
356
-
357
- **Don't:**
358
-
359
- - Implement in 5+ languages
360
- - Create fill-in-the-blank templates
361
- - Write contrived examples
362
-
363
- You're good at porting - one great example is enough.
364
-
365
- ## File Organization
366
-
367
- ### Self-Contained Skill
368
-
369
- ```
370
- defense-in-depth/
371
- SKILL.md # Everything inline
372
- ```
373
-
374
- When: All content fits, no heavy reference needed
375
-
376
- ### Skill with Reusable Tool
377
-
378
- ```
379
- condition-based-waiting/
380
- SKILL.md # Overview + patterns
381
- example.ts # Working helpers to adapt
382
- ```
383
-
384
- When: Tool is reusable code, not just narrative
385
-
386
- ### Skill with Heavy Reference
387
-
388
- ```
389
- pptx/
390
- SKILL.md # Overview + workflows
391
- pptxgenjs.md # 600 lines API reference
392
- ooxml.md # 500 lines XML structure
393
- scripts/ # Executable tools
394
- ```
395
-
396
- When: Reference material too large for inline
157
+ **See writing-guide.md** for flowchart usage, code examples, file organization, and bulletproofing techniques.
397
158
 
398
159
  ## The Iron Law (Same as TDD)
399
160
 
@@ -497,79 +258,7 @@ Example: Testing a "condition-based-waiting" skill
497
258
 
498
259
  ## Bulletproofing Skills Against Rationalization
499
260
 
500
- Skills that enforce discipline (like TDD) need to resist rationalization. Agents are smart and will find loopholes when under pressure.
501
-
502
- **Psychology note:** Understanding WHY persuasion techniques work helps you apply them systematically. See persuasion-principles.md for research foundation (Cialdini, 2021; Meincke et al., 2025) on authority, commitment, scarcity, social proof, and unity principles.
503
-
504
- ### Close Every Loophole Explicitly
505
-
506
- Don't just state the rule - forbid specific workarounds:
507
-
508
- <Bad>
509
- ```markdown
510
- Write code before test? Delete it.
511
- ```
512
- </Bad>
513
-
514
- <Good>
515
- ```markdown
516
- Write code before test? Delete it. Start over.
517
-
518
- **No exceptions:**
519
-
520
- - Don't keep it as "reference"
521
- - Don't "adapt" it while writing tests
522
- - Don't look at it
523
- - Delete means delete
524
-
525
- ````
526
- </Good>
527
-
528
- ### Address "Spirit vs Letter" Arguments
529
-
530
- Add foundational principle early:
531
-
532
- ```markdown
533
- **Violating the letter of the rules is violating the spirit of the rules.**
534
- ````
535
-
536
- This cuts off entire class of "I'm following the spirit" rationalizations.
537
-
538
- ### Build Rationalization Table
539
-
540
- Capture rationalizations from baseline testing (see Testing section below). Every excuse agents make goes in the table:
541
-
542
- ```markdown
543
- | Excuse | Reality |
544
- | -------------------------------- | ----------------------------------------------------------------------- |
545
- | "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
546
- | "I'll test after" | Tests passing immediately prove nothing. |
547
- | "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
548
- ```
549
-
550
- ### Create Red Flags List
551
-
552
- Make it easy for agents to self-check when rationalizing:
553
-
554
- ```markdown
555
- ## Red Flags - STOP and Start Over
556
-
557
- - Code before test
558
- - "I already manually tested it"
559
- - "Tests after achieve the same purpose"
560
- - "It's about spirit not ritual"
561
- - "This is different because..."
562
-
563
- **All of these mean: Delete code. Start over with TDD.**
564
- ```
565
-
566
- ### Update CSO for Violation Symptoms
567
-
568
- Add to description: symptoms of when you're ABOUT to violate the rule:
569
-
570
- ```yaml
571
- description: use when implementing any feature or bugfix, before writing implementation code
572
- ```
261
+ Skills that enforce discipline need to resist rationalization. **See writing-guide.md** for detailed techniques on closing loopholes, spirit-vs-letter arguments, rationalization tables, and red flags lists.
573
262
 
574
263
  ## RED-GREEN-REFACTOR for Skills
575
264
 
@@ -0,0 +1,161 @@
1
+ # Claude Search Optimization (CSO) Guide
2
+
3
+ **Load this reference when:** writing or editing skill frontmatter, optimizing skill discoverability, or naming skills.
4
+
5
+ ## Overview
6
+
7
+ Future Claude needs to FIND your skill. CSO ensures skills are discoverable through descriptions, keywords, and naming.
8
+
9
+ ## 1. Rich Description Field
10
+
11
+ **Purpose:** Claude reads description to decide which skills to load for a given task. Make it answer: "Should I read this skill right now?"
12
+
13
+ **Format:** Start with "Use when..." to focus on triggering conditions
14
+
15
+ **CRITICAL: Description = When to Use, NOT What the Skill Does**
16
+
17
+ The description should ONLY describe triggering conditions. Do NOT summarize the skill's process or workflow in the description.
18
+
19
+ **Why this matters:** Testing revealed that when a description summarizes the skill's workflow, Claude may follow the description instead of reading the full skill content. A description saying "code review between tasks" caused Claude to do ONE review, even though the skill's flowchart clearly showed TWO reviews (spec compliance then code quality).
20
+
21
+ When the description was changed to just "Use when executing implementation plans with independent tasks" (no workflow summary), Claude correctly read the flowchart and followed the two-stage review process.
22
+
23
+ **The trap:** Descriptions that summarize workflow create a shortcut Claude will take. The skill body becomes documentation Claude skips.
24
+
25
+ ```yaml
26
+ # BAD: Summarizes workflow - Claude may follow this instead of reading skill
27
+ description: Use when executing plans - dispatches subagent per task with code review between tasks
28
+
29
+ # BAD: Too much process detail
30
+ description: Use for TDD - write test first, watch it fail, write minimal code, refactor
31
+
32
+ # GOOD: Just triggering conditions, no workflow summary
33
+ description: Use when executing implementation plans with independent tasks in the current session
34
+
35
+ # GOOD: Triggering conditions only
36
+ description: Use when implementing any feature or bugfix, before writing implementation code
37
+ ```
38
+
39
+ **Content:**
40
+
41
+ - Use concrete triggers, symptoms, and situations that signal this skill applies
42
+ - Describe the _problem_ (race conditions, inconsistent behavior) not _language-specific symptoms_ (setTimeout, sleep)
43
+ - Keep triggers technology-agnostic unless the skill itself is technology-specific
44
+ - If skill is technology-specific, make that explicit in the trigger
45
+ - Write in third person (injected into system prompt)
46
+ - **NEVER summarize the skill's process or workflow**
47
+
48
+ ```yaml
49
+ # BAD: Too abstract, vague, doesn't include when to use
50
+ description: For async testing
51
+
52
+ # BAD: First person
53
+ description: I can help you with async tests when they're flaky
54
+
55
+ # BAD: Mentions technology but skill isn't specific to it
56
+ description: Use when tests use setTimeout/sleep and are flaky
57
+
58
+ # GOOD: Starts with "Use when", describes problem, no workflow
59
+ description: Use when tests have race conditions, timing dependencies, or pass/fail inconsistently
60
+
61
+ # GOOD: Technology-specific skill with explicit trigger
62
+ description: Use when using React Router and handling authentication redirects
63
+ ```
64
+
65
+ ## 2. Keyword Coverage
66
+
67
+ Use words Claude would search for:
68
+
69
+ - Error messages: "Hook timed out", "ENOTEMPTY", "race condition"
70
+ - Symptoms: "flaky", "hanging", "zombie", "pollution"
71
+ - Synonyms: "timeout/hang/freeze", "cleanup/teardown/afterEach"
72
+ - Tools: Actual commands, library names, file types
73
+
74
+ ## 3. Descriptive Naming
75
+
76
+ **Use active voice, verb-first:**
77
+
78
+ - `creating-skills` not `skill-creation`
79
+ - `condition-based-waiting` not `async-test-helpers`
80
+
81
+ **Name by what you DO or core insight:**
82
+
83
+ - `condition-based-waiting` > `async-test-helpers`
84
+ - `using-skills` not `skill-usage`
85
+ - `flatten-with-flags` > `data-structure-refactoring`
86
+ - `root-cause-tracing` > `debugging-techniques`
87
+
88
+ **Gerunds (-ing) work well for processes:**
89
+
90
+ - `creating-skills`, `testing-skills`, `debugging-with-logs`
91
+ - Active, describes the action you're taking
92
+
93
+ ## 4. Token Efficiency (Critical)
94
+
95
+ **Problem:** getting-started and frequently-referenced skills load into EVERY conversation. Every token counts.
96
+
97
+ **Target word counts:**
98
+
99
+ - getting-started workflows: <150 words each
100
+ - Frequently-loaded skills: <200 words total
101
+ - Other skills: <500 words (still be concise)
102
+
103
+ **Techniques:**
104
+
105
+ **Move details to tool help:**
106
+
107
+ ```bash
108
+ # BAD: Document all flags in SKILL.md
109
+ search-conversations supports --text, --both, --after DATE, --before DATE, --limit N
110
+
111
+ # GOOD: Reference --help
112
+ search-conversations supports multiple modes and filters. Run --help for details.
113
+ ```
114
+
115
+ **Use cross-references:**
116
+
117
+ ```markdown
118
+ # BAD: Repeat workflow details
119
+
120
+ When searching, dispatch subagent with template...
121
+ [20 lines of repeated instructions]
122
+
123
+ # GOOD: Reference other skill
124
+
125
+ Always use subagents (50-100x context savings). REQUIRED: Use [other-skill-name] for workflow.
126
+ ```
127
+
128
+ **Compress examples:**
129
+
130
+ ```markdown
131
+ # BAD: Verbose example (42 words)
132
+
133
+ your human partner: "How did we handle authentication errors in React Router before?"
134
+ You: I'll search past conversations for React Router authentication patterns.
135
+ [Dispatch subagent with search query: "React Router authentication error handling 401"]
136
+
137
+ # GOOD: Minimal example (20 words)
138
+
139
+ Partner: "How did we handle auth errors in React Router?"
140
+ You: Searching...
141
+ [Dispatch subagent -> synthesis]
142
+ ```
143
+
144
+ **Eliminate redundancy:**
145
+
146
+ - Don't repeat what's in cross-referenced skills
147
+ - Don't explain what's obvious from command
148
+ - Don't include multiple examples of same pattern
149
+
150
+ ## 5. Cross-Referencing Other Skills
151
+
152
+ **When writing documentation that references other skills:**
153
+
154
+ Use skill name only, with explicit requirement markers:
155
+
156
+ - Good: `**REQUIRED SUB-SKILL:** Use sd-tdd`
157
+ - Good: `**REQUIRED BACKGROUND:** You MUST understand sd-tdd`
158
+ - Bad: `See skills/testing/test-driven-development` (unclear if required)
159
+ - Bad: `@skills/testing/test-driven-development/SKILL.md` (force-loads, burns context)
160
+
161
+ **Why no @ links:** `@` syntax force-loads files immediately, consuming 200k+ context before you need them.
@@ -0,0 +1,163 @@
1
+ # Skill Writing Guide
2
+
3
+ **Load this reference when:** writing or editing skill content, organizing skill files, or bulletproofing discipline-enforcing skills against rationalization.
4
+
5
+ ## Flowchart Usage
6
+
7
+ ```dot
8
+ digraph when_flowchart {
9
+ "Need to show information?" [shape=diamond];
10
+ "Decision where I might go wrong?" [shape=diamond];
11
+ "Use markdown" [shape=box];
12
+ "Small inline flowchart" [shape=box];
13
+
14
+ "Need to show information?" -> "Decision where I might go wrong?" [label="yes"];
15
+ "Decision where I might go wrong?" -> "Small inline flowchart" [label="yes"];
16
+ "Decision where I might go wrong?" -> "Use markdown" [label="no"];
17
+ }
18
+ ```
19
+
20
+ **Use flowcharts ONLY for:**
21
+
22
+ - Non-obvious decision points
23
+ - Process loops where you might stop too early
24
+ - "When to use A vs B" decisions
25
+
26
+ **Never use flowcharts for:**
27
+
28
+ - Reference material -> Tables, lists
29
+ - Code examples -> Markdown blocks
30
+ - Linear instructions -> Numbered lists
31
+ - Labels without semantic meaning (step1, helper2)
32
+
33
+ ## Code Examples
34
+
35
+ **One excellent example beats many mediocre ones**
36
+
37
+ Choose most relevant language:
38
+
39
+ - Testing techniques -> TypeScript/JavaScript
40
+ - System debugging -> Shell/Python
41
+ - Data processing -> Python
42
+
43
+ **Good example:**
44
+
45
+ - Complete and runnable
46
+ - Well-commented explaining WHY
47
+ - From real scenario
48
+ - Shows pattern clearly
49
+ - Ready to adapt (not generic template)
50
+
51
+ **Don't:**
52
+
53
+ - Implement in 5+ languages
54
+ - Create fill-in-the-blank templates
55
+ - Write contrived examples
56
+
57
+ You're good at porting - one great example is enough.
58
+
59
+ ## File Organization
60
+
61
+ ### Self-Contained Skill
62
+
63
+ ```
64
+ defense-in-depth/
65
+ SKILL.md # Everything inline
66
+ ```
67
+
68
+ When: All content fits, no heavy reference needed
69
+
70
+ ### Skill with Reusable Tool
71
+
72
+ ```
73
+ condition-based-waiting/
74
+ SKILL.md # Overview + patterns
75
+ example.ts # Working helpers to adapt
76
+ ```
77
+
78
+ When: Tool is reusable code, not just narrative
79
+
80
+ ### Skill with Heavy Reference
81
+
82
+ ```
83
+ pptx/
84
+ SKILL.md # Overview + workflows
85
+ pptxgenjs.md # 600 lines API reference
86
+ ooxml.md # 500 lines XML structure
87
+ scripts/ # Executable tools
88
+ ```
89
+
90
+ When: Reference material too large for inline
91
+
92
+ ## Bulletproofing Skills Against Rationalization
93
+
94
+ Skills that enforce discipline (like TDD) need to resist rationalization. Agents are smart and will find loopholes when under pressure.
95
+
96
+ **Psychology note:** Understanding WHY persuasion techniques work helps you apply them systematically. See persuasion-principles.md for research foundation (Cialdini, 2021; Meincke et al., 2025) on authority, commitment, scarcity, social proof, and unity principles.
97
+
98
+ ### Close Every Loophole Explicitly
99
+
100
+ Don't just state the rule - forbid specific workarounds:
101
+
102
+ Bad:
103
+ ```markdown
104
+ Write code before test? Delete it.
105
+ ```
106
+
107
+ Good:
108
+ ```markdown
109
+ Write code before test? Delete it. Start over.
110
+
111
+ **No exceptions:**
112
+
113
+ - Don't keep it as "reference"
114
+ - Don't "adapt" it while writing tests
115
+ - Don't look at it
116
+ - Delete means delete
117
+ ```
118
+
119
+ ### Address "Spirit vs Letter" Arguments
120
+
121
+ Add foundational principle early:
122
+
123
+ ```markdown
124
+ **Violating the letter of the rules is violating the spirit of the rules.**
125
+ ```
126
+
127
+ This cuts off entire class of "I'm following the spirit" rationalizations.
128
+
129
+ ### Build Rationalization Table
130
+
131
+ Capture rationalizations from baseline testing. Every excuse agents make goes in the table:
132
+
133
+ ```markdown
134
+ | Excuse | Reality |
135
+ | -------------------------------- | ----------------------------------------------------------------------- |
136
+ | "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
137
+ | "I'll test after" | Tests passing immediately prove nothing. |
138
+ | "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
139
+ ```
140
+
141
+ ### Create Red Flags List
142
+
143
+ Make it easy for agents to self-check when rationalizing:
144
+
145
+ ```markdown
146
+ ## Red Flags - STOP and Start Over
147
+
148
+ - Code before test
149
+ - "I already manually tested it"
150
+ - "Tests after achieve the same purpose"
151
+ - "It's about spirit not ritual"
152
+ - "This is different because..."
153
+
154
+ **All of these mean: Delete code. Start over with TDD.**
155
+ ```
156
+
157
+ ### Update CSO for Violation Symptoms
158
+
159
+ Add to description: symptoms of when you're ABOUT to violate the rule:
160
+
161
+ ```yaml
162
+ description: use when implementing any feature or bugfix, before writing implementation code
163
+ ```
@@ -1,9 +1,7 @@
1
1
  ---
2
2
  name: sd-tdd
3
- description: Test-Driven Development - write failing test first, then implement
4
- disable-model-invocation: true
3
+ description: "TDD - failing test first, then implement (explicit invocation only)"
5
4
  user-invocable: false
6
- model: opus
7
5
  ---
8
6
 
9
7
  # Test-Driven Development (TDD)
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: sd-use
3
- description: Auto router that matches user requests to the appropriate sd-* skill or agent
4
- disable-model-invocation: true
3
+ description: "Route requests to sd-* skills/agents (explicit invocation only)"
5
4
  model: haiku
6
5
  ---
7
6
 
@@ -28,7 +27,6 @@ then execute it.
28
27
  | `sd-tdd` | Implementing a feature or fixing a bug — **before writing code** |
29
28
  | `sd-plan` | Multi-step task with spec/requirements — **planning before code** |
30
29
  | `sd-plan-dev` | Already have a plan — **executing implementation plan** |
31
- | `sd-explore` | Deep codebase analysis — tracing execution paths, architecture, dependencies |
32
30
  | `sd-review` | **Large-scale** comprehensive review of an entire package or broad path — use only when user explicitly requests full/deep/comprehensive review |
33
31
  | `sd-check` | Verify code — typecheck, lint, tests |
34
32
  | `sd-commit` | Create a git commit |