@cubis/foundry 0.3.71 → 0.3.73

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 (276) hide show
  1. package/CHANGELOG.md +23 -2
  2. package/dist/cli/core.js +9 -22
  3. package/dist/cli/core.js.map +1 -1
  4. package/package.json +1 -1
  5. package/src/cli/core.ts +13 -22
  6. package/workflows/powers/accessibility/POWER.md +83 -94
  7. package/workflows/powers/accessibility/SKILL.md +82 -94
  8. package/workflows/powers/agent-design/POWER.md +201 -0
  9. package/workflows/powers/agent-design/SKILL.md +198 -0
  10. package/workflows/powers/agent-design/references/clarification-patterns.md +153 -0
  11. package/workflows/powers/agent-design/references/skill-testing.md +164 -0
  12. package/workflows/powers/agent-design/references/workflow-patterns.md +226 -0
  13. package/workflows/powers/agentic-eval/POWER.md +62 -0
  14. package/workflows/powers/agentic-eval/SKILL.md +59 -0
  15. package/workflows/powers/agentic-eval/references/rubric-and-regression-checklist.md +11 -0
  16. package/workflows/powers/api-designer/POWER.md +43 -71
  17. package/workflows/powers/api-designer/SKILL.md +43 -71
  18. package/workflows/powers/api-patterns/POWER.md +42 -56
  19. package/workflows/powers/api-patterns/SKILL.md +42 -57
  20. package/workflows/powers/architecture-designer/POWER.md +43 -60
  21. package/workflows/powers/architecture-designer/SKILL.md +43 -60
  22. package/workflows/powers/ask-questions-if-underspecified/POWER.md +51 -3
  23. package/workflows/powers/auth-architect/POWER.md +69 -0
  24. package/workflows/powers/auth-architect/SKILL.md +66 -0
  25. package/workflows/powers/auth-architect/references/session-token-policy-checklist.md +45 -0
  26. package/workflows/powers/behavioral-modes/POWER.md +100 -9
  27. package/workflows/powers/c-pro/POWER.md +105 -0
  28. package/workflows/powers/c-pro/SKILL.md +102 -0
  29. package/workflows/powers/c-pro/references/build-systems-and-toolchains.md +148 -0
  30. package/workflows/powers/c-pro/references/common-ub-and-portability.md +166 -0
  31. package/workflows/powers/c-pro/references/debugging-with-sanitizers.md +205 -0
  32. package/workflows/powers/c-pro/references/memory-safety-and-build-checklist.md +60 -0
  33. package/workflows/powers/c-pro/references/posix-and-platform-apis.md +244 -0
  34. package/workflows/powers/changelog-generator/POWER.md +127 -63
  35. package/workflows/powers/changelog-generator/SKILL.md +126 -63
  36. package/workflows/powers/ci-cd-pipelines/POWER.md +156 -0
  37. package/workflows/powers/ci-cd-pipelines/SKILL.md +153 -0
  38. package/workflows/powers/ci-cd-pipelines/references/github-actions-patterns.md +160 -0
  39. package/workflows/powers/ci-cd-pipelines/references/pipeline-security-checklist.md +57 -0
  40. package/workflows/powers/cli-developer/POWER.md +152 -95
  41. package/workflows/powers/cli-developer/SKILL.md +152 -95
  42. package/workflows/powers/cpp-pro/POWER.md +111 -0
  43. package/workflows/powers/cpp-pro/SKILL.md +108 -0
  44. package/workflows/powers/cpp-pro/references/concurrency-primitives.md +266 -0
  45. package/workflows/powers/cpp-pro/references/move-semantics-and-value-types.md +149 -0
  46. package/workflows/powers/cpp-pro/references/performance-and-profiling.md +191 -0
  47. package/workflows/powers/cpp-pro/references/raii-and-modern-cpp-checklist.md +87 -0
  48. package/workflows/powers/cpp-pro/references/template-and-concepts-patterns.md +205 -0
  49. package/workflows/powers/csharp-pro/POWER.md +47 -22
  50. package/workflows/powers/csharp-pro/SKILL.md +47 -22
  51. package/workflows/powers/dart-pro/POWER.md +68 -0
  52. package/workflows/powers/dart-pro/SKILL.md +65 -0
  53. package/workflows/powers/dart-pro/references/isolate-and-concurrency.md +180 -0
  54. package/workflows/powers/dart-pro/references/null-safety-and-async-patterns.md +133 -0
  55. package/workflows/powers/dart-pro/references/package-structure-and-linting.md +193 -0
  56. package/workflows/powers/dart-pro/references/sealed-records-patterns.md +173 -0
  57. package/workflows/powers/dart-pro/references/testing-and-mocking.md +235 -0
  58. package/workflows/powers/database-design/POWER.md +47 -33
  59. package/workflows/powers/database-design/SKILL.md +47 -33
  60. package/workflows/powers/database-optimizer/POWER.md +43 -64
  61. package/workflows/powers/database-optimizer/SKILL.md +43 -64
  62. package/workflows/powers/database-skills/POWER.md +59 -93
  63. package/workflows/powers/database-skills/SKILL.md +59 -93
  64. package/workflows/powers/debugging-strategies/POWER.md +69 -0
  65. package/workflows/powers/debugging-strategies/SKILL.md +66 -0
  66. package/workflows/powers/debugging-strategies/references/reproduce-isolate-verify-checklist.md +42 -0
  67. package/workflows/powers/deep-research/POWER.md +67 -0
  68. package/workflows/powers/deep-research/SKILL.md +64 -0
  69. package/workflows/powers/deep-research/references/multi-round-research-loop.md +80 -0
  70. package/workflows/powers/design-system-builder/POWER.md +130 -116
  71. package/workflows/powers/design-system-builder/SKILL.md +130 -116
  72. package/workflows/powers/devops-engineer/POWER.md +120 -57
  73. package/workflows/powers/devops-engineer/SKILL.md +120 -57
  74. package/workflows/powers/docker-kubernetes/POWER.md +94 -0
  75. package/workflows/powers/docker-kubernetes/SKILL.md +91 -0
  76. package/workflows/powers/docker-kubernetes/references/dockerfile-optimization-checklist.md +35 -0
  77. package/workflows/powers/docker-kubernetes/references/kubernetes-deployment-patterns.md +59 -0
  78. package/workflows/powers/documentation-templates/POWER.md +158 -127
  79. package/workflows/powers/documentation-templates/SKILL.md +158 -127
  80. package/workflows/powers/drizzle-expert/POWER.md +66 -0
  81. package/workflows/powers/drizzle-expert/SKILL.md +63 -0
  82. package/workflows/powers/drizzle-expert/references/runtime-pairing-matrix.md +16 -0
  83. package/workflows/powers/drizzle-expert/references/schema-and-migration-playbook.md +18 -0
  84. package/workflows/powers/error-ux-observability/POWER.md +144 -131
  85. package/workflows/powers/error-ux-observability/SKILL.md +143 -131
  86. package/workflows/powers/fastapi-expert/POWER.md +46 -60
  87. package/workflows/powers/fastapi-expert/SKILL.md +46 -60
  88. package/workflows/powers/firebase/POWER.md +65 -0
  89. package/workflows/powers/firebase/SKILL.md +62 -0
  90. package/workflows/powers/firebase/references/platform-routing.md +16 -0
  91. package/workflows/powers/firebase/references/rules-and-indexes-checklist.md +11 -0
  92. package/workflows/powers/flutter-design-system/POWER.md +63 -0
  93. package/workflows/powers/flutter-design-system/SKILL.md +60 -0
  94. package/workflows/powers/flutter-design-system/references/shared-widgets.md +29 -0
  95. package/workflows/powers/flutter-design-system/references/tokens-and-theme.md +34 -0
  96. package/workflows/powers/flutter-drift/POWER.md +65 -0
  97. package/workflows/powers/flutter-drift/SKILL.md +62 -0
  98. package/workflows/powers/flutter-drift/references/migrations.md +22 -0
  99. package/workflows/powers/flutter-drift/references/query-patterns.md +26 -0
  100. package/workflows/powers/flutter-feature/POWER.md +65 -0
  101. package/workflows/powers/flutter-feature/SKILL.md +62 -0
  102. package/workflows/powers/flutter-feature/references/architecture-rules.md +85 -0
  103. package/workflows/powers/flutter-feature/references/composite-provider.md +58 -0
  104. package/workflows/powers/flutter-feature/references/outbox-pattern.md +87 -0
  105. package/workflows/powers/flutter-feature/references/testing-patterns.md +218 -0
  106. package/workflows/powers/flutter-go-router/POWER.md +64 -0
  107. package/workflows/powers/flutter-go-router/SKILL.md +61 -0
  108. package/workflows/powers/flutter-go-router/references/guards-and-deeplinks.md +20 -0
  109. package/workflows/powers/flutter-go-router/references/typed-routes.md +27 -0
  110. package/workflows/powers/flutter-offline-sync/POWER.md +62 -0
  111. package/workflows/powers/flutter-offline-sync/SKILL.md +59 -0
  112. package/workflows/powers/flutter-offline-sync/references/outbox-full.md +44 -0
  113. package/workflows/powers/flutter-repository/POWER.md +64 -0
  114. package/workflows/powers/flutter-repository/SKILL.md +61 -0
  115. package/workflows/powers/flutter-repository/references/drift-patterns.md +21 -0
  116. package/workflows/powers/flutter-repository/references/retrofit-patterns.md +20 -0
  117. package/workflows/powers/flutter-riverpod/POWER.md +70 -0
  118. package/workflows/powers/flutter-riverpod/SKILL.md +67 -0
  119. package/workflows/powers/flutter-riverpod/references/async-and-mutations.md +19 -0
  120. package/workflows/powers/flutter-riverpod/references/async-lifecycle.md +19 -0
  121. package/workflows/powers/flutter-riverpod/references/provider-selection.md +20 -0
  122. package/workflows/powers/flutter-riverpod/references/testing.md +21 -0
  123. package/workflows/powers/flutter-riverpod/references/version-matrix.md +24 -0
  124. package/workflows/powers/flutter-state-machine/POWER.md +62 -0
  125. package/workflows/powers/flutter-state-machine/SKILL.md +59 -0
  126. package/workflows/powers/flutter-state-machine/references/app-state-contract.md +23 -0
  127. package/workflows/powers/flutter-state-machine/references/ui-rendering.md +14 -0
  128. package/workflows/powers/flutter-testing/POWER.md +64 -0
  129. package/workflows/powers/flutter-testing/SKILL.md +61 -0
  130. package/workflows/powers/flutter-testing/references/offline-sync-tests.md +16 -0
  131. package/workflows/powers/flutter-testing/references/test-layers.md +33 -0
  132. package/workflows/powers/frontend-code-review/POWER.md +137 -0
  133. package/workflows/powers/frontend-code-review/SKILL.md +134 -0
  134. package/workflows/powers/frontend-code-review/references/common-antipatterns.md +86 -0
  135. package/workflows/powers/frontend-code-review/references/performance-budgets.md +56 -0
  136. package/workflows/powers/frontend-code-review/references/review-checklists.md +47 -0
  137. package/workflows/powers/frontend-design/POWER.md +163 -362
  138. package/workflows/powers/frontend-design/SKILL.md +163 -362
  139. package/workflows/powers/game-development/POWER.md +57 -140
  140. package/workflows/powers/game-development/SKILL.md +57 -140
  141. package/workflows/powers/geo-fundamentals/POWER.md +64 -126
  142. package/workflows/powers/geo-fundamentals/SKILL.md +64 -127
  143. package/workflows/powers/git-workflow/POWER.md +135 -0
  144. package/workflows/powers/git-workflow/SKILL.md +132 -0
  145. package/workflows/powers/git-workflow/references/pr-review-checklist.md +63 -0
  146. package/workflows/powers/golang-pro/POWER.md +46 -35
  147. package/workflows/powers/golang-pro/SKILL.md +46 -35
  148. package/workflows/powers/graphql-architect/POWER.md +44 -62
  149. package/workflows/powers/graphql-architect/SKILL.md +44 -62
  150. package/workflows/powers/i18n-localization/POWER.md +118 -103
  151. package/workflows/powers/i18n-localization/SKILL.md +118 -103
  152. package/workflows/powers/java-pro/POWER.md +47 -22
  153. package/workflows/powers/java-pro/SKILL.md +47 -22
  154. package/workflows/powers/javascript-pro/POWER.md +47 -34
  155. package/workflows/powers/javascript-pro/SKILL.md +47 -34
  156. package/workflows/powers/kotlin-pro/POWER.md +46 -23
  157. package/workflows/powers/kotlin-pro/SKILL.md +46 -23
  158. package/workflows/powers/legacy-modernizer/POWER.md +43 -60
  159. package/workflows/powers/legacy-modernizer/SKILL.md +43 -60
  160. package/workflows/powers/mcp-builder/POWER.md +65 -0
  161. package/workflows/powers/mcp-builder/SKILL.md +62 -0
  162. package/workflows/powers/mcp-builder/references/testing-and-evals.md +17 -0
  163. package/workflows/powers/mcp-builder/references/transport-and-tool-design.md +17 -0
  164. package/workflows/powers/microservices-architect/POWER.md +43 -70
  165. package/workflows/powers/microservices-architect/SKILL.md +43 -70
  166. package/workflows/powers/mobile-design/POWER.md +110 -345
  167. package/workflows/powers/mobile-design/SKILL.md +110 -345
  168. package/workflows/powers/mongodb/POWER.md +67 -0
  169. package/workflows/powers/mongodb/SKILL.md +64 -0
  170. package/workflows/powers/mongodb/references/mongodb-checklist.md +20 -0
  171. package/workflows/powers/mysql/POWER.md +67 -0
  172. package/workflows/powers/mysql/SKILL.md +64 -0
  173. package/workflows/powers/mysql/references/mysql-checklist.md +20 -0
  174. package/workflows/powers/neki/POWER.md +67 -0
  175. package/workflows/powers/neki/SKILL.md +64 -0
  176. package/workflows/powers/neki/references/neki-checklist.md +18 -0
  177. package/workflows/powers/nestjs-expert/POWER.md +45 -91
  178. package/workflows/powers/nestjs-expert/SKILL.md +45 -91
  179. package/workflows/powers/nextjs-developer/POWER.md +51 -44
  180. package/workflows/powers/nextjs-developer/SKILL.md +51 -44
  181. package/workflows/powers/nodejs-best-practices/POWER.md +48 -29
  182. package/workflows/powers/nodejs-best-practices/SKILL.md +48 -29
  183. package/workflows/powers/observability/POWER.md +109 -0
  184. package/workflows/powers/observability/SKILL.md +106 -0
  185. package/workflows/powers/observability/references/alerting-and-slo-checklist.md +87 -0
  186. package/workflows/powers/observability/references/opentelemetry-setup-guide.md +121 -0
  187. package/workflows/powers/openai-docs/POWER.md +61 -0
  188. package/workflows/powers/openai-docs/SKILL.md +58 -0
  189. package/workflows/powers/openai-docs/references/official-source-playbook.md +10 -0
  190. package/workflows/powers/performance-profiling/POWER.md +61 -114
  191. package/workflows/powers/performance-profiling/SKILL.md +61 -114
  192. package/workflows/powers/php-pro/POWER.md +116 -0
  193. package/workflows/powers/php-pro/SKILL.md +113 -0
  194. package/workflows/powers/php-pro/references/architecture-and-di.md +239 -0
  195. package/workflows/powers/php-pro/references/modern-php-features.md +189 -0
  196. package/workflows/powers/php-pro/references/performance-and-deployment.md +197 -0
  197. package/workflows/powers/php-pro/references/php84-strict-typing-checklist.md +161 -0
  198. package/workflows/powers/php-pro/references/testing-and-static-analysis.md +235 -0
  199. package/workflows/powers/playwright-e2e/POWER.md +85 -0
  200. package/workflows/powers/playwright-e2e/SKILL.md +82 -0
  201. package/workflows/powers/playwright-e2e/references/locator-trace-flake-checklist.md +80 -0
  202. package/workflows/powers/postgres/POWER.md +67 -0
  203. package/workflows/powers/postgres/SKILL.md +64 -0
  204. package/workflows/powers/postgres/references/postgres-checklist.md +20 -0
  205. package/workflows/powers/prompt-engineer/POWER.md +47 -30
  206. package/workflows/powers/prompt-engineer/SKILL.md +47 -30
  207. package/workflows/powers/python-pro/POWER.md +47 -36
  208. package/workflows/powers/python-pro/SKILL.md +47 -36
  209. package/workflows/powers/react-best-practices/POWER.md +56 -33
  210. package/workflows/powers/react-best-practices/SKILL.md +56 -33
  211. package/workflows/powers/react-expert/POWER.md +47 -37
  212. package/workflows/powers/react-expert/SKILL.md +47 -37
  213. package/workflows/powers/redis/POWER.md +67 -0
  214. package/workflows/powers/redis/SKILL.md +64 -0
  215. package/workflows/powers/redis/references/redis-checklist.md +19 -0
  216. package/workflows/powers/ruby-pro/POWER.md +118 -0
  217. package/workflows/powers/ruby-pro/SKILL.md +115 -0
  218. package/workflows/powers/ruby-pro/references/modern-ruby-features.md +189 -0
  219. package/workflows/powers/ruby-pro/references/object-design-patterns.md +220 -0
  220. package/workflows/powers/ruby-pro/references/performance-and-profiling.md +224 -0
  221. package/workflows/powers/ruby-pro/references/ruby-concurrency-and-testing.md +190 -0
  222. package/workflows/powers/ruby-pro/references/testing-and-rspec.md +236 -0
  223. package/workflows/powers/rust-pro/POWER.md +45 -31
  224. package/workflows/powers/rust-pro/SKILL.md +45 -31
  225. package/workflows/powers/security-engineer/POWER.md +129 -0
  226. package/workflows/powers/security-engineer/SKILL.md +126 -0
  227. package/workflows/powers/seo-fundamentals/POWER.md +59 -102
  228. package/workflows/powers/seo-fundamentals/SKILL.md +59 -102
  229. package/workflows/powers/serverless-patterns/POWER.md +171 -0
  230. package/workflows/powers/serverless-patterns/SKILL.md +168 -0
  231. package/workflows/powers/skill-creator/POWER.md +90 -0
  232. package/workflows/powers/skill-creator/SKILL.md +87 -0
  233. package/workflows/powers/skill-creator/references/platform-formats.md +181 -0
  234. package/workflows/powers/skill-creator/references/schemas.md +430 -0
  235. package/workflows/powers/spec-miner/POWER.md +49 -57
  236. package/workflows/powers/spec-miner/SKILL.md +49 -57
  237. package/workflows/powers/sqlite/POWER.md +67 -0
  238. package/workflows/powers/sqlite/SKILL.md +64 -0
  239. package/workflows/powers/sqlite/references/sqlite-checklist.md +19 -0
  240. package/workflows/powers/sre-engineer/POWER.md +123 -64
  241. package/workflows/powers/sre-engineer/SKILL.md +123 -64
  242. package/workflows/powers/static-analysis/POWER.md +121 -77
  243. package/workflows/powers/static-analysis/SKILL.md +121 -77
  244. package/workflows/powers/stripe-best-practices/POWER.md +140 -17
  245. package/workflows/powers/stripe-best-practices/SKILL.md +139 -17
  246. package/workflows/powers/supabase/POWER.md +67 -0
  247. package/workflows/powers/supabase/SKILL.md +64 -0
  248. package/workflows/powers/supabase/references/supabase-checklist.md +19 -0
  249. package/workflows/powers/swift-pro/POWER.md +118 -0
  250. package/workflows/powers/swift-pro/SKILL.md +115 -0
  251. package/workflows/powers/swift-pro/references/concurrency-patterns.md +165 -0
  252. package/workflows/powers/swift-pro/references/protocol-and-generics.md +172 -0
  253. package/workflows/powers/swift-pro/references/sendable-and-isolation.md +116 -0
  254. package/workflows/powers/swift-pro/references/swift-concurrency-and-protocols.md +260 -0
  255. package/workflows/powers/swift-pro/references/testing-and-packages.md +192 -0
  256. package/workflows/powers/tailwind-patterns/POWER.md +71 -240
  257. package/workflows/powers/tailwind-patterns/SKILL.md +71 -240
  258. package/workflows/powers/testing-patterns/POWER.md +155 -10
  259. package/workflows/powers/testing-patterns/SKILL.md +155 -10
  260. package/workflows/powers/typescript-pro/POWER.md +47 -38
  261. package/workflows/powers/typescript-pro/SKILL.md +47 -38
  262. package/workflows/powers/vitess/POWER.md +67 -0
  263. package/workflows/powers/vitess/SKILL.md +64 -0
  264. package/workflows/powers/vitess/references/vitess-checklist.md +19 -0
  265. package/workflows/powers/vulnerability-scanner/POWER.md +146 -10
  266. package/workflows/powers/vulnerability-scanner/SKILL.md +146 -10
  267. package/workflows/powers/web-perf/POWER.md +43 -170
  268. package/workflows/powers/web-perf/SKILL.md +43 -170
  269. package/workflows/powers/webapp-testing/POWER.md +43 -164
  270. package/workflows/powers/webapp-testing/SKILL.md +43 -164
  271. package/workflows/workflows/agent-environment-setup/platforms/antigravity/rules/GEMINI.md +65 -42
  272. package/workflows/workflows/agent-environment-setup/platforms/claude/rules/CLAUDE.md +8 -6
  273. package/workflows/workflows/agent-environment-setup/platforms/codex/rules/AGENTS.md +65 -41
  274. package/workflows/workflows/agent-environment-setup/platforms/copilot/rules/copilot-instructions.md +8 -6
  275. package/workflows/workflows/agent-environment-setup/shared/rules/STEERING.md +9 -8
  276. package/workflows/workflows/agent-environment-setup/shared/rules/overrides/codex.md +1 -1
@@ -1,21 +1,166 @@
1
1
  ---
2
2
  name: testing-patterns
3
- description: "Compatibility alias skill. Deprecated: use test-master."
3
+ description: Design test strategies with unit, integration, and e2e testing. Apply TDD, mocking, fixtures, coverage analysis, and test architecture best practices.
4
+ license: Apache-2.0
4
5
  metadata:
5
- deprecated: true
6
- replaced_by: test-master
7
- removal_target: v0.6.0
6
+ author: cubis-foundry
7
+ version: "3.0"
8
+ compatibility: Claude Code, Codex, GitHub Copilot, Gemini CLI
8
9
  ---
9
10
 
10
11
  # Testing Patterns
11
12
 
12
- ## Compatibility Alias
13
+ ## Purpose
13
14
 
14
- This skill is deprecated and kept for backward compatibility.
15
+ Guide test strategy, structure, and implementation across all testing levels. Covers unit, integration, and e2e testing patterns, TDD methodology, mocking strategies, and test architecture.
15
16
 
16
- Use `test-master` as the canonical skill.
17
+ ## When to Use
17
18
 
18
- ## Migration
19
+ - Writing tests for new features or bug fixes
20
+ - Designing a test strategy for a new project or module
21
+ - Debugging flaky or slow tests
22
+ - Reviewing test quality and coverage gaps
23
+ - Setting up test infrastructure (runners, fixtures, mocks)
24
+ - Deciding what level of testing is appropriate
19
25
 
20
- 1. Replace direct references to `testing-patterns` with `test-master`.
21
- 2. Apply the full workflow from `test-master` for new work.
26
+ ## Instructions
27
+
28
+ ### Step 1 — Choose the Right Test Level
29
+
30
+ | Level | Tests | Speed | Confidence | When to Use |
31
+ | ----------- | ---------------------------- | -------- | ---------------------------- | -------------------------------------------------- |
32
+ | Unit | Individual functions/classes | ms | Logic correctness | Pure logic, calculations, transformers |
33
+ | Integration | Module boundaries | 100ms–1s | Components work together | API routes, database queries, service interactions |
34
+ | E2E | Full user flows | 5–30s | System works as user expects | Critical paths (signup, checkout, deploy) |
35
+
36
+ **Testing Trophy** (preferred distribution):
37
+
38
+ - Many integration tests (highest ROI)
39
+ - Some unit tests (fast logic verification)
40
+ - Few e2e tests (critical paths only)
41
+ - Static analysis as the foundation (TypeScript, linting)
42
+
43
+ ### Step 2 — Write Effective Tests
44
+
45
+ **Structure every test as Arrange → Act → Assert**:
46
+
47
+ ```typescript
48
+ test("calculates total with tax", () => {
49
+ // Arrange
50
+ const items = [{ price: 100 }, { price: 200 }];
51
+ const taxRate = 0.1;
52
+
53
+ // Act
54
+ const total = calculateTotal(items, taxRate);
55
+
56
+ // Assert
57
+ expect(total).toBe(330);
58
+ });
59
+ ```
60
+
61
+ **Naming**: Use natural language that describes the behavior:
62
+
63
+ - DO: `"returns empty array when no items match filter"`
64
+ - DON'T: `"test filter"` or `"test1"`
65
+
66
+ **One assertion per behavior** (not per test):
67
+
68
+ - One test can have multiple `expect()` calls if they verify the same behavior
69
+ - Split separate behaviors into separate tests
70
+
71
+ ### Step 3 — Mock Strategically
72
+
73
+ **Mock at boundaries, not everywhere**:
74
+
75
+ - Mock: external APIs, databases, file system, time, randomness
76
+ - Don't mock: your own code, simple utilities, data transformations
77
+
78
+ **Mock patterns**:
79
+
80
+ ```typescript
81
+ // Dependency injection (preferred)
82
+ function createUserService(db: Database) {
83
+ return { getUser: (id) => db.query("SELECT...", [id]) };
84
+ }
85
+
86
+ // Module mocking (when DI not available)
87
+ vi.mock("./database", () => ({
88
+ query: vi.fn().mockResolvedValue([{ id: 1, name: "Alice" }]),
89
+ }));
90
+ ```
91
+
92
+ **Avoid**:
93
+
94
+ - Mocking implementation details (private methods, internal state)
95
+ - Over-mocking (if you mock everything, you're testing nothing)
96
+ - Snapshot tests for behavior (only for serialized output like HTML)
97
+
98
+ ### Step 4 — Handle Test Data
99
+
100
+ **Factories over fixtures**:
101
+
102
+ ```typescript
103
+ function createUser(overrides = {}) {
104
+ return {
105
+ id: crypto.randomUUID(),
106
+ name: "Test User",
107
+ email: "test@example.com",
108
+ role: "user",
109
+ ...overrides,
110
+ };
111
+ }
112
+
113
+ // Usage
114
+ const admin = createUser({ role: "admin" });
115
+ ```
116
+
117
+ **Test isolation**:
118
+
119
+ - Each test creates its own data (no shared mutable state)
120
+ - Clean up after integration tests (database, files)
121
+ - Use transactions for database tests (rollback after each test)
122
+
123
+ ### Step 5 — Fix Common Test Problems
124
+
125
+ **Flaky tests**:
126
+
127
+ - Remove timing dependencies (`setTimeout`, `sleep`)
128
+ - Use deterministic data (no `Math.random()` without seeding)
129
+ - Await all async operations properly
130
+ - Isolate external dependencies (mock network, use test databases)
131
+
132
+ **Slow tests**:
133
+
134
+ - Run in parallel when tests are isolated
135
+ - Use in-memory databases for integration tests
136
+ - Minimize e2e tests — push logic down to unit/integration
137
+ - Profile and fix the slowest 10% first
138
+
139
+ **Brittle tests**:
140
+
141
+ - Test behavior, not implementation
142
+ - Use accessible queries in UI tests (role, label — not CSS selectors)
143
+ - Avoid testing framework internals
144
+
145
+ ## Output Format
146
+
147
+ ```
148
+ ## Test Strategy
149
+ [approach and reasoning for test level choices]
150
+
151
+ ## Tests
152
+ [test code organized by describe blocks]
153
+
154
+ ## Coverage Notes
155
+ [what's tested, what's intentionally not tested, and why]
156
+ ```
157
+
158
+ ## Examples
159
+
160
+ **User**: "Write tests for this user registration function"
161
+
162
+ **Response approach**: Unit tests for validation logic (email format, password strength). Integration test for the full registration flow (validate → hash password → insert DB → send email). Mock the email service and database. Test edge cases (duplicate email, weak password, missing fields).
163
+
164
+ **User**: "Our test suite takes 20 minutes, help us speed it up"
165
+
166
+ **Response approach**: Profile the slowest tests. Look for unnecessary e2e tests that could be integration. Check for missing parallelization. Identify shared state causing serial execution. Suggest in-memory database for integration tests.
@@ -1,63 +1,72 @@
1
1
  ````markdown
2
2
  ---
3
3
  inclusion: manual
4
- name: "typescript-pro"
5
- description: "Use for TypeScript architecture and implementation with TS 5.9+ production baselines and TS 6/7 transition readiness."
4
+ name: typescript-pro
5
+ description: "Use for TypeScript architecture and implementation with TS 5.9+ production baselines and TS 6/7 transition readiness. Use when designing type-safe APIs, refactoring to strict TypeScript, reducing type regressions in monorepos, or preparing for TS 6/7 behavior shifts."
6
6
  license: MIT
7
7
  metadata:
8
- version: "2.0.0"
9
- domain: "language"
10
- role: "specialist"
11
- stack: "typescript"
12
- baseline: "TypeScript 5.9 stable"
13
- transition: "TypeScript 6 compatibility prep"
8
+ author: cubis-foundry
9
+ version: "3.0"
10
+ compatibility: Claude Code, Codex, GitHub Copilot
14
11
  ---
15
12
 
16
13
  # TypeScript Pro
17
14
 
18
- ## When to use
15
+ ## Purpose
16
+
17
+ Language-layer specialist for TypeScript architecture, type design, and production implementation. Provides the type-system foundation before loading framework skills like `nextjs-developer` or `nestjs-expert`. Covers strict compiler configuration, domain modeling with discriminated unions, generic patterns, module structure, and tooling selection for TS 5.9+ codebases with awareness of TS 6/7 transitions.
18
+
19
+ ## When to Use
19
20
 
20
21
  - Designing type-safe APIs and shared contracts.
21
22
  - Refactoring codebases to strict TypeScript.
22
23
  - Reducing type regressions in monorepos.
23
24
  - Preparing for upcoming TS 6/7 behavior shifts.
25
+ - Acting as the language-layer foundation before loading framework skills.
24
26
 
25
- ## Core workflow
27
+ ## Instructions
26
28
 
27
- 1. Confirm runtime and module target (Node, browser, edge).
28
- 2. Lock strict compiler baseline before feature work.
29
- 3. Model domain types first, then implement behavior.
30
- 4. Keep runtime validation where untrusted input enters.
31
- 5. Run type checks and targeted tests before finishing.
29
+ 1. Confirm runtime and module target (Node, browser, edge) because compiler settings and polyfill requirements differ.
30
+ 2. Lock strict compiler baseline (`strict: true`) before feature work because weak defaults hide implicit `any`.
31
+ 3. Model domain types first with discriminated unions and `satisfies`/`as const`, then implement behavior — type design is the primary design feedback loop.
32
+ 4. Use `unknown` over `any` at boundaries because `any` silently defeats type checking.
33
+ 5. Narrow with type guards (`x is T`) instead of `as` assertions because guards provide runtime safety while assertions only silence the compiler.
34
+ 6. Encode state machines with discriminated unions and exhaustive `switch`/`assertNever` checks because unhandled variants become compile errors.
35
+ 7. Use schema validation (Zod/Valibot) for external input because runtime validation must match declared types at system boundaries.
36
+ 8. Keep public API types stable and explicit — do not rely on inferred return types for exported functions.
37
+ 9. Use project references (`composite: true` + `references`) for large repos because they enable incremental builds and cross-package type awareness.
38
+ 10. Keep barrel exports (`index.ts`) thin — re-export only the public API because deep barrels cause circular dependency pain and slow IDE resolution.
39
+ 11. Use `import type` for type-only imports because it prevents runtime import of type-only modules and improves tree-shaking.
40
+ 12. Use constrained generics to express input/output relationships — do not exceed 3 type parameters without splitting the abstraction.
41
+ 13. Prefer mapped types and template literal types for systematic type transformations — extract complex conditional types into named types for readability.
42
+ 14. Run `tsc --noEmit` in CI separately from bundling because type errors should fail CI even when the bundler succeeds.
43
+ 15. Use Biome or ESLint + `typescript-eslint` for linting; `tsup` for library builds; Vitest for tests with native TS support.
44
+ 16. Do not use library-facing `any` — it poisons downstream callers.
45
+ 17. Do not use broad `as` casts to silence errors — treat type errors as design feedback, not noise.
46
+ 18. Do not mix runtime and type-only imports carelessly — use `import type` consistently.
32
47
 
33
- ## Baseline standards
48
+ ## Output Format
34
49
 
35
- - Use `strict: true` and avoid opt-outs unless documented.
36
- - Prefer `unknown` over `any` at boundaries.
37
- - Use `satisfies` and `as const` for safer inference.
38
- - Keep public API types stable and explicit.
39
- - Use project references for large repos.
50
+ Provide type definitions, implementation code, and compiler configuration as fenced TypeScript code blocks. Include `tsconfig.json` excerpts when configuration changes are part of the solution. Explain type-level design decisions inline with brief comments.
40
51
 
41
- ## Implementation guidance
52
+ ## References
42
53
 
43
- - Encode state with discriminated unions.
44
- - Narrow with type guards instead of assertions.
45
- - Keep utility types readable; avoid type-level obfuscation.
46
- - Use schema validation (zod/valibot/etc.) for external input.
47
- - Treat type errors as design feedback, not noise.
54
+ | File | Load when |
55
+ | ------------------------------ | ---------------------------------------------------------------------------- |
56
+ | `references/configuration.md` | `tsconfig`, strictness, module targets, or project references need detail. |
57
+ | `references/advanced-types.md` | Generics, conditional types, mapped types, or template literals are central. |
58
+ | `references/type-guards.md` | Narrowing and runtime-safe type refinement need detail. |
59
+ | `references/utility-types.md` | Utility-type composition or shared helper types are in scope. |
60
+ | `references/patterns.md` | Type-safe architecture patterns or public API design needs detail. |
48
61
 
49
- ## Avoid
62
+ ## Scripts
50
63
 
51
- - Library-facing `any`.
52
- - Broad `as` casts to silence errors.
53
- - Hidden implicit `any` from weak tsconfig defaults.
54
- - Mixing runtime and type-only imports carelessly.
64
+ No helper scripts are required for this skill right now. Keep execution in `SKILL.md` and `references/` unless repeated automation becomes necessary.
55
65
 
56
- ## Reference files
66
+ ## Examples
57
67
 
58
- - `references/configuration.md`
59
- - `references/advanced-types.md`
60
- - `references/type-guards.md`
61
- - `references/utility-types.md`
62
- - `references/patterns.md`
68
+ - "Refactor this module to use strict TypeScript with discriminated unions for state"
69
+ - "Design a type-safe event system with template literal types"
70
+ - "Set up tsconfig project references for our monorepo"
71
+ - "Replace these `any` casts with proper type narrowing"
63
72
  ````
@@ -1,60 +1,69 @@
1
1
  ---
2
- name: "typescript-pro"
3
- description: "Use for TypeScript architecture and implementation with TS 5.9+ production baselines and TS 6/7 transition readiness."
2
+ name: typescript-pro
3
+ description: "Use for TypeScript architecture and implementation with TS 5.9+ production baselines and TS 6/7 transition readiness. Use when designing type-safe APIs, refactoring to strict TypeScript, reducing type regressions in monorepos, or preparing for TS 6/7 behavior shifts."
4
4
  license: MIT
5
5
  metadata:
6
- version: "2.0.0"
7
- domain: "language"
8
- role: "specialist"
9
- stack: "typescript"
10
- baseline: "TypeScript 5.9 stable"
11
- transition: "TypeScript 6 compatibility prep"
6
+ author: cubis-foundry
7
+ version: "3.0"
8
+ compatibility: Claude Code, Codex, GitHub Copilot
12
9
  ---
13
10
 
14
11
  # TypeScript Pro
15
12
 
16
- ## When to use
13
+ ## Purpose
14
+
15
+ Language-layer specialist for TypeScript architecture, type design, and production implementation. Provides the type-system foundation before loading framework skills like `nextjs-developer` or `nestjs-expert`. Covers strict compiler configuration, domain modeling with discriminated unions, generic patterns, module structure, and tooling selection for TS 5.9+ codebases with awareness of TS 6/7 transitions.
16
+
17
+ ## When to Use
17
18
 
18
19
  - Designing type-safe APIs and shared contracts.
19
20
  - Refactoring codebases to strict TypeScript.
20
21
  - Reducing type regressions in monorepos.
21
22
  - Preparing for upcoming TS 6/7 behavior shifts.
23
+ - Acting as the language-layer foundation before loading framework skills.
22
24
 
23
- ## Core workflow
25
+ ## Instructions
24
26
 
25
- 1. Confirm runtime and module target (Node, browser, edge).
26
- 2. Lock strict compiler baseline before feature work.
27
- 3. Model domain types first, then implement behavior.
28
- 4. Keep runtime validation where untrusted input enters.
29
- 5. Run type checks and targeted tests before finishing.
27
+ 1. Confirm runtime and module target (Node, browser, edge) because compiler settings and polyfill requirements differ.
28
+ 2. Lock strict compiler baseline (`strict: true`) before feature work because weak defaults hide implicit `any`.
29
+ 3. Model domain types first with discriminated unions and `satisfies`/`as const`, then implement behavior — type design is the primary design feedback loop.
30
+ 4. Use `unknown` over `any` at boundaries because `any` silently defeats type checking.
31
+ 5. Narrow with type guards (`x is T`) instead of `as` assertions because guards provide runtime safety while assertions only silence the compiler.
32
+ 6. Encode state machines with discriminated unions and exhaustive `switch`/`assertNever` checks because unhandled variants become compile errors.
33
+ 7. Use schema validation (Zod/Valibot) for external input because runtime validation must match declared types at system boundaries.
34
+ 8. Keep public API types stable and explicit — do not rely on inferred return types for exported functions.
35
+ 9. Use project references (`composite: true` + `references`) for large repos because they enable incremental builds and cross-package type awareness.
36
+ 10. Keep barrel exports (`index.ts`) thin — re-export only the public API because deep barrels cause circular dependency pain and slow IDE resolution.
37
+ 11. Use `import type` for type-only imports because it prevents runtime import of type-only modules and improves tree-shaking.
38
+ 12. Use constrained generics to express input/output relationships — do not exceed 3 type parameters without splitting the abstraction.
39
+ 13. Prefer mapped types and template literal types for systematic type transformations — extract complex conditional types into named types for readability.
40
+ 14. Run `tsc --noEmit` in CI separately from bundling because type errors should fail CI even when the bundler succeeds.
41
+ 15. Use Biome or ESLint + `typescript-eslint` for linting; `tsup` for library builds; Vitest for tests with native TS support.
42
+ 16. Do not use library-facing `any` — it poisons downstream callers.
43
+ 17. Do not use broad `as` casts to silence errors — treat type errors as design feedback, not noise.
44
+ 18. Do not mix runtime and type-only imports carelessly — use `import type` consistently.
30
45
 
31
- ## Baseline standards
46
+ ## Output Format
32
47
 
33
- - Use `strict: true` and avoid opt-outs unless documented.
34
- - Prefer `unknown` over `any` at boundaries.
35
- - Use `satisfies` and `as const` for safer inference.
36
- - Keep public API types stable and explicit.
37
- - Use project references for large repos.
48
+ Provide type definitions, implementation code, and compiler configuration as fenced TypeScript code blocks. Include `tsconfig.json` excerpts when configuration changes are part of the solution. Explain type-level design decisions inline with brief comments.
38
49
 
39
- ## Implementation guidance
50
+ ## References
40
51
 
41
- - Encode state with discriminated unions.
42
- - Narrow with type guards instead of assertions.
43
- - Keep utility types readable; avoid type-level obfuscation.
44
- - Use schema validation (zod/valibot/etc.) for external input.
45
- - Treat type errors as design feedback, not noise.
52
+ | File | Load when |
53
+ | ------------------------------ | ---------------------------------------------------------------------------- |
54
+ | `references/configuration.md` | `tsconfig`, strictness, module targets, or project references need detail. |
55
+ | `references/advanced-types.md` | Generics, conditional types, mapped types, or template literals are central. |
56
+ | `references/type-guards.md` | Narrowing and runtime-safe type refinement need detail. |
57
+ | `references/utility-types.md` | Utility-type composition or shared helper types are in scope. |
58
+ | `references/patterns.md` | Type-safe architecture patterns or public API design needs detail. |
46
59
 
47
- ## Avoid
60
+ ## Scripts
48
61
 
49
- - Library-facing `any`.
50
- - Broad `as` casts to silence errors.
51
- - Hidden implicit `any` from weak tsconfig defaults.
52
- - Mixing runtime and type-only imports carelessly.
62
+ No helper scripts are required for this skill right now. Keep execution in `SKILL.md` and `references/` unless repeated automation becomes necessary.
53
63
 
54
- ## Reference files
64
+ ## Examples
55
65
 
56
- - `references/configuration.md`
57
- - `references/advanced-types.md`
58
- - `references/type-guards.md`
59
- - `references/utility-types.md`
60
- - `references/patterns.md`
66
+ - "Refactor this module to use strict TypeScript with discriminated unions for state"
67
+ - "Design a type-safe event system with template literal types"
68
+ - "Set up tsconfig project references for our monorepo"
69
+ - "Replace these `any` casts with proper type narrowing"
@@ -0,0 +1,67 @@
1
+ ````markdown
2
+ ---
3
+ inclusion: manual
4
+ name: vitess
5
+ description: "Use when the task is specifically Vitess or Vitess-backed MySQL platforms: shard-key design, vindexes, resharding, query-routing constraints, Online DDL, and operational tradeoffs for horizontally scaled MySQL."
6
+ license: MIT
7
+ metadata:
8
+ author: cubis-foundry
9
+ version: "3.0"
10
+ compatibility: Claude Code, Codex, GitHub Copilot
11
+ ---
12
+
13
+ # Vitess
14
+
15
+ ## Purpose
16
+
17
+ Use when the task is specifically Vitess or Vitess-backed MySQL platforms: shard-key design, vindexes, resharding, query-routing constraints, Online DDL, and operational tradeoffs for horizontally scaled MySQL.
18
+
19
+ ## When to Use
20
+
21
+ - The engine is Vitess or a Vitess-backed managed MySQL platform.
22
+ - The problem depends on shard keys, vindexes, resharding, query routing, or Online DDL behavior.
23
+ - You need guidance for scaling MySQL horizontally rather than treating it like a single-node database.
24
+
25
+ ## Instructions
26
+
27
+ 1. Confirm whether the task is schema design, query shape, shard-key choice, or operational scaling.
28
+ 2. Make entity ownership and routing key choice explicit before optimizing anything else.
29
+ 3. Check whether queries respect shard boundaries and Vitess execution constraints.
30
+ 4. Plan Online DDL, resharding, and rollback with operational evidence.
31
+ 5. Report the coupling, fan-out, and migration risks that remain after the change.
32
+
33
+ ### Baseline standards
34
+
35
+ - Choose shard keys from access patterns and ownership, not convenience.
36
+ - Minimize cross-shard fan-out and hidden coordination costs.
37
+ - Treat Online DDL and resharding as operational programs, not single commands.
38
+ - Keep query routing constraints visible to application teams.
39
+
40
+ ### Constraints
41
+
42
+ - Avoid designing as if the database were a single-node MySQL instance.
43
+ - Avoid late shard-key decisions after application coupling hardens.
44
+ - Avoid cross-shard joins or transactions without explicit justification.
45
+ - Avoid treating Vitess complexity as free scale.
46
+
47
+ ## Output Format
48
+
49
+ Provide implementation guidance, code examples, and configuration as appropriate to the task.
50
+
51
+ ## References
52
+
53
+ Load on demand. Do not preload all reference files.
54
+
55
+ | File | Load when |
56
+ | --- | --- |
57
+ | `references/vitess-checklist.md` | You need deeper Vitess guidance for shard keys, vindexes, query routing, resharding, and Online DDL tradeoffs. |
58
+
59
+ ## Scripts
60
+
61
+ No helper scripts are required for this skill right now. Keep execution in `SKILL.md` and `references/` unless repeated automation becomes necessary.
62
+
63
+ ## Examples
64
+
65
+ - "Help me with vitess best practices in this project"
66
+ - "Review my vitess implementation for issues"
67
+ ````
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: vitess
3
+ description: "Use when the task is specifically Vitess or Vitess-backed MySQL platforms: shard-key design, vindexes, resharding, query-routing constraints, Online DDL, and operational tradeoffs for horizontally scaled MySQL."
4
+ license: MIT
5
+ metadata:
6
+ author: cubis-foundry
7
+ version: "3.0"
8
+ compatibility: Claude Code, Codex, GitHub Copilot
9
+ ---
10
+
11
+ # Vitess
12
+
13
+ ## Purpose
14
+
15
+ Use when the task is specifically Vitess or Vitess-backed MySQL platforms: shard-key design, vindexes, resharding, query-routing constraints, Online DDL, and operational tradeoffs for horizontally scaled MySQL.
16
+
17
+ ## When to Use
18
+
19
+ - The engine is Vitess or a Vitess-backed managed MySQL platform.
20
+ - The problem depends on shard keys, vindexes, resharding, query routing, or Online DDL behavior.
21
+ - You need guidance for scaling MySQL horizontally rather than treating it like a single-node database.
22
+
23
+ ## Instructions
24
+
25
+ 1. Confirm whether the task is schema design, query shape, shard-key choice, or operational scaling.
26
+ 2. Make entity ownership and routing key choice explicit before optimizing anything else.
27
+ 3. Check whether queries respect shard boundaries and Vitess execution constraints.
28
+ 4. Plan Online DDL, resharding, and rollback with operational evidence.
29
+ 5. Report the coupling, fan-out, and migration risks that remain after the change.
30
+
31
+ ### Baseline standards
32
+
33
+ - Choose shard keys from access patterns and ownership, not convenience.
34
+ - Minimize cross-shard fan-out and hidden coordination costs.
35
+ - Treat Online DDL and resharding as operational programs, not single commands.
36
+ - Keep query routing constraints visible to application teams.
37
+
38
+ ### Constraints
39
+
40
+ - Avoid designing as if the database were a single-node MySQL instance.
41
+ - Avoid late shard-key decisions after application coupling hardens.
42
+ - Avoid cross-shard joins or transactions without explicit justification.
43
+ - Avoid treating Vitess complexity as free scale.
44
+
45
+ ## Output Format
46
+
47
+ Provide implementation guidance, code examples, and configuration as appropriate to the task.
48
+
49
+ ## References
50
+
51
+ Load on demand. Do not preload all reference files.
52
+
53
+ | File | Load when |
54
+ | --- | --- |
55
+ | `references/vitess-checklist.md` | You need deeper Vitess guidance for shard keys, vindexes, query routing, resharding, and Online DDL tradeoffs. |
56
+
57
+ ## Scripts
58
+
59
+ No helper scripts are required for this skill right now. Keep execution in `SKILL.md` and `references/` unless repeated automation becomes necessary.
60
+
61
+ ## Examples
62
+
63
+ - "Help me with vitess best practices in this project"
64
+ - "Review my vitess implementation for issues"
@@ -0,0 +1,19 @@
1
+ # Vitess Checklist
2
+
3
+ Load this when sharded MySQL behavior is the real problem.
4
+
5
+ ## Routing and ownership
6
+
7
+ - Choose shard keys from access patterns and ownership boundaries.
8
+ - Keep cross-shard fan-out visible and minimized.
9
+ - Treat vindexes as application-shaping decisions, not low-level detail.
10
+
11
+ ## Query behavior
12
+
13
+ - Check whether queries respect shard routing constraints.
14
+ - Avoid assuming single-node MySQL semantics when the topology is distributed.
15
+
16
+ ## Operations
17
+
18
+ - Make Online DDL, resharding, and rollback operationally explicit.
19
+ - Keep coupling and migration risk visible to application teams.