antigravity-init 1.0.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 (123) hide show
  1. package/.agent/agents/architect.md +211 -0
  2. package/.agent/agents/build-error-resolver.md +532 -0
  3. package/.agent/agents/code-reviewer.md +104 -0
  4. package/.agent/agents/doc-updater.md +452 -0
  5. package/.agent/agents/e2e-runner.md +708 -0
  6. package/.agent/agents/planner.md +119 -0
  7. package/.agent/agents/refactor-cleaner.md +306 -0
  8. package/.agent/agents/security-reviewer.md +545 -0
  9. package/.agent/agents/tdd-guide.md +280 -0
  10. package/.agent/rules/agents.md +49 -0
  11. package/.agent/rules/coding-style.md +70 -0
  12. package/.agent/rules/git-workflow.md +45 -0
  13. package/.agent/rules/hooks.md +46 -0
  14. package/.agent/rules/patterns.md +55 -0
  15. package/.agent/rules/performance.md +47 -0
  16. package/.agent/rules/security.md +36 -0
  17. package/.agent/rules/testing.md +30 -0
  18. package/.agent/skills/backend-patterns/SKILL.md +582 -0
  19. package/.agent/skills/brainstorming/SKILL.md +54 -0
  20. package/.agent/skills/coding-standards/SKILL.md +520 -0
  21. package/.agent/skills/dispatching-parallel-agents/SKILL.md +180 -0
  22. package/.agent/skills/executing-plans/SKILL.md +76 -0
  23. package/.agent/skills/finishing-a-development-branch/SKILL.md +200 -0
  24. package/.agent/skills/frontend-patterns/SKILL.md +631 -0
  25. package/.agent/skills/receiving-code-review/SKILL.md +213 -0
  26. package/.agent/skills/requesting-code-review/SKILL.md +105 -0
  27. package/.agent/skills/requesting-code-review/code-reviewer.md +48 -0
  28. package/.agent/skills/security-review/SKILL.md +494 -0
  29. package/.agent/skills/subagent-driven-development/SKILL.md +240 -0
  30. package/.agent/skills/subagent-driven-development/code-quality-reviewer-prompt.md +20 -0
  31. package/.agent/skills/subagent-driven-development/implementer-prompt.md +78 -0
  32. package/.agent/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  33. package/.agent/skills/systematic-debugging/CREATION-LOG.md +119 -0
  34. package/.agent/skills/systematic-debugging/SKILL.md +296 -0
  35. package/.agent/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  36. package/.agent/skills/systematic-debugging/condition-based-waiting.md +115 -0
  37. package/.agent/skills/systematic-debugging/defense-in-depth.md +122 -0
  38. package/.agent/skills/systematic-debugging/find-polluter.sh +63 -0
  39. package/.agent/skills/systematic-debugging/root-cause-tracing.md +169 -0
  40. package/.agent/skills/systematic-debugging/test-academic.md +14 -0
  41. package/.agent/skills/systematic-debugging/test-pressure-1.md +58 -0
  42. package/.agent/skills/systematic-debugging/test-pressure-2.md +68 -0
  43. package/.agent/skills/systematic-debugging/test-pressure-3.md +69 -0
  44. package/.agent/skills/test-driven-development/SKILL.md +371 -0
  45. package/.agent/skills/test-driven-development/testing-anti-patterns.md +299 -0
  46. package/.agent/skills/ui-ux-pro-max/SKILL.md +292 -0
  47. package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
  48. package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
  49. package/.agent/skills/ui-ux-pro-max/data/icons.csv +101 -0
  50. package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
  51. package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
  52. package/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  53. package/.agent/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  54. package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  55. package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  56. package/.agent/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  57. package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  58. package/.agent/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  59. package/.agent/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  60. package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  61. package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  62. package/.agent/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  63. package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  64. package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  65. package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  66. package/.agent/skills/ui-ux-pro-max/data/styles.csv +68 -0
  67. package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
  68. package/.agent/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  69. package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  70. package/.agent/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  71. package/.agent/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-314.pyc +0 -0
  72. package/.agent/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-314.pyc +0 -0
  73. package/.agent/skills/ui-ux-pro-max/scripts/__pycache__/search.cpython-314.pyc +0 -0
  74. package/.agent/skills/ui-ux-pro-max/scripts/core.py +253 -0
  75. package/.agent/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  76. package/.agent/skills/ui-ux-pro-max/scripts/search.py +106 -0
  77. package/.agent/skills/using-git-worktrees/SKILL.md +217 -0
  78. package/.agent/skills/using-superpowers/SKILL.md +87 -0
  79. package/.agent/skills/verification-before-completion/SKILL.md +139 -0
  80. package/.agent/skills/writing-plans/SKILL.md +116 -0
  81. package/.agent/skills/writing-skills/SKILL.md +655 -0
  82. package/.agent/skills/writing-skills/anthropic-best-practices.md +1150 -0
  83. package/.agent/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  84. package/.agent/skills/writing-skills/graphviz-conventions.dot +172 -0
  85. package/.agent/skills/writing-skills/persuasion-principles.md +187 -0
  86. package/.agent/skills/writing-skills/render-graphs.js +168 -0
  87. package/.agent/skills/writing-skills/testing-skills-with-subagents.md +384 -0
  88. package/.agent/workflows/brainstorm.md +5 -0
  89. package/.agent/workflows/build-fix.md +212 -0
  90. package/.agent/workflows/code-review.md +169 -0
  91. package/.agent/workflows/execute-plan.md +5 -0
  92. package/.agent/workflows/tdd-workflow.md +166 -0
  93. package/.agent/workflows/ui-ux-pro-max.md +292 -0
  94. package/.agent/workflows/write-plan.md +5 -0
  95. package/.shared/ui-ux-pro-max/data/charts.csv +26 -0
  96. package/.shared/ui-ux-pro-max/data/colors.csv +97 -0
  97. package/.shared/ui-ux-pro-max/data/icons.csv +101 -0
  98. package/.shared/ui-ux-pro-max/data/landing.csv +31 -0
  99. package/.shared/ui-ux-pro-max/data/products.csv +97 -0
  100. package/.shared/ui-ux-pro-max/data/prompts.csv +24 -0
  101. package/.shared/ui-ux-pro-max/data/react-performance.csv +45 -0
  102. package/.shared/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  103. package/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  104. package/.shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  105. package/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  106. package/.shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  107. package/.shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  108. package/.shared/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  109. package/.shared/ui-ux-pro-max/data/stacks/react.csv +54 -0
  110. package/.shared/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  111. package/.shared/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  112. package/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  113. package/.shared/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  114. package/.shared/ui-ux-pro-max/data/styles.csv +59 -0
  115. package/.shared/ui-ux-pro-max/data/typography.csv +58 -0
  116. package/.shared/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  117. package/.shared/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  118. package/.shared/ui-ux-pro-max/data/web-interface.csv +31 -0
  119. package/.shared/ui-ux-pro-max/scripts/core.py +258 -0
  120. package/.shared/ui-ux-pro-max/scripts/design_system.py +1067 -0
  121. package/.shared/ui-ux-pro-max/scripts/search.py +106 -0
  122. package/bin/cli.js +53 -0
  123. package/package.json +30 -0
@@ -0,0 +1,655 @@
1
+ ---
2
+ name: writing-skills
3
+ description: Use when creating new skills, editing existing skills, or verifying skills work before deployment
4
+ ---
5
+
6
+ # Writing Skills
7
+
8
+ ## Overview
9
+
10
+ **Writing skills IS Test-Driven Development applied to process documentation.**
11
+
12
+ **Personal skills live in agent-specific directories (`~/.claude/skills` for Claude Code, `~/.codex/skills` for Codex)**
13
+
14
+ You write test cases (pressure scenarios with subagents), watch them fail (baseline behavior), write the skill (documentation), watch tests pass (agents comply), and refactor (close loopholes).
15
+
16
+ **Core principle:** If you didn't watch an agent fail without the skill, you don't know if the skill teaches the right thing.
17
+
18
+ **REQUIRED BACKGROUND:** You MUST understand test-driven-development before using this skill. That skill defines the fundamental RED-GREEN-REFACTOR cycle. This skill adapts TDD to documentation.
19
+
20
+ **Official guidance:** For Anthropic's official skill authoring best practices, see anthropic-best-practices.md. This document provides additional patterns and guidelines that complement the TDD-focused approach in this skill.
21
+
22
+ ## What is a Skill?
23
+
24
+ A **skill** is a reference guide for proven techniques, patterns, or tools. Skills help future Claude instances find and apply effective approaches.
25
+
26
+ **Skills are:** Reusable techniques, patterns, tools, reference guides
27
+
28
+ **Skills are NOT:** Narratives about how you solved a problem once
29
+
30
+ ## TDD Mapping for Skills
31
+
32
+ | TDD Concept | Skill Creation |
33
+ |-------------|----------------|
34
+ | **Test case** | Pressure scenario with subagent |
35
+ | **Production code** | Skill document (SKILL.md) |
36
+ | **Test fails (RED)** | Agent violates rule without skill (baseline) |
37
+ | **Test passes (GREEN)** | Agent complies with skill present |
38
+ | **Refactor** | Close loopholes while maintaining compliance |
39
+ | **Write test first** | Run baseline scenario BEFORE writing skill |
40
+ | **Watch it fail** | Document exact rationalizations agent uses |
41
+ | **Minimal code** | Write skill addressing those specific violations |
42
+ | **Watch it pass** | Verify agent now complies |
43
+ | **Refactor cycle** | Find new rationalizations → plug → re-verify |
44
+
45
+ The entire skill creation process follows RED-GREEN-REFACTOR.
46
+
47
+ ## When to Create a Skill
48
+
49
+ **Create when:**
50
+ - Technique wasn't intuitively obvious to you
51
+ - You'd reference this again across projects
52
+ - Pattern applies broadly (not project-specific)
53
+ - Others would benefit
54
+
55
+ **Don't create for:**
56
+ - One-off solutions
57
+ - Standard practices well-documented elsewhere
58
+ - Project-specific conventions (put in CLAUDE.md)
59
+ - Mechanical constraints (if it's enforceable with regex/validation, automate it—save documentation for judgment calls)
60
+
61
+ ## Skill Types
62
+
63
+ ### Technique
64
+ Concrete method with steps to follow (condition-based-waiting, root-cause-tracing)
65
+
66
+ ### Pattern
67
+ Way of thinking about problems (flatten-with-flags, test-invariants)
68
+
69
+ ### Reference
70
+ API docs, syntax guides, tool documentation (office docs)
71
+
72
+ ## Directory Structure
73
+
74
+
75
+ ```
76
+ skills/
77
+ skill-name/
78
+ SKILL.md # Main reference (required)
79
+ supporting-file.* # Only if needed
80
+ ```
81
+
82
+ **Flat namespace** - all skills in one searchable namespace
83
+
84
+ **Separate files for:**
85
+ 1. **Heavy reference** (100+ lines) - API docs, comprehensive syntax
86
+ 2. **Reusable tools** - Scripts, utilities, templates
87
+
88
+ **Keep inline:**
89
+ - Principles and concepts
90
+ - Code patterns (< 50 lines)
91
+ - Everything else
92
+
93
+ ## SKILL.md Structure
94
+
95
+ **Frontmatter (YAML):**
96
+ - Only two fields supported: `name` and `description`
97
+ - Max 1024 characters total
98
+ - `name`: Use letters, numbers, and hyphens only (no parentheses, special chars)
99
+ - `description`: Third-person, describes ONLY when to use (NOT what it does)
100
+ - Start with "Use when..." to focus on triggering conditions
101
+ - Include specific symptoms, situations, and contexts
102
+ - **NEVER summarize the skill's process or workflow** (see CSO section for why)
103
+ - Keep under 500 characters if possible
104
+
105
+ ```markdown
106
+ ---
107
+ name: Skill-Name-With-Hyphens
108
+ description: Use when [specific triggering conditions and symptoms]
109
+ ---
110
+
111
+ # Skill Name
112
+
113
+ ## Overview
114
+ What is this? Core principle in 1-2 sentences.
115
+
116
+ ## When to Use
117
+ [Small inline flowchart IF decision non-obvious]
118
+
119
+ Bullet list with SYMPTOMS and use cases
120
+ When NOT to use
121
+
122
+ ## Core Pattern (for techniques/patterns)
123
+ Before/after code comparison
124
+
125
+ ## Quick Reference
126
+ Table or bullets for scanning common operations
127
+
128
+ ## Implementation
129
+ Inline code for simple patterns
130
+ Link to file for heavy reference or reusable tools
131
+
132
+ ## Common Mistakes
133
+ What goes wrong + fixes
134
+
135
+ ## Real-World Impact (optional)
136
+ Concrete results
137
+ ```
138
+
139
+
140
+ ## Claude Search Optimization (CSO)
141
+
142
+ **Critical for discovery:** Future Claude needs to FIND your skill
143
+
144
+ ### 1. Rich Description Field
145
+
146
+ **Purpose:** Claude reads description to decide which skills to load for a given task. Make it answer: "Should I read this skill right now?"
147
+
148
+ **Format:** Start with "Use when..." to focus on triggering conditions
149
+
150
+ **CRITICAL: Description = When to Use, NOT What the Skill Does**
151
+
152
+ The description should ONLY describe triggering conditions. Do NOT summarize the skill's process or workflow in the description.
153
+
154
+ **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).
155
+
156
+ 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.
157
+
158
+ **The trap:** Descriptions that summarize workflow create a shortcut Claude will take. The skill body becomes documentation Claude skips.
159
+
160
+ ```yaml
161
+ # ❌ BAD: Summarizes workflow - Claude may follow this instead of reading skill
162
+ description: Use when executing plans - dispatches subagent per task with code review between tasks
163
+
164
+ # ❌ BAD: Too much process detail
165
+ description: Use for TDD - write test first, watch it fail, write minimal code, refactor
166
+
167
+ # ✅ GOOD: Just triggering conditions, no workflow summary
168
+ description: Use when executing implementation plans with independent tasks in the current session
169
+
170
+ # ✅ GOOD: Triggering conditions only
171
+ description: Use when implementing any feature or bugfix, before writing implementation code
172
+ ```
173
+
174
+ **Content:**
175
+ - Use concrete triggers, symptoms, and situations that signal this skill applies
176
+ - Describe the *problem* (race conditions, inconsistent behavior) not *language-specific symptoms* (setTimeout, sleep)
177
+ - Keep triggers technology-agnostic unless the skill itself is technology-specific
178
+ - If skill is technology-specific, make that explicit in the trigger
179
+ - Write in third person (injected into system prompt)
180
+ - **NEVER summarize the skill's process or workflow**
181
+
182
+ ```yaml
183
+ # ❌ BAD: Too abstract, vague, doesn't include when to use
184
+ description: For async testing
185
+
186
+ # ❌ BAD: First person
187
+ description: I can help you with async tests when they're flaky
188
+
189
+ # ❌ BAD: Mentions technology but skill isn't specific to it
190
+ description: Use when tests use setTimeout/sleep and are flaky
191
+
192
+ # ✅ GOOD: Starts with "Use when", describes problem, no workflow
193
+ description: Use when tests have race conditions, timing dependencies, or pass/fail inconsistently
194
+
195
+ # ✅ GOOD: Technology-specific skill with explicit trigger
196
+ description: Use when using React Router and handling authentication redirects
197
+ ```
198
+
199
+ ### 2. Keyword Coverage
200
+
201
+ Use words Claude would search for:
202
+ - Error messages: "Hook timed out", "ENOTEMPTY", "race condition"
203
+ - Symptoms: "flaky", "hanging", "zombie", "pollution"
204
+ - Synonyms: "timeout/hang/freeze", "cleanup/teardown/afterEach"
205
+ - Tools: Actual commands, library names, file types
206
+
207
+ ### 3. Descriptive Naming
208
+
209
+ **Use active voice, verb-first:**
210
+ - ✅ `creating-skills` not `skill-creation`
211
+ - ✅ `condition-based-waiting` not `async-test-helpers`
212
+
213
+ ### 4. Token Efficiency (Critical)
214
+
215
+ **Problem:** getting-started and frequently-referenced skills load into EVERY conversation. Every token counts.
216
+
217
+ **Target word counts:**
218
+ - getting-started workflows: <150 words each
219
+ - Frequently-loaded skills: <200 words total
220
+ - Other skills: <500 words (still be concise)
221
+
222
+ **Techniques:**
223
+
224
+ **Move details to tool help:**
225
+ ```bash
226
+ # ❌ BAD: Document all flags in SKILL.md
227
+ search-conversations supports --text, --both, --after DATE, --before DATE, --limit N
228
+
229
+ # ✅ GOOD: Reference --help
230
+ search-conversations supports multiple modes and filters. Run --help for details.
231
+ ```
232
+
233
+ **Use cross-references:**
234
+ ```markdown
235
+ # ❌ BAD: Repeat workflow details
236
+ When searching, dispatch subagent with template...
237
+ [20 lines of repeated instructions]
238
+
239
+ # ✅ GOOD: Reference other skill
240
+ Always use subagents (50-100x context savings). REQUIRED: Use [other-skill-name] for workflow.
241
+ ```
242
+
243
+ **Compress examples:**
244
+ ```markdown
245
+ # ❌ BAD: Verbose example (42 words)
246
+ your human partner: "How did we handle authentication errors in React Router before?"
247
+ You: I'll search past conversations for React Router authentication patterns.
248
+ [Dispatch subagent with search query: "React Router authentication error handling 401"]
249
+
250
+ # ✅ GOOD: Minimal example (20 words)
251
+ Partner: "How did we handle auth errors in React Router?"
252
+ You: Searching...
253
+ [Dispatch subagent → synthesis]
254
+ ```
255
+
256
+ **Eliminate redundancy:**
257
+ - Don't repeat what's in cross-referenced skills
258
+ - Don't explain what's obvious from command
259
+ - Don't include multiple examples of same pattern
260
+
261
+ **Verification:**
262
+ ```bash
263
+ wc -w skills/path/SKILL.md
264
+ # getting-started workflows: aim for <150 each
265
+ # Other frequently-loaded: aim for <200 total
266
+ ```
267
+
268
+ **Name by what you DO or core insight:**
269
+ - ✅ `condition-based-waiting` > `async-test-helpers`
270
+ - ✅ `using-skills` not `skill-usage`
271
+ - ✅ `flatten-with-flags` > `data-structure-refactoring`
272
+ - ✅ `root-cause-tracing` > `debugging-techniques`
273
+
274
+ **Gerunds (-ing) work well for processes:**
275
+ - `creating-skills`, `testing-skills`, `debugging-with-logs`
276
+ - Active, describes the action you're taking
277
+
278
+ ### 4. Cross-Referencing Other Skills
279
+
280
+ **When writing documentation that references other skills:**
281
+
282
+ Use skill name only, with explicit requirement markers:
283
+ - ✅ Good: `**REQUIRED SUB-SKILL:** Use test-driven-development`
284
+ - ✅ Good: `**REQUIRED BACKGROUND:** You MUST understand systematic-debugging`
285
+ - ❌ Bad: `See skills/testing/test-driven-development` (unclear if required)
286
+ - ❌ Bad: `@skills/testing/test-driven-development/SKILL.md` (force-loads, burns context)
287
+
288
+ **Why no @ links:** `@` syntax force-loads files immediately, consuming 200k+ context before you need them.
289
+
290
+ ## Flowchart Usage
291
+
292
+ ```dot
293
+ digraph when_flowchart {
294
+ "Need to show information?" [shape=diamond];
295
+ "Decision where I might go wrong?" [shape=diamond];
296
+ "Use markdown" [shape=box];
297
+ "Small inline flowchart" [shape=box];
298
+
299
+ "Need to show information?" -> "Decision where I might go wrong?" [label="yes"];
300
+ "Decision where I might go wrong?" -> "Small inline flowchart" [label="yes"];
301
+ "Decision where I might go wrong?" -> "Use markdown" [label="no"];
302
+ }
303
+ ```
304
+
305
+ **Use flowcharts ONLY for:**
306
+ - Non-obvious decision points
307
+ - Process loops where you might stop too early
308
+ - "When to use A vs B" decisions
309
+
310
+ **Never use flowcharts for:**
311
+ - Reference material → Tables, lists
312
+ - Code examples → Markdown blocks
313
+ - Linear instructions → Numbered lists
314
+ - Labels without semantic meaning (step1, helper2)
315
+
316
+ See @graphviz-conventions.dot for graphviz style rules.
317
+
318
+ **Visualizing for your human partner:** Use `render-graphs.js` in this directory to render a skill's flowcharts to SVG:
319
+ ```bash
320
+ ./render-graphs.js ../some-skill # Each diagram separately
321
+ ./render-graphs.js ../some-skill --combine # All diagrams in one SVG
322
+ ```
323
+
324
+ ## Code Examples
325
+
326
+ **One excellent example beats many mediocre ones**
327
+
328
+ Choose most relevant language:
329
+ - Testing techniques → TypeScript/JavaScript
330
+ - System debugging → Shell/Python
331
+ - Data processing → Python
332
+
333
+ **Good example:**
334
+ - Complete and runnable
335
+ - Well-commented explaining WHY
336
+ - From real scenario
337
+ - Shows pattern clearly
338
+ - Ready to adapt (not generic template)
339
+
340
+ **Don't:**
341
+ - Implement in 5+ languages
342
+ - Create fill-in-the-blank templates
343
+ - Write contrived examples
344
+
345
+ You're good at porting - one great example is enough.
346
+
347
+ ## File Organization
348
+
349
+ ### Self-Contained Skill
350
+ ```
351
+ defense-in-depth/
352
+ SKILL.md # Everything inline
353
+ ```
354
+ When: All content fits, no heavy reference needed
355
+
356
+ ### Skill with Reusable Tool
357
+ ```
358
+ condition-based-waiting/
359
+ SKILL.md # Overview + patterns
360
+ example.ts # Working helpers to adapt
361
+ ```
362
+ When: Tool is reusable code, not just narrative
363
+
364
+ ### Skill with Heavy Reference
365
+ ```
366
+ pptx/
367
+ SKILL.md # Overview + workflows
368
+ pptxgenjs.md # 600 lines API reference
369
+ ooxml.md # 500 lines XML structure
370
+ scripts/ # Executable tools
371
+ ```
372
+ When: Reference material too large for inline
373
+
374
+ ## The Iron Law (Same as TDD)
375
+
376
+ ```
377
+ NO SKILL WITHOUT A FAILING TEST FIRST
378
+ ```
379
+
380
+ This applies to NEW skills AND EDITS to existing skills.
381
+
382
+ Write skill before testing? Delete it. Start over.
383
+ Edit skill without testing? Same violation.
384
+
385
+ **No exceptions:**
386
+ - Not for "simple additions"
387
+ - Not for "just adding a section"
388
+ - Not for "documentation updates"
389
+ - Don't keep untested changes as "reference"
390
+ - Don't "adapt" while running tests
391
+ - Delete means delete
392
+
393
+ **REQUIRED BACKGROUND:** The test-driven-development skill explains why this matters. Same principles apply to documentation.
394
+
395
+ ## Testing All Skill Types
396
+
397
+ Different skill types need different test approaches:
398
+
399
+ ### Discipline-Enforcing Skills (rules/requirements)
400
+
401
+ **Examples:** TDD, verification-before-completion, designing-before-coding
402
+
403
+ **Test with:**
404
+ - Academic questions: Do they understand the rules?
405
+ - Pressure scenarios: Do they comply under stress?
406
+ - Multiple pressures combined: time + sunk cost + exhaustion
407
+ - Identify rationalizations and add explicit counters
408
+
409
+ **Success criteria:** Agent follows rule under maximum pressure
410
+
411
+ ### Technique Skills (how-to guides)
412
+
413
+ **Examples:** condition-based-waiting, root-cause-tracing, defensive-programming
414
+
415
+ **Test with:**
416
+ - Application scenarios: Can they apply the technique correctly?
417
+ - Variation scenarios: Do they handle edge cases?
418
+ - Missing information tests: Do instructions have gaps?
419
+
420
+ **Success criteria:** Agent successfully applies technique to new scenario
421
+
422
+ ### Pattern Skills (mental models)
423
+
424
+ **Examples:** reducing-complexity, information-hiding concepts
425
+
426
+ **Test with:**
427
+ - Recognition scenarios: Do they recognize when pattern applies?
428
+ - Application scenarios: Can they use the mental model?
429
+ - Counter-examples: Do they know when NOT to apply?
430
+
431
+ **Success criteria:** Agent correctly identifies when/how to apply pattern
432
+
433
+ ### Reference Skills (documentation/APIs)
434
+
435
+ **Examples:** API documentation, command references, library guides
436
+
437
+ **Test with:**
438
+ - Retrieval scenarios: Can they find the right information?
439
+ - Application scenarios: Can they use what they found correctly?
440
+ - Gap testing: Are common use cases covered?
441
+
442
+ **Success criteria:** Agent finds and correctly applies reference information
443
+
444
+ ## Common Rationalizations for Skipping Testing
445
+
446
+ | Excuse | Reality |
447
+ |--------|---------|
448
+ | "Skill is obviously clear" | Clear to you ≠ clear to other agents. Test it. |
449
+ | "It's just a reference" | References can have gaps, unclear sections. Test retrieval. |
450
+ | "Testing is overkill" | Untested skills have issues. Always. 15 min testing saves hours. |
451
+ | "I'll test if problems emerge" | Problems = agents can't use skill. Test BEFORE deploying. |
452
+ | "Too tedious to test" | Testing is less tedious than debugging bad skill in production. |
453
+ | "I'm confident it's good" | Overconfidence guarantees issues. Test anyway. |
454
+ | "Academic review is enough" | Reading ≠ using. Test application scenarios. |
455
+ | "No time to test" | Deploying untested skill wastes more time fixing it later. |
456
+
457
+ **All of these mean: Test before deploying. No exceptions.**
458
+
459
+ ## Bulletproofing Skills Against Rationalization
460
+
461
+ Skills that enforce discipline (like TDD) need to resist rationalization. Agents are smart and will find loopholes when under pressure.
462
+
463
+ **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.
464
+
465
+ ### Close Every Loophole Explicitly
466
+
467
+ Don't just state the rule - forbid specific workarounds:
468
+
469
+ <Bad>
470
+ ```markdown
471
+ Write code before test? Delete it.
472
+ ```
473
+ </Bad>
474
+
475
+ <Good>
476
+ ```markdown
477
+ Write code before test? Delete it. Start over.
478
+
479
+ **No exceptions:**
480
+ - Don't keep it as "reference"
481
+ - Don't "adapt" it while writing tests
482
+ - Don't look at it
483
+ - Delete means delete
484
+ ```
485
+ </Good>
486
+
487
+ ### Address "Spirit vs Letter" Arguments
488
+
489
+ Add foundational principle early:
490
+
491
+ ```markdown
492
+ **Violating the letter of the rules is violating the spirit of the rules.**
493
+ ```
494
+
495
+ This cuts off entire class of "I'm following the spirit" rationalizations.
496
+
497
+ ### Build Rationalization Table
498
+
499
+ Capture rationalizations from baseline testing (see Testing section below). Every excuse agents make goes in the table:
500
+
501
+ ```markdown
502
+ | Excuse | Reality |
503
+ |--------|---------|
504
+ | "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
505
+ | "I'll test after" | Tests passing immediately prove nothing. |
506
+ | "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
507
+ ```
508
+
509
+ ### Create Red Flags List
510
+
511
+ Make it easy for agents to self-check when rationalizing:
512
+
513
+ ```markdown
514
+ ## Red Flags - STOP and Start Over
515
+
516
+ - Code before test
517
+ - "I already manually tested it"
518
+ - "Tests after achieve the same purpose"
519
+ - "It's about spirit not ritual"
520
+ - "This is different because..."
521
+
522
+ **All of these mean: Delete code. Start over with TDD.**
523
+ ```
524
+
525
+ ### Update CSO for Violation Symptoms
526
+
527
+ Add to description: symptoms of when you're ABOUT to violate the rule:
528
+
529
+ ```yaml
530
+ description: use when implementing any feature or bugfix, before writing implementation code
531
+ ```
532
+
533
+ ## RED-GREEN-REFACTOR for Skills
534
+
535
+ Follow the TDD cycle:
536
+
537
+ ### RED: Write Failing Test (Baseline)
538
+
539
+ Run pressure scenario with subagent WITHOUT the skill. Document exact behavior:
540
+ - What choices did they make?
541
+ - What rationalizations did they use (verbatim)?
542
+ - Which pressures triggered violations?
543
+
544
+ This is "watch the test fail" - you must see what agents naturally do before writing the skill.
545
+
546
+ ### GREEN: Write Minimal Skill
547
+
548
+ Write skill that addresses those specific rationalizations. Don't add extra content for hypothetical cases.
549
+
550
+ Run same scenarios WITH skill. Agent should now comply.
551
+
552
+ ### REFACTOR: Close Loopholes
553
+
554
+ Agent found new rationalization? Add explicit counter. Re-test until bulletproof.
555
+
556
+ **Testing methodology:** See @testing-skills-with-subagents.md for the complete testing methodology:
557
+ - How to write pressure scenarios
558
+ - Pressure types (time, sunk cost, authority, exhaustion)
559
+ - Plugging holes systematically
560
+ - Meta-testing techniques
561
+
562
+ ## Anti-Patterns
563
+
564
+ ### ❌ Narrative Example
565
+ "In session 2025-10-03, we found empty projectDir caused..."
566
+ **Why bad:** Too specific, not reusable
567
+
568
+ ### ❌ Multi-Language Dilution
569
+ example-js.js, example-py.py, example-go.go
570
+ **Why bad:** Mediocre quality, maintenance burden
571
+
572
+ ### ❌ Code in Flowcharts
573
+ ```dot
574
+ step1 [label="import fs"];
575
+ step2 [label="read file"];
576
+ ```
577
+ **Why bad:** Can't copy-paste, hard to read
578
+
579
+ ### ❌ Generic Labels
580
+ helper1, helper2, step3, pattern4
581
+ **Why bad:** Labels should have semantic meaning
582
+
583
+ ## STOP: Before Moving to Next Skill
584
+
585
+ **After writing ANY skill, you MUST STOP and complete the deployment process.**
586
+
587
+ **Do NOT:**
588
+ - Create multiple skills in batch without testing each
589
+ - Move to next skill before current one is verified
590
+ - Skip testing because "batching is more efficient"
591
+
592
+ **The deployment checklist below is MANDATORY for EACH skill.**
593
+
594
+ Deploying untested skills = deploying untested code. It's a violation of quality standards.
595
+
596
+ ## Skill Creation Checklist (TDD Adapted)
597
+
598
+ **IMPORTANT: Use TodoWrite to create todos for EACH checklist item below.**
599
+
600
+ **RED Phase - Write Failing Test:**
601
+ - [ ] Create pressure scenarios (3+ combined pressures for discipline skills)
602
+ - [ ] Run scenarios WITHOUT skill - document baseline behavior verbatim
603
+ - [ ] Identify patterns in rationalizations/failures
604
+
605
+ **GREEN Phase - Write Minimal Skill:**
606
+ - [ ] Name uses only letters, numbers, hyphens (no parentheses/special chars)
607
+ - [ ] YAML frontmatter with only name and description (max 1024 chars)
608
+ - [ ] Description starts with "Use when..." and includes specific triggers/symptoms
609
+ - [ ] Description written in third person
610
+ - [ ] Keywords throughout for search (errors, symptoms, tools)
611
+ - [ ] Clear overview with core principle
612
+ - [ ] Address specific baseline failures identified in RED
613
+ - [ ] Code inline OR link to separate file
614
+ - [ ] One excellent example (not multi-language)
615
+ - [ ] Run scenarios WITH skill - verify agents now comply
616
+
617
+ **REFACTOR Phase - Close Loopholes:**
618
+ - [ ] Identify NEW rationalizations from testing
619
+ - [ ] Add explicit counters (if discipline skill)
620
+ - [ ] Build rationalization table from all test iterations
621
+ - [ ] Create red flags list
622
+ - [ ] Re-test until bulletproof
623
+
624
+ **Quality Checks:**
625
+ - [ ] Small flowchart only if decision non-obvious
626
+ - [ ] Quick reference table
627
+ - [ ] Common mistakes section
628
+ - [ ] No narrative storytelling
629
+ - [ ] Supporting files only for tools or heavy reference
630
+
631
+ **Deployment:**
632
+ - [ ] Commit skill to git and push to your fork (if configured)
633
+ - [ ] Consider contributing back via PR (if broadly useful)
634
+
635
+ ## Discovery Workflow
636
+
637
+ How future Claude finds your skill:
638
+
639
+ 1. **Encounters problem** ("tests are flaky")
640
+ 3. **Finds SKILL** (description matches)
641
+ 4. **Scans overview** (is this relevant?)
642
+ 5. **Reads patterns** (quick reference table)
643
+ 6. **Loads example** (only when implementing)
644
+
645
+ **Optimize for this flow** - put searchable terms early and often.
646
+
647
+ ## The Bottom Line
648
+
649
+ **Creating skills IS TDD for process documentation.**
650
+
651
+ Same Iron Law: No skill without failing test first.
652
+ Same cycle: RED (baseline) → GREEN (write skill) → REFACTOR (close loopholes).
653
+ Same benefits: Better quality, fewer surprises, bulletproof results.
654
+
655
+ If you follow TDD for code, follow it for skills. It's the same discipline applied to documentation.