@biggora/claude-plugins 1.2.0 → 1.3.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 (265) hide show
  1. package/README.md +13 -4
  2. package/package.json +1 -1
  3. package/registry/registry.json +334 -244
  4. package/specs/coding.md +30 -0
  5. package/specs/pod.md +2 -0
  6. package/src/commands/skills/add.js +63 -7
  7. package/src/commands/skills/list.js +23 -52
  8. package/src/commands/skills/remove.js +26 -27
  9. package/src/commands/skills/resolve.js +155 -0
  10. package/src/commands/skills/update.js +58 -74
  11. package/src/skills/captcha/README.md +221 -0
  12. package/src/skills/captcha/SKILL.md +355 -0
  13. package/src/skills/captcha/references/captcha-types.md +254 -0
  14. package/src/skills/captcha/references/services.md +172 -0
  15. package/src/skills/captcha/references/stealth.md +238 -0
  16. package/src/skills/captcha/scripts/solve_captcha.py +323 -0
  17. package/src/skills/captcha/scripts/solve_image_grid.py +350 -0
  18. package/src/skills/google-merchant-api/SKILL.md +581 -0
  19. package/src/skills/google-merchant-api/references/accounts.md +247 -0
  20. package/src/skills/google-merchant-api/references/content-api-legacy.md +216 -0
  21. package/src/skills/google-merchant-api/references/datasources.md +233 -0
  22. package/src/skills/google-merchant-api/references/inventories.md +201 -0
  23. package/src/skills/google-merchant-api/references/migration.md +267 -0
  24. package/src/skills/google-merchant-api/references/products.md +316 -0
  25. package/src/skills/google-merchant-api/references/promotions.md +201 -0
  26. package/src/skills/google-merchant-api/references/reports.md +240 -0
  27. package/src/skills/lv-aggregators-api/SKILL.md +113 -0
  28. package/src/skills/lv-aggregators-api/references/integration-guide.md +368 -0
  29. package/src/skills/lv-aggregators-api/references/kurpirkt.md +103 -0
  30. package/src/skills/lv-aggregators-api/references/salidzini.md +122 -0
  31. package/src/skills/nest-best-practices/SKILL.md +251 -0
  32. package/src/skills/nest-best-practices/references/best-practices-request-lifecycle.md +158 -0
  33. package/src/skills/nest-best-practices/references/cli-monorepo.md +106 -0
  34. package/src/skills/nest-best-practices/references/cli-overview.md +157 -0
  35. package/src/skills/nest-best-practices/references/core-controllers.md +165 -0
  36. package/src/skills/nest-best-practices/references/core-dependency-injection.md +179 -0
  37. package/src/skills/nest-best-practices/references/core-middleware.md +139 -0
  38. package/src/skills/nest-best-practices/references/core-modules.md +138 -0
  39. package/src/skills/nest-best-practices/references/core-providers.md +188 -0
  40. package/src/skills/nest-best-practices/references/faq-raw-body-hybrid.md +122 -0
  41. package/src/skills/nest-best-practices/references/fundamentals-circular-dependency.md +89 -0
  42. package/src/skills/nest-best-practices/references/fundamentals-custom-decorators.md +107 -0
  43. package/src/skills/nest-best-practices/references/fundamentals-dynamic-modules.md +125 -0
  44. package/src/skills/nest-best-practices/references/fundamentals-exception-filters.md +202 -0
  45. package/src/skills/nest-best-practices/references/fundamentals-execution-context.md +107 -0
  46. package/src/skills/nest-best-practices/references/fundamentals-guards.md +136 -0
  47. package/src/skills/nest-best-practices/references/fundamentals-interceptors.md +187 -0
  48. package/src/skills/nest-best-practices/references/fundamentals-lazy-loading.md +89 -0
  49. package/src/skills/nest-best-practices/references/fundamentals-lifecycle-events.md +87 -0
  50. package/src/skills/nest-best-practices/references/fundamentals-module-reference.md +107 -0
  51. package/src/skills/nest-best-practices/references/fundamentals-pipes.md +197 -0
  52. package/src/skills/nest-best-practices/references/fundamentals-provider-scopes.md +92 -0
  53. package/src/skills/nest-best-practices/references/fundamentals-testing.md +142 -0
  54. package/src/skills/nest-best-practices/references/graphql-overview.md +233 -0
  55. package/src/skills/nest-best-practices/references/graphql-resolvers-mutations.md +199 -0
  56. package/src/skills/nest-best-practices/references/graphql-scalars-unions-enums.md +180 -0
  57. package/src/skills/nest-best-practices/references/graphql-subscriptions.md +228 -0
  58. package/src/skills/nest-best-practices/references/microservices-grpc.md +175 -0
  59. package/src/skills/nest-best-practices/references/microservices-overview.md +221 -0
  60. package/src/skills/nest-best-practices/references/microservices-transports.md +119 -0
  61. package/src/skills/nest-best-practices/references/openapi-swagger.md +207 -0
  62. package/src/skills/nest-best-practices/references/recipes-authentication.md +97 -0
  63. package/src/skills/nest-best-practices/references/recipes-cqrs.md +176 -0
  64. package/src/skills/nest-best-practices/references/recipes-crud-generator.md +87 -0
  65. package/src/skills/nest-best-practices/references/recipes-documentation.md +93 -0
  66. package/src/skills/nest-best-practices/references/recipes-mongoose.md +153 -0
  67. package/src/skills/nest-best-practices/references/recipes-prisma.md +98 -0
  68. package/src/skills/nest-best-practices/references/recipes-terminus.md +148 -0
  69. package/src/skills/nest-best-practices/references/recipes-typeorm.md +122 -0
  70. package/src/skills/nest-best-practices/references/security-authorization.md +196 -0
  71. package/src/skills/nest-best-practices/references/security-cors-helmet-rate-limiting.md +204 -0
  72. package/src/skills/nest-best-practices/references/security-encryption-hashing.md +93 -0
  73. package/src/skills/nest-best-practices/references/techniques-caching.md +142 -0
  74. package/src/skills/nest-best-practices/references/techniques-compression-streaming-sse.md +194 -0
  75. package/src/skills/nest-best-practices/references/techniques-configuration.md +132 -0
  76. package/src/skills/nest-best-practices/references/techniques-database.md +153 -0
  77. package/src/skills/nest-best-practices/references/techniques-events.md +163 -0
  78. package/src/skills/nest-best-practices/references/techniques-fastify.md +137 -0
  79. package/src/skills/nest-best-practices/references/techniques-file-upload.md +140 -0
  80. package/src/skills/nest-best-practices/references/techniques-http-module.md +176 -0
  81. package/src/skills/nest-best-practices/references/techniques-logging.md +146 -0
  82. package/src/skills/nest-best-practices/references/techniques-mvc-serve-static.md +132 -0
  83. package/src/skills/nest-best-practices/references/techniques-queues.md +162 -0
  84. package/src/skills/nest-best-practices/references/techniques-serialization.md +158 -0
  85. package/src/skills/nest-best-practices/references/techniques-sessions-cookies.md +167 -0
  86. package/src/skills/nest-best-practices/references/techniques-task-scheduling.md +166 -0
  87. package/src/skills/nest-best-practices/references/techniques-validation.md +126 -0
  88. package/src/skills/nest-best-practices/references/techniques-versioning.md +153 -0
  89. package/src/skills/nest-best-practices/references/websockets-advanced.md +96 -0
  90. package/src/skills/nest-best-practices/references/websockets-gateways.md +215 -0
  91. package/src/skills/tailwindcss-best-practices/SKILL.md +180 -0
  92. package/src/skills/tailwindcss-best-practices/references/best-practices-utility-patterns.md +87 -0
  93. package/src/skills/tailwindcss-best-practices/references/core-installation.md +109 -0
  94. package/src/skills/tailwindcss-best-practices/references/core-preflight.md +200 -0
  95. package/src/skills/tailwindcss-best-practices/references/core-responsive.md +163 -0
  96. package/src/skills/tailwindcss-best-practices/references/core-source-detection.md +114 -0
  97. package/src/skills/tailwindcss-best-practices/references/core-theme.md +108 -0
  98. package/src/skills/tailwindcss-best-practices/references/core-utility-classes.md +59 -0
  99. package/src/skills/tailwindcss-best-practices/references/core-variants.md +204 -0
  100. package/src/skills/tailwindcss-best-practices/references/effects-form-controls.md +76 -0
  101. package/src/skills/tailwindcss-best-practices/references/effects-mask.md +91 -0
  102. package/src/skills/tailwindcss-best-practices/references/effects-scroll-snap.md +59 -0
  103. package/src/skills/tailwindcss-best-practices/references/effects-text-shadow.md +78 -0
  104. package/src/skills/tailwindcss-best-practices/references/effects-transition-animation.md +80 -0
  105. package/src/skills/tailwindcss-best-practices/references/effects-visibility-interactivity.md +82 -0
  106. package/src/skills/tailwindcss-best-practices/references/features-content-detection.md +175 -0
  107. package/src/skills/tailwindcss-best-practices/references/features-custom-styles.md +203 -0
  108. package/src/skills/tailwindcss-best-practices/references/features-dark-mode.md +137 -0
  109. package/src/skills/tailwindcss-best-practices/references/features-functions-directives.md +241 -0
  110. package/src/skills/tailwindcss-best-practices/references/features-upgrade.md +160 -0
  111. package/src/skills/tailwindcss-best-practices/references/layout-aspect-ratio.md +39 -0
  112. package/src/skills/tailwindcss-best-practices/references/layout-columns.md +80 -0
  113. package/src/skills/tailwindcss-best-practices/references/layout-display.md +110 -0
  114. package/src/skills/tailwindcss-best-practices/references/layout-flexbox.md +112 -0
  115. package/src/skills/tailwindcss-best-practices/references/layout-grid.md +87 -0
  116. package/src/skills/tailwindcss-best-practices/references/layout-height.md +97 -0
  117. package/src/skills/tailwindcss-best-practices/references/layout-inset.md +103 -0
  118. package/src/skills/tailwindcss-best-practices/references/layout-logical-properties.md +92 -0
  119. package/src/skills/tailwindcss-best-practices/references/layout-margin.md +126 -0
  120. package/src/skills/tailwindcss-best-practices/references/layout-min-max-sizing.md +63 -0
  121. package/src/skills/tailwindcss-best-practices/references/layout-object-fit-position.md +64 -0
  122. package/src/skills/tailwindcss-best-practices/references/layout-overflow.md +57 -0
  123. package/src/skills/tailwindcss-best-practices/references/layout-padding.md +77 -0
  124. package/src/skills/tailwindcss-best-practices/references/layout-position.md +85 -0
  125. package/src/skills/tailwindcss-best-practices/references/layout-tables.md +67 -0
  126. package/src/skills/tailwindcss-best-practices/references/layout-width.md +102 -0
  127. package/src/skills/tailwindcss-best-practices/references/transform-base.md +68 -0
  128. package/src/skills/tailwindcss-best-practices/references/transform-rotate.md +70 -0
  129. package/src/skills/tailwindcss-best-practices/references/transform-scale.md +83 -0
  130. package/src/skills/tailwindcss-best-practices/references/transform-skew.md +62 -0
  131. package/src/skills/tailwindcss-best-practices/references/transform-translate.md +77 -0
  132. package/src/skills/tailwindcss-best-practices/references/typography-font-text.md +142 -0
  133. package/src/skills/tailwindcss-best-practices/references/typography-list-style.md +65 -0
  134. package/src/skills/tailwindcss-best-practices/references/typography-text-align.md +60 -0
  135. package/src/skills/tailwindcss-best-practices/references/visual-background.md +76 -0
  136. package/src/skills/tailwindcss-best-practices/references/visual-border.md +108 -0
  137. package/src/skills/tailwindcss-best-practices/references/visual-effects.md +111 -0
  138. package/src/skills/tailwindcss-best-practices/references/visual-svg.md +82 -0
  139. package/src/skills/test-mobile-app/SKILL.md +11 -6
  140. package/src/skills/test-mobile-app/scripts/analyze_apk.py +15 -4
  141. package/src/skills/test-mobile-app/scripts/check_environment.py +5 -5
  142. package/src/skills/test-mobile-app/scripts/run_tests.py +1 -1
  143. package/src/skills/test-web-ui/SKILL.md +264 -84
  144. package/src/skills/test-web-ui/scripts/discover.py +25 -12
  145. package/src/skills/test-web-ui/scripts/run_tests.py +3 -2
  146. package/src/skills/typescript-expert/SKILL.md +145 -0
  147. package/src/skills/typescript-expert/commands/typescript-fix.md +65 -0
  148. package/src/skills/typescript-expert/references/advanced-conditional-types.md +190 -0
  149. package/src/skills/typescript-expert/references/advanced-decorators.md +243 -0
  150. package/src/skills/typescript-expert/references/advanced-mapped-types.md +223 -0
  151. package/src/skills/typescript-expert/references/advanced-template-literals.md +209 -0
  152. package/src/skills/typescript-expert/references/advanced-type-guards.md +308 -0
  153. package/src/skills/typescript-expert/references/best-practices-patterns.md +313 -0
  154. package/src/skills/typescript-expert/references/best-practices-performance.md +185 -0
  155. package/src/skills/typescript-expert/references/best-practices-tsconfig.md +242 -0
  156. package/src/skills/typescript-expert/references/core-generics.md +246 -0
  157. package/src/skills/typescript-expert/references/core-interfaces-types.md +231 -0
  158. package/src/skills/typescript-expert/references/core-type-system.md +261 -0
  159. package/src/skills/typescript-expert/references/core-utility-types.md +235 -0
  160. package/src/skills/typescript-expert/references/features-ts5x.md +370 -0
  161. package/src/skills/vite-best-practices/SKILL.md +115 -0
  162. package/src/skills/vite-best-practices/references/build-and-ssr.md +255 -0
  163. package/src/skills/vite-best-practices/references/core-config.md +231 -0
  164. package/src/skills/vite-best-practices/references/core-features.md +222 -0
  165. package/src/skills/vite-best-practices/references/core-plugin-api.md +294 -0
  166. package/src/skills/vite-best-practices/references/environment-api.md +108 -0
  167. package/src/skills/vite-best-practices/references/rolldown-migration.md +242 -0
  168. package/codex-cli-workspace/iteration-1/benchmark.json +0 -122
  169. package/codex-cli-workspace/iteration-1/eval-1-ci-integration/eval_metadata.json +0 -13
  170. package/codex-cli-workspace/iteration-1/eval-1-ci-integration/with_skill/grading.json +0 -52
  171. package/codex-cli-workspace/iteration-1/eval-1-ci-integration/with_skill/outputs/response.md +0 -163
  172. package/codex-cli-workspace/iteration-1/eval-1-ci-integration/with_skill/timing.json +0 -5
  173. package/codex-cli-workspace/iteration-1/eval-1-ci-integration/without_skill/grading.json +0 -58
  174. package/codex-cli-workspace/iteration-1/eval-1-ci-integration/without_skill/outputs/response.md +0 -151
  175. package/codex-cli-workspace/iteration-1/eval-1-ci-integration/without_skill/timing.json +0 -5
  176. package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/eval_metadata.json +0 -13
  177. package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/grading.json +0 -52
  178. package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/outputs/response.md +0 -86
  179. package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/timing.json +0 -5
  180. package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/grading.json +0 -58
  181. package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/outputs/response.md +0 -164
  182. package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/timing.json +0 -5
  183. package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/eval_metadata.json +0 -13
  184. package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/with_skill/grading.json +0 -52
  185. package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/with_skill/outputs/response.md +0 -130
  186. package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/with_skill/timing.json +0 -5
  187. package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/without_skill/grading.json +0 -64
  188. package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/without_skill/outputs/response.md +0 -209
  189. package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/without_skill/timing.json +0 -5
  190. package/codex-cli-workspace/iteration-1/review.html +0 -1325
  191. package/gemini-cli-workspace/iteration-1/benchmark.json +0 -86
  192. package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/eval_metadata.json +0 -37
  193. package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/with_skill/grading.json +0 -37
  194. package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/with_skill/outputs/response.md +0 -401
  195. package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/with_skill/timing.json +0 -5
  196. package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/without_skill/grading.json +0 -37
  197. package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/without_skill/outputs/response.md +0 -405
  198. package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/without_skill/timing.json +0 -5
  199. package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/eval_metadata.json +0 -37
  200. package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/grading.json +0 -37
  201. package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/outputs/response.md +0 -212
  202. package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/timing.json +0 -5
  203. package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/grading.json +0 -37
  204. package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/outputs/response.md +0 -427
  205. package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/timing.json +0 -5
  206. package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/eval_metadata.json +0 -32
  207. package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/with_skill/grading.json +0 -32
  208. package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/with_skill/outputs/response.md +0 -171
  209. package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/with_skill/timing.json +0 -5
  210. package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/without_skill/grading.json +0 -32
  211. package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/without_skill/outputs/response.md +0 -199
  212. package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/without_skill/timing.json +0 -5
  213. package/gemini-cli-workspace/iteration-1/review.html +0 -1325
  214. package/gemini-cli-workspace/iteration-2/benchmark.json +0 -173
  215. package/gemini-cli-workspace/iteration-2/benchmark.md +0 -28
  216. package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/eval_metadata.json +0 -37
  217. package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/with_skill/grading.json +0 -37
  218. package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/with_skill/outputs/response.md +0 -195
  219. package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/with_skill/timing.json +0 -5
  220. package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/without_skill/grading.json +0 -37
  221. package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/without_skill/outputs/response.md +0 -377
  222. package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/without_skill/timing.json +0 -5
  223. package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/eval_metadata.json +0 -37
  224. package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/with_skill/grading.json +0 -37
  225. package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/with_skill/outputs/response.md +0 -127
  226. package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/with_skill/timing.json +0 -5
  227. package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/without_skill/grading.json +0 -37
  228. package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/without_skill/outputs/response.md +0 -164
  229. package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/without_skill/timing.json +0 -5
  230. package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/eval_metadata.json +0 -32
  231. package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/with_skill/grading.json +0 -32
  232. package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/with_skill/outputs/response.md +0 -91
  233. package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/with_skill/timing.json +0 -5
  234. package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/without_skill/grading.json +0 -32
  235. package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/without_skill/outputs/response.md +0 -112
  236. package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/without_skill/timing.json +0 -5
  237. package/gemini-cli-workspace/iteration-2/eval-viewer.html +0 -1325
  238. package/screen-recording-workspace/evals.json +0 -41
  239. package/screen-recording-workspace/iteration-1/benchmark.json +0 -102
  240. package/screen-recording-workspace/iteration-1/eval-0-fullscreen/eval_metadata.json +0 -31
  241. package/screen-recording-workspace/iteration-1/eval-0-fullscreen/with_skill/grading.json +0 -11
  242. package/screen-recording-workspace/iteration-1/eval-0-fullscreen/with_skill/outputs/demo.mp4 +0 -0
  243. package/screen-recording-workspace/iteration-1/eval-0-fullscreen/with_skill/timing.json +0 -5
  244. package/screen-recording-workspace/iteration-1/eval-0-fullscreen/without_skill/grading.json +0 -11
  245. package/screen-recording-workspace/iteration-1/eval-0-fullscreen/without_skill/outputs/demo.mp4 +0 -0
  246. package/screen-recording-workspace/iteration-1/eval-0-fullscreen/without_skill/timing.json +0 -5
  247. package/screen-recording-workspace/iteration-1/eval-1-region-audio/eval_metadata.json +0 -31
  248. package/screen-recording-workspace/iteration-1/eval-1-region-audio/with_skill/grading.json +0 -11
  249. package/screen-recording-workspace/iteration-1/eval-1-region-audio/with_skill/outputs/region_capture.mp4 +0 -0
  250. package/screen-recording-workspace/iteration-1/eval-1-region-audio/with_skill/timing.json +0 -5
  251. package/screen-recording-workspace/iteration-1/eval-1-region-audio/without_skill/grading.json +0 -11
  252. package/screen-recording-workspace/iteration-1/eval-1-region-audio/without_skill/outputs/region_capture.mp4 +0 -0
  253. package/screen-recording-workspace/iteration-1/eval-1-region-audio/without_skill/timing.json +0 -5
  254. package/screen-recording-workspace/iteration-1/eval-2-python-fallback/eval_metadata.json +0 -31
  255. package/screen-recording-workspace/iteration-1/eval-2-python-fallback/with_skill/grading.json +0 -11
  256. package/screen-recording-workspace/iteration-1/eval-2-python-fallback/with_skill/outputs/fallback_recording.mp4 +0 -0
  257. package/screen-recording-workspace/iteration-1/eval-2-python-fallback/with_skill/timing.json +0 -5
  258. package/screen-recording-workspace/iteration-1/eval-2-python-fallback/without_skill/grading.json +0 -11
  259. package/screen-recording-workspace/iteration-1/eval-2-python-fallback/without_skill/outputs/fallback_recording.mp4 +0 -0
  260. package/screen-recording-workspace/iteration-1/eval-2-python-fallback/without_skill/outputs/record_screen.py +0 -67
  261. package/screen-recording-workspace/iteration-1/eval-2-python-fallback/without_skill/timing.json +0 -5
  262. package/screen-recording-workspace/iteration-1/review.html +0 -1325
  263. package/src/skills/codex-cli/evals/evals.json +0 -47
  264. package/src/skills/gemini-cli/evals/evals.json +0 -46
  265. package/src/skills/tm-search/evals/evals.json +0 -23
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: typescript-expert
3
+ description: TypeScript language expertise covering the type system, generics, utility types, advanced type patterns, and project configuration. Use this skill whenever writing, reviewing, or refactoring TypeScript code, designing type-safe APIs, working with complex generics, debugging type errors, configuring tsconfig.json, migrating JavaScript to TypeScript, or leveraging TypeScript 5.x features like satisfies, const type parameters, decorators, and the using keyword. Also use when the user asks about type narrowing, conditional types, mapped types, template literal types, branded types, discriminated unions, or any TypeScript type system question — even seemingly simple ones, because TypeScript's type system has subtle gotchas that catch experienced developers.
4
+ ---
5
+
6
+ # TypeScript Expert
7
+
8
+ > Covers TypeScript through 5.8 (latest stable as of March 2026). The official handbook at https://www.typescriptlang.org/docs/handbook/ is the canonical reference.
9
+
10
+ TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. Its type system is structural (not nominal), meaning type compatibility is determined by shape rather than declaration. This has profound implications for how you design types and APIs.
11
+
12
+ ## Quick Decision Guide
13
+
14
+ | You need to... | Read |
15
+ |----------------|------|
16
+ | Understand primitives, inference, narrowing | [core-type-system](references/core-type-system.md) |
17
+ | Choose between `interface` and `type` | [core-interfaces-types](references/core-interfaces-types.md) |
18
+ | Write generic functions, classes, constraints | [core-generics](references/core-generics.md) |
19
+ | Use `Partial`, `Pick`, `Omit`, `Record`, etc. | [core-utility-types](references/core-utility-types.md) |
20
+ | Build conditional types with `infer` | [advanced-conditional-types](references/advanced-conditional-types.md) |
21
+ | Create mapped types and key remapping | [advanced-mapped-types](references/advanced-mapped-types.md) |
22
+ | Use template literal types for string patterns | [advanced-template-literals](references/advanced-template-literals.md) |
23
+ | Narrow types with guards and discriminated unions | [advanced-type-guards](references/advanced-type-guards.md) |
24
+ | Use TC39 decorators (TS 5.0+) | [advanced-decorators](references/advanced-decorators.md) |
25
+ | Configure `tsconfig.json` properly | [best-practices-tsconfig](references/best-practices-tsconfig.md) |
26
+ | Apply common patterns (branded types, error handling, immutability) | [best-practices-patterns](references/best-practices-patterns.md) |
27
+ | Optimize type-level performance | [best-practices-performance](references/best-practices-performance.md) |
28
+ | Use TS 5.0-5.8 features (`satisfies`, `const` params, `using`) | [features-ts5x](references/features-ts5x.md) |
29
+
30
+ ## Core Principles
31
+
32
+ ### 1. Let TypeScript Infer
33
+
34
+ TypeScript's inference is powerful. Don't annotate what TypeScript can figure out on its own:
35
+
36
+ ```typescript
37
+ // Unnecessary — TypeScript infers `number`
38
+ const count: number = 5;
39
+
40
+ // Good — let inference work
41
+ const count = 5;
42
+
43
+ // DO annotate function signatures (parameters + return types for public APIs)
44
+ function getUser(id: string): Promise<User> { ... }
45
+
46
+ // Return type annotation catches accidental returns
47
+ function parse(input: string): ParseResult {
48
+ if (!input) return null; // Error! null isn't ParseResult — good, we caught a bug
49
+ }
50
+ ```
51
+
52
+ ### 2. Prefer `unknown` over `any`
53
+
54
+ `any` disables type checking. `unknown` is type-safe — you must narrow it before use:
55
+
56
+ ```typescript
57
+ // Bad — silently breaks type safety
58
+ function process(data: any) {
59
+ data.foo.bar; // No error, but might crash at runtime
60
+ }
61
+
62
+ // Good — forces you to check before using
63
+ function process(data: unknown) {
64
+ if (typeof data === "object" && data !== null && "foo" in data) {
65
+ // Now TypeScript knows data has a foo property
66
+ }
67
+ }
68
+ ```
69
+
70
+ ### 3. Use Strict Mode
71
+
72
+ Always enable `"strict": true` in tsconfig.json. It enables all strict type-checking flags including `strictNullChecks`, `noImplicitAny`, and `strictFunctionTypes`. Projects that skip strict mode accumulate hidden bugs that surface painfully later. See [best-practices-tsconfig](references/best-practices-tsconfig.md) for the full recommended configuration.
73
+
74
+ ### 4. Model Your Domain with Types
75
+
76
+ The type system is a tool for encoding business rules. Use discriminated unions to model states, branded types for domain identifiers, and `readonly` to enforce immutability:
77
+
78
+ ```typescript
79
+ // Model states explicitly — impossible to access data in loading/error state
80
+ type AsyncState<T> =
81
+ | { status: "loading" }
82
+ | { status: "error"; error: Error }
83
+ | { status: "success"; data: T };
84
+
85
+ // Branded types prevent ID mixups at compile time
86
+ type UserId = string & { readonly __brand: "UserId" };
87
+ type OrderId = string & { readonly __brand: "OrderId" };
88
+
89
+ function getOrder(orderId: OrderId): Order { ... }
90
+ getOrder(userId); // Error! UserId is not assignable to OrderId
91
+ ```
92
+
93
+ ### 5. Structural Typing Implications
94
+
95
+ TypeScript uses structural typing — if two types have the same shape, they're compatible:
96
+
97
+ ```typescript
98
+ interface Point { x: number; y: number }
99
+ interface Coordinate { x: number; y: number }
100
+
101
+ const p: Point = { x: 1, y: 2 };
102
+ const c: Coordinate = p; // OK — same shape
103
+
104
+ // This means excess property checks only apply to object literals
105
+ function plot(point: Point) { ... }
106
+ plot({ x: 1, y: 2, z: 3 }); // Error — excess property check on literal
107
+ const obj = { x: 1, y: 2, z: 3 };
108
+ plot(obj); // OK — no excess check on variable
109
+ ```
110
+
111
+ ## Common Gotchas
112
+
113
+ | Gotcha | Explanation |
114
+ |--------|-------------|
115
+ | `object` vs `Object` vs `{}` | Use `object` for non-primitives. Never use `Object` or `{}` as types — `{}` matches everything except `null`/`undefined`. |
116
+ | `T[]` vs `readonly T[]` | Arrays are mutable by default. Use `readonly T[]` or `ReadonlyArray<T>` when mutation isn't intended. |
117
+ | `enum` vs union | Prefer union types (`type Dir = "N" \| "S" \| "E" \| "W"`) over enums. Enums produce runtime code and have subtle nominal typing behavior. Use `as const` objects if you need runtime values. |
118
+ | Optional vs `undefined` | `{ x?: number }` means x may be missing entirely. `{ x: number \| undefined }` means x must be present but can be undefined. These behave differently with `in` checks and spread. |
119
+ | `as` casts | Type assertions (`as`) override the compiler. Prefer type guards for runtime narrowing. Use `as` only when you genuinely know more than TypeScript. |
120
+ | `any` propagation | A single `any` silently infects surrounding types. Use `unknown` and narrow, or use `// @ts-expect-error` for known edge cases. |
121
+
122
+ ## TypeScript 5.x Highlights
123
+
124
+ Key features added in TypeScript 5.0-5.8 (see [features-ts5x](references/features-ts5x.md) for details):
125
+
126
+ | Version | Feature | Why it matters |
127
+ |---------|---------|----------------|
128
+ | 5.0 | TC39 Decorators | Standard decorator syntax, no `experimentalDecorators` needed |
129
+ | 5.0 | `const` type parameters | `<const T>` gives const-like inference without `as const` at call site |
130
+ | 5.1 | Easier implicit returns | `undefined`-returning functions can omit `return` |
131
+ | 5.2 | `using` declarations | Deterministic resource cleanup (like C# `using` / Python `with`) |
132
+ | 5.4 | `NoInfer<T>` | Prevents unwanted inference from specific positions |
133
+ | 5.5 | Inferred type predicates | `filter(Boolean)` and arrow guards just work |
134
+ | 5.6 | Iterator helper methods | `.map()`, `.filter()`, `.take()` on iterators |
135
+ | 5.7 | `--squash` for project refs | Faster composite project builds |
136
+ | 5.8 | `--erasableSyntaxOnly` | Strip types without full compilation (Node.js `--strip-types` support) |
137
+
138
+ ## When to Read the References
139
+
140
+ - **Writing a new module/library**: Read [core-generics](references/core-generics.md) and [best-practices-patterns](references/best-practices-patterns.md)
141
+ - **Debugging a confusing type error**: Read [advanced-type-guards](references/advanced-type-guards.md) and [core-type-system](references/core-type-system.md)
142
+ - **Designing a type-safe API**: Read [advanced-conditional-types](references/advanced-conditional-types.md) and [advanced-mapped-types](references/advanced-mapped-types.md)
143
+ - **Setting up a new project**: Read [best-practices-tsconfig](references/best-practices-tsconfig.md)
144
+ - **Migrating from JS or older TS**: Read [features-ts5x](references/features-ts5x.md) and [best-practices-tsconfig](references/best-practices-tsconfig.md)
145
+ - **Performance issues with types**: Read [best-practices-performance](references/best-practices-performance.md)
@@ -0,0 +1,65 @@
1
+ ---
2
+ description: Run TypeScript type-checking and resolve all errors using the typescript-expert skill
3
+ allowed-tools: ["Read", "Edit", "Write", "Glob", "Grep", "Bash"]
4
+ ---
5
+
6
+ You are a TypeScript expert with deep expertise in advanced typing patterns, modern JavaScript (ES6+), and enterprise-grade development practices. You specialize in building reliable, maintainable, and performant TypeScript solutions for complex business problems, with a solid understanding of JavaScript fundamentals and code quality tools.
7
+
8
+ Use the `typescript-expert` skill for reference when resolving complex type issues — it covers generics, conditional types, mapped types, utility types, type guards, discriminated unions, and TypeScript 5.x features.
9
+
10
+ ## Step 1: Detect the Project Setup
11
+
12
+ Read `package.json` to determine:
13
+ - The package manager in use (`npm`, `pnpm`, `yarn`, or `bun`) — check for lock files (`pnpm-lock.yaml`, `yarn.lock`, `bun.lockb`, `package-lock.json`)
14
+ - Whether a `typecheck` script exists in `scripts` (e.g., `"typecheck": "tsc --noEmit"`)
15
+ - The TypeScript version installed
16
+ - Any relevant type-checking plugins (e.g., `vue-tsc`, `astro check`)
17
+
18
+ Read `tsconfig.json` (and any extended configs like `tsconfig.app.json`) to understand:
19
+ - The `strict` settings in effect
20
+ - The `include`/`exclude` paths
21
+ - Module resolution strategy
22
+ - Any path aliases
23
+
24
+ ## Step 2: Run Type-Checking
25
+
26
+ Run the appropriate command based on what you found:
27
+
28
+ 1. **If a `typecheck` script exists**: `npm run typecheck` / `pnpm run typecheck` / `yarn typecheck`
29
+ 2. **If no script but `tsc` is available**: `npx tsc --noEmit`
30
+ 3. **For monorepos**: Check if there's a root-level typecheck or per-package scripts
31
+
32
+ Capture the full output. If there are no errors, report success and stop.
33
+
34
+ ## Step 3: Analyze and Categorize Errors
35
+
36
+ Group errors by category before fixing:
37
+
38
+ - **Missing types**: `Cannot find module` or `Could not find a declaration file` — need `@types/*` packages or declaration files
39
+ - **Strict null violations**: `Object is possibly 'null' or 'undefined'` — need null checks or non-null assertions
40
+ - **Type mismatches**: `Type 'X' is not assignable to type 'Y'` — need type corrections, guards, or generics
41
+ - **Missing properties**: `Property 'X' does not exist on type 'Y'` — need interface extensions or type narrowing
42
+ - **Import issues**: `Module has no exported member` — need import corrections or type augmentation
43
+ - **Generic constraints**: `Type 'T' does not satisfy the constraint` — need constraint adjustments
44
+
45
+ ## Step 4: Fix Errors Systematically
46
+
47
+ Work through errors file-by-file, starting with root causes (a single fix often resolves multiple downstream errors):
48
+
49
+ 1. **Fix type declaration issues first** — missing `@types/*`, incorrect `d.ts` files, or module augmentations
50
+ 2. **Fix interface/type definitions** — incorrect shapes propagate errors everywhere
51
+ 3. **Fix implementation code** — narrowing, guards, assertions, generic constraints
52
+ 4. **Fix edge cases** — strict null checks, index access, exhaustiveness
53
+
54
+ For each fix:
55
+ - Read the file and understand the context around the error
56
+ - Apply the minimal correct fix — don't over-annotate or use `any` as an escape hatch
57
+ - Prefer type narrowing and guards over type assertions (`as`)
58
+ - Use `unknown` instead of `any` when the type is truly unknown
59
+ - Add `// @ts-expect-error` only as a last resort, with a comment explaining why
60
+
61
+ ## Step 5: Verify
62
+
63
+ Re-run the type-check command from Step 2. If errors remain, go back to Step 3 with the new output. Repeat until clean.
64
+
65
+ Report the final result: how many errors were found, how many were fixed, and what changes were made.
@@ -0,0 +1,190 @@
1
+ # Conditional Types
2
+
3
+ Conditional types select one of two types based on a condition, enabling type-level logic similar to ternary expressions.
4
+
5
+ ## Basic Syntax
6
+
7
+ ```typescript
8
+ type IsString<T> = T extends string ? true : false;
9
+
10
+ type A = IsString<"hello">; // true
11
+ type B = IsString<42>; // false
12
+ ```
13
+
14
+ The syntax is `T extends U ? X : Y` — if `T` is assignable to `U`, the result is `X`, otherwise `Y`.
15
+
16
+ ## The `infer` Keyword
17
+
18
+ `infer` declares a type variable within a conditional type, extracting parts of a type:
19
+
20
+ ```typescript
21
+ // Extract the element type from an array
22
+ type ElementType<T> = T extends (infer E)[] ? E : never;
23
+ type A = ElementType<string[]>; // string
24
+ type B = ElementType<number>; // never
25
+
26
+ // Extract the return type of a function
27
+ type MyReturnType<T> = T extends (...args: any[]) => infer R ? R : never;
28
+ type C = MyReturnType<() => string>; // string
29
+
30
+ // Extract promise inner type
31
+ type UnwrapPromise<T> = T extends Promise<infer U> ? U : T;
32
+ type D = UnwrapPromise<Promise<number>>; // number
33
+ type E = UnwrapPromise<string>; // string
34
+
35
+ // Multiple infer positions
36
+ type FirstArg<T> = T extends (first: infer F, ...rest: any[]) => any ? F : never;
37
+ type F = FirstArg<(name: string, age: number) => void>; // string
38
+ ```
39
+
40
+ ### `infer` with Constraints (TS 4.7+)
41
+
42
+ You can constrain what `infer` matches:
43
+
44
+ ```typescript
45
+ // Only infer if the element is a string
46
+ type StringElements<T> = T extends (infer E extends string)[] ? E : never;
47
+ type G = StringElements<["a", "b", "c"]>; // "a" | "b" | "c"
48
+ type H = StringElements<[1, 2, 3]>; // never
49
+ ```
50
+
51
+ ## Distributive Conditional Types
52
+
53
+ When a conditional type acts on a **naked type parameter** (not wrapped in `[]`, `Promise<>`, etc.), it distributes over union types:
54
+
55
+ ```typescript
56
+ type ToArray<T> = T extends any ? T[] : never;
57
+
58
+ // Distributes: applies to each union member separately
59
+ type A = ToArray<string | number>; // string[] | number[]
60
+
61
+ // Compare with non-distributive version:
62
+ type ToArrayND<T> = [T] extends [any] ? T[] : never;
63
+ type B = ToArrayND<string | number>; // (string | number)[]
64
+ ```
65
+
66
+ ### Preventing Distribution
67
+
68
+ Wrap both sides in `[]` to prevent distribution:
69
+
70
+ ```typescript
71
+ type IsNever<T> = [T] extends [never] ? true : false;
72
+
73
+ type A = IsNever<never>; // true
74
+ type B = IsNever<string>; // false
75
+
76
+ // Without brackets, never distributes to... nothing
77
+ type IsNeverBad<T> = T extends never ? true : false;
78
+ type C = IsNeverBad<never>; // never (not true!)
79
+ ```
80
+
81
+ ## Practical Patterns
82
+
83
+ ### Filtering Union Members
84
+
85
+ ```typescript
86
+ // Keep only object types from a union
87
+ type ObjectsOnly<T> = T extends object ? T : never;
88
+ type Mixed = string | { a: 1 } | number | { b: 2 };
89
+ type OnlyObjects = ObjectsOnly<Mixed>; // { a: 1 } | { b: 2 }
90
+
91
+ // Keep only functions
92
+ type FunctionsOnly<T> = T extends (...args: any[]) => any ? T : never;
93
+ ```
94
+
95
+ ### Recursive Conditional Types
96
+
97
+ ```typescript
98
+ // Deeply unwrap promises
99
+ type DeepAwaited<T> = T extends Promise<infer U> ? DeepAwaited<U> : T;
100
+ type A = DeepAwaited<Promise<Promise<Promise<string>>>>; // string
101
+
102
+ // Flatten nested arrays
103
+ type Flatten<T> = T extends (infer E)[] ? Flatten<E> : T;
104
+ type B = Flatten<number[][][]>; // number
105
+ ```
106
+
107
+ ### Extracting Based on Shape
108
+
109
+ ```typescript
110
+ // Extract event handlers from an object type
111
+ type EventHandlers<T> = {
112
+ [K in keyof T as T[K] extends (...args: any[]) => any ? K : never]: T[K];
113
+ };
114
+
115
+ interface Component {
116
+ onClick: (e: MouseEvent) => void;
117
+ onHover: (e: MouseEvent) => void;
118
+ className: string;
119
+ id: string;
120
+ }
121
+
122
+ type Handlers = EventHandlers<Component>;
123
+ // { onClick: (e: MouseEvent) => void; onHover: (e: MouseEvent) => void }
124
+ ```
125
+
126
+ ### Conditional Return Types
127
+
128
+ ```typescript
129
+ // Function overload via conditional types
130
+ function process<T extends string | number>(
131
+ value: T
132
+ ): T extends string ? string[] : number {
133
+ if (typeof value === "string") {
134
+ return value.split("") as any;
135
+ }
136
+ return (value * 2) as any;
137
+ }
138
+
139
+ const a = process("hello"); // string[]
140
+ const b = process(42); // number
141
+ ```
142
+
143
+ Note: Conditional return types often require `as any` inside the implementation because TypeScript can't narrow generic types. This is one of the few legitimate uses of `as any`.
144
+
145
+ ### Type-Level Assertions
146
+
147
+ ```typescript
148
+ // Ensure a type satisfies a condition at the type level
149
+ type Assert<T extends true> = T;
150
+ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? true : false : false;
151
+
152
+ // Compile-time test
153
+ type _test = Assert<IsEqual<string, string>>; // OK
154
+ // type _test2 = Assert<IsEqual<string, number>>; // Error!
155
+ ```
156
+
157
+ ## Common Utility Implementations
158
+
159
+ ```typescript
160
+ // Built-in Exclude
161
+ type MyExclude<T, U> = T extends U ? never : T;
162
+
163
+ // Built-in Extract
164
+ type MyExtract<T, U> = T extends U ? T : never;
165
+
166
+ // Built-in NonNullable
167
+ type MyNonNullable<T> = T extends null | undefined ? never : T;
168
+
169
+ // Built-in Parameters
170
+ type MyParameters<T extends (...args: any) => any> =
171
+ T extends (...args: infer P) => any ? P : never;
172
+
173
+ // Built-in ReturnType
174
+ type MyReturnType<T extends (...args: any) => any> =
175
+ T extends (...args: any) => infer R ? R : any;
176
+ ```
177
+
178
+ ## Gotchas
179
+
180
+ 1. **`never` in conditionals**: `never` distributes to nothing. Use `[T] extends [never]` to check for never.
181
+
182
+ 2. **`any` in conditionals**: `any` produces a union of both branches:
183
+ ```typescript
184
+ type Test<T> = T extends string ? "yes" : "no";
185
+ type X = Test<any>; // "yes" | "no"
186
+ ```
187
+
188
+ 3. **Depth limits**: TypeScript has a recursion depth limit (~50 levels). Deep recursive types may hit it.
189
+
190
+ 4. **Assignability of conditional types**: TypeScript often can't resolve conditional types involving unresolved generics. Inside a generic function, `T extends X ? A : B` remains unresolved.
@@ -0,0 +1,243 @@
1
+ # TC39 Decorators (TypeScript 5.0+)
2
+
3
+ TypeScript 5.0 introduced support for the TC39 Stage 3 decorator proposal. These are **not** the same as legacy `experimentalDecorators` — they have different semantics, no `reflect-metadata`, and work without any compiler flag.
4
+
5
+ ## When to Use Which
6
+
7
+ - **TC39 decorators** (default, no flag): The standard going forward. Use for new code.
8
+ - **`experimentalDecorators`** (tsconfig flag): Legacy. Required by Angular, NestJS, TypeORM, and other frameworks that depend on `reflect-metadata`. Keep using if your framework requires it.
9
+
10
+ Check your framework's documentation — many are migrating to TC39 decorators.
11
+
12
+ ## Class Decorators
13
+
14
+ ```typescript
15
+ // A class decorator receives the class itself and an optional context
16
+ function sealed(target: Function, context: ClassDecoratorContext) {
17
+ Object.seal(target);
18
+ Object.seal(target.prototype);
19
+ }
20
+
21
+ @sealed
22
+ class Greeter {
23
+ greeting: string;
24
+ constructor(message: string) {
25
+ this.greeting = message;
26
+ }
27
+ }
28
+ ```
29
+
30
+ ### Adding Functionality
31
+
32
+ ```typescript
33
+ function withTimestamp<T extends new (...args: any[]) => any>(
34
+ target: T,
35
+ context: ClassDecoratorContext
36
+ ) {
37
+ return class extends target {
38
+ createdAt = new Date();
39
+ };
40
+ }
41
+
42
+ @withTimestamp
43
+ class User {
44
+ name: string;
45
+ constructor(name: string) { this.name = name; }
46
+ }
47
+ ```
48
+
49
+ ## Method Decorators
50
+
51
+ ```typescript
52
+ function log(
53
+ target: Function,
54
+ context: ClassMethodDecoratorContext
55
+ ) {
56
+ const methodName = String(context.name);
57
+ return function (this: any, ...args: any[]) {
58
+ console.log(`Calling ${methodName} with`, args);
59
+ const result = target.call(this, ...args);
60
+ console.log(`${methodName} returned`, result);
61
+ return result;
62
+ };
63
+ }
64
+
65
+ class Calculator {
66
+ @log
67
+ add(a: number, b: number): number {
68
+ return a + b;
69
+ }
70
+ }
71
+ ```
72
+
73
+ ### Bound Method Decorator
74
+
75
+ ```typescript
76
+ function bound(
77
+ target: Function,
78
+ context: ClassMethodDecoratorContext
79
+ ) {
80
+ const methodName = context.name;
81
+ context.addInitializer(function (this: any) {
82
+ this[methodName] = this[methodName].bind(this);
83
+ });
84
+ }
85
+
86
+ class Button {
87
+ label = "Click me";
88
+
89
+ @bound
90
+ handleClick() {
91
+ console.log(this.label); // Always correct `this`
92
+ }
93
+ }
94
+ ```
95
+
96
+ ## Field Decorators
97
+
98
+ ```typescript
99
+ function min(minValue: number) {
100
+ return function (
101
+ target: undefined, // field decorators receive undefined
102
+ context: ClassFieldDecoratorContext
103
+ ) {
104
+ return function (initialValue: number) {
105
+ if (initialValue < minValue) {
106
+ throw new Error(`${String(context.name)} must be >= ${minValue}`);
107
+ }
108
+ return initialValue;
109
+ };
110
+ };
111
+ }
112
+
113
+ class Product {
114
+ @min(0)
115
+ price: number;
116
+
117
+ constructor(price: number) {
118
+ this.price = price;
119
+ }
120
+ }
121
+ ```
122
+
123
+ ## Accessor Decorators
124
+
125
+ The `accessor` keyword (TS 5.0+) creates auto-accessor fields with implicit getter/setter:
126
+
127
+ ```typescript
128
+ class Person {
129
+ accessor name: string;
130
+
131
+ constructor(name: string) {
132
+ this.name = name;
133
+ }
134
+ }
135
+
136
+ // Decorator for accessors
137
+ function validate(
138
+ target: ClassAccessorDecoratorTarget<any, string>,
139
+ context: ClassAccessorDecoratorContext
140
+ ) {
141
+ return {
142
+ set(value: string) {
143
+ if (!value.trim()) throw new Error(`${String(context.name)} cannot be empty`);
144
+ target.set.call(this, value);
145
+ },
146
+ get() {
147
+ return target.get.call(this);
148
+ },
149
+ };
150
+ }
151
+
152
+ class User {
153
+ @validate
154
+ accessor name: string = "";
155
+ }
156
+ ```
157
+
158
+ ## Decorator Factories
159
+
160
+ Most real-world decorators are factories — functions that return decorators:
161
+
162
+ ```typescript
163
+ function retry(attempts: number) {
164
+ return function (
165
+ target: Function,
166
+ context: ClassMethodDecoratorContext
167
+ ) {
168
+ return async function (this: any, ...args: any[]) {
169
+ for (let i = 0; i < attempts; i++) {
170
+ try {
171
+ return await target.call(this, ...args);
172
+ } catch (err) {
173
+ if (i === attempts - 1) throw err;
174
+ }
175
+ }
176
+ };
177
+ };
178
+ }
179
+
180
+ class ApiClient {
181
+ @retry(3)
182
+ async fetchData(url: string): Promise<Response> {
183
+ return fetch(url);
184
+ }
185
+ }
186
+ ```
187
+
188
+ ## Decorator Context Types
189
+
190
+ Each decorator kind has a specific context type:
191
+
192
+ | Decorator Target | Context Type |
193
+ |------------------|-------------|
194
+ | Class | `ClassDecoratorContext` |
195
+ | Method | `ClassMethodDecoratorContext` |
196
+ | Getter | `ClassGetterDecoratorContext` |
197
+ | Setter | `ClassSetterDecoratorContext` |
198
+ | Field | `ClassFieldDecoratorContext` |
199
+ | Auto-accessor | `ClassAccessorDecoratorContext` |
200
+
201
+ All context types include:
202
+ - `name`: The name of the decorated element
203
+ - `kind`: "class", "method", "getter", "setter", "field", or "accessor"
204
+ - `static`: Whether the element is static
205
+ - `private`: Whether the element is private
206
+ - `addInitializer()`: Register a callback to run during construction
207
+ - `metadata`: Shared metadata object (replaces `reflect-metadata`)
208
+
209
+ ## Metadata (TC39 Decorator Metadata)
210
+
211
+ TC39 decorators have a built-in metadata mechanism:
212
+
213
+ ```typescript
214
+ function meta(key: string, value: any) {
215
+ return function (_target: any, context: ClassMethodDecoratorContext) {
216
+ context.metadata[key] = value;
217
+ };
218
+ }
219
+
220
+ class Routes {
221
+ @meta("path", "/users")
222
+ @meta("method", "GET")
223
+ getUsers() { ... }
224
+ }
225
+
226
+ // Access metadata
227
+ const metadata = Routes[Symbol.metadata];
228
+ // { path: "/users", method: "GET" }
229
+ ```
230
+
231
+ ## Migration from `experimentalDecorators`
232
+
233
+ Key differences:
234
+
235
+ | `experimentalDecorators` | TC39 Decorators |
236
+ |--------------------------|-----------------|
237
+ | Receives `(target, key, descriptor)` | Receives `(value, context)` |
238
+ | Uses `reflect-metadata` for metadata | Uses `context.metadata` |
239
+ | Parameter decorators supported | No parameter decorators |
240
+ | `emitDecoratorMetadata` flag | No equivalent (use `context.metadata`) |
241
+ | Runs at class definition time | Runs at class definition time |
242
+
243
+ Parameter decorators are **not** part of TC39 decorators. Frameworks that need them (like NestJS for DI) still require `experimentalDecorators`.