cfsa-antigravity 2.19.0 → 2.19.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.
Files changed (200) hide show
  1. package/package.json +1 -1
  2. package/template/.agent/kit-sync.md +3 -3
  3. package/template/.claude/commands/audit-ambiguity-execute.md +6 -0
  4. package/template/.claude/commands/audit-ambiguity-rubrics.md +6 -0
  5. package/template/.claude/commands/audit-ambiguity.md +6 -0
  6. package/template/.claude/commands/bootstrap-agents-fill.md +6 -0
  7. package/template/.claude/commands/bootstrap-agents-provision.md +6 -0
  8. package/template/.claude/commands/bootstrap-agents.md +6 -0
  9. package/template/.claude/commands/create-prd-architecture.md +6 -0
  10. package/template/.claude/commands/create-prd-compile.md +6 -0
  11. package/template/.claude/commands/create-prd-design-system.md +6 -0
  12. package/template/.claude/commands/create-prd-security.md +6 -0
  13. package/template/.claude/commands/create-prd-stack.md +6 -0
  14. package/template/.claude/commands/decompose-architecture-structure.md +6 -0
  15. package/template/.claude/commands/decompose-architecture-validate.md +6 -0
  16. package/template/.claude/commands/evolve-contract.md +6 -0
  17. package/template/.claude/commands/evolve-feature-cascade.md +6 -0
  18. package/template/.claude/commands/evolve-feature-classify.md +6 -0
  19. package/template/.claude/commands/evolve-feature.md +6 -0
  20. package/template/.claude/commands/ideate-discover.md +6 -0
  21. package/template/.claude/commands/ideate-extract.md +6 -0
  22. package/template/.claude/commands/ideate-validate.md +6 -0
  23. package/template/.claude/commands/implement-slice-setup.md +6 -0
  24. package/template/.claude/commands/implement-slice-tdd.md +6 -0
  25. package/template/.claude/commands/plan-phase-preflight.md +6 -0
  26. package/template/.claude/commands/plan-phase-write.md +6 -0
  27. package/template/.claude/commands/propagate-decision-apply.md +6 -0
  28. package/template/.claude/commands/propagate-decision-scan.md +6 -0
  29. package/template/.claude/commands/propagate-decision.md +6 -0
  30. package/template/.claude/commands/remediate-pipeline-assess.md +6 -0
  31. package/template/.claude/commands/remediate-pipeline-execute.md +6 -0
  32. package/template/.claude/commands/remediate-pipeline.md +6 -0
  33. package/template/.claude/commands/remediate-shard-split.md +6 -0
  34. package/template/.claude/commands/resolve-ambiguity.md +6 -0
  35. package/template/.claude/commands/setup-workspace-cicd.md +6 -0
  36. package/template/.claude/commands/setup-workspace-data.md +6 -0
  37. package/template/.claude/commands/setup-workspace-hosting.md +6 -0
  38. package/template/.claude/commands/setup-workspace-scaffold.md +6 -0
  39. package/template/.claude/commands/sync-kit.md +6 -0
  40. package/template/.claude/commands/update-architecture-map.md +6 -0
  41. package/template/.claude/commands/validate-phase-quality.md +6 -0
  42. package/template/.claude/commands/validate-phase-readiness.md +6 -0
  43. package/template/.claude/commands/verify-infrastructure.md +6 -0
  44. package/template/.claude/commands/write-architecture-spec-deepen.md +6 -0
  45. package/template/.claude/commands/write-architecture-spec-design.md +6 -0
  46. package/template/.claude/commands/write-be-spec-classify.md +6 -0
  47. package/template/.claude/commands/write-be-spec-write.md +6 -0
  48. package/template/.claude/commands/write-fe-spec-classify.md +6 -0
  49. package/template/.claude/commands/write-fe-spec-write.md +6 -0
  50. package/template/.claude/skills/accessibility/SKILL.md +522 -0
  51. package/template/.claude/skills/accessibility/references/WCAG.md +162 -0
  52. package/template/.claude/skills/accessibility/references/ia-spec-checklist.md +35 -0
  53. package/template/.claude/skills/adversarial-review/SKILL.md +90 -0
  54. package/template/.claude/skills/antigravity-workflows/SKILL.md +81 -0
  55. package/template/.claude/skills/antigravity-workflows/resources/implementation-playbook.md +36 -0
  56. package/template/.claude/skills/api-design-principles/SKILL.md +169 -0
  57. package/template/.claude/skills/api-design-principles/assets/api-design-checklist.md +155 -0
  58. package/template/.claude/skills/api-design-principles/assets/rest-api-template.py +182 -0
  59. package/template/.claude/skills/api-design-principles/references/graphql-schema-design.md +583 -0
  60. package/template/.claude/skills/api-design-principles/references/rest-best-practices.md +408 -0
  61. package/template/.claude/skills/api-design-principles/resources/implementation-playbook.md +513 -0
  62. package/template/.claude/skills/api-versioning/SKILL.md +166 -0
  63. package/template/.claude/skills/api-versioning/references/typescript.md +157 -0
  64. package/template/.claude/skills/architecture-mapping/SKILL.md +219 -0
  65. package/template/.claude/skills/bootstrap-agents/SKILL.md +258 -0
  66. package/template/.claude/skills/brainstorming/SKILL.md +177 -0
  67. package/template/.claude/skills/brand-guidelines/SKILL.md +44 -0
  68. package/template/.claude/skills/clean-code/SKILL.md +196 -0
  69. package/template/.claude/skills/clean-code/references/typescript.md +126 -0
  70. package/template/.claude/skills/code-review-pro/SKILL.md +152 -0
  71. package/template/.claude/skills/concise-planning/SKILL.md +107 -0
  72. package/template/.claude/skills/cross-layer-consistency/SKILL.md +117 -0
  73. package/template/.claude/skills/database-schema-design/SKILL.md +205 -0
  74. package/template/.claude/skills/database-schema-design/references/relational.md +228 -0
  75. package/template/.claude/skills/deployment-procedures/SKILL.md +241 -0
  76. package/template/.claude/skills/design-anti-cliche/SKILL.md +159 -0
  77. package/template/.claude/skills/design-direction/SKILL.md +45 -0
  78. package/template/.claude/skills/error-handling-patterns/SKILL.md +226 -0
  79. package/template/.claude/skills/error-handling-patterns/references/go.md +162 -0
  80. package/template/.claude/skills/error-handling-patterns/references/python.md +262 -0
  81. package/template/.claude/skills/error-handling-patterns/references/rust.md +112 -0
  82. package/template/.claude/skills/error-handling-patterns/references/typescript.md +178 -0
  83. package/template/.claude/skills/find-skills/SKILL.md +145 -0
  84. package/template/.claude/skills/git-advanced/SKILL.md +972 -0
  85. package/template/.claude/skills/git-workflow/SKILL.md +420 -0
  86. package/template/.claude/skills/idea-extraction/SKILL.md +644 -0
  87. package/template/.claude/skills/logging-best-practices/SKILL.md +192 -0
  88. package/template/.claude/skills/logging-best-practices/references/go.md +49 -0
  89. package/template/.claude/skills/logging-best-practices/references/python.md +52 -0
  90. package/template/.claude/skills/logging-best-practices/references/typescript.md +215 -0
  91. package/template/.claude/skills/migration-management/SKILL.md +200 -0
  92. package/template/.claude/skills/migration-management/references/relational.md +214 -0
  93. package/template/.claude/skills/minimalist-surgical-development/SKILL.md +135 -0
  94. package/template/.claude/skills/parallel-agents/SKILL.md +165 -0
  95. package/template/.claude/skills/parallel-debugging/SKILL.md +135 -0
  96. package/template/.claude/skills/parallel-feature-development/SKILL.md +157 -0
  97. package/template/.claude/skills/performance-budgeting/SKILL.md +144 -0
  98. package/template/.claude/skills/pipeline-rubrics/SKILL.md +51 -0
  99. package/template/.claude/skills/pipeline-rubrics/references/architecture-rubric.md +19 -0
  100. package/template/.claude/skills/pipeline-rubrics/references/be-rubric.md +21 -0
  101. package/template/.claude/skills/pipeline-rubrics/references/fe-rubric.md +20 -0
  102. package/template/.claude/skills/pipeline-rubrics/references/ia-rubric.md +19 -0
  103. package/template/.claude/skills/pipeline-rubrics/references/scoring.md +32 -0
  104. package/template/.claude/skills/pipeline-rubrics/references/vision-rubric.md +12 -0
  105. package/template/.claude/skills/prd-templates/SKILL.md +107 -0
  106. package/template/.claude/skills/prd-templates/references/architecture-completeness-checklist.md +28 -0
  107. package/template/.claude/skills/prd-templates/references/architecture-design-template.md +88 -0
  108. package/template/.claude/skills/prd-templates/references/be-spec-classification.md +41 -0
  109. package/template/.claude/skills/prd-templates/references/be-spec-template.md +107 -0
  110. package/template/.claude/skills/prd-templates/references/bootstrap-verification-protocol.md +50 -0
  111. package/template/.claude/skills/prd-templates/references/constraint-exploration.md +41 -0
  112. package/template/.claude/skills/prd-templates/references/data-placement-template.md +74 -0
  113. package/template/.claude/skills/prd-templates/references/decision-confirmation-protocol.md +68 -0
  114. package/template/.claude/skills/prd-templates/references/decision-propagation.md +121 -0
  115. package/template/.claude/skills/prd-templates/references/decomposition-templates.md +226 -0
  116. package/template/.claude/skills/prd-templates/references/deep-ideation-loading-protocol.md +114 -0
  117. package/template/.claude/skills/prd-templates/references/design-system-decisions.md +198 -0
  118. package/template/.claude/skills/prd-templates/references/design-system-prerequisite-check.md +18 -0
  119. package/template/.claude/skills/prd-templates/references/domain-exhaustion-criteria.md +37 -0
  120. package/template/.claude/skills/prd-templates/references/engagement-tier-protocol.md +58 -0
  121. package/template/.claude/skills/prd-templates/references/engineering-standards-template.md +126 -0
  122. package/template/.claude/skills/prd-templates/references/evolution-layer-guidance.md +91 -0
  123. package/template/.claude/skills/prd-templates/references/expansion-modes.md +27 -0
  124. package/template/.claude/skills/prd-templates/references/fe-classification-procedures.md +47 -0
  125. package/template/.claude/skills/prd-templates/references/fe-spec-template.md +90 -0
  126. package/template/.claude/skills/prd-templates/references/feature-ledger-protocol.md +149 -0
  127. package/template/.claude/skills/prd-templates/references/folder-seeding-protocol.md +77 -0
  128. package/template/.claude/skills/prd-templates/references/fractal-cx-template.md +58 -0
  129. package/template/.claude/skills/prd-templates/references/fractal-feature-template.md +93 -0
  130. package/template/.claude/skills/prd-templates/references/fractal-node-index-template.md +55 -0
  131. package/template/.claude/skills/prd-templates/references/gate-applicability.md +92 -0
  132. package/template/.claude/skills/prd-templates/references/ideation-crosscut-template.md +36 -0
  133. package/template/.claude/skills/prd-templates/references/ideation-index-template.md +111 -0
  134. package/template/.claude/skills/prd-templates/references/ideation-meta-template.md +126 -0
  135. package/template/.claude/skills/prd-templates/references/infrastructure-report-template.md +71 -0
  136. package/template/.claude/skills/prd-templates/references/input-classification.md +23 -0
  137. package/template/.claude/skills/prd-templates/references/map-guard-protocol.md +65 -0
  138. package/template/.claude/skills/prd-templates/references/operational-templates.md +116 -0
  139. package/template/.claude/skills/prd-templates/references/persona-completeness-gate.md +20 -0
  140. package/template/.claude/skills/prd-templates/references/placeholder-guard-template.md +21 -0
  141. package/template/.claude/skills/prd-templates/references/placeholder-workflow-mapping.md +50 -0
  142. package/template/.claude/skills/prd-templates/references/shard-boundary-analysis.md +103 -0
  143. package/template/.claude/skills/prd-templates/references/shard-split-remediation.md +157 -0
  144. package/template/.claude/skills/prd-templates/references/skill-loading-protocol.md +36 -0
  145. package/template/.claude/skills/prd-templates/references/slice-completion-gates.md +29 -0
  146. package/template/.claude/skills/prd-templates/references/spec-coverage-sweep.md +44 -0
  147. package/template/.claude/skills/prd-templates/references/surface-model.md +61 -0
  148. package/template/.claude/skills/prd-templates/references/tdd-testing-policy.md +39 -0
  149. package/template/.claude/skills/prd-templates/references/vision-template.md +57 -0
  150. package/template/.claude/skills/prd-templates/references/workflow-checkpoint-protocol.md +112 -0
  151. package/template/.claude/skills/prd-templates/references/write-verification-protocol.md +57 -0
  152. package/template/.claude/skills/prompt-engineer/SKILL.md +203 -0
  153. package/template/.claude/skills/regex-patterns/SKILL.md +333 -0
  154. package/template/.claude/skills/regex-patterns/references/go.md +44 -0
  155. package/template/.claude/skills/regex-patterns/references/javascript.md +63 -0
  156. package/template/.claude/skills/regex-patterns/references/python.md +77 -0
  157. package/template/.claude/skills/regex-patterns/references/rust.md +43 -0
  158. package/template/.claude/skills/resolve-ambiguity/SKILL.md +278 -0
  159. package/template/.claude/skills/security-scanning-security-hardening/SKILL.md +231 -0
  160. package/template/.claude/skills/session-continuity/SKILL.md +732 -0
  161. package/template/.claude/skills/session-continuity/protocols/01-session-resumption.md +38 -0
  162. package/template/.claude/skills/session-continuity/protocols/02-progress-generation.md +85 -0
  163. package/template/.claude/skills/session-continuity/protocols/03-progress-update.md +70 -0
  164. package/template/.claude/skills/session-continuity/protocols/04-pattern-extraction.md +60 -0
  165. package/template/.claude/skills/session-continuity/protocols/05-session-close.md +37 -0
  166. package/template/.claude/skills/session-continuity/protocols/06-decision-analysis.md +84 -0
  167. package/template/.claude/skills/session-continuity/protocols/07-spec-pipeline-generation.md +48 -0
  168. package/template/.claude/skills/session-continuity/protocols/08-spec-pipeline-update.md +55 -0
  169. package/template/.claude/skills/session-continuity/protocols/09-parallel-claim.md +122 -0
  170. package/template/.claude/skills/session-continuity/protocols/10-placeholder-verification-gate.md +83 -0
  171. package/template/.claude/skills/session-continuity/protocols/11-parallel-synthesis.md +21 -0
  172. package/template/.claude/skills/session-continuity/protocols/ambiguity-gates.md +48 -0
  173. package/template/.claude/skills/skill-creator/SKILL.md +203 -0
  174. package/template/.claude/skills/skill-creator/references/.gitkeep +0 -0
  175. package/template/.claude/skills/skill-creator/scripts/.gitkeep +0 -0
  176. package/template/.claude/skills/spec-writing/SKILL.md +110 -0
  177. package/template/.claude/skills/systematic-debugging/CREATION-LOG.md +119 -0
  178. package/template/.claude/skills/systematic-debugging/SKILL.md +297 -0
  179. package/template/.claude/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  180. package/template/.claude/skills/systematic-debugging/condition-based-waiting.md +115 -0
  181. package/template/.claude/skills/systematic-debugging/defense-in-depth.md +122 -0
  182. package/template/.claude/skills/systematic-debugging/find-polluter.sh +63 -0
  183. package/template/.claude/skills/systematic-debugging/root-cause-tracing.md +169 -0
  184. package/template/.claude/skills/systematic-debugging/test-academic.md +14 -0
  185. package/template/.claude/skills/systematic-debugging/test-pressure-1.md +58 -0
  186. package/template/.claude/skills/systematic-debugging/test-pressure-2.md +68 -0
  187. package/template/.claude/skills/systematic-debugging/test-pressure-3.md +69 -0
  188. package/template/.claude/skills/tdd-workflow/SKILL.md +186 -0
  189. package/template/.claude/skills/tdd-workflow/references/typescript.md +231 -0
  190. package/template/.claude/skills/tech-stack-catalog/SKILL.md +49 -0
  191. package/template/.claude/skills/tech-stack-catalog/references/constraint-questions.md +237 -0
  192. package/template/.claude/skills/tech-stack-catalog/references/dev-tooling-decisions.md +37 -0
  193. package/template/.claude/skills/tech-stack-catalog/references/surface-decision-tables.md +69 -0
  194. package/template/.claude/skills/technical-writer/SKILL.md +242 -0
  195. package/template/.claude/skills/testing-strategist/SKILL.md +319 -0
  196. package/template/.claude/skills/testing-strategist/references/typescript.md +328 -0
  197. package/template/.claude/skills/verification-before-completion/SKILL.md +97 -0
  198. package/template/.claude/skills/workflow-automation/SKILL.md +166 -0
  199. package/template/.claude/skills/workflow-automation/references/inngest.md +88 -0
  200. package/template/.claude/skills/workflow-automation/references/temporal.md +64 -0
@@ -0,0 +1,242 @@
1
+ ---
2
+ name: Technical Writer
3
+ description: Create clear, comprehensive technical documentation for any audience
4
+ ---
5
+
6
+ # Technical Writer
7
+
8
+ Create clear, comprehensive technical documentation for any audience.
9
+
10
+ ## When to Use This Skill
11
+ - Write user documentation for a feature
12
+ - Create a tutorial for setting up a development environment
13
+ - Document system architecture
14
+ - Write a troubleshooting guide
15
+ - Create onboarding documentation for new developers
16
+ - Write a README for a project
17
+
18
+ ## Instructions
19
+
20
+ When a user needs technical documentation:
21
+
22
+ 1. **Identify Documentation Type**:
23
+ - User guide / end-user documentation
24
+ - Developer documentation / API docs
25
+ - System architecture documentation
26
+ - Tutorial / how-to guide
27
+ - Troubleshooting guide
28
+ - README file
29
+ - Release notes / changelog
30
+ - Onboarding documentation
31
+ - Knowledge base article
32
+ - Standard Operating Procedure (SOP)
33
+
34
+ 2. **Determine Audience**:
35
+ - Technical level (beginner, intermediate, expert)
36
+ - Role (end user, developer, admin, stakeholder)
37
+ - Prior knowledge assumptions
38
+ - Context (internal team, external customers, open source community)
39
+
40
+ 3. **Structure Documentation**:
41
+
42
+ **User Guide Format**:
43
+ ```markdown
44
+ # [Product/Feature Name]
45
+
46
+ ## Overview
47
+ [What it is, what it does, why use it - 2-3 sentences]
48
+
49
+ ## Prerequisites
50
+ - [Required knowledge]
51
+ - [Required tools/access]
52
+ - [System requirements]
53
+
54
+ ## Getting Started
55
+ [Quick start guide with minimal steps to first success]
56
+
57
+ ## Key Concepts
58
+ ### [Concept 1]
59
+ [Explanation with examples]
60
+
61
+ ## Common Tasks
62
+ ### How to [Task]
63
+ 1. [Step]
64
+ 2. [Step]
65
+ 3. [Expected result]
66
+
67
+ ## Advanced Features
68
+ [Optional advanced functionality]
69
+
70
+ ## Troubleshooting
71
+ ### Problem: [Common issue]
72
+ **Symptoms**: [What users see]
73
+ **Solution**: [How to fix]
74
+
75
+ ## FAQ
76
+ **Q: [Question]**
77
+ A: [Answer]
78
+
79
+ ## Additional Resources
80
+ - [Link to related docs]
81
+ - [Support channels]
82
+ ```
83
+
84
+ **Tutorial Format**:
85
+ ```markdown
86
+ # How to [Accomplish Goal]
87
+
88
+ **Time required**: [X minutes]
89
+ **Difficulty**: [Beginner/Intermediate/Advanced]
90
+
91
+ ## What You'll Learn
92
+ - [Learning objective 1]
93
+ - [Learning objective 2]
94
+
95
+ ## Prerequisites
96
+ - [Required knowledge]
97
+ - [Tools needed]
98
+
99
+ ## Step-by-Step Instructions
100
+
101
+ ### 1. [First Major Step]
102
+ [Explanation of why this step matters]
103
+
104
+ ### 2. [Next Major Step]
105
+ [Continue pattern]
106
+
107
+ ## Verification
108
+ [How to confirm it worked]
109
+
110
+ ## Next Steps
111
+ [What to learn next]
112
+
113
+ ## Troubleshooting
114
+ [Common issues]
115
+ ```
116
+
117
+ **Architecture Documentation Format**:
118
+ ```markdown
119
+ # [System Name] Architecture
120
+
121
+ ## Overview
122
+ [High-level description, purpose, key characteristics]
123
+
124
+ ## Architecture Diagram
125
+ [ASCII diagram or description for diagram]
126
+
127
+ ## Components
128
+ ### [Component 1]
129
+ **Purpose**: [What it does]
130
+ **Technology**: [Stack/framework]
131
+ **Responsibilities**:
132
+ - [Responsibility 1]
133
+ - [Responsibility 2]
134
+
135
+ **Interfaces**:
136
+ - Input: [Data/requests it receives]
137
+ - Output: [Data/responses it produces]
138
+
139
+ ## Data Flow
140
+ 1. [Step-by-step flow through system]
141
+
142
+ ## Technology Stack
143
+ - **Frontend**: [Technologies]
144
+ - **Backend**: [Technologies]
145
+ - **Database**: [Technologies]
146
+ - **Infrastructure**: [Technologies]
147
+
148
+ ## Design Decisions
149
+ ### Why [Technology/Pattern]?
150
+ [Rationale, alternatives considered, trade-offs]
151
+
152
+ ## Scalability Considerations
153
+ [How system scales, bottlenecks, mitigation strategies]
154
+
155
+ ## Security
156
+ [Authentication, authorization, data protection]
157
+
158
+ ## Monitoring & Observability
159
+ [Logging, metrics, alerting]
160
+ ```
161
+
162
+ 4. **Apply Technical Writing Best Practices**:
163
+
164
+ **Clarity**:
165
+ - Use short sentences (aim for 15-20 words)
166
+ - Avoid jargon or define it when first used
167
+ - Use active voice ("Click the button" not "The button should be clicked")
168
+ - Be specific ("Set timeout to 30 seconds" not "Set a reasonable timeout")
169
+
170
+ **Structure**:
171
+ - Use descriptive headings
172
+ - Break content into scannable sections
173
+ - Use numbered lists for sequences
174
+ - Use bullet points for unordered items
175
+ - Add table of contents for long docs
176
+
177
+ **Visuals**:
178
+ - Include screenshots with annotations
179
+ - Add code examples with syntax highlighting
180
+ - Use diagrams for complex concepts
181
+ - Show expected outputs
182
+ - Add tables for comparison or reference
183
+
184
+ **Code Examples**:
185
+ - Include language identifier
186
+ - Show both good and bad examples
187
+ - Add comments explaining complex parts
188
+ - Use realistic, runnable examples
189
+ - Include error handling
190
+
191
+ **User-Focused**:
192
+ - Start with most common use case
193
+ - Include "why" not just "how"
194
+ - Anticipate user questions
195
+ - Address common pitfalls
196
+ - Provide troubleshooting
197
+
198
+ 5. **Special Documentation Types**:
199
+
200
+ **README.md**:
201
+ - Project name and description
202
+ - Installation instructions
203
+ - Quick start example
204
+ - Features list
205
+ - Documentation links
206
+ - Contributing guidelines
207
+ - License
208
+
209
+ **Release Notes**:
210
+ - Version number and date
211
+ - New features
212
+ - Improvements
213
+ - Bug fixes
214
+ - Breaking changes
215
+ - Migration guide
216
+ - Deprecation notices
217
+
218
+ **Troubleshooting Guide**:
219
+ - Symptom-based organization
220
+ - Root cause analysis
221
+ - Step-by-step resolution
222
+ - Prevention tips
223
+ - When to escalate
224
+
225
+ ## Output Quality
226
+ Ensure documentation:
227
+ - Has clear, descriptive title
228
+ - Starts with overview/context
229
+ - Lists prerequisites upfront
230
+ - Uses consistent formatting
231
+ - Includes code examples where appropriate
232
+ - Shows expected outputs
233
+ - Has troubleshooting section
234
+ - Uses appropriate technical level for audience
235
+ - Is structured logically (simple to complex)
236
+ - Includes visual aids (diagrams, screenshots)
237
+ - Has table of contents for long docs
238
+ - Links to related documentation
239
+ - Is easy to scan
240
+ - Uses active voice
241
+ - Avoids ambiguity
242
+ - Includes examples from user perspective
@@ -0,0 +1,319 @@
1
+ ---
2
+ name: Testing Strategist
3
+ description: Design and implement comprehensive testing strategies. Use when setting up tests, choosing test types, implementing TDD, or improving code quality. Covers unit tests, integration tests, E2E tests, test-driven development, and testing best practices.
4
+ version: 1.0.0
5
+ ---
6
+
7
+ # Testing Strategist
8
+
9
+ Test the right things at the right level — write tests that give you confidence to ship.
10
+
11
+ ## Stack-Specific References
12
+
13
+ After reading the methodology below, read the reference matching your surface's Languages column in the surface stack map (`.agent/instructions/tech-stack.md`):
14
+
15
+ | Language | Reference |
16
+ |----------|-----------|
17
+ | TypeScript / JavaScript | `references/typescript.md` |
18
+ | Python | `references/python.md` |
19
+ | Go | `references/go.md` |
20
+ | Rust | `references/rust.md` |
21
+
22
+ ## Core Principle
23
+
24
+ **The Testing Pyramid:** 70% unit tests, 20% integration tests, 10% E2E tests.
25
+
26
+ Tests should be:
27
+
28
+ - **Fast** — Run in milliseconds (unit) to seconds (integration) to minutes (E2E)
29
+ - **Isolated** — Test one thing at a time
30
+ - **Repeatable** — Same input = same output
31
+ - **Self-checking** — Pass/fail automatically, no manual verification
32
+ - **Timely** — Written alongside code (or before, with TDD)
33
+
34
+ ---
35
+
36
+ ## The Testing Pyramid
37
+
38
+ ```
39
+ /\
40
+ / \ E2E Tests (10%)
41
+ /----\ - Slow, brittle, expensive
42
+ / \ - Test critical user journeys
43
+ /--------\ - Example: "User can complete checkout"
44
+ / \
45
+ /------------\ Integration Tests (20%)
46
+ / \ - Medium speed, test components together
47
+ /----------------\ - Example: "API endpoint returns correct data"
48
+ / \
49
+ /--------------------\ Unit Tests (70%)
50
+ /______________________\ - Fast, isolated, test functions/components
51
+ - Example: "calculateTotal returns sum"
52
+ ```
53
+
54
+ ### Why This Ratio?
55
+
56
+ - **Unit tests:** Fast feedback, pinpoint bugs precisely, easy to maintain
57
+ - **Integration tests:** Ensure components work together, catch interface issues
58
+ - **E2E tests:** Verify actual user flows, catch UI bugs, but slow and brittle
59
+
60
+ ---
61
+
62
+ ## Level 1: Unit Tests (70%)
63
+
64
+ ### What to Test
65
+
66
+ Test individual functions, components, or classes in isolation.
67
+
68
+ **Good candidates:**
69
+
70
+ - ✅ Business logic functions (calculations, validation, transformations)
71
+ - ✅ Utility functions (formatting, parsing, etc.)
72
+ - ✅ UI components (rendering, props, state)
73
+ - ✅ Pure functions (same input = same output)
74
+
75
+ **Skip:**
76
+
77
+ - ❌ Third-party libraries (assume they work)
78
+ - ❌ Framework internals
79
+ - ❌ Simple getters/setters with no logic
80
+
81
+ ### Unit Test Best Practices
82
+
83
+ ✅ **Do:**
84
+
85
+ - Test behavior, not implementation
86
+ - Use descriptive test names
87
+ - Follow AAA pattern: Arrange, Act, Assert
88
+ - Test edge cases (empty, null, negative, boundary values)
89
+ - Keep tests simple and readable
90
+
91
+ ❌ **Don't:**
92
+
93
+ - Test private methods directly
94
+ - Over-mock (makes tests brittle)
95
+ - Test framework internals
96
+ - Write tests that depend on other tests
97
+
98
+ ---
99
+
100
+ ## Level 2: Integration Tests (20%)
101
+
102
+ ### What to Test
103
+
104
+ Test multiple units working together — typically API routes, database operations, or service integrations.
105
+
106
+ **Good candidates:**
107
+
108
+ - ✅ API endpoints (request → handler → database → response)
109
+ - ✅ Database operations (queries, transactions)
110
+ - ✅ Third-party integrations (payment, email, etc.)
111
+ - ✅ Authentication flows
112
+ - ✅ File upload/download
113
+
114
+ ### Integration Test Best Practices
115
+
116
+ ✅ **Do:**
117
+
118
+ - Use test database (separate from development/production)
119
+ - Clean up test data before/after each test
120
+ - Test happy path + error cases
121
+ - Test authentication/authorization
122
+ - Use factories/fixtures for test data
123
+
124
+ ❌ **Don't:**
125
+
126
+ - Test against production database
127
+ - Leave test data behind
128
+ - Mock database (defeats purpose of integration test)
129
+ - Depend on external services (mock external APIs)
130
+
131
+ ---
132
+
133
+ ## Level 3: E2E Tests (10%)
134
+
135
+ ### What to Test
136
+
137
+ Test complete user journeys through the actual UI.
138
+
139
+ **Good candidates:**
140
+
141
+ - ✅ Critical user flows (signup, login, checkout)
142
+ - ✅ Core business processes
143
+ - ✅ Multi-step workflows
144
+
145
+ **Skip:**
146
+
147
+ - ❌ Every possible UI interaction (too slow/brittle)
148
+ - ❌ Edge cases (cover with unit/integration tests)
149
+
150
+ ### E2E Test Best Practices
151
+
152
+ ✅ **Do:**
153
+
154
+ - Test critical paths only (< 20 tests)
155
+ - Use stable selectors (test IDs, roles, labels — not CSS classes)
156
+ - Run in CI/CD pipeline
157
+ - Test across browsers if web surface
158
+ - Take screenshots on failure
159
+
160
+ ❌ **Don't:**
161
+
162
+ - Test every UI variation
163
+ - Use fragile selectors (nth-child, CSS classes)
164
+ - Run E2E tests on every commit (too slow)
165
+ - Ignore flaky tests (fix or remove them)
166
+
167
+ ---
168
+
169
+ ## Test-Driven Development (TDD)
170
+
171
+ ### The Red-Green-Refactor Cycle
172
+
173
+ 1. **Red:** Write a failing test that defines expected behavior
174
+ 2. **Green:** Write minimal code to make it pass
175
+ 3. **Refactor:** Improve code while keeping tests green
176
+
177
+ ### When to Use TDD
178
+
179
+ **Good for:**
180
+
181
+ - ✅ Complex business logic
182
+ - ✅ Bug fixes (write test that reproduces bug first)
183
+ - ✅ Well-defined requirements
184
+ - ✅ Critical algorithms
185
+
186
+ **Skip for:**
187
+
188
+ - ❌ Exploratory coding (don't know requirements yet)
189
+ - ❌ Throwaway prototypes
190
+ - ❌ Simple CRUD operations
191
+
192
+ ---
193
+
194
+ ## Mocking Strategies
195
+
196
+ ### When to Mock
197
+
198
+ - ✅ External APIs (slow, unreliable, cost money)
199
+ - ✅ Time/randomness (make tests deterministic)
200
+ - ✅ File system operations
201
+ - ✅ Database (in unit tests only — NEVER in integration tests)
202
+
203
+ ### Anti-Mock-Abuse Rules
204
+
205
+ 1. **Never mock what you own** — if you wrote the module, test it directly
206
+ 2. **One mock = one boundary** — only mock at the boundary between your code and external systems
207
+ 3. **Verify mock interactions** — assert that mocked deps were called with correct arguments
208
+ 4. **Mock return values, not internals** — mock the return value, not the internal implementation
209
+
210
+ ### Mocking Best Practices
211
+
212
+ ✅ **Do:**
213
+
214
+ - Mock at boundaries (APIs, file system, network)
215
+ - Restore mocks after tests
216
+ - Make mocks realistic (same shape as real data)
217
+
218
+ ❌ **Don't:**
219
+
220
+ - Over-mock (makes tests brittle and meaningless)
221
+ - Mock your own code (test real behavior)
222
+ - Leave mocks unreset between tests
223
+
224
+ ---
225
+
226
+ ## Assertion Depth Rules
227
+
228
+ ### ❌ Shallow Assertions (BANNED)
229
+
230
+ Assertions that prove nothing about correctness:
231
+ - "Result is defined" — undefined would also be defined
232
+ - "Result is truthy" — empty arrays and objects are truthy
233
+ - "Status is 200" alone — doesn't verify response body
234
+
235
+ ### ✅ Deep Assertions (REQUIRED)
236
+
237
+ Every test must assert:
238
+ 1. **The correct output** — specific values, not just types
239
+ 2. **The correct side effects** — what changed in the system
240
+ 3. **The correct error behavior** — specific error type and message
241
+
242
+ ---
243
+
244
+ ## Code Coverage
245
+
246
+ ### Coverage Targets
247
+
248
+ - **70% minimum** — Below this, you're missing important tests
249
+ - **80% good** — Solid coverage of critical paths
250
+ - **90%+ diminishing returns** — Chasing 100% often not worth it
251
+
252
+ ### What to Focus On
253
+
254
+ **High priority (90%+ coverage):**
255
+
256
+ - Business logic
257
+ - Authentication/authorization
258
+ - Payment processing
259
+ - Data validation
260
+
261
+ **Medium priority (70%+):**
262
+
263
+ - API routes
264
+ - Database queries
265
+ - Utility functions
266
+
267
+ **Low priority (okay to skip):**
268
+
269
+ - UI components (test behavior, not rendering)
270
+ - Configuration files
271
+ - Type definitions
272
+
273
+ ---
274
+
275
+ ## Common Testing Patterns
276
+
277
+ ### Testing Async Code
278
+ Write tests that properly wait for async operations to complete before asserting. Use your framework's async test utilities.
279
+
280
+ ### Testing Error Handling
281
+ Mock dependencies to throw errors, then assert your code handles them correctly — shows the right error message, returns the right status code, logs appropriately.
282
+
283
+ ### Testing Forms
284
+ Fill form fields programmatically, submit, and assert both the submission data and any validation errors.
285
+
286
+ ---
287
+
288
+ ## Test Organization
289
+
290
+ ### File Structure
291
+
292
+ Tests co-locate with source files:
293
+
294
+ ```
295
+ source-file.ext → source-file.test.ext (unit tests)
296
+ route-handler.ext → route-handler.test.ext (integration tests)
297
+ e2e/ → feature-name.e2e.ext (E2E tests)
298
+ ```
299
+
300
+ ### Naming Conventions
301
+
302
+ - Unit/Integration: `*.test.*` or `*.spec.*`
303
+ - E2E: `*.e2e.*` or `*.spec.*` (in tests/e2e/)
304
+ - Test names should describe behavior: "returns X when Y" or "throws error for invalid input"
305
+
306
+ ---
307
+
308
+ ## When to Use This Skill
309
+
310
+ - ✅ Setting up testing for new project
311
+ - ✅ Choosing test frameworks
312
+ - ✅ Deciding what to test and at what level
313
+ - ✅ Implementing TDD
314
+ - ✅ Improving code coverage
315
+ - ✅ Fixing flaky tests
316
+
317
+ ---
318
+
319
+ **Good tests give you confidence to ship.** ✅