@djm204/agent-skills 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (392) hide show
  1. package/README.md +597 -0
  2. package/bin/cli.js +8 -0
  3. package/package.json +55 -0
  4. package/src/index.js +1817 -0
  5. package/src/index.test.js +1264 -0
  6. package/templates/_shared/code-quality.mdc +52 -0
  7. package/templates/_shared/communication.mdc +43 -0
  8. package/templates/_shared/core-principles.mdc +67 -0
  9. package/templates/_shared/git-workflow.mdc +48 -0
  10. package/templates/_shared/security-fundamentals.mdc +41 -0
  11. package/templates/agents/utility-agent/.cursor/rules/action-control.mdc +71 -0
  12. package/templates/agents/utility-agent/.cursor/rules/context-management.mdc +61 -0
  13. package/templates/agents/utility-agent/.cursor/rules/hallucination-prevention.mdc +58 -0
  14. package/templates/agents/utility-agent/.cursor/rules/overview.mdc +34 -0
  15. package/templates/agents/utility-agent/.cursor/rules/token-optimization.mdc +71 -0
  16. package/templates/agents/utility-agent/CLAUDE.md +513 -0
  17. package/templates/business/market-intelligence/.cursor/rules/data-sources.mdc +62 -0
  18. package/templates/business/market-intelligence/.cursor/rules/overview.mdc +55 -0
  19. package/templates/business/market-intelligence/.cursor/rules/reporting.mdc +59 -0
  20. package/templates/business/market-intelligence/.cursor/rules/risk-signals.mdc +63 -0
  21. package/templates/business/market-intelligence/.cursor/rules/sentiment-analysis.mdc +70 -0
  22. package/templates/business/market-intelligence/.cursor/rules/trend-detection.mdc +72 -0
  23. package/templates/business/market-intelligence/CLAUDE.md +371 -0
  24. package/templates/business/marketing-expert/.cursor/rules/brand-strategy.mdc +74 -0
  25. package/templates/business/marketing-expert/.cursor/rules/campaign-planning.mdc +60 -0
  26. package/templates/business/marketing-expert/.cursor/rules/growth-frameworks.mdc +69 -0
  27. package/templates/business/marketing-expert/.cursor/rules/market-analysis.mdc +70 -0
  28. package/templates/business/marketing-expert/.cursor/rules/marketing-analytics.mdc +71 -0
  29. package/templates/business/marketing-expert/.cursor/rules/overview.mdc +56 -0
  30. package/templates/business/marketing-expert/CLAUDE.md +567 -0
  31. package/templates/business/predictive-maintenance/.cursor/rules/alerting.mdc +56 -0
  32. package/templates/business/predictive-maintenance/.cursor/rules/asset-lifecycle.mdc +71 -0
  33. package/templates/business/predictive-maintenance/.cursor/rules/failure-prediction.mdc +65 -0
  34. package/templates/business/predictive-maintenance/.cursor/rules/maintenance-scheduling.mdc +61 -0
  35. package/templates/business/predictive-maintenance/.cursor/rules/overview.mdc +55 -0
  36. package/templates/business/predictive-maintenance/.cursor/rules/sensor-analytics.mdc +66 -0
  37. package/templates/business/predictive-maintenance/CLAUDE.md +529 -0
  38. package/templates/business/product-manager/.cursor/rules/communication.mdc +77 -0
  39. package/templates/business/product-manager/.cursor/rules/discovery.mdc +79 -0
  40. package/templates/business/product-manager/.cursor/rules/metrics.mdc +75 -0
  41. package/templates/business/product-manager/.cursor/rules/overview.mdc +47 -0
  42. package/templates/business/product-manager/.cursor/rules/prioritization.mdc +66 -0
  43. package/templates/business/product-manager/.cursor/rules/requirements.mdc +79 -0
  44. package/templates/business/product-manager/CLAUDE.md +593 -0
  45. package/templates/business/project-manager/.cursor/rules/overview.mdc +53 -0
  46. package/templates/business/project-manager/.cursor/rules/reporting.mdc +68 -0
  47. package/templates/business/project-manager/.cursor/rules/risk-management.mdc +71 -0
  48. package/templates/business/project-manager/.cursor/rules/scheduling.mdc +67 -0
  49. package/templates/business/project-manager/.cursor/rules/scope-management.mdc +66 -0
  50. package/templates/business/project-manager/.cursor/rules/stakeholder-management.mdc +70 -0
  51. package/templates/business/project-manager/CLAUDE.md +540 -0
  52. package/templates/business/regulatory-sentinel/.cursor/rules/compliance-tracking.mdc +74 -0
  53. package/templates/business/regulatory-sentinel/.cursor/rules/impact-assessment.mdc +62 -0
  54. package/templates/business/regulatory-sentinel/.cursor/rules/monitoring.mdc +67 -0
  55. package/templates/business/regulatory-sentinel/.cursor/rules/overview.mdc +55 -0
  56. package/templates/business/regulatory-sentinel/.cursor/rules/reporting.mdc +61 -0
  57. package/templates/business/regulatory-sentinel/.cursor/rules/risk-classification.mdc +73 -0
  58. package/templates/business/regulatory-sentinel/CLAUDE.md +572 -0
  59. package/templates/business/resource-allocator/.cursor/rules/capacity-modeling.mdc +65 -0
  60. package/templates/business/resource-allocator/.cursor/rules/coordination.mdc +67 -0
  61. package/templates/business/resource-allocator/.cursor/rules/crisis-management.mdc +64 -0
  62. package/templates/business/resource-allocator/.cursor/rules/demand-prediction.mdc +52 -0
  63. package/templates/business/resource-allocator/.cursor/rules/overview.mdc +76 -0
  64. package/templates/business/resource-allocator/.cursor/rules/scheduling.mdc +63 -0
  65. package/templates/business/resource-allocator/CLAUDE.md +525 -0
  66. package/templates/business/strategic-negotiator/.cursor/rules/contract-analysis.mdc +60 -0
  67. package/templates/business/strategic-negotiator/.cursor/rules/deal-structuring.mdc +66 -0
  68. package/templates/business/strategic-negotiator/.cursor/rules/game-theory.mdc +64 -0
  69. package/templates/business/strategic-negotiator/.cursor/rules/overview.mdc +55 -0
  70. package/templates/business/strategic-negotiator/.cursor/rules/preparation.mdc +79 -0
  71. package/templates/business/strategic-negotiator/.cursor/rules/scenario-modeling.mdc +66 -0
  72. package/templates/business/strategic-negotiator/CLAUDE.md +640 -0
  73. package/templates/business/supply-chain/.cursor/rules/cost-modeling.mdc +67 -0
  74. package/templates/business/supply-chain/.cursor/rules/demand-forecasting.mdc +67 -0
  75. package/templates/business/supply-chain/.cursor/rules/inventory-management.mdc +69 -0
  76. package/templates/business/supply-chain/.cursor/rules/logistics.mdc +61 -0
  77. package/templates/business/supply-chain/.cursor/rules/overview.mdc +64 -0
  78. package/templates/business/supply-chain/.cursor/rules/supplier-evaluation.mdc +66 -0
  79. package/templates/business/supply-chain/CLAUDE.md +590 -0
  80. package/templates/business/supply-chain-harmonizer/.cursor/rules/disruption-response.mdc +67 -0
  81. package/templates/business/supply-chain-harmonizer/.cursor/rules/inventory-rebalancing.mdc +63 -0
  82. package/templates/business/supply-chain-harmonizer/.cursor/rules/overview.mdc +65 -0
  83. package/templates/business/supply-chain-harmonizer/.cursor/rules/rerouting.mdc +64 -0
  84. package/templates/business/supply-chain-harmonizer/.cursor/rules/scenario-simulation.mdc +68 -0
  85. package/templates/business/supply-chain-harmonizer/.cursor/rules/stakeholder-notifications.mdc +61 -0
  86. package/templates/business/supply-chain-harmonizer/CLAUDE.md +600 -0
  87. package/templates/creative/brand-guardian/.cursor/rules/brand-voice.mdc +64 -0
  88. package/templates/creative/brand-guardian/.cursor/rules/content-review.mdc +47 -0
  89. package/templates/creative/brand-guardian/.cursor/rules/ethical-guidelines.mdc +47 -0
  90. package/templates/creative/brand-guardian/.cursor/rules/multi-channel.mdc +49 -0
  91. package/templates/creative/brand-guardian/.cursor/rules/overview.mdc +58 -0
  92. package/templates/creative/brand-guardian/.cursor/rules/visual-identity.mdc +64 -0
  93. package/templates/creative/brand-guardian/CLAUDE.md +634 -0
  94. package/templates/creative/content-creation-expert/.cursor/rules/content-strategy.mdc +65 -0
  95. package/templates/creative/content-creation-expert/.cursor/rules/copywriting.mdc +59 -0
  96. package/templates/creative/content-creation-expert/.cursor/rules/editorial-operations.mdc +65 -0
  97. package/templates/creative/content-creation-expert/.cursor/rules/multimedia-production.mdc +64 -0
  98. package/templates/creative/content-creation-expert/.cursor/rules/overview.mdc +58 -0
  99. package/templates/creative/content-creation-expert/.cursor/rules/seo-content.mdc +75 -0
  100. package/templates/creative/content-creation-expert/CLAUDE.md +568 -0
  101. package/templates/creative/narrative-architect/.cursor/rules/collaboration.mdc +62 -0
  102. package/templates/creative/narrative-architect/.cursor/rules/continuity-tracking.mdc +56 -0
  103. package/templates/creative/narrative-architect/.cursor/rules/overview.mdc +68 -0
  104. package/templates/creative/narrative-architect/.cursor/rules/story-bible.mdc +77 -0
  105. package/templates/creative/narrative-architect/.cursor/rules/timeline-management.mdc +60 -0
  106. package/templates/creative/narrative-architect/.cursor/rules/world-building.mdc +78 -0
  107. package/templates/creative/narrative-architect/CLAUDE.md +737 -0
  108. package/templates/creative/social-media-expert/.cursor/rules/audience-growth.mdc +62 -0
  109. package/templates/creative/social-media-expert/.cursor/rules/community-management.mdc +67 -0
  110. package/templates/creative/social-media-expert/.cursor/rules/content-strategy.mdc +60 -0
  111. package/templates/creative/social-media-expert/.cursor/rules/overview.mdc +48 -0
  112. package/templates/creative/social-media-expert/.cursor/rules/platform-strategy.mdc +64 -0
  113. package/templates/creative/social-media-expert/.cursor/rules/social-analytics.mdc +64 -0
  114. package/templates/creative/social-media-expert/CLAUDE.md +624 -0
  115. package/templates/creative/trend-forecaster/.cursor/rules/cultural-analysis.mdc +59 -0
  116. package/templates/creative/trend-forecaster/.cursor/rules/forecasting-methods.mdc +63 -0
  117. package/templates/creative/trend-forecaster/.cursor/rules/overview.mdc +58 -0
  118. package/templates/creative/trend-forecaster/.cursor/rules/reporting.mdc +61 -0
  119. package/templates/creative/trend-forecaster/.cursor/rules/signal-analysis.mdc +74 -0
  120. package/templates/creative/trend-forecaster/.cursor/rules/trend-lifecycle.mdc +75 -0
  121. package/templates/creative/trend-forecaster/CLAUDE.md +717 -0
  122. package/templates/creative/ux-designer/.cursor/rules/accessibility.mdc +69 -0
  123. package/templates/creative/ux-designer/.cursor/rules/emotional-design.mdc +59 -0
  124. package/templates/creative/ux-designer/.cursor/rules/handoff.mdc +73 -0
  125. package/templates/creative/ux-designer/.cursor/rules/information-architecture.mdc +62 -0
  126. package/templates/creative/ux-designer/.cursor/rules/interaction-design.mdc +66 -0
  127. package/templates/creative/ux-designer/.cursor/rules/overview.mdc +61 -0
  128. package/templates/creative/ux-designer/.cursor/rules/research.mdc +61 -0
  129. package/templates/creative/ux-designer/.cursor/rules/visual-design.mdc +68 -0
  130. package/templates/creative/ux-designer/CLAUDE.md +124 -0
  131. package/templates/dogfood/project-overview.mdc +12 -0
  132. package/templates/dogfood/project-structure.mdc +82 -0
  133. package/templates/dogfood/rules-creation-best-practices.mdc +45 -0
  134. package/templates/education/educator/.cursor/rules/accessibility.mdc +67 -0
  135. package/templates/education/educator/.cursor/rules/assessment.mdc +68 -0
  136. package/templates/education/educator/.cursor/rules/curriculum.mdc +57 -0
  137. package/templates/education/educator/.cursor/rules/engagement.mdc +65 -0
  138. package/templates/education/educator/.cursor/rules/instructional-design.mdc +69 -0
  139. package/templates/education/educator/.cursor/rules/overview.mdc +57 -0
  140. package/templates/education/educator/.cursor/rules/retention.mdc +64 -0
  141. package/templates/education/educator/CLAUDE.md +338 -0
  142. package/templates/engineering/blockchain/.cursor/rules/defi-patterns.mdc +48 -0
  143. package/templates/engineering/blockchain/.cursor/rules/gas-optimization.mdc +77 -0
  144. package/templates/engineering/blockchain/.cursor/rules/overview.mdc +41 -0
  145. package/templates/engineering/blockchain/.cursor/rules/security.mdc +61 -0
  146. package/templates/engineering/blockchain/.cursor/rules/smart-contracts.mdc +64 -0
  147. package/templates/engineering/blockchain/.cursor/rules/testing.mdc +77 -0
  148. package/templates/engineering/blockchain/.cursor/rules/web3-integration.mdc +47 -0
  149. package/templates/engineering/blockchain/CLAUDE.md +389 -0
  150. package/templates/engineering/cli-tools/.cursor/rules/architecture.mdc +76 -0
  151. package/templates/engineering/cli-tools/.cursor/rules/arguments.mdc +65 -0
  152. package/templates/engineering/cli-tools/.cursor/rules/distribution.mdc +40 -0
  153. package/templates/engineering/cli-tools/.cursor/rules/error-handling.mdc +67 -0
  154. package/templates/engineering/cli-tools/.cursor/rules/overview.mdc +58 -0
  155. package/templates/engineering/cli-tools/.cursor/rules/testing.mdc +42 -0
  156. package/templates/engineering/cli-tools/.cursor/rules/user-experience.mdc +43 -0
  157. package/templates/engineering/cli-tools/CLAUDE.md +356 -0
  158. package/templates/engineering/data-engineering/.cursor/rules/data-modeling.mdc +71 -0
  159. package/templates/engineering/data-engineering/.cursor/rules/data-quality.mdc +78 -0
  160. package/templates/engineering/data-engineering/.cursor/rules/overview.mdc +49 -0
  161. package/templates/engineering/data-engineering/.cursor/rules/performance.mdc +71 -0
  162. package/templates/engineering/data-engineering/.cursor/rules/pipeline-design.mdc +79 -0
  163. package/templates/engineering/data-engineering/.cursor/rules/security.mdc +79 -0
  164. package/templates/engineering/data-engineering/.cursor/rules/testing.mdc +75 -0
  165. package/templates/engineering/data-engineering/CLAUDE.md +974 -0
  166. package/templates/engineering/devops-sre/.cursor/rules/capacity-planning.mdc +49 -0
  167. package/templates/engineering/devops-sre/.cursor/rules/change-management.mdc +51 -0
  168. package/templates/engineering/devops-sre/.cursor/rules/chaos-engineering.mdc +50 -0
  169. package/templates/engineering/devops-sre/.cursor/rules/disaster-recovery.mdc +54 -0
  170. package/templates/engineering/devops-sre/.cursor/rules/incident-management.mdc +56 -0
  171. package/templates/engineering/devops-sre/.cursor/rules/observability.mdc +50 -0
  172. package/templates/engineering/devops-sre/.cursor/rules/overview.mdc +76 -0
  173. package/templates/engineering/devops-sre/.cursor/rules/postmortems.mdc +49 -0
  174. package/templates/engineering/devops-sre/.cursor/rules/runbooks.mdc +49 -0
  175. package/templates/engineering/devops-sre/.cursor/rules/slo-sli.mdc +46 -0
  176. package/templates/engineering/devops-sre/.cursor/rules/toil-reduction.mdc +52 -0
  177. package/templates/engineering/devops-sre/CLAUDE.md +1007 -0
  178. package/templates/engineering/fullstack/.cursor/rules/api-contracts.mdc +79 -0
  179. package/templates/engineering/fullstack/.cursor/rules/architecture.mdc +79 -0
  180. package/templates/engineering/fullstack/.cursor/rules/overview.mdc +61 -0
  181. package/templates/engineering/fullstack/.cursor/rules/shared-types.mdc +77 -0
  182. package/templates/engineering/fullstack/.cursor/rules/testing.mdc +72 -0
  183. package/templates/engineering/fullstack/CLAUDE.md +349 -0
  184. package/templates/engineering/ml-ai/.cursor/rules/data-engineering.mdc +71 -0
  185. package/templates/engineering/ml-ai/.cursor/rules/deployment.mdc +43 -0
  186. package/templates/engineering/ml-ai/.cursor/rules/model-development.mdc +44 -0
  187. package/templates/engineering/ml-ai/.cursor/rules/monitoring.mdc +45 -0
  188. package/templates/engineering/ml-ai/.cursor/rules/overview.mdc +42 -0
  189. package/templates/engineering/ml-ai/.cursor/rules/security.mdc +51 -0
  190. package/templates/engineering/ml-ai/.cursor/rules/testing.mdc +44 -0
  191. package/templates/engineering/ml-ai/CLAUDE.md +1136 -0
  192. package/templates/engineering/mobile/.cursor/rules/navigation.mdc +75 -0
  193. package/templates/engineering/mobile/.cursor/rules/offline-first.mdc +68 -0
  194. package/templates/engineering/mobile/.cursor/rules/overview.mdc +76 -0
  195. package/templates/engineering/mobile/.cursor/rules/performance.mdc +78 -0
  196. package/templates/engineering/mobile/.cursor/rules/testing.mdc +77 -0
  197. package/templates/engineering/mobile/CLAUDE.md +233 -0
  198. package/templates/engineering/platform-engineering/.cursor/rules/ci-cd.mdc +51 -0
  199. package/templates/engineering/platform-engineering/.cursor/rules/developer-experience.mdc +48 -0
  200. package/templates/engineering/platform-engineering/.cursor/rules/infrastructure-as-code.mdc +62 -0
  201. package/templates/engineering/platform-engineering/.cursor/rules/kubernetes.mdc +51 -0
  202. package/templates/engineering/platform-engineering/.cursor/rules/observability.mdc +52 -0
  203. package/templates/engineering/platform-engineering/.cursor/rules/overview.mdc +44 -0
  204. package/templates/engineering/platform-engineering/.cursor/rules/security.mdc +74 -0
  205. package/templates/engineering/platform-engineering/.cursor/rules/testing.mdc +59 -0
  206. package/templates/engineering/platform-engineering/CLAUDE.md +850 -0
  207. package/templates/engineering/qa-engineering/.cursor/rules/automation.mdc +71 -0
  208. package/templates/engineering/qa-engineering/.cursor/rules/metrics.mdc +68 -0
  209. package/templates/engineering/qa-engineering/.cursor/rules/overview.mdc +45 -0
  210. package/templates/engineering/qa-engineering/.cursor/rules/quality-gates.mdc +54 -0
  211. package/templates/engineering/qa-engineering/.cursor/rules/test-design.mdc +59 -0
  212. package/templates/engineering/qa-engineering/.cursor/rules/test-strategy.mdc +62 -0
  213. package/templates/engineering/qa-engineering/CLAUDE.md +726 -0
  214. package/templates/engineering/testing/.cursor/rules/advanced-techniques.mdc +44 -0
  215. package/templates/engineering/testing/.cursor/rules/ci-cd-integration.mdc +43 -0
  216. package/templates/engineering/testing/.cursor/rules/overview.mdc +61 -0
  217. package/templates/engineering/testing/.cursor/rules/performance-testing.mdc +39 -0
  218. package/templates/engineering/testing/.cursor/rules/quality-metrics.mdc +74 -0
  219. package/templates/engineering/testing/.cursor/rules/reliability.mdc +39 -0
  220. package/templates/engineering/testing/.cursor/rules/tdd-methodology.mdc +52 -0
  221. package/templates/engineering/testing/.cursor/rules/test-data.mdc +46 -0
  222. package/templates/engineering/testing/.cursor/rules/test-design.mdc +45 -0
  223. package/templates/engineering/testing/.cursor/rules/test-types.mdc +71 -0
  224. package/templates/engineering/testing/CLAUDE.md +1134 -0
  225. package/templates/engineering/unity-dev-expert/.cursor/rules/csharp-architecture.mdc +61 -0
  226. package/templates/engineering/unity-dev-expert/.cursor/rules/multiplayer-networking.mdc +67 -0
  227. package/templates/engineering/unity-dev-expert/.cursor/rules/overview.mdc +56 -0
  228. package/templates/engineering/unity-dev-expert/.cursor/rules/performance-optimization.mdc +76 -0
  229. package/templates/engineering/unity-dev-expert/.cursor/rules/physics-rendering.mdc +59 -0
  230. package/templates/engineering/unity-dev-expert/.cursor/rules/ui-systems.mdc +59 -0
  231. package/templates/engineering/unity-dev-expert/CLAUDE.md +534 -0
  232. package/templates/engineering/web-backend/.cursor/rules/api-design.mdc +64 -0
  233. package/templates/engineering/web-backend/.cursor/rules/authentication.mdc +69 -0
  234. package/templates/engineering/web-backend/.cursor/rules/database-patterns.mdc +73 -0
  235. package/templates/engineering/web-backend/.cursor/rules/error-handling.mdc +66 -0
  236. package/templates/engineering/web-backend/.cursor/rules/overview.mdc +74 -0
  237. package/templates/engineering/web-backend/.cursor/rules/security.mdc +60 -0
  238. package/templates/engineering/web-backend/.cursor/rules/testing.mdc +74 -0
  239. package/templates/engineering/web-backend/CLAUDE.md +366 -0
  240. package/templates/engineering/web-frontend/.cursor/rules/accessibility.mdc +75 -0
  241. package/templates/engineering/web-frontend/.cursor/rules/component-patterns.mdc +76 -0
  242. package/templates/engineering/web-frontend/.cursor/rules/overview.mdc +77 -0
  243. package/templates/engineering/web-frontend/.cursor/rules/performance.mdc +73 -0
  244. package/templates/engineering/web-frontend/.cursor/rules/state-management.mdc +71 -0
  245. package/templates/engineering/web-frontend/.cursor/rules/styling.mdc +69 -0
  246. package/templates/engineering/web-frontend/.cursor/rules/testing.mdc +75 -0
  247. package/templates/engineering/web-frontend/CLAUDE.md +399 -0
  248. package/templates/languages/cpp-expert/.cursor/rules/concurrency.mdc +68 -0
  249. package/templates/languages/cpp-expert/.cursor/rules/error-handling.mdc +65 -0
  250. package/templates/languages/cpp-expert/.cursor/rules/memory-and-ownership.mdc +68 -0
  251. package/templates/languages/cpp-expert/.cursor/rules/modern-cpp.mdc +75 -0
  252. package/templates/languages/cpp-expert/.cursor/rules/overview.mdc +37 -0
  253. package/templates/languages/cpp-expert/.cursor/rules/performance.mdc +74 -0
  254. package/templates/languages/cpp-expert/.cursor/rules/testing.mdc +70 -0
  255. package/templates/languages/cpp-expert/.cursor/rules/tooling.mdc +77 -0
  256. package/templates/languages/cpp-expert/CLAUDE.md +242 -0
  257. package/templates/languages/csharp-expert/.cursor/rules/aspnet-core.mdc +78 -0
  258. package/templates/languages/csharp-expert/.cursor/rules/async-patterns.mdc +71 -0
  259. package/templates/languages/csharp-expert/.cursor/rules/dependency-injection.mdc +76 -0
  260. package/templates/languages/csharp-expert/.cursor/rules/error-handling.mdc +65 -0
  261. package/templates/languages/csharp-expert/.cursor/rules/language-features.mdc +74 -0
  262. package/templates/languages/csharp-expert/.cursor/rules/overview.mdc +47 -0
  263. package/templates/languages/csharp-expert/.cursor/rules/performance.mdc +66 -0
  264. package/templates/languages/csharp-expert/.cursor/rules/testing.mdc +78 -0
  265. package/templates/languages/csharp-expert/.cursor/rules/tooling.mdc +78 -0
  266. package/templates/languages/csharp-expert/CLAUDE.md +360 -0
  267. package/templates/languages/golang-expert/.cursor/rules/concurrency.mdc +79 -0
  268. package/templates/languages/golang-expert/.cursor/rules/error-handling.mdc +77 -0
  269. package/templates/languages/golang-expert/.cursor/rules/interfaces-and-types.mdc +77 -0
  270. package/templates/languages/golang-expert/.cursor/rules/overview.mdc +74 -0
  271. package/templates/languages/golang-expert/.cursor/rules/performance.mdc +76 -0
  272. package/templates/languages/golang-expert/.cursor/rules/production-patterns.mdc +76 -0
  273. package/templates/languages/golang-expert/.cursor/rules/stdlib-and-tooling.mdc +68 -0
  274. package/templates/languages/golang-expert/.cursor/rules/testing.mdc +77 -0
  275. package/templates/languages/golang-expert/CLAUDE.md +361 -0
  276. package/templates/languages/java-expert/.cursor/rules/concurrency.mdc +69 -0
  277. package/templates/languages/java-expert/.cursor/rules/error-handling.mdc +70 -0
  278. package/templates/languages/java-expert/.cursor/rules/modern-java.mdc +74 -0
  279. package/templates/languages/java-expert/.cursor/rules/overview.mdc +42 -0
  280. package/templates/languages/java-expert/.cursor/rules/performance.mdc +69 -0
  281. package/templates/languages/java-expert/.cursor/rules/persistence.mdc +74 -0
  282. package/templates/languages/java-expert/.cursor/rules/spring-boot.mdc +73 -0
  283. package/templates/languages/java-expert/.cursor/rules/testing.mdc +79 -0
  284. package/templates/languages/java-expert/.cursor/rules/tooling.mdc +76 -0
  285. package/templates/languages/java-expert/CLAUDE.md +325 -0
  286. package/templates/languages/javascript-expert/.cursor/rules/language-deep-dive.mdc +74 -0
  287. package/templates/languages/javascript-expert/.cursor/rules/node-patterns.mdc +77 -0
  288. package/templates/languages/javascript-expert/.cursor/rules/overview.mdc +66 -0
  289. package/templates/languages/javascript-expert/.cursor/rules/performance.mdc +64 -0
  290. package/templates/languages/javascript-expert/.cursor/rules/react-patterns.mdc +70 -0
  291. package/templates/languages/javascript-expert/.cursor/rules/testing.mdc +76 -0
  292. package/templates/languages/javascript-expert/.cursor/rules/tooling.mdc +72 -0
  293. package/templates/languages/javascript-expert/.cursor/rules/typescript-deep-dive.mdc +77 -0
  294. package/templates/languages/javascript-expert/CLAUDE.md +479 -0
  295. package/templates/languages/kotlin-expert/.cursor/rules/coroutines.mdc +75 -0
  296. package/templates/languages/kotlin-expert/.cursor/rules/error-handling.mdc +69 -0
  297. package/templates/languages/kotlin-expert/.cursor/rules/frameworks.mdc +76 -0
  298. package/templates/languages/kotlin-expert/.cursor/rules/language-features.mdc +78 -0
  299. package/templates/languages/kotlin-expert/.cursor/rules/overview.mdc +38 -0
  300. package/templates/languages/kotlin-expert/.cursor/rules/performance.mdc +73 -0
  301. package/templates/languages/kotlin-expert/.cursor/rules/testing.mdc +70 -0
  302. package/templates/languages/kotlin-expert/.cursor/rules/tooling.mdc +67 -0
  303. package/templates/languages/kotlin-expert/CLAUDE.md +276 -0
  304. package/templates/languages/python-expert/.cursor/rules/async-python.mdc +71 -0
  305. package/templates/languages/python-expert/.cursor/rules/overview.mdc +76 -0
  306. package/templates/languages/python-expert/.cursor/rules/patterns-and-idioms.mdc +77 -0
  307. package/templates/languages/python-expert/.cursor/rules/performance.mdc +74 -0
  308. package/templates/languages/python-expert/.cursor/rules/testing.mdc +77 -0
  309. package/templates/languages/python-expert/.cursor/rules/tooling.mdc +77 -0
  310. package/templates/languages/python-expert/.cursor/rules/type-system.mdc +77 -0
  311. package/templates/languages/python-expert/.cursor/rules/web-and-apis.mdc +76 -0
  312. package/templates/languages/python-expert/CLAUDE.md +264 -0
  313. package/templates/languages/ruby-expert/.cursor/rules/concurrency-and-threading.mdc +65 -0
  314. package/templates/languages/ruby-expert/.cursor/rules/error-handling.mdc +69 -0
  315. package/templates/languages/ruby-expert/.cursor/rules/idioms-and-style.mdc +76 -0
  316. package/templates/languages/ruby-expert/.cursor/rules/overview.mdc +60 -0
  317. package/templates/languages/ruby-expert/.cursor/rules/performance.mdc +68 -0
  318. package/templates/languages/ruby-expert/.cursor/rules/rails-and-frameworks.mdc +60 -0
  319. package/templates/languages/ruby-expert/.cursor/rules/testing.mdc +56 -0
  320. package/templates/languages/ruby-expert/.cursor/rules/tooling.mdc +52 -0
  321. package/templates/languages/ruby-expert/CLAUDE.md +102 -0
  322. package/templates/languages/rust-expert/.cursor/rules/concurrency.mdc +69 -0
  323. package/templates/languages/rust-expert/.cursor/rules/ecosystem-and-tooling.mdc +76 -0
  324. package/templates/languages/rust-expert/.cursor/rules/error-handling.mdc +76 -0
  325. package/templates/languages/rust-expert/.cursor/rules/overview.mdc +62 -0
  326. package/templates/languages/rust-expert/.cursor/rules/ownership-and-borrowing.mdc +70 -0
  327. package/templates/languages/rust-expert/.cursor/rules/performance-and-unsafe.mdc +70 -0
  328. package/templates/languages/rust-expert/.cursor/rules/testing.mdc +73 -0
  329. package/templates/languages/rust-expert/.cursor/rules/traits-and-generics.mdc +76 -0
  330. package/templates/languages/rust-expert/CLAUDE.md +283 -0
  331. package/templates/languages/swift-expert/.cursor/rules/concurrency.mdc +77 -0
  332. package/templates/languages/swift-expert/.cursor/rules/error-handling.mdc +76 -0
  333. package/templates/languages/swift-expert/.cursor/rules/language-features.mdc +78 -0
  334. package/templates/languages/swift-expert/.cursor/rules/overview.mdc +46 -0
  335. package/templates/languages/swift-expert/.cursor/rules/performance.mdc +69 -0
  336. package/templates/languages/swift-expert/.cursor/rules/swiftui.mdc +77 -0
  337. package/templates/languages/swift-expert/.cursor/rules/testing.mdc +75 -0
  338. package/templates/languages/swift-expert/.cursor/rules/tooling.mdc +77 -0
  339. package/templates/languages/swift-expert/CLAUDE.md +275 -0
  340. package/templates/professional/documentation/.cursor/rules/adr.mdc +65 -0
  341. package/templates/professional/documentation/.cursor/rules/api-documentation.mdc +64 -0
  342. package/templates/professional/documentation/.cursor/rules/code-comments.mdc +75 -0
  343. package/templates/professional/documentation/.cursor/rules/maintenance.mdc +58 -0
  344. package/templates/professional/documentation/.cursor/rules/overview.mdc +48 -0
  345. package/templates/professional/documentation/.cursor/rules/readme-standards.mdc +70 -0
  346. package/templates/professional/documentation/CLAUDE.md +120 -0
  347. package/templates/professional/executive-assistant/.cursor/rules/calendar.mdc +51 -0
  348. package/templates/professional/executive-assistant/.cursor/rules/confidentiality.mdc +53 -0
  349. package/templates/professional/executive-assistant/.cursor/rules/email.mdc +49 -0
  350. package/templates/professional/executive-assistant/.cursor/rules/meetings.mdc +39 -0
  351. package/templates/professional/executive-assistant/.cursor/rules/overview.mdc +42 -0
  352. package/templates/professional/executive-assistant/.cursor/rules/prioritization.mdc +48 -0
  353. package/templates/professional/executive-assistant/.cursor/rules/stakeholder-management.mdc +50 -0
  354. package/templates/professional/executive-assistant/.cursor/rules/travel.mdc +43 -0
  355. package/templates/professional/executive-assistant/CLAUDE.md +620 -0
  356. package/templates/professional/grant-writer/.cursor/rules/budgets.mdc +55 -0
  357. package/templates/professional/grant-writer/.cursor/rules/compliance.mdc +47 -0
  358. package/templates/professional/grant-writer/.cursor/rules/funding-research.mdc +47 -0
  359. package/templates/professional/grant-writer/.cursor/rules/narrative.mdc +58 -0
  360. package/templates/professional/grant-writer/.cursor/rules/overview.mdc +68 -0
  361. package/templates/professional/grant-writer/.cursor/rules/post-award.mdc +59 -0
  362. package/templates/professional/grant-writer/.cursor/rules/review-criteria.mdc +51 -0
  363. package/templates/professional/grant-writer/.cursor/rules/sustainability.mdc +48 -0
  364. package/templates/professional/grant-writer/CLAUDE.md +577 -0
  365. package/templates/professional/knowledge-synthesis/.cursor/rules/document-management.mdc +51 -0
  366. package/templates/professional/knowledge-synthesis/.cursor/rules/knowledge-graphs.mdc +63 -0
  367. package/templates/professional/knowledge-synthesis/.cursor/rules/overview.mdc +74 -0
  368. package/templates/professional/knowledge-synthesis/.cursor/rules/research-workflow.mdc +50 -0
  369. package/templates/professional/knowledge-synthesis/.cursor/rules/search-retrieval.mdc +62 -0
  370. package/templates/professional/knowledge-synthesis/.cursor/rules/summarization.mdc +61 -0
  371. package/templates/professional/knowledge-synthesis/CLAUDE.md +593 -0
  372. package/templates/professional/life-logistics/.cursor/rules/financial-optimization.mdc +78 -0
  373. package/templates/professional/life-logistics/.cursor/rules/negotiation.mdc +68 -0
  374. package/templates/professional/life-logistics/.cursor/rules/overview.mdc +75 -0
  375. package/templates/professional/life-logistics/.cursor/rules/research-methodology.mdc +76 -0
  376. package/templates/professional/life-logistics/.cursor/rules/scheduling.mdc +68 -0
  377. package/templates/professional/life-logistics/.cursor/rules/task-management.mdc +47 -0
  378. package/templates/professional/life-logistics/CLAUDE.md +601 -0
  379. package/templates/professional/research-assistant/.cursor/rules/citation-attribution.mdc +61 -0
  380. package/templates/professional/research-assistant/.cursor/rules/information-synthesis.mdc +65 -0
  381. package/templates/professional/research-assistant/.cursor/rules/overview.mdc +56 -0
  382. package/templates/professional/research-assistant/.cursor/rules/research-methodologies.mdc +54 -0
  383. package/templates/professional/research-assistant/.cursor/rules/search-strategies.mdc +57 -0
  384. package/templates/professional/research-assistant/.cursor/rules/source-evaluation.mdc +59 -0
  385. package/templates/professional/research-assistant/CLAUDE.md +318 -0
  386. package/templates/professional/wellness-orchestrator/.cursor/rules/adaptive-planning.mdc +69 -0
  387. package/templates/professional/wellness-orchestrator/.cursor/rules/data-integration.mdc +60 -0
  388. package/templates/professional/wellness-orchestrator/.cursor/rules/fitness-programming.mdc +66 -0
  389. package/templates/professional/wellness-orchestrator/.cursor/rules/nutrition-planning.mdc +57 -0
  390. package/templates/professional/wellness-orchestrator/.cursor/rules/overview.mdc +76 -0
  391. package/templates/professional/wellness-orchestrator/.cursor/rules/sleep-optimization.mdc +68 -0
  392. package/templates/professional/wellness-orchestrator/CLAUDE.md +573 -0
@@ -0,0 +1,76 @@
1
+ ---
2
+ description: JavaScript Testing
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # JavaScript Testing
7
+
8
+ - Tests are production code — same quality standards
9
+ - Test behavior and contracts, never implementation details
10
+ - Every bug fix starts with a failing test
11
+ - If it's hard to test, the design is wrong
12
+
13
+ ## Unit Tests
14
+
15
+ ```typescript
16
+ describe('clamp', () => {
17
+ it('returns value when within range', () => { expect(clamp(5, 0, 10)).toBe(5); });
18
+ it('returns min when below range', () => { expect(clamp(-5, 0, 10)).toBe(0); });
19
+ it('returns max when above range', () => { expect(clamp(15, 0, 10)).toBe(10); });
20
+ });
21
+
22
+ // Parameterized
23
+ it.each([
24
+ ['Hello World', 'hello-world'],
25
+ ['Special!@#Chars', 'specialchars'],
26
+ ])('slugify "%s" → "%s"', (input, expected) => { expect(slugify(input)).toBe(expected); });
27
+ ```
28
+
29
+ ## Component Tests
30
+
31
+ ```tsx
32
+ import { render, screen } from '@testing-library/react';
33
+ import userEvent from '@testing-library/user-event';
34
+
35
+ it('adds a new todo when form is submitted', async () => {
36
+ const user = userEvent.setup();
37
+ render(<TodoList />);
38
+ await user.type(screen.getByRole('textbox', { name: /new todo/i }), 'Buy milk');
39
+ await user.click(screen.getByRole('button', { name: /add/i }));
40
+ expect(screen.getByText('Buy milk')).toBeInTheDocument();
41
+ });
42
+ ```
43
+
44
+ ## Mocking (MSW for APIs)
45
+
46
+ ```typescript
47
+ import { http, HttpResponse } from 'msw';
48
+ import { setupServer } from 'msw/node';
49
+ const server = setupServer(
50
+ http.get('/api/users/:id', ({ params }) => HttpResponse.json({ id: params.id, name: 'Test' })),
51
+ );
52
+ beforeAll(() => server.listen({ onUnhandledRequest: 'error' }));
53
+ afterEach(() => server.resetHandlers());
54
+ afterAll(() => server.close());
55
+ ```
56
+
57
+ - Mock at boundaries (HTTP, DB), not internals — if you need to mock internals, redesign
58
+ - Use dependency injection for testability
59
+
60
+ ## E2E Tests (Playwright)
61
+
62
+ ```typescript
63
+ test('login flow', async ({ page }) => {
64
+ await page.goto('/login');
65
+ await page.getByLabel('Email').fill('user@example.com');
66
+ await page.getByLabel('Password').fill('password');
67
+ await page.getByRole('button', { name: 'Sign in' }).click();
68
+ await expect(page).toHaveURL('/dashboard');
69
+ });
70
+ ```
71
+
72
+ ## Anti-Patterns
73
+
74
+ - Never test implementation details (internal state, class names)
75
+ - Never `setTimeout` for waiting — use `waitFor` or `findBy`
76
+ - Never let tests depend on execution order; never ignore flaky tests
@@ -0,0 +1,72 @@
1
+ ---
2
+ description: JavaScript Tooling
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # JavaScript Tooling
7
+
8
+ Modern JavaScript tooling configuration and best practices.
9
+
10
+ ## TypeScript Configuration
11
+
12
+ ```jsonc
13
+ {
14
+ "compilerOptions": {
15
+ "strict": true,
16
+ "noUncheckedIndexedAccess": true,
17
+ "exactOptionalPropertyTypes": true,
18
+ "verbatimModuleSyntax": true,
19
+ "isolatedModules": true,
20
+ "moduleResolution": "bundler",
21
+ "module": "ESNext",
22
+ "target": "ES2022"
23
+ }
24
+ }
25
+ ```
26
+
27
+ ## Package Management
28
+
29
+ - `"type": "module"` in package.json, `"engines": { "node": ">=20" }`
30
+ - Pin exact versions for apps, ranges for libraries
31
+ - Audit regularly (`npm audit`), prefer zero-dependency packages
32
+ - Check bundle size before adding (`bundlephobia.com`), remove unused (`npx depcheck`)
33
+
34
+ ## Linting (ESLint Flat Config)
35
+
36
+ ```javascript
37
+ import tseslint from 'typescript-eslint';
38
+ export default tseslint.config(
39
+ ...tseslint.configs.strictTypeChecked,
40
+ { rules: {
41
+ '@typescript-eslint/no-explicit-any': 'error',
42
+ '@typescript-eslint/no-floating-promises': 'error',
43
+ '@typescript-eslint/no-misused-promises': 'error',
44
+ 'no-console': ['warn', { allow: ['warn', 'error'] }],
45
+ }},
46
+ );
47
+ ```
48
+
49
+ ## Build Tools
50
+
51
+ - **Vite** (frontend): `target: 'es2022'`, sourcemaps, manual chunks for vendor splitting
52
+ - **tsup** (libraries): ESM output, `dts: true`, `treeshake: true`, `splitting: true`
53
+
54
+ ## Git Hooks
55
+
56
+ ```jsonc
57
+ {
58
+ "scripts": {
59
+ "prepare": "husky",
60
+ "check": "npm run typecheck && npm run lint && npm run test"
61
+ },
62
+ "lint-staged": {
63
+ "*.{ts,tsx}": ["eslint --fix", "prettier --write"],
64
+ "*.{json,md,yml}": ["prettier --write"]
65
+ }
66
+ }
67
+ ```
68
+
69
+ ## Debugging
70
+
71
+ - Node.js: `node --inspect-brk app.js` + Chrome DevTools
72
+ - Use structured logging over `console.log` — never log passwords, tokens, or PII
@@ -0,0 +1,77 @@
1
+ ---
2
+ description: TypeScript Deep Dive
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # TypeScript Deep Dive
7
+
8
+ Advanced type system mastery. Builds on `overview.mdc` (discriminated unions, branded types, const assertions).
9
+
10
+ ## Generics
11
+
12
+ ```typescript
13
+ function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] { return obj[key]; }
14
+ function merge<T extends object, U extends object>(a: T, b: U): T & U { return { ...a, ...b }; }
15
+ ```
16
+
17
+ ## Conditional Types
18
+
19
+ ```typescript
20
+ type Awaited<T> = T extends Promise<infer U> ? Awaited<U> : T;
21
+ type ToArray<T> = T extends unknown ? T[] : never; // Distributive
22
+ type ToArrayNonDist<T> = [T] extends [unknown] ? T[] : never; // Non-distributive
23
+ ```
24
+
25
+ ## Mapped Types
26
+
27
+ ```typescript
28
+ type Getters<T> = { [K in keyof T as `get${Capitalize<string & K>}`]: () => T[K] };
29
+ type PickByType<T, V> = { [K in keyof T as T[K] extends V ? K : never]: T[K] };
30
+ type DeepReadonly<T> = {
31
+ readonly [K in keyof T]: T[K] extends object ? T[K] extends Function ? T[K] : DeepReadonly<T[K]> : T[K];
32
+ };
33
+ ```
34
+
35
+ ## Template Literal Types
36
+
37
+ ```typescript
38
+ type ExtractParams<T extends string> =
39
+ T extends `${string}:${infer P}/${infer Rest}` ? P | ExtractParams<`/${Rest}`>
40
+ : T extends `${string}:${infer P}` ? P : never;
41
+ type Params = ExtractParams<'/users/:userId/posts/:postId'>; // "userId" | "postId"
42
+ ```
43
+
44
+ ## `satisfies` Operator
45
+
46
+ ```typescript
47
+ const routes = {
48
+ home: { path: '/', component: HomePage },
49
+ } satisfies Record<string, { path: string; component: React.ComponentType }>;
50
+ // routes.home.path is literal "/" — not widened to string
51
+ ```
52
+
53
+ ## Runtime Boundary Validation
54
+
55
+ ```typescript
56
+ import { z } from 'zod';
57
+ const UserSchema = z.object({ id: z.string().uuid(), email: z.string().email(), role: z.enum(['admin', 'user']) });
58
+ type User = z.infer<typeof UserSchema>; // Single source of truth
59
+
60
+ // Validate at every I/O boundary — types disappear at runtime
61
+ const parsed = UserSchema.safeParse(body);
62
+ if (!parsed.success) return Response.json({ errors: parsed.error.flatten().fieldErrors }, { status: 400 });
63
+ ```
64
+
65
+ ## Type Predicates
66
+
67
+ ```typescript
68
+ function isUser(value: unknown): value is User {
69
+ return typeof value === 'object' && value !== null && 'id' in value && 'email' in value;
70
+ }
71
+ ```
72
+
73
+ ## Anti-Patterns
74
+
75
+ - Never `any` — use `unknown` then narrow with type guards or Zod
76
+ - Never `as` to silence errors — use runtime validation
77
+ - Never `enum` — use string literal unions (`type Status = 'active' | 'inactive'`)
@@ -0,0 +1,479 @@
1
+ # JavaScript & TypeScript Expert Development Guide
2
+
3
+ Comprehensive guidelines for principal-level JavaScript and TypeScript engineering across all runtimes, frameworks, and paradigms.
4
+
5
+ **This template covers both JavaScript and TypeScript.** TypeScript is the default — all code is written in strict TypeScript. Advanced type system patterns (conditional types, mapped types, generics, runtime validation) are included.
6
+
7
+ ---
8
+
9
+ ## Overview
10
+
11
+ This guide applies to:
12
+ - Node.js services, CLIs, and tooling
13
+ - React, Vue, Angular, Svelte, and other UI frameworks
14
+ - Vanilla JavaScript and Web APIs
15
+ - TypeScript (strict mode, always) — including advanced type system patterns
16
+ - Build tools, bundlers, and transpilers
17
+ - Testing at every level (unit, integration, E2E, performance)
18
+
19
+ ### Core Philosophy
20
+
21
+ JavaScript is the runtime. Know it deeply:
22
+ - The event loop is not optional knowledge — it's the foundation
23
+ - Prototypes, closures, and the module system are first principles
24
+ - The spec (ECMAScript) is the source of truth, not blog posts
25
+ - Every abstraction leaks — understand what's underneath
26
+
27
+ ### Key Principles
28
+
29
+ 1. **Language Mastery Over Framework Dependence** - Frameworks come and go, JS fundamentals are permanent
30
+ 2. **Type Safety Is Non-Negotiable** - TypeScript strict mode, always
31
+ 3. **Functional by Default** - Pure functions and composition, classes when lifecycle demands it
32
+ 4. **Performance Is a Feature** - Profile before optimizing, measure don't guess
33
+ 5. **Error Handling Is Control Flow** - Result types over thrown exceptions
34
+
35
+ ### Project Structure
36
+
37
+ ```
38
+ src/
39
+ ├── core/ # Pure business logic, zero dependencies
40
+ ├── adapters/ # External integrations (DB, HTTP, FS)
41
+ ├── services/ # Orchestration layer
42
+ ├── utils/ # Pure utility functions
43
+ ├── types/ # TypeScript type definitions
44
+ ├── __tests__/ # Test files
45
+ └── index.ts # Public API surface
46
+ ```
47
+
48
+ ---
49
+
50
+ ## Language Deep Dive
51
+
52
+ ### The Event Loop
53
+
54
+ Understanding execution order is fundamental:
55
+
56
+ ```typescript
57
+ console.log('1 - sync');
58
+ setTimeout(() => console.log('2 - macrotask'), 0);
59
+ Promise.resolve().then(() => console.log('3 - microtask'));
60
+ queueMicrotask(() => console.log('4 - microtask'));
61
+ console.log('5 - sync');
62
+ // Output: 1, 5, 3, 4, 2
63
+ ```
64
+
65
+ ### Type Safety
66
+
67
+ ```typescript
68
+ // Discriminated unions over optional fields
69
+ type Result<T, E = Error> =
70
+ | { ok: true; value: T }
71
+ | { ok: false; error: E };
72
+
73
+ // Branded types for domain safety
74
+ type UserId = string & { readonly __brand: unique symbol };
75
+
76
+ // Const assertions and template literal types
77
+ const EVENTS = ['click', 'keydown', 'submit'] as const;
78
+ type EventName = (typeof EVENTS)[number];
79
+ ```
80
+
81
+ ### TypeScript Deep Dive
82
+
83
+ Advanced type system patterns beyond the basics:
84
+
85
+ ```typescript
86
+ // Conditional types
87
+ type Awaited<T> = T extends Promise<infer U> ? Awaited<U> : T;
88
+
89
+ // Mapped types with key remapping
90
+ type Getters<T> = {
91
+ [K in keyof T as `get${Capitalize<string & K>}`]: () => T[K];
92
+ };
93
+
94
+ // Template literal type extraction
95
+ type ExtractParams<T extends string> =
96
+ T extends `${string}:${infer Param}/${infer Rest}`
97
+ ? Param | ExtractParams<`/${Rest}`>
98
+ : T extends `${string}:${infer Param}` ? Param : never;
99
+
100
+ // satisfies — validate without widening
101
+ const config = { port: 3000, host: 'localhost' } satisfies Record<string, string | number>;
102
+ // config.port is still number, not string | number
103
+
104
+ // Runtime boundary validation with Zod
105
+ const UserSchema = z.object({ id: z.string().uuid(), email: z.string().email() });
106
+ type User = z.infer<typeof UserSchema>;
107
+ // Types disappear at runtime — validate at every I/O boundary
108
+ ```
109
+
110
+ ### Functional Patterns
111
+
112
+ ```typescript
113
+ const pipe = <T>(...fns: Array<(arg: T) => T>) =>
114
+ (value: T): T => fns.reduce((acc, fn) => fn(acc), value);
115
+
116
+ const processUser = pipe(validateInput, normalizeEmail, hashPassword);
117
+ ```
118
+
119
+ ### Async Patterns
120
+
121
+ ```typescript
122
+ // Parallel independent operations
123
+ const [users, posts] = await Promise.all([fetchUsers(), fetchPosts()]);
124
+
125
+ // Race with timeout
126
+ const withTimeout = <T>(promise: Promise<T>, ms: number): Promise<T> =>
127
+ Promise.race([
128
+ promise,
129
+ new Promise<never>((_, reject) =>
130
+ setTimeout(() => reject(new Error(`Timeout after ${ms}ms`)), ms)
131
+ ),
132
+ ]);
133
+
134
+ // Async iteration for streams
135
+ async function* readChunks(stream: ReadableStream<Uint8Array>) {
136
+ const reader = stream.getReader();
137
+ try {
138
+ while (true) {
139
+ const { done, value } = await reader.read();
140
+ if (done) break;
141
+ yield value;
142
+ }
143
+ } finally {
144
+ reader.releaseLock();
145
+ }
146
+ }
147
+ ```
148
+
149
+ ### Generators and Lazy Evaluation
150
+
151
+ ```typescript
152
+ function* filter<T>(iterable: Iterable<T>, predicate: (item: T) => boolean) {
153
+ for (const item of iterable) {
154
+ if (predicate(item)) yield item;
155
+ }
156
+ }
157
+
158
+ function* take<T>(iterable: Iterable<T>, count: number) {
159
+ let i = 0;
160
+ for (const item of iterable) {
161
+ if (i++ >= count) break;
162
+ yield item;
163
+ }
164
+ }
165
+ ```
166
+
167
+ ### Error Handling
168
+
169
+ ```typescript
170
+ // Result types for expected failures
171
+ function parseConfig(raw: string): Result<Config> {
172
+ try {
173
+ const parsed = JSON.parse(raw);
174
+ const validated = ConfigSchema.safeParse(parsed);
175
+ if (!validated.success) {
176
+ return { ok: false, error: new ValidationError(validated.error) };
177
+ }
178
+ return { ok: true, value: validated.data };
179
+ } catch {
180
+ return { ok: false, error: new ParseError('Invalid JSON') };
181
+ }
182
+ }
183
+
184
+ // Reserve throw for invariant violations
185
+ function assertNonNull<T>(value: T | null | undefined, msg: string): asserts value is T {
186
+ if (value == null) throw new Error(`Invariant: ${msg}`);
187
+ }
188
+ ```
189
+
190
+ ---
191
+
192
+ ## Node.js Patterns
193
+
194
+ ### Graceful Shutdown
195
+
196
+ ```typescript
197
+ const shutdown = async (signal: string) => {
198
+ console.log(`Received ${signal}, shutting down...`);
199
+ server.close();
200
+ await db.disconnect();
201
+ process.exit(0);
202
+ };
203
+
204
+ process.on('SIGTERM', () => shutdown('SIGTERM'));
205
+ process.on('SIGINT', () => shutdown('SIGINT'));
206
+ ```
207
+
208
+ ### Streams
209
+
210
+ ```typescript
211
+ import { pipeline } from 'node:stream/promises';
212
+
213
+ await pipeline(
214
+ createReadStream('input.log'),
215
+ new Transform({
216
+ transform(chunk, _encoding, callback) {
217
+ const filtered = chunk.toString()
218
+ .split('\n')
219
+ .filter((line: string) => line.includes('ERROR'))
220
+ .join('\n');
221
+ callback(null, filtered);
222
+ },
223
+ }),
224
+ createGzip(),
225
+ createWriteStream('errors.log.gz'),
226
+ );
227
+ ```
228
+
229
+ ### Worker Threads
230
+
231
+ ```typescript
232
+ import { Worker, isMainThread, parentPort, workerData } from 'node:worker_threads';
233
+
234
+ if (isMainThread) {
235
+ const runWorker = <T>(data: unknown): Promise<T> =>
236
+ new Promise((resolve, reject) => {
237
+ const worker = new Worker(new URL(import.meta.url), { workerData: data });
238
+ worker.on('message', resolve);
239
+ worker.on('error', reject);
240
+ });
241
+ } else {
242
+ const result = performExpensiveComputation(workerData);
243
+ parentPort!.postMessage(result);
244
+ }
245
+ ```
246
+
247
+ ### Configuration
248
+
249
+ ```typescript
250
+ import { z } from 'zod';
251
+
252
+ const EnvSchema = z.object({
253
+ NODE_ENV: z.enum(['development', 'production', 'test']),
254
+ PORT: z.coerce.number().int().positive().default(3000),
255
+ DATABASE_URL: z.string().url(),
256
+ });
257
+
258
+ export const env = EnvSchema.parse(process.env);
259
+ ```
260
+
261
+ ---
262
+
263
+ ## React Patterns
264
+
265
+ ### Server Components First (React 19+)
266
+
267
+ ```tsx
268
+ // Default: Server Component — no 'use client'
269
+ async function ProjectList() {
270
+ const projects = await db.projects.findMany();
271
+ return <ul>{projects.map(p => <ProjectCard key={p.id} project={p} />)}</ul>;
272
+ }
273
+
274
+ // Only add 'use client' when you need interactivity
275
+ 'use client';
276
+ function SearchInput({ onSearch }: { onSearch: (q: string) => void }) {
277
+ const [query, setQuery] = useState('');
278
+ return <input value={query} onChange={e => setQuery(e.target.value)} />;
279
+ }
280
+ ```
281
+
282
+ ### Composition Patterns
283
+
284
+ ```tsx
285
+ // Compound components
286
+ function Tabs({ children }: { children: React.ReactNode }) {
287
+ const [active, setActive] = useState(0);
288
+ return <TabsContext.Provider value={{ active, setActive }}>{children}</TabsContext.Provider>;
289
+ }
290
+ Tabs.List = function TabList({ children }) { ... };
291
+ Tabs.Panel = function TabPanel({ children, index }) { ... };
292
+ ```
293
+
294
+ ### State Management Hierarchy
295
+
296
+ 1. `useState` — local state
297
+ 2. `useReducer` — complex local state with actions
298
+ 3. Context — low-frequency shared state (theme, auth, locale)
299
+ 4. External store (Zustand, Jotai) — high-frequency shared state
300
+
301
+ ### Anti-Patterns
302
+
303
+ ```tsx
304
+ // Never: useEffect for derived state
305
+ const fullName = `${firstName} ${lastName}`; // Just compute it
306
+
307
+ // Never: index as key for dynamic lists
308
+ {items.map(item => <Item key={item.id} item={item} />)}
309
+
310
+ // Never: Object literals as default props
311
+ const EMPTY: readonly Item[] = [];
312
+ function List({ items = EMPTY }: { items?: readonly Item[] }) { ... }
313
+ ```
314
+
315
+ ---
316
+
317
+ ## Testing
318
+
319
+ ### Philosophy
320
+
321
+ - Tests are production code — same quality standards
322
+ - Test behavior and contracts, never implementation details
323
+ - Every bug fix starts with a failing test
324
+ - If it's hard to test, the design is wrong
325
+
326
+ ### Unit Tests
327
+
328
+ ```typescript
329
+ describe('clamp', () => {
330
+ it('returns value when within range', () => {
331
+ expect(clamp(5, 0, 10)).toBe(5);
332
+ });
333
+ it('returns min when value is below range', () => {
334
+ expect(clamp(-5, 0, 10)).toBe(0);
335
+ });
336
+ it('returns max when value is above range', () => {
337
+ expect(clamp(15, 0, 10)).toBe(10);
338
+ });
339
+ });
340
+ ```
341
+
342
+ ### Parameterized Tests
343
+
344
+ ```typescript
345
+ it.each([
346
+ ['Hello World', 'hello-world'],
347
+ [' spaces ', 'spaces'],
348
+ ['Special!@#Characters', 'specialcharacters'],
349
+ ])('converts "%s" to "%s"', (input, expected) => {
350
+ expect(slugify(input)).toBe(expected);
351
+ });
352
+ ```
353
+
354
+ ### Component Tests
355
+
356
+ ```tsx
357
+ import { render, screen } from '@testing-library/react';
358
+ import userEvent from '@testing-library/user-event';
359
+
360
+ it('adds a new todo when form is submitted', async () => {
361
+ const user = userEvent.setup();
362
+ render(<TodoList />);
363
+ await user.type(screen.getByRole('textbox', { name: /new todo/i }), 'Buy milk');
364
+ await user.click(screen.getByRole('button', { name: /add/i }));
365
+ expect(screen.getByText('Buy milk')).toBeInTheDocument();
366
+ });
367
+ ```
368
+
369
+ ### API Mocking with MSW
370
+
371
+ ```typescript
372
+ import { http, HttpResponse } from 'msw';
373
+ import { setupServer } from 'msw/node';
374
+
375
+ const server = setupServer(
376
+ http.get('/api/users/:id', ({ params }) => {
377
+ return HttpResponse.json({ id: params.id, name: 'Test User' });
378
+ }),
379
+ );
380
+
381
+ beforeAll(() => server.listen({ onUnhandledRequest: 'error' }));
382
+ afterEach(() => server.resetHandlers());
383
+ afterAll(() => server.close());
384
+ ```
385
+
386
+ ### E2E Tests
387
+
388
+ ```typescript
389
+ import { test, expect } from '@playwright/test';
390
+
391
+ test('login flow', async ({ page }) => {
392
+ await page.goto('/login');
393
+ await page.getByLabel('Email').fill('user@example.com');
394
+ await page.getByLabel('Password').fill('password');
395
+ await page.getByRole('button', { name: 'Sign in' }).click();
396
+ await expect(page).toHaveURL('/dashboard');
397
+ });
398
+ ```
399
+
400
+ ### Test Anti-Patterns
401
+
402
+ - Never test implementation details (internal state, class names)
403
+ - Never use `setTimeout` for waiting — use `waitFor` or `findBy`
404
+ - Never let tests depend on execution order
405
+ - Never ignore flaky tests — a flaky test is a bug
406
+
407
+ ---
408
+
409
+ ## Performance
410
+
411
+ ### Profiling First
412
+
413
+ ```typescript
414
+ performance.mark('operation-start');
415
+ doExpensiveWork();
416
+ performance.mark('operation-end');
417
+ performance.measure('operation', 'operation-start', 'operation-end');
418
+ ```
419
+
420
+ ### V8 Optimization
421
+
422
+ - Keep function argument shapes consistent (monomorphic)
423
+ - Initialize all object properties in the same order
424
+ - Use `Map`/`Set` for dynamic collections, plain objects for static shapes
425
+ - Use `TypedArray` for numeric data
426
+
427
+ ### Memory Management
428
+
429
+ - Use `AbortController` signals for event listener cleanup
430
+ - Use `WeakMap`/`WeakRef` for caches that shouldn't prevent GC
431
+ - Avoid closures that capture large scopes — extract only what's needed
432
+
433
+ ### Bundle Size
434
+
435
+ - Dynamic imports for code splitting
436
+ - Named exports for tree-shaking
437
+ - Prefer native APIs (`structuredClone`, `Intl`, `URL`, `crypto.randomUUID`)
438
+
439
+ ---
440
+
441
+ ## Tooling
442
+
443
+ ### TypeScript Config
444
+
445
+ ```jsonc
446
+ {
447
+ "compilerOptions": {
448
+ "strict": true,
449
+ "noUncheckedIndexedAccess": true,
450
+ "exactOptionalPropertyTypes": true,
451
+ "verbatimModuleSyntax": true,
452
+ "module": "ESNext",
453
+ "target": "ES2022"
454
+ }
455
+ }
456
+ ```
457
+
458
+ ### Dependency Hygiene
459
+
460
+ - Pin exact versions for applications
461
+ - Audit regularly (`npm audit`)
462
+ - Prefer zero-dependency packages
463
+ - Check bundle size before adding (`bundlephobia.com`)
464
+
465
+ ---
466
+
467
+ ## Definition of Done
468
+
469
+ A JavaScript feature is complete when:
470
+
471
+ - [ ] TypeScript strict mode passes with zero errors
472
+ - [ ] All code paths have explicit types (no `any`)
473
+ - [ ] Unit tests cover logic branches and edge cases
474
+ - [ ] Integration tests verify external boundaries
475
+ - [ ] Error cases are tested, not just happy paths
476
+ - [ ] No floating promises
477
+ - [ ] No memory leaks in long-running paths
478
+ - [ ] Bundle impact assessed (client-side code)
479
+ - [ ] Code reviewed and approved