@cubis/foundry 0.3.71 → 0.3.72

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 (270) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cli/core.js +4 -18
  3. package/dist/cli/core.js.map +1 -1
  4. package/package.json +1 -1
  5. package/src/cli/core.ts +4 -18
  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
@@ -1,269 +1,100 @@
1
1
  ---
2
2
  name: tailwind-patterns
3
- description: Tailwind CSS v4 principles. CSS-first configuration, container queries, modern patterns, design token architecture.
4
- allowed-tools: Read, Write, Edit, Glob, Grep
3
+ description: "Use for Tailwind CSS v4 architecture, CSS-first theme setup, utility composition, container-query usage, design-token hygiene, and dark-mode strategy."
4
+ license: MIT
5
+ metadata:
6
+ author: cubis-foundry
7
+ version: "4.0"
8
+ compatibility: Claude Code, Codex, GitHub Copilot
5
9
  ---
6
10
 
7
- # Tailwind CSS Patterns (v4 - 2025)
11
+ # Tailwind Patterns
8
12
 
9
- > Modern utility-first CSS with CSS-native configuration.
13
+ ## Purpose
10
14
 
11
- ---
12
-
13
- ## 1. Tailwind v4 Architecture
14
-
15
- ### What Changed from v3
16
-
17
- | v3 (Legacy) | v4 (Current) |
18
- |-------------|--------------|
19
- | `tailwind.config.js` | CSS-based `@theme` directive |
20
- | PostCSS plugin | Oxide engine (10x faster) |
21
- | JIT mode | Native, always-on |
22
- | Plugin system | CSS-native features |
23
- | `@apply` directive | Still works, discouraged |
24
-
25
- ### v4 Core Concepts
26
-
27
- | Concept | Description |
28
- |---------|-------------|
29
- | **CSS-first** | Configuration in CSS, not JavaScript |
30
- | **Oxide Engine** | Rust-based compiler, much faster |
31
- | **Native Nesting** | CSS nesting without PostCSS |
32
- | **CSS Variables** | All tokens exposed as `--*` vars |
33
-
34
- ---
35
-
36
- ## 2. CSS-Based Configuration
37
-
38
- ### Theme Definition
39
-
40
- ```
41
- @theme {
42
- /* Colors - use semantic names */
43
- --color-primary: oklch(0.7 0.15 250);
44
- --color-surface: oklch(0.98 0 0);
45
- --color-surface-dark: oklch(0.15 0 0);
46
-
47
- /* Spacing scale */
48
- --spacing-xs: 0.25rem;
49
- --spacing-sm: 0.5rem;
50
- --spacing-md: 1rem;
51
- --spacing-lg: 2rem;
52
-
53
- /* Typography */
54
- --font-sans: 'Inter', system-ui, sans-serif;
55
- --font-mono: 'JetBrains Mono', monospace;
56
- }
57
- ```
58
-
59
- ### When to Extend vs Override
60
-
61
- | Action | Use When |
62
- |--------|----------|
63
- | **Extend** | Adding new values alongside defaults |
64
- | **Override** | Replacing default scale entirely |
65
- | **Semantic tokens** | Project-specific naming (primary, surface) |
66
-
67
- ---
68
-
69
- ## 3. Container Queries (v4 Native)
70
-
71
- ### Breakpoint vs Container
72
-
73
- | Type | Responds To |
74
- |------|-------------|
75
- | **Breakpoint** (`md:`) | Viewport width |
76
- | **Container** (`@container`) | Parent element width |
77
-
78
- ### Container Query Usage
79
-
80
- | Pattern | Classes |
81
- |---------|---------|
82
- | Define container | `@container` on parent |
83
- | Container breakpoint | `@sm:`, `@md:`, `@lg:` on children |
84
- | Named containers | `@container/card` for specificity |
85
-
86
- ### When to Use
87
-
88
- | Scenario | Use |
89
- |----------|-----|
90
- | Page-level layouts | Viewport breakpoints |
91
- | Component-level responsive | Container queries |
92
- | Reusable components | Container queries (context-independent) |
93
-
94
- ---
95
-
96
- ## 4. Responsive Design
97
-
98
- ### Breakpoint System
99
-
100
- | Prefix | Min Width | Target |
101
- |--------|-----------|--------|
102
- | (none) | 0px | Mobile-first base |
103
- | `sm:` | 640px | Large phone / small tablet |
104
- | `md:` | 768px | Tablet |
105
- | `lg:` | 1024px | Laptop |
106
- | `xl:` | 1280px | Desktop |
107
- | `2xl:` | 1536px | Large desktop |
108
-
109
- ### Mobile-First Principle
110
-
111
- 1. Write mobile styles first (no prefix)
112
- 2. Add larger screen overrides with prefixes
113
- 3. Example: `w-full md:w-1/2 lg:w-1/3`
114
-
115
- ---
116
-
117
- ## 5. Dark Mode
118
-
119
- ### Configuration Strategies
120
-
121
- | Method | Behavior | Use When |
122
- |--------|----------|----------|
123
- | `class` | `.dark` class toggles | Manual theme switcher |
124
- | `media` | Follows system preference | No user control |
125
- | `selector` | Custom selector (v4) | Complex theming |
126
-
127
- ### Dark Mode Pattern
128
-
129
- | Element | Light | Dark |
130
- |---------|-------|------|
131
- | Background | `bg-white` | `dark:bg-zinc-900` |
132
- | Text | `text-zinc-900` | `dark:text-zinc-100` |
133
- | Borders | `border-zinc-200` | `dark:border-zinc-700` |
134
-
135
- ---
136
-
137
- ## 6. Modern Layout Patterns
138
-
139
- ### Flexbox Patterns
140
-
141
- | Pattern | Classes |
142
- |---------|---------|
143
- | Center (both axes) | `flex items-center justify-center` |
144
- | Vertical stack | `flex flex-col gap-4` |
145
- | Horizontal row | `flex gap-4` |
146
- | Space between | `flex justify-between items-center` |
147
- | Wrap grid | `flex flex-wrap gap-4` |
148
-
149
- ### Grid Patterns
150
-
151
- | Pattern | Classes |
152
- |---------|---------|
153
- | Auto-fit responsive | `grid grid-cols-[repeat(auto-fit,minmax(250px,1fr))]` |
154
- | Asymmetric (Bento) | `grid grid-cols-3 grid-rows-2` with spans |
155
- | Sidebar layout | `grid grid-cols-[auto_1fr]` |
156
-
157
- > **Note:** Prefer asymmetric/Bento layouts over symmetric 3-column grids.
158
-
159
- ---
160
-
161
- ## 7. Modern Color System
162
-
163
- ### OKLCH vs RGB/HSL
164
-
165
- | Format | Advantage |
166
- |--------|-----------|
167
- | **OKLCH** | Perceptually uniform, better for design |
168
- | **HSL** | Intuitive hue/saturation |
169
- | **RGB** | Legacy compatibility |
15
+ Use for Tailwind CSS v4 architecture, CSS-first theme setup, utility composition, container-query usage, design-token hygiene, and dark-mode strategy.
170
16
 
171
- ### Color Token Architecture
17
+ ## When to Use
172
18
 
173
- | Layer | Example | Purpose |
174
- |-------|---------|---------|
175
- | **Primitive** | `--blue-500` | Raw color values |
176
- | **Semantic** | `--color-primary` | Purpose-based naming |
177
- | **Component** | `--button-bg` | Component-specific |
19
+ - Building or refactoring Tailwind-based UI systems.
20
+ - Choosing theme token structure and CSS-first configuration.
21
+ - Applying container queries, responsive composition, and utility extraction.
22
+ - Reviewing class composition for maintainability and scale.
23
+ - Setting up dark mode, color-scheme toggling, or multi-theme systems.
24
+ - Optimizing Tailwind output for production bundle size.
178
25
 
179
- ---
26
+ ## Instructions
180
27
 
181
- ## 8. Typography System
28
+ 1. Confirm whether the codebase is truly Tailwind-first and which v4 features are active.
29
+ 2. Establish semantic tokens (color, spacing, type, radius) before piling on utilities.
30
+ 3. Define dark-mode and color-scheme strategy at the theme level, not per-component.
31
+ 4. Use responsive and container-query rules deliberately at the component boundary.
32
+ 5. Extract repeated patterns only when reuse and readability clearly improve.
33
+ 6. Verify the result stays readable, consistent, and easy to extend.
182
34
 
183
- ### Font Stack Pattern
35
+ ### Baseline standards
184
36
 
185
- | Type | Recommended |
186
- |------|-------------|
187
- | Sans | `'Inter', 'SF Pro', system-ui, sans-serif` |
188
- | Mono | `'JetBrains Mono', 'Fira Code', monospace` |
189
- | Display | `'Outfit', 'Poppins', sans-serif` |
37
+ - Prefer CSS-first theme and token definition in v4-era setups.
38
+ - Keep utility composition semantic at the component boundary.
39
+ - Use container queries for component context, not everything.
40
+ - Treat arbitrary values as exceptions, not the system.
41
+ - Keep spacing, typography, and color scales coherent.
42
+ - Define dark mode via `@custom-variant` or built-in `dark:` — never inline JavaScript toggling of raw classes.
43
+ - Use CSS custom properties for tokens that need runtime switching.
190
44
 
191
- ### Type Scale
45
+ ### Implementation guidance
192
46
 
193
- | Class | Size | Use |
194
- |-------|------|-----|
195
- | `text-xs` | 0.75rem | Labels, captions |
196
- | `text-sm` | 0.875rem | Secondary text |
197
- | `text-base` | 1rem | Body text |
198
- | `text-lg` | 1.125rem | Lead text |
199
- | `text-xl`+ | 1.25rem+ | Headings |
47
+ - Use `@theme` blocks to define design tokens as CSS custom properties.
48
+ - Prefer `@layer` directives to control specificity ordering.
49
+ - Use `@variant` for semantic state grouping (e.g., `@variant hover, focus-visible`).
50
+ - Keep component-level `@apply` usage to shared design-system primitives, not arbitrary shortcuts.
51
+ - Use `@container` at the component wrapper level with named containers for clarity.
52
+ - Compose responsive with container queries: responsive for page layout, container queries for component-internal layout.
200
53
 
201
- ---
54
+ ### Dark mode and theming
202
55
 
203
- ## 9. Animation & Transitions
56
+ - Define color tokens as HSL or OKLCH custom properties for easy theme switching.
57
+ - Use `@custom-variant dark` with a class or media-query strategy — pick one per project and enforce it.
58
+ - Keep contrast ratios WCAG AA minimum (4.5:1 text, 3:1 large text / UI).
59
+ - Test both themes with real content, not just color swatches.
204
60
 
205
- ### Built-in Animations
61
+ ### Performance and production
206
62
 
207
- | Class | Effect |
208
- |-------|--------|
209
- | `animate-spin` | Continuous rotation |
210
- | `animate-ping` | Attention pulse |
211
- | `animate-pulse` | Subtle opacity pulse |
212
- | `animate-bounce` | Bouncing effect |
63
+ - Purge unused styles by keeping utility usage in template files Tailwind can scan.
64
+ - Avoid dynamic class construction (`bg-${color}-500`) — Tailwind cannot detect these at build time.
65
+ - Keep `@apply` chains short long chains defeat tree-shaking.
66
+ - Use `content` configuration to limit scan scope in monorepos.
67
+ - Prefer targeted `@import` over importing the entire Tailwind base when only utilities are needed.
213
68
 
214
- ### Transition Patterns
69
+ ### Constraints
215
70
 
216
- | Pattern | Classes |
217
- |---------|---------|
218
- | All properties | `transition-all duration-200` |
219
- | Specific | `transition-colors duration-150` |
220
- | With easing | `ease-out` or `ease-in-out` |
221
- | Hover effect | `hover:scale-105 transition-transform` |
71
+ - Avoid dumping arbitrary values into every class list.
72
+ - Avoid mixing old config habits into a CSS-first setup without reason.
73
+ - Avoid repeating long class strings when a component or token should exist.
74
+ - Avoid styling choices that fight the design system instead of clarifying it.
75
+ - Avoid dynamic class name construction that breaks purge scanning.
76
+ - Avoid overriding Tailwind with inline styles or `!important` instead of fixing token conflicts.
77
+ - Avoid using `@apply` with responsive or state variants — compose those in the template.
222
78
 
223
- ---
79
+ ## Output Format
224
80
 
225
- ## 10. Component Extraction
81
+ Provide implementation guidance, code examples, and configuration as appropriate to the task.
226
82
 
227
- ### When to Extract
83
+ ## References
228
84
 
229
- | Signal | Action |
230
- |--------|--------|
231
- | Same class combo 3+ times | Extract component |
232
- | Complex state variants | Extract component |
233
- | Design system element | Extract + document |
85
+ Load on demand. Do not preload all reference files.
234
86
 
235
- ### Extraction Methods
87
+ | File | Load when |
88
+ | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
89
+ | `references/token-and-composition-checklist.md` | You need deeper Tailwind guidance for v4 token setup, utility composition, container queries, and class extraction rules. |
90
+ | `references/dark-mode-and-theming-guide.md` | The task involves dark mode setup, multi-theme systems, color-scheme toggling, or OKLCH token architecture. |
91
+ | `references/performance-and-purge-checklist.md` | The task involves production build optimization, bundle size reduction, or monorepo content configuration. |
236
92
 
237
- | Method | Use When |
238
- |--------|----------|
239
- | **React/Vue component** | Dynamic, JS needed |
240
- | **@apply in CSS** | Static, no JS needed |
241
- | **Design tokens** | Reusable values |
93
+ ## Scripts
242
94
 
243
- ---
95
+ No helper scripts are required for this skill right now. Keep execution in `SKILL.md` and `references/` unless repeated automation becomes necessary.
244
96
 
245
- ## 11. Anti-Patterns
246
-
247
- | Don't | Do |
248
- |-------|-----|
249
- | Arbitrary values everywhere | Use design system scale |
250
- | `!important` | Fix specificity properly |
251
- | Inline `style=` | Use utilities |
252
- | Duplicate long class lists | Extract component |
253
- | Mix v3 config with v4 | Migrate fully to CSS-first |
254
- | Use `@apply` heavily | Prefer components |
255
-
256
- ---
257
-
258
- ## 12. Performance Principles
259
-
260
- | Principle | Implementation |
261
- |-----------|----------------|
262
- | **Purge unused** | Automatic in v4 |
263
- | **Avoid dynamism** | No template string classes |
264
- | **Use Oxide** | Default in v4, 10x faster |
265
- | **Cache builds** | CI/CD caching |
266
-
267
- ---
97
+ ## Examples
268
98
 
269
- > **Remember:** Tailwind v4 is CSS-first. Embrace CSS variables, container queries, and native features. The config file is now optional.
99
+ - "Help me with tailwind patterns best practices in this project"
100
+ - "Review my tailwind patterns implementation for issues"
@@ -2,23 +2,168 @@
2
2
  ---
3
3
  inclusion: manual
4
4
  name: testing-patterns
5
- description: "Compatibility alias skill. Deprecated: use test-master."
5
+ description: Design test strategies with unit, integration, and e2e testing. Apply TDD, mocking, fixtures, coverage analysis, and test architecture best practices.
6
+ license: Apache-2.0
6
7
  metadata:
7
- deprecated: true
8
- replaced_by: test-master
9
- removal_target: v0.6.0
8
+ author: cubis-foundry
9
+ version: "3.0"
10
+ compatibility: Claude Code, Codex, GitHub Copilot, Gemini CLI
10
11
  ---
11
12
 
12
13
  # Testing Patterns
13
14
 
14
- ## Compatibility Alias
15
+ ## Purpose
15
16
 
16
- This skill is deprecated and kept for backward compatibility.
17
+ Guide test strategy, structure, and implementation across all testing levels. Covers unit, integration, and e2e testing patterns, TDD methodology, mocking strategies, and test architecture.
17
18
 
18
- Use `test-master` as the canonical skill.
19
+ ## When to Use
19
20
 
20
- ## Migration
21
+ - Writing tests for new features or bug fixes
22
+ - Designing a test strategy for a new project or module
23
+ - Debugging flaky or slow tests
24
+ - Reviewing test quality and coverage gaps
25
+ - Setting up test infrastructure (runners, fixtures, mocks)
26
+ - Deciding what level of testing is appropriate
21
27
 
22
- 1. Replace direct references to `testing-patterns` with `test-master`.
23
- 2. Apply the full workflow from `test-master` for new work.
28
+ ## Instructions
29
+
30
+ ### Step 1 — Choose the Right Test Level
31
+
32
+ | Level | Tests | Speed | Confidence | When to Use |
33
+ | ----------- | ---------------------------- | -------- | ---------------------------- | -------------------------------------------------- |
34
+ | Unit | Individual functions/classes | ms | Logic correctness | Pure logic, calculations, transformers |
35
+ | Integration | Module boundaries | 100ms–1s | Components work together | API routes, database queries, service interactions |
36
+ | E2E | Full user flows | 5–30s | System works as user expects | Critical paths (signup, checkout, deploy) |
37
+
38
+ **Testing Trophy** (preferred distribution):
39
+
40
+ - Many integration tests (highest ROI)
41
+ - Some unit tests (fast logic verification)
42
+ - Few e2e tests (critical paths only)
43
+ - Static analysis as the foundation (TypeScript, linting)
44
+
45
+ ### Step 2 — Write Effective Tests
46
+
47
+ **Structure every test as Arrange → Act → Assert**:
48
+
49
+ ```typescript
50
+ test("calculates total with tax", () => {
51
+ // Arrange
52
+ const items = [{ price: 100 }, { price: 200 }];
53
+ const taxRate = 0.1;
54
+
55
+ // Act
56
+ const total = calculateTotal(items, taxRate);
57
+
58
+ // Assert
59
+ expect(total).toBe(330);
60
+ });
61
+ ```
62
+
63
+ **Naming**: Use natural language that describes the behavior:
64
+
65
+ - DO: `"returns empty array when no items match filter"`
66
+ - DON'T: `"test filter"` or `"test1"`
67
+
68
+ **One assertion per behavior** (not per test):
69
+
70
+ - One test can have multiple `expect()` calls if they verify the same behavior
71
+ - Split separate behaviors into separate tests
72
+
73
+ ### Step 3 — Mock Strategically
74
+
75
+ **Mock at boundaries, not everywhere**:
76
+
77
+ - Mock: external APIs, databases, file system, time, randomness
78
+ - Don't mock: your own code, simple utilities, data transformations
79
+
80
+ **Mock patterns**:
81
+
82
+ ```typescript
83
+ // Dependency injection (preferred)
84
+ function createUserService(db: Database) {
85
+ return { getUser: (id) => db.query("SELECT...", [id]) };
86
+ }
87
+
88
+ // Module mocking (when DI not available)
89
+ vi.mock("./database", () => ({
90
+ query: vi.fn().mockResolvedValue([{ id: 1, name: "Alice" }]),
91
+ }));
92
+ ```
93
+
94
+ **Avoid**:
95
+
96
+ - Mocking implementation details (private methods, internal state)
97
+ - Over-mocking (if you mock everything, you're testing nothing)
98
+ - Snapshot tests for behavior (only for serialized output like HTML)
99
+
100
+ ### Step 4 — Handle Test Data
101
+
102
+ **Factories over fixtures**:
103
+
104
+ ```typescript
105
+ function createUser(overrides = {}) {
106
+ return {
107
+ id: crypto.randomUUID(),
108
+ name: "Test User",
109
+ email: "test@example.com",
110
+ role: "user",
111
+ ...overrides,
112
+ };
113
+ }
114
+
115
+ // Usage
116
+ const admin = createUser({ role: "admin" });
117
+ ```
118
+
119
+ **Test isolation**:
120
+
121
+ - Each test creates its own data (no shared mutable state)
122
+ - Clean up after integration tests (database, files)
123
+ - Use transactions for database tests (rollback after each test)
124
+
125
+ ### Step 5 — Fix Common Test Problems
126
+
127
+ **Flaky tests**:
128
+
129
+ - Remove timing dependencies (`setTimeout`, `sleep`)
130
+ - Use deterministic data (no `Math.random()` without seeding)
131
+ - Await all async operations properly
132
+ - Isolate external dependencies (mock network, use test databases)
133
+
134
+ **Slow tests**:
135
+
136
+ - Run in parallel when tests are isolated
137
+ - Use in-memory databases for integration tests
138
+ - Minimize e2e tests — push logic down to unit/integration
139
+ - Profile and fix the slowest 10% first
140
+
141
+ **Brittle tests**:
142
+
143
+ - Test behavior, not implementation
144
+ - Use accessible queries in UI tests (role, label — not CSS selectors)
145
+ - Avoid testing framework internals
146
+
147
+ ## Output Format
148
+
149
+ ```
150
+ ## Test Strategy
151
+ [approach and reasoning for test level choices]
152
+
153
+ ## Tests
154
+ [test code organized by describe blocks]
155
+
156
+ ## Coverage Notes
157
+ [what's tested, what's intentionally not tested, and why]
158
+ ```
159
+
160
+ ## Examples
161
+
162
+ **User**: "Write tests for this user registration function"
163
+
164
+ **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).
165
+
166
+ **User**: "Our test suite takes 20 minutes, help us speed it up"
167
+
168
+ **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.
24
169
  ````