thachvd-kit 1.0.28 → 1.0.30

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 (396) hide show
  1. package/README.md +50 -148
  2. package/bin/cli.js +439 -293
  3. package/package.json +1 -9
  4. package/.agent/agents/backend-specialist.md +0 -263
  5. package/.agent/agents/code-archaeologist.md +0 -106
  6. package/.agent/agents/database-architect.md +0 -226
  7. package/.agent/agents/debugger.md +0 -225
  8. package/.agent/agents/devops-engineer.md +0 -242
  9. package/.agent/agents/documentation-writer.md +0 -104
  10. package/.agent/agents/explorer-agent.md +0 -73
  11. package/.agent/agents/frontend-specialist.md +0 -593
  12. package/.agent/agents/game-developer.md +0 -162
  13. package/.agent/agents/mobile-developer.md +0 -377
  14. package/.agent/agents/orchestrator.md +0 -416
  15. package/.agent/agents/penetration-tester.md +0 -188
  16. package/.agent/agents/performance-optimizer.md +0 -187
  17. package/.agent/agents/product-manager.md +0 -112
  18. package/.agent/agents/product-owner.md +0 -95
  19. package/.agent/agents/project-planner.md +0 -406
  20. package/.agent/agents/qa-automation-engineer.md +0 -103
  21. package/.agent/agents/security-auditor.md +0 -170
  22. package/.agent/agents/seo-specialist.md +0 -111
  23. package/.agent/agents/test-engineer.md +0 -158
  24. package/.agent/docs/architecture.md +0 -15
  25. package/.agent/docs/conventions.md +0 -16
  26. package/.agent/docs/getting-started.md +0 -92
  27. package/.agent/docs/project.md +0 -59
  28. package/.agent/docs/tooling.md +0 -136
  29. package/.agent/docs/workflow.md +0 -78
  30. package/.agent/rules/GEMINI.md +0 -61
  31. package/.agent/skills/api-design/SKILL.md +0 -156
  32. package/.agent/skills/api-patterns/SKILL.md +0 -81
  33. package/.agent/skills/api-patterns/api-style.md +0 -42
  34. package/.agent/skills/api-patterns/auth.md +0 -24
  35. package/.agent/skills/api-patterns/documentation.md +0 -26
  36. package/.agent/skills/api-patterns/graphql.md +0 -41
  37. package/.agent/skills/api-patterns/rate-limiting.md +0 -31
  38. package/.agent/skills/api-patterns/response.md +0 -37
  39. package/.agent/skills/api-patterns/rest.md +0 -40
  40. package/.agent/skills/api-patterns/scripts/api_validator.py +0 -211
  41. package/.agent/skills/api-patterns/security-testing.md +0 -122
  42. package/.agent/skills/api-patterns/trpc.md +0 -41
  43. package/.agent/skills/api-patterns/versioning.md +0 -22
  44. package/.agent/skills/app-builder/SKILL.md +0 -75
  45. package/.agent/skills/app-builder/agent-coordination.md +0 -71
  46. package/.agent/skills/app-builder/feature-building.md +0 -53
  47. package/.agent/skills/app-builder/project-detection.md +0 -34
  48. package/.agent/skills/app-builder/scaffolding.md +0 -118
  49. package/.agent/skills/app-builder/tech-stack.md +0 -40
  50. package/.agent/skills/app-builder/templates/SKILL.md +0 -39
  51. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +0 -76
  52. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +0 -92
  53. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +0 -88
  54. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +0 -88
  55. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +0 -83
  56. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +0 -90
  57. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +0 -90
  58. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +0 -122
  59. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +0 -122
  60. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +0 -169
  61. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +0 -134
  62. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +0 -83
  63. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +0 -119
  64. package/.agent/skills/architecture/SKILL.md +0 -55
  65. package/.agent/skills/architecture/context-discovery.md +0 -43
  66. package/.agent/skills/architecture/examples.md +0 -94
  67. package/.agent/skills/architecture/pattern-selection.md +0 -68
  68. package/.agent/skills/architecture/patterns-reference.md +0 -50
  69. package/.agent/skills/architecture/trade-off-analysis.md +0 -77
  70. package/.agent/skills/bash-linux/SKILL.md +0 -199
  71. package/.agent/skills/behavioral-modes/SKILL.md +0 -242
  72. package/.agent/skills/brainstorming/SKILL.md +0 -163
  73. package/.agent/skills/brainstorming/dynamic-questioning.md +0 -350
  74. package/.agent/skills/clean-code/SKILL.md +0 -201
  75. package/.agent/skills/code-review-checklist/SKILL.md +0 -109
  76. package/.agent/skills/database-design/SKILL.md +0 -52
  77. package/.agent/skills/database-design/database-selection.md +0 -43
  78. package/.agent/skills/database-design/indexing.md +0 -39
  79. package/.agent/skills/database-design/migrations.md +0 -48
  80. package/.agent/skills/database-design/optimization.md +0 -36
  81. package/.agent/skills/database-design/orm-selection.md +0 -30
  82. package/.agent/skills/database-design/schema-design.md +0 -56
  83. package/.agent/skills/database-design/scripts/schema_validator.py +0 -172
  84. package/.agent/skills/deployment-procedures/SKILL.md +0 -241
  85. package/.agent/skills/desktop-design/SKILL.md +0 -25
  86. package/.agent/skills/dispatching-parallel-agents/SKILL.md +0 -112
  87. package/.agent/skills/doc.md +0 -177
  88. package/.agent/skills/docker-patterns/SKILL.md +0 -232
  89. package/.agent/skills/documentation-templates/SKILL.md +0 -194
  90. package/.agent/skills/executing-plans/SKILL.md +0 -61
  91. package/.agent/skills/finishing-a-development-branch/SKILL.md +0 -135
  92. package/.agent/skills/frontend-design/SKILL.md +0 -418
  93. package/.agent/skills/frontend-design/animation-guide.md +0 -331
  94. package/.agent/skills/frontend-design/color-system.md +0 -311
  95. package/.agent/skills/frontend-design/decision-trees.md +0 -418
  96. package/.agent/skills/frontend-design/motion-graphics.md +0 -306
  97. package/.agent/skills/frontend-design/scripts/accessibility_checker.py +0 -183
  98. package/.agent/skills/frontend-design/scripts/ux_audit.py +0 -722
  99. package/.agent/skills/frontend-design/typography-system.md +0 -345
  100. package/.agent/skills/frontend-design/ux-psychology.md +0 -1116
  101. package/.agent/skills/frontend-design/visual-effects.md +0 -383
  102. package/.agent/skills/game-development/2d-games/SKILL.md +0 -119
  103. package/.agent/skills/game-development/3d-games/SKILL.md +0 -135
  104. package/.agent/skills/game-development/SKILL.md +0 -167
  105. package/.agent/skills/game-development/game-art/SKILL.md +0 -185
  106. package/.agent/skills/game-development/game-audio/SKILL.md +0 -190
  107. package/.agent/skills/game-development/game-design/SKILL.md +0 -129
  108. package/.agent/skills/game-development/mobile-games/SKILL.md +0 -108
  109. package/.agent/skills/game-development/multiplayer/SKILL.md +0 -132
  110. package/.agent/skills/game-development/pc-games/SKILL.md +0 -144
  111. package/.agent/skills/game-development/vr-ar/SKILL.md +0 -123
  112. package/.agent/skills/game-development/web-games/SKILL.md +0 -150
  113. package/.agent/skills/geo-fundamentals/SKILL.md +0 -156
  114. package/.agent/skills/geo-fundamentals/scripts/geo_checker.py +0 -289
  115. package/.agent/skills/golang-patterns/SKILL.md +0 -226
  116. package/.agent/skills/golang-testing/SKILL.md +0 -182
  117. package/.agent/skills/i18n-localization/SKILL.md +0 -154
  118. package/.agent/skills/i18n-localization/scripts/i18n_checker.py +0 -241
  119. package/.agent/skills/intelligent-routing/SKILL.md +0 -335
  120. package/.agent/skills/laravel-patterns/SKILL.md +0 -224
  121. package/.agent/skills/laravel-security/SKILL.md +0 -171
  122. package/.agent/skills/laravel-tdd/SKILL.md +0 -149
  123. package/.agent/skills/lint-and-validate/SKILL.md +0 -45
  124. package/.agent/skills/lint-and-validate/scripts/lint_runner.py +0 -184
  125. package/.agent/skills/lint-and-validate/scripts/type_coverage.py +0 -173
  126. package/.agent/skills/mcp-builder/SKILL.md +0 -176
  127. package/.agent/skills/mobile-design/SKILL.md +0 -394
  128. package/.agent/skills/mobile-design/decision-trees.md +0 -516
  129. package/.agent/skills/mobile-design/mobile-backend.md +0 -491
  130. package/.agent/skills/mobile-design/mobile-color-system.md +0 -420
  131. package/.agent/skills/mobile-design/mobile-debugging.md +0 -122
  132. package/.agent/skills/mobile-design/mobile-design-thinking.md +0 -357
  133. package/.agent/skills/mobile-design/mobile-navigation.md +0 -458
  134. package/.agent/skills/mobile-design/mobile-performance.md +0 -767
  135. package/.agent/skills/mobile-design/mobile-testing.md +0 -356
  136. package/.agent/skills/mobile-design/mobile-typography.md +0 -433
  137. package/.agent/skills/mobile-design/platform-android.md +0 -666
  138. package/.agent/skills/mobile-design/platform-ios.md +0 -561
  139. package/.agent/skills/mobile-design/scripts/mobile_audit.py +0 -670
  140. package/.agent/skills/mobile-design/touch-psychology.md +0 -537
  141. package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +0 -312
  142. package/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +0 -240
  143. package/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +0 -490
  144. package/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +0 -264
  145. package/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +0 -581
  146. package/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +0 -432
  147. package/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +0 -684
  148. package/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +0 -150
  149. package/.agent/skills/nextjs-react-expert/SKILL.md +0 -286
  150. package/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +0 -222
  151. package/.agent/skills/nextjs-react-expert/scripts/react_performance_checker.py +0 -252
  152. package/.agent/skills/nodejs-best-practices/SKILL.md +0 -333
  153. package/.agent/skills/parallel-agents/SKILL.md +0 -175
  154. package/.agent/skills/performance-profiling/SKILL.md +0 -143
  155. package/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +0 -76
  156. package/.agent/skills/plan-writing/SKILL.md +0 -152
  157. package/.agent/skills/powershell-windows/SKILL.md +0 -167
  158. package/.agent/skills/project-onboarding/SKILL.md +0 -42
  159. package/.agent/skills/python-patterns/SKILL.md +0 -441
  160. package/.agent/skills/react-frontend/SKILL.md +0 -25
  161. package/.agent/skills/receiving-code-review/SKILL.md +0 -120
  162. package/.agent/skills/red-team-tactics/SKILL.md +0 -199
  163. package/.agent/skills/requesting-code-review/SKILL.md +0 -67
  164. package/.agent/skills/rust-pro/SKILL.md +0 -176
  165. package/.agent/skills/seo-fundamentals/SKILL.md +0 -129
  166. package/.agent/skills/seo-fundamentals/scripts/seo_checker.py +0 -219
  167. package/.agent/skills/server-management/SKILL.md +0 -161
  168. package/.agent/skills/subagent-driven-development/SKILL.md +0 -76
  169. package/.agent/skills/systematic-debugging/SKILL.md +0 -109
  170. package/.agent/skills/tailwind-patterns/SKILL.md +0 -269
  171. package/.agent/skills/tdd-workflow/SKILL.md +0 -149
  172. package/.agent/skills/testing-patterns/SKILL.md +0 -178
  173. package/.agent/skills/testing-patterns/scripts/test_runner.py +0 -219
  174. package/.agent/skills/using-git-worktrees/SKILL.md +0 -121
  175. package/.agent/skills/verification-before-completion/SKILL.md +0 -99
  176. package/.agent/skills/vulnerability-scanner/SKILL.md +0 -276
  177. package/.agent/skills/vulnerability-scanner/checklists.md +0 -121
  178. package/.agent/skills/vulnerability-scanner/scripts/security_scan.py +0 -458
  179. package/.agent/skills/web-design-guidelines/SKILL.md +0 -57
  180. package/.agent/skills/webapp-testing/SKILL.md +0 -187
  181. package/.agent/skills/webapp-testing/scripts/playwright_runner.py +0 -173
  182. package/.agent/skills/writing-skills/SKILL.md +0 -170
  183. package/.agent/workflows/brainstorm.md +0 -113
  184. package/.agent/workflows/create.md +0 -59
  185. package/.agent/workflows/debug.md +0 -103
  186. package/.agent/workflows/deploy.md +0 -176
  187. package/.agent/workflows/enhance.md +0 -63
  188. package/.agent/workflows/orchestrate.md +0 -237
  189. package/.agent/workflows/plan.md +0 -89
  190. package/.agent/workflows/preview.md +0 -81
  191. package/.agent/workflows/release.md +0 -42
  192. package/.agent/workflows/review.md +0 -125
  193. package/.agent/workflows/simple.md +0 -42
  194. package/.agent/workflows/spec.md +0 -140
  195. package/.agent/workflows/status.md +0 -86
  196. package/.agent/workflows/task.md +0 -59
  197. package/.agent/workflows/test.md +0 -144
  198. package/.agent/workflows/ui-ux-pro-max.md +0 -296
  199. package/agents/backend-specialist.md +0 -263
  200. package/agents/code-archaeologist.md +0 -106
  201. package/agents/database-architect.md +0 -226
  202. package/agents/debugger.md +0 -225
  203. package/agents/devops-engineer.md +0 -242
  204. package/agents/documentation-writer.md +0 -104
  205. package/agents/explorer-agent.md +0 -73
  206. package/agents/frontend-specialist.md +0 -593
  207. package/agents/game-developer.md +0 -162
  208. package/agents/mobile-developer.md +0 -377
  209. package/agents/orchestrator.md +0 -416
  210. package/agents/penetration-tester.md +0 -188
  211. package/agents/performance-optimizer.md +0 -187
  212. package/agents/product-manager.md +0 -112
  213. package/agents/product-owner.md +0 -95
  214. package/agents/project-planner.md +0 -406
  215. package/agents/qa-automation-engineer.md +0 -103
  216. package/agents/security-auditor.md +0 -170
  217. package/agents/seo-specialist.md +0 -111
  218. package/agents/test-engineer.md +0 -158
  219. package/kit/PROMPT_RECIPE.md +0 -30
  220. package/kit/README.md +0 -30
  221. package/prompts/debug.md +0 -11
  222. package/prompts/release.md +0 -11
  223. package/prompts/simple.md +0 -11
  224. package/prompts/spec.md +0 -11
  225. package/prompts/task.md +0 -12
  226. package/rules/GEMINI.md +0 -45
  227. package/scripts/auto_preview.py +0 -148
  228. package/scripts/checklist.py +0 -217
  229. package/scripts/session_manager.py +0 -120
  230. package/scripts/verify_all.py +0 -327
  231. package/skills/api-design/SKILL.md +0 -156
  232. package/skills/api-patterns/SKILL.md +0 -81
  233. package/skills/api-patterns/api-style.md +0 -42
  234. package/skills/api-patterns/auth.md +0 -24
  235. package/skills/api-patterns/documentation.md +0 -26
  236. package/skills/api-patterns/graphql.md +0 -41
  237. package/skills/api-patterns/rate-limiting.md +0 -31
  238. package/skills/api-patterns/response.md +0 -37
  239. package/skills/api-patterns/rest.md +0 -40
  240. package/skills/api-patterns/scripts/api_validator.py +0 -211
  241. package/skills/api-patterns/security-testing.md +0 -122
  242. package/skills/api-patterns/trpc.md +0 -41
  243. package/skills/api-patterns/versioning.md +0 -22
  244. package/skills/app-builder/SKILL.md +0 -75
  245. package/skills/app-builder/agent-coordination.md +0 -71
  246. package/skills/app-builder/feature-building.md +0 -53
  247. package/skills/app-builder/project-detection.md +0 -34
  248. package/skills/app-builder/scaffolding.md +0 -118
  249. package/skills/app-builder/tech-stack.md +0 -40
  250. package/skills/app-builder/templates/SKILL.md +0 -39
  251. package/skills/app-builder/templates/astro-static/TEMPLATE.md +0 -76
  252. package/skills/app-builder/templates/chrome-extension/TEMPLATE.md +0 -92
  253. package/skills/app-builder/templates/cli-tool/TEMPLATE.md +0 -88
  254. package/skills/app-builder/templates/electron-desktop/TEMPLATE.md +0 -88
  255. package/skills/app-builder/templates/express-api/TEMPLATE.md +0 -83
  256. package/skills/app-builder/templates/flutter-app/TEMPLATE.md +0 -90
  257. package/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +0 -90
  258. package/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +0 -122
  259. package/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +0 -122
  260. package/skills/app-builder/templates/nextjs-static/TEMPLATE.md +0 -169
  261. package/skills/app-builder/templates/nuxt-app/TEMPLATE.md +0 -134
  262. package/skills/app-builder/templates/python-fastapi/TEMPLATE.md +0 -83
  263. package/skills/app-builder/templates/react-native-app/TEMPLATE.md +0 -119
  264. package/skills/architecture/SKILL.md +0 -55
  265. package/skills/architecture/context-discovery.md +0 -43
  266. package/skills/architecture/examples.md +0 -94
  267. package/skills/architecture/pattern-selection.md +0 -68
  268. package/skills/architecture/patterns-reference.md +0 -50
  269. package/skills/architecture/trade-off-analysis.md +0 -77
  270. package/skills/bash-linux/SKILL.md +0 -199
  271. package/skills/behavioral-modes/SKILL.md +0 -242
  272. package/skills/brainstorming/SKILL.md +0 -163
  273. package/skills/brainstorming/dynamic-questioning.md +0 -350
  274. package/skills/clean-code/SKILL.md +0 -201
  275. package/skills/code-review-checklist/SKILL.md +0 -142
  276. package/skills/database-design/SKILL.md +0 -52
  277. package/skills/database-design/database-selection.md +0 -43
  278. package/skills/database-design/indexing.md +0 -39
  279. package/skills/database-design/migrations.md +0 -48
  280. package/skills/database-design/optimization.md +0 -36
  281. package/skills/database-design/orm-selection.md +0 -30
  282. package/skills/database-design/schema-design.md +0 -56
  283. package/skills/database-design/scripts/schema_validator.py +0 -172
  284. package/skills/deployment-procedures/SKILL.md +0 -241
  285. package/skills/desktop-design/SKILL.md +0 -25
  286. package/skills/dispatching-parallel-agents/SKILL.md +0 -112
  287. package/skills/doc.md +0 -177
  288. package/skills/docker-patterns/SKILL.md +0 -232
  289. package/skills/documentation-templates/SKILL.md +0 -194
  290. package/skills/executing-plans/SKILL.md +0 -61
  291. package/skills/finishing-a-development-branch/SKILL.md +0 -135
  292. package/skills/frontend-design/SKILL.md +0 -418
  293. package/skills/frontend-design/animation-guide.md +0 -331
  294. package/skills/frontend-design/color-system.md +0 -311
  295. package/skills/frontend-design/decision-trees.md +0 -418
  296. package/skills/frontend-design/motion-graphics.md +0 -306
  297. package/skills/frontend-design/scripts/accessibility_checker.py +0 -183
  298. package/skills/frontend-design/scripts/ux_audit.py +0 -722
  299. package/skills/frontend-design/typography-system.md +0 -345
  300. package/skills/frontend-design/ux-psychology.md +0 -1116
  301. package/skills/frontend-design/visual-effects.md +0 -383
  302. package/skills/game-development/2d-games/SKILL.md +0 -119
  303. package/skills/game-development/3d-games/SKILL.md +0 -135
  304. package/skills/game-development/SKILL.md +0 -167
  305. package/skills/game-development/game-art/SKILL.md +0 -185
  306. package/skills/game-development/game-audio/SKILL.md +0 -190
  307. package/skills/game-development/game-design/SKILL.md +0 -129
  308. package/skills/game-development/mobile-games/SKILL.md +0 -108
  309. package/skills/game-development/multiplayer/SKILL.md +0 -132
  310. package/skills/game-development/pc-games/SKILL.md +0 -144
  311. package/skills/game-development/vr-ar/SKILL.md +0 -123
  312. package/skills/game-development/web-games/SKILL.md +0 -150
  313. package/skills/geo-fundamentals/SKILL.md +0 -156
  314. package/skills/geo-fundamentals/scripts/geo_checker.py +0 -289
  315. package/skills/golang-patterns/SKILL.md +0 -226
  316. package/skills/golang-testing/SKILL.md +0 -182
  317. package/skills/i18n-localization/SKILL.md +0 -154
  318. package/skills/i18n-localization/scripts/i18n_checker.py +0 -241
  319. package/skills/intelligent-routing/SKILL.md +0 -335
  320. package/skills/laravel-patterns/SKILL.md +0 -224
  321. package/skills/laravel-security/SKILL.md +0 -171
  322. package/skills/laravel-tdd/SKILL.md +0 -149
  323. package/skills/lint-and-validate/SKILL.md +0 -45
  324. package/skills/lint-and-validate/scripts/lint_runner.py +0 -184
  325. package/skills/lint-and-validate/scripts/type_coverage.py +0 -173
  326. package/skills/mcp-builder/SKILL.md +0 -176
  327. package/skills/mobile-design/SKILL.md +0 -394
  328. package/skills/mobile-design/decision-trees.md +0 -516
  329. package/skills/mobile-design/mobile-backend.md +0 -491
  330. package/skills/mobile-design/mobile-color-system.md +0 -420
  331. package/skills/mobile-design/mobile-debugging.md +0 -122
  332. package/skills/mobile-design/mobile-design-thinking.md +0 -357
  333. package/skills/mobile-design/mobile-navigation.md +0 -458
  334. package/skills/mobile-design/mobile-performance.md +0 -767
  335. package/skills/mobile-design/mobile-testing.md +0 -356
  336. package/skills/mobile-design/mobile-typography.md +0 -433
  337. package/skills/mobile-design/platform-android.md +0 -666
  338. package/skills/mobile-design/platform-ios.md +0 -561
  339. package/skills/mobile-design/scripts/mobile_audit.py +0 -670
  340. package/skills/mobile-design/touch-psychology.md +0 -537
  341. package/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +0 -312
  342. package/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +0 -240
  343. package/skills/nextjs-react-expert/3-server-server-side-performance.md +0 -490
  344. package/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +0 -264
  345. package/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +0 -581
  346. package/skills/nextjs-react-expert/6-rendering-rendering-performance.md +0 -432
  347. package/skills/nextjs-react-expert/7-js-javascript-performance.md +0 -684
  348. package/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +0 -150
  349. package/skills/nextjs-react-expert/SKILL.md +0 -286
  350. package/skills/nextjs-react-expert/scripts/convert_rules.py +0 -222
  351. package/skills/nextjs-react-expert/scripts/react_performance_checker.py +0 -252
  352. package/skills/nodejs-best-practices/SKILL.md +0 -333
  353. package/skills/parallel-agents/SKILL.md +0 -175
  354. package/skills/performance-profiling/SKILL.md +0 -143
  355. package/skills/performance-profiling/scripts/lighthouse_audit.py +0 -76
  356. package/skills/plan-writing/SKILL.md +0 -152
  357. package/skills/powershell-windows/SKILL.md +0 -167
  358. package/skills/project-onboarding/SKILL.md +0 -42
  359. package/skills/python-patterns/SKILL.md +0 -441
  360. package/skills/react-frontend/SKILL.md +0 -25
  361. package/skills/receiving-code-review/SKILL.md +0 -120
  362. package/skills/red-team-tactics/SKILL.md +0 -199
  363. package/skills/requesting-code-review/SKILL.md +0 -67
  364. package/skills/rust-pro/SKILL.md +0 -176
  365. package/skills/seo-fundamentals/SKILL.md +0 -129
  366. package/skills/seo-fundamentals/scripts/seo_checker.py +0 -219
  367. package/skills/server-management/SKILL.md +0 -161
  368. package/skills/subagent-driven-development/SKILL.md +0 -76
  369. package/skills/systematic-debugging/SKILL.md +0 -109
  370. package/skills/tailwind-patterns/SKILL.md +0 -269
  371. package/skills/tdd-workflow/SKILL.md +0 -173
  372. package/skills/testing-patterns/SKILL.md +0 -178
  373. package/skills/testing-patterns/scripts/test_runner.py +0 -219
  374. package/skills/using-git-worktrees/SKILL.md +0 -121
  375. package/skills/verification-before-completion/SKILL.md +0 -113
  376. package/skills/vulnerability-scanner/SKILL.md +0 -276
  377. package/skills/vulnerability-scanner/checklists.md +0 -121
  378. package/skills/vulnerability-scanner/scripts/security_scan.py +0 -458
  379. package/skills/web-design-guidelines/SKILL.md +0 -57
  380. package/skills/webapp-testing/SKILL.md +0 -187
  381. package/skills/webapp-testing/scripts/playwright_runner.py +0 -173
  382. package/skills/writing-skills/SKILL.md +0 -170
  383. package/workflows/brainstorm.md +0 -113
  384. package/workflows/create.md +0 -59
  385. package/workflows/debug.md +0 -103
  386. package/workflows/deploy.md +0 -176
  387. package/workflows/enhance.md +0 -63
  388. package/workflows/orchestrate.md +0 -237
  389. package/workflows/plan.md +0 -89
  390. package/workflows/preview.md +0 -81
  391. package/workflows/release.md +0 -42
  392. package/workflows/simple.md +0 -42
  393. package/workflows/status.md +0 -86
  394. package/workflows/task.md +0 -59
  395. package/workflows/test.md +0 -144
  396. package/workflows/ui-ux-pro-max.md +0 -296
@@ -1,156 +0,0 @@
1
- ---
2
- name: api-design
3
- description: REST API design patterns. Use when designing new API endpoints, reviewing API contracts, choosing pagination strategies, error response formats, versioning, or HTTP status codes.
4
- allowed-tools: Read, Edit, Write
5
- ---
6
-
7
- # API Design Patterns
8
-
9
- ## URL Structure
10
-
11
- ```
12
- # Resources: plural nouns, lowercase, kebab-case, no verbs
13
- GET /api/v1/users
14
- POST /api/v1/users
15
- GET /api/v1/users/:id
16
- PUT /api/v1/users/:id
17
- PATCH /api/v1/users/:id
18
- DELETE /api/v1/users/:id
19
-
20
- # Sub-resources for relationships
21
- GET /api/v1/users/:id/orders
22
- POST /api/v1/users/:id/orders
23
-
24
- # Actions that don't map to CRUD
25
- POST /api/v1/orders/:id/cancel
26
- POST /api/v1/auth/refresh
27
- ```
28
-
29
- **Naming rules:**
30
- ```
31
- ✅ /api/v1/team-members kebab-case
32
- ✅ /api/v1/orders?status=active query params for filtering
33
- ✅ /api/v1/users/123/orders nested for ownership
34
-
35
- ❌ /api/v1/getUsers verb in URL
36
- ❌ /api/v1/user singular
37
- ❌ /api/v1/team_members snake_case in URLs
38
- ```
39
-
40
- ## HTTP Methods and Status Codes
41
-
42
- | Method | Idempotent | Use For |
43
- |--------|-----------|---------|
44
- | GET | Yes | Retrieve |
45
- | POST | No | Create / trigger actions |
46
- | PUT | Yes | Full replacement |
47
- | PATCH | No | Partial update |
48
- | DELETE | Yes | Remove |
49
-
50
- ```
51
- # Success
52
- 200 OK GET, PUT, PATCH (with body)
53
- 201 Created POST (add Location header)
54
- 204 No Content DELETE, PUT (no body)
55
-
56
- # Client Errors
57
- 400 Bad Request Validation failure, malformed JSON
58
- 401 Unauthorized Missing or invalid auth
59
- 403 Forbidden Authenticated, not authorized
60
- 404 Not Found Resource doesn't exist
61
- 409 Conflict Duplicate entry, state conflict
62
- 422 Unprocessable Entity Valid JSON, semantically invalid
63
- 429 Too Many Requests Rate limit exceeded
64
-
65
- # Server Errors
66
- 500 Internal Server Error Never expose internal details
67
- 503 Service Unavailable Include Retry-After header
68
- ```
69
-
70
- ## Response Format
71
-
72
- ```json
73
- // Success
74
- { "data": { "id": "abc-123", "email": "alice@example.com", "created_at": "2025-01-15T10:30:00Z" } }
75
-
76
- // Collection with pagination
77
- {
78
- "data": [{ "id": "abc-123", "name": "Alice" }],
79
- "meta": { "total": 142, "page": 1, "per_page": 20, "total_pages": 8 },
80
- "links": { "next": "/api/v1/users?page=2&per_page=20" }
81
- }
82
-
83
- // Error
84
- {
85
- "error": {
86
- "code": "validation_error",
87
- "message": "Request validation failed",
88
- "details": [
89
- { "field": "email", "message": "Must be a valid email", "code": "invalid_format" }
90
- ]
91
- }
92
- }
93
- ```
94
-
95
- ## Pagination
96
-
97
- | Use Case | Type |
98
- |----------|------|
99
- | Admin dashboards, small datasets (<10K) | Offset |
100
- | Infinite scroll, feeds, large datasets | **Cursor** |
101
- | Public APIs | Cursor (default) |
102
- | Search results | Offset (users expect page numbers) |
103
-
104
- ```
105
- # Offset
106
- GET /api/v1/users?page=2&per_page=20
107
-
108
- # Cursor
109
- GET /api/v1/users?cursor=eyJpZCI6MTIzfQ&limit=20
110
- → { "data": [...], "meta": { "has_next": true, "next_cursor": "eyJpZCI6MTQzfQ" } }
111
- ```
112
-
113
- ## Versioning
114
-
115
- ```
116
- /api/v1/users ← recommended
117
- /api/v2/users ← when breaking changes needed
118
- ```
119
-
120
- **Breaking changes** (require new version): removing fields, changing types, changing URL structure.
121
- **Non-breaking** (no new version): adding optional fields/params, adding endpoints.
122
-
123
- Deprecation: 6-month notice, add `Sunset` header, return `410 Gone` after.
124
-
125
- ## Filtering, Sorting, Search
126
-
127
- ```
128
- GET /api/v1/orders?status=active&created_after=2025-01-01
129
- GET /api/v1/users?sort=created_at&order=desc
130
- GET /api/v1/products?q=widget
131
- GET /api/v1/users?fields=id,email,name # Sparse fieldsets
132
- ```
133
-
134
- ## Rate Limiting Headers
135
-
136
- ```
137
- X-RateLimit-Limit: 100
138
- X-RateLimit-Remaining: 45
139
- X-RateLimit-Reset: 1640995200
140
- Retry-After: 30 # on 429
141
- ```
142
-
143
- ## API Design Checklist
144
-
145
- Before shipping a new endpoint:
146
-
147
- - [ ] URL: plural noun, kebab-case, no verbs
148
- - [ ] Correct HTTP method and status code
149
- - [ ] Input validated with schema (Zod, Pydantic, Go validator)
150
- - [ ] Error response follows standard format with field-level details
151
- - [ ] Pagination implemented for list endpoints
152
- - [ ] Authentication required (or explicitly marked public)
153
- - [ ] Authorization checked (user can only access their own resources)
154
- - [ ] Rate limiting configured
155
- - [ ] Response does not leak internal details (stack traces, SQL errors)
156
- - [ ] OpenAPI spec updated
@@ -1,81 +0,0 @@
1
- ---
2
- name: api-patterns
3
- description: API design principles and decision-making. REST vs GraphQL vs tRPC selection, response formats, versioning, pagination.
4
- allowed-tools: Read, Write, Edit, Glob, Grep
5
- ---
6
-
7
- # API Patterns
8
-
9
- > API design principles and decision-making for 2025.
10
- > **Learn to THINK, not copy fixed patterns.**
11
-
12
- ## 🎯 Selective Reading Rule
13
-
14
- **Read ONLY files relevant to the request!** Check the content map, find what you need.
15
-
16
- ---
17
-
18
- ## 📑 Content Map
19
-
20
- | File | Description | When to Read |
21
- |------|-------------|--------------|
22
- | `api-style.md` | REST vs GraphQL vs tRPC decision tree | Choosing API type |
23
- | `rest.md` | Resource naming, HTTP methods, status codes | Designing REST API |
24
- | `response.md` | Envelope pattern, error format, pagination | Response structure |
25
- | `graphql.md` | Schema design, when to use, security | Considering GraphQL |
26
- | `trpc.md` | TypeScript monorepo, type safety | TS fullstack projects |
27
- | `versioning.md` | URI/Header/Query versioning | API evolution planning |
28
- | `auth.md` | JWT, OAuth, Passkey, API Keys | Auth pattern selection |
29
- | `rate-limiting.md` | Token bucket, sliding window | API protection |
30
- | `documentation.md` | OpenAPI/Swagger best practices | Documentation |
31
- | `security-testing.md` | OWASP API Top 10, auth/authz testing | Security audits |
32
-
33
- ---
34
-
35
- ## 🔗 Related Skills
36
-
37
- | Need | Skill |
38
- |------|-------|
39
- | API implementation | `@[skills/backend-development]` |
40
- | Data structure | `@[skills/database-design]` |
41
- | Security details | `@[skills/security-hardening]` |
42
-
43
- ---
44
-
45
- ## ✅ Decision Checklist
46
-
47
- Before designing an API:
48
-
49
- - [ ] **Asked user about API consumers?**
50
- - [ ] **Chosen API style for THIS context?** (REST/GraphQL/tRPC)
51
- - [ ] **Defined consistent response format?**
52
- - [ ] **Planned versioning strategy?**
53
- - [ ] **Considered authentication needs?**
54
- - [ ] **Planned rate limiting?**
55
- - [ ] **Documentation approach defined?**
56
-
57
- ---
58
-
59
- ## ❌ Anti-Patterns
60
-
61
- **DON'T:**
62
- - Default to REST for everything
63
- - Use verbs in REST endpoints (/getUsers)
64
- - Return inconsistent response formats
65
- - Expose internal errors to clients
66
- - Skip rate limiting
67
-
68
- **DO:**
69
- - Choose API style based on context
70
- - Ask about client requirements
71
- - Document thoroughly
72
- - Use appropriate status codes
73
-
74
- ---
75
-
76
- ## Script
77
-
78
- | Script | Purpose | Command |
79
- |--------|---------|---------|
80
- | `scripts/api_validator.py` | API endpoint validation | `python scripts/api_validator.py <project_path>` |
81
-
@@ -1,42 +0,0 @@
1
- # API Style Selection (2025)
2
-
3
- > REST vs GraphQL vs tRPC - Hangi durumda hangisi?
4
-
5
- ## Decision Tree
6
-
7
- ```
8
- Who are the API consumers?
9
- │
10
- ├── Public API / Multiple platforms
11
- │ └── REST + OpenAPI (widest compatibility)
12
- │
13
- ├── Complex data needs / Multiple frontends
14
- │ └── GraphQL (flexible queries)
15
- │
16
- ├── TypeScript frontend + backend (monorepo)
17
- │ └── tRPC (end-to-end type safety)
18
- │
19
- ├── Real-time / Event-driven
20
- │ └── WebSocket + AsyncAPI
21
- │
22
- └── Internal microservices
23
- └── gRPC (performance) or REST (simplicity)
24
- ```
25
-
26
- ## Comparison
27
-
28
- | Factor | REST | GraphQL | tRPC |
29
- |--------|------|---------|------|
30
- | **Best for** | Public APIs | Complex apps | TS monorepos |
31
- | **Learning curve** | Low | Medium | Low (if TS) |
32
- | **Over/under fetching** | Common | Solved | Solved |
33
- | **Type safety** | Manual (OpenAPI) | Schema-based | Automatic |
34
- | **Caching** | HTTP native | Complex | Client-based |
35
-
36
- ## Selection Questions
37
-
38
- 1. Who are the API consumers?
39
- 2. Is the frontend TypeScript?
40
- 3. How complex are the data relationships?
41
- 4. Is caching critical?
42
- 5. Public or internal API?
@@ -1,24 +0,0 @@
1
- # Authentication Patterns
2
-
3
- > Choose auth pattern based on use case.
4
-
5
- ## Selection Guide
6
-
7
- | Pattern | Best For |
8
- |---------|----------|
9
- | **JWT** | Stateless, microservices |
10
- | **Session** | Traditional web, simple |
11
- | **OAuth 2.0** | Third-party integration |
12
- | **API Keys** | Server-to-server, public APIs |
13
- | **Passkey** | Modern passwordless (2025+) |
14
-
15
- ## JWT Principles
16
-
17
- ```
18
- Important:
19
- ├── Always verify signature
20
- ├── Check expiration
21
- ├── Include minimal claims
22
- ├── Use short expiry + refresh tokens
23
- └── Never store sensitive data in JWT
24
- ```
@@ -1,26 +0,0 @@
1
- # API Documentation Principles
2
-
3
- > Good docs = happy developers = API adoption.
4
-
5
- ## OpenAPI/Swagger Essentials
6
-
7
- ```
8
- Include:
9
- ├── All endpoints with examples
10
- ├── Request/response schemas
11
- ├── Authentication requirements
12
- ├── Error response formats
13
- └── Rate limiting info
14
- ```
15
-
16
- ## Good Documentation Has
17
-
18
- ```
19
- Essentials:
20
- ├── Quick start / Getting started
21
- ├── Authentication guide
22
- ├── Complete API reference
23
- ├── Error handling guide
24
- ├── Code examples (multiple languages)
25
- └── Changelog
26
- ```
@@ -1,41 +0,0 @@
1
- # GraphQL Principles
2
-
3
- > Flexible queries for complex, interconnected data.
4
-
5
- ## When to Use
6
-
7
- ```
8
- ✅ Good fit:
9
- ├── Complex, interconnected data
10
- ├── Multiple frontend platforms
11
- ├── Clients need flexible queries
12
- ├── Evolving data requirements
13
- └── Reducing over-fetching matters
14
-
15
- ❌ Poor fit:
16
- ├── Simple CRUD operations
17
- ├── File upload heavy
18
- ├── HTTP caching important
19
- └── Team unfamiliar with GraphQL
20
- ```
21
-
22
- ## Schema Design Principles
23
-
24
- ```
25
- Principles:
26
- ├── Think in graphs, not endpoints
27
- ├── Design for evolvability (no versions)
28
- ├── Use connections for pagination
29
- ├── Be specific with types (not generic "data")
30
- └── Handle nullability thoughtfully
31
- ```
32
-
33
- ## Security Considerations
34
-
35
- ```
36
- Protect against:
37
- ├── Query depth attacks → Set max depth
38
- ├── Query complexity → Calculate cost
39
- ├── Batching abuse → Limit batch size
40
- ├── Introspection → Disable in production
41
- ```
@@ -1,31 +0,0 @@
1
- # Rate Limiting Principles
2
-
3
- > Protect your API from abuse and overload.
4
-
5
- ## Why Rate Limit
6
-
7
- ```
8
- Protect against:
9
- ├── Brute force attacks
10
- ├── Resource exhaustion
11
- ├── Cost overruns (if pay-per-use)
12
- └── Unfair usage
13
- ```
14
-
15
- ## Strategy Selection
16
-
17
- | Type | How | When |
18
- |------|-----|------|
19
- | **Token bucket** | Burst allowed, refills over time | Most APIs |
20
- | **Sliding window** | Smooth distribution | Strict limits |
21
- | **Fixed window** | Simple counters per window | Basic needs |
22
-
23
- ## Response Headers
24
-
25
- ```
26
- Include in headers:
27
- ├── X-RateLimit-Limit (max requests)
28
- ├── X-RateLimit-Remaining (requests left)
29
- ├── X-RateLimit-Reset (when limit resets)
30
- └── Return 429 when exceeded
31
- ```
@@ -1,37 +0,0 @@
1
- # Response Format Principles
2
-
3
- > Consistency is key - choose a format and stick to it.
4
-
5
- ## Common Patterns
6
-
7
- ```
8
- Choose one:
9
- ├── Envelope pattern ({ success, data, error })
10
- ├── Direct data (just return the resource)
11
- └── HAL/JSON:API (hypermedia)
12
- ```
13
-
14
- ## Error Response
15
-
16
- ```
17
- Include:
18
- ├── Error code (for programmatic handling)
19
- ├── User message (for display)
20
- ├── Details (for debugging, field-level errors)
21
- ├── Request ID (for support)
22
- └── NOT internal details (security!)
23
- ```
24
-
25
- ## Pagination Types
26
-
27
- | Type | Best For | Trade-offs |
28
- |------|----------|------------|
29
- | **Offset** | Simple, jumpable | Performance on large datasets |
30
- | **Cursor** | Large datasets | Can't jump to page |
31
- | **Keyset** | Performance critical | Requires sortable key |
32
-
33
- ### Selection Questions
34
-
35
- 1. How large is the dataset?
36
- 2. Do users need to jump to specific pages?
37
- 3. Is data frequently changing?
@@ -1,40 +0,0 @@
1
- # REST Principles
2
-
3
- > Resource-based API design - nouns not verbs.
4
-
5
- ## Resource Naming Rules
6
-
7
- ```
8
- Principles:
9
- ├── Use NOUNS, not verbs (resources, not actions)
10
- ├── Use PLURAL forms (/users not /user)
11
- ├── Use lowercase with hyphens (/user-profiles)
12
- ├── Nest for relationships (/users/123/posts)
13
- └── Keep shallow (max 3 levels deep)
14
- ```
15
-
16
- ## HTTP Method Selection
17
-
18
- | Method | Purpose | Idempotent? | Body? |
19
- |--------|---------|-------------|-------|
20
- | **GET** | Read resource(s) | Yes | No |
21
- | **POST** | Create new resource | No | Yes |
22
- | **PUT** | Replace entire resource | Yes | Yes |
23
- | **PATCH** | Partial update | No | Yes |
24
- | **DELETE** | Remove resource | Yes | No |
25
-
26
- ## Status Code Selection
27
-
28
- | Situation | Code | Why |
29
- |-----------|------|-----|
30
- | Success (read) | 200 | Standard success |
31
- | Created | 201 | New resource created |
32
- | No content | 204 | Success, nothing to return |
33
- | Bad request | 400 | Malformed request |
34
- | Unauthorized | 401 | Missing/invalid auth |
35
- | Forbidden | 403 | Valid auth, no permission |
36
- | Not found | 404 | Resource doesn't exist |
37
- | Conflict | 409 | State conflict (duplicate) |
38
- | Validation error | 422 | Valid syntax, invalid data |
39
- | Rate limited | 429 | Too many requests |
40
- | Server error | 500 | Our fault |
@@ -1,211 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- API Validator - Checks API endpoints for best practices.
4
- Validates OpenAPI specs, response formats, and common issues.
5
- """
6
- import sys
7
- import json
8
- import re
9
- from pathlib import Path
10
-
11
- # Fix Windows console encoding for Unicode output
12
- try:
13
- sys.stdout.reconfigure(encoding='utf-8', errors='replace')
14
- sys.stderr.reconfigure(encoding='utf-8', errors='replace')
15
- except AttributeError:
16
- pass # Python < 3.7
17
-
18
- def find_api_files(project_path: Path) -> list:
19
- """Find API-related files."""
20
- patterns = [
21
- "**/*api*.ts", "**/*api*.js", "**/*api*.py",
22
- "**/routes/*.ts", "**/routes/*.js", "**/routes/*.py",
23
- "**/controllers/*.ts", "**/controllers/*.js",
24
- "**/endpoints/*.ts", "**/endpoints/*.py",
25
- "**/*.openapi.json", "**/*.openapi.yaml",
26
- "**/swagger.json", "**/swagger.yaml",
27
- "**/openapi.json", "**/openapi.yaml"
28
- ]
29
-
30
- files = []
31
- for pattern in patterns:
32
- files.extend(project_path.glob(pattern))
33
-
34
- # Exclude node_modules, etc.
35
- return [f for f in files if not any(x in str(f) for x in ['node_modules', '.git', 'dist', 'build', '__pycache__'])]
36
-
37
- def check_openapi_spec(file_path: Path) -> dict:
38
- """Check OpenAPI/Swagger specification."""
39
- issues = []
40
- passed = []
41
-
42
- try:
43
- content = file_path.read_text(encoding='utf-8')
44
-
45
- if file_path.suffix == '.json':
46
- spec = json.loads(content)
47
- else:
48
- # Basic YAML check
49
- if 'openapi:' in content or 'swagger:' in content:
50
- passed.append("[OK] OpenAPI/Swagger version defined")
51
- else:
52
- issues.append("[X] No OpenAPI version found")
53
-
54
- if 'paths:' in content:
55
- passed.append("[OK] Paths section exists")
56
- else:
57
- issues.append("[X] No paths defined")
58
-
59
- if 'components:' in content or 'definitions:' in content:
60
- passed.append("[OK] Schema components defined")
61
-
62
- return {'file': str(file_path), 'passed': passed, 'issues': issues, 'type': 'openapi'}
63
-
64
- # JSON OpenAPI checks
65
- if 'openapi' in spec or 'swagger' in spec:
66
- passed.append("[OK] OpenAPI version defined")
67
-
68
- if 'info' in spec:
69
- if 'title' in spec['info']:
70
- passed.append("[OK] API title defined")
71
- if 'version' in spec['info']:
72
- passed.append("[OK] API version defined")
73
- if 'description' not in spec['info']:
74
- issues.append("[!] API description missing")
75
-
76
- if 'paths' in spec:
77
- path_count = len(spec['paths'])
78
- passed.append(f"[OK] {path_count} endpoints defined")
79
-
80
- # Check each path
81
- for path, methods in spec['paths'].items():
82
- for method, details in methods.items():
83
- if method in ['get', 'post', 'put', 'patch', 'delete']:
84
- if 'responses' not in details:
85
- issues.append(f"[X] {method.upper()} {path}: No responses defined")
86
- if 'summary' not in details and 'description' not in details:
87
- issues.append(f"[!] {method.upper()} {path}: No description")
88
-
89
- except Exception as e:
90
- issues.append(f"[X] Parse error: {e}")
91
-
92
- return {'file': str(file_path), 'passed': passed, 'issues': issues, 'type': 'openapi'}
93
-
94
- def check_api_code(file_path: Path) -> dict:
95
- """Check API code for common issues."""
96
- issues = []
97
- passed = []
98
-
99
- try:
100
- content = file_path.read_text(encoding='utf-8')
101
-
102
- # Check for error handling
103
- error_patterns = [
104
- r'try\s*{', r'try:', r'\.catch\(',
105
- r'except\s+', r'catch\s*\('
106
- ]
107
- has_error_handling = any(re.search(p, content) for p in error_patterns)
108
- if has_error_handling:
109
- passed.append("[OK] Error handling present")
110
- else:
111
- issues.append("[X] No error handling found")
112
-
113
- # Check for status codes
114
- status_patterns = [
115
- r'status\s*\(\s*\d{3}\s*\)', r'statusCode\s*[=:]\s*\d{3}',
116
- r'HttpStatus\.', r'status_code\s*=\s*\d{3}',
117
- r'\.status\(\d{3}\)', r'res\.status\('
118
- ]
119
- has_status = any(re.search(p, content) for p in status_patterns)
120
- if has_status:
121
- passed.append("[OK] HTTP status codes used")
122
- else:
123
- issues.append("[!] No explicit HTTP status codes")
124
-
125
- # Check for validation
126
- validation_patterns = [
127
- r'validate', r'schema', r'zod', r'joi', r'yup',
128
- r'pydantic', r'@Body\(', r'@Query\('
129
- ]
130
- has_validation = any(re.search(p, content, re.I) for p in validation_patterns)
131
- if has_validation:
132
- passed.append("[OK] Input validation present")
133
- else:
134
- issues.append("[!] No input validation detected")
135
-
136
- # Check for auth middleware
137
- auth_patterns = [
138
- r'auth', r'jwt', r'bearer', r'token',
139
- r'middleware', r'guard', r'@Authenticated'
140
- ]
141
- has_auth = any(re.search(p, content, re.I) for p in auth_patterns)
142
- if has_auth:
143
- passed.append("[OK] Authentication/authorization detected")
144
-
145
- # Check for rate limiting
146
- rate_patterns = [r'rateLimit', r'throttle', r'rate.?limit']
147
- has_rate = any(re.search(p, content, re.I) for p in rate_patterns)
148
- if has_rate:
149
- passed.append("[OK] Rate limiting present")
150
-
151
- # Check for logging
152
- log_patterns = [r'console\.log', r'logger\.', r'logging\.', r'log\.']
153
- has_logging = any(re.search(p, content) for p in log_patterns)
154
- if has_logging:
155
- passed.append("[OK] Logging present")
156
-
157
- except Exception as e:
158
- issues.append(f"[X] Read error: {e}")
159
-
160
- return {'file': str(file_path), 'passed': passed, 'issues': issues, 'type': 'code'}
161
-
162
- def main():
163
- target = sys.argv[1] if len(sys.argv) > 1 else "."
164
- project_path = Path(target)
165
-
166
- print("\n" + "=" * 60)
167
- print(" API VALIDATOR - Endpoint Best Practices Check")
168
- print("=" * 60 + "\n")
169
-
170
- api_files = find_api_files(project_path)
171
-
172
- if not api_files:
173
- print("[!] No API files found.")
174
- print(" Looking for: routes/, controllers/, api/, openapi.json/yaml")
175
- sys.exit(0)
176
-
177
- results = []
178
- for file_path in api_files[:15]: # Limit
179
- if 'openapi' in file_path.name.lower() or 'swagger' in file_path.name.lower():
180
- result = check_openapi_spec(file_path)
181
- else:
182
- result = check_api_code(file_path)
183
- results.append(result)
184
-
185
- # Print results
186
- total_issues = 0
187
- total_passed = 0
188
-
189
- for result in results:
190
- print(f"\n[FILE] {result['file']} [{result['type']}]")
191
- for item in result['passed']:
192
- print(f" {item}")
193
- total_passed += 1
194
- for item in result['issues']:
195
- print(f" {item}")
196
- if item.startswith("[X]"):
197
- total_issues += 1
198
-
199
- print("\n" + "=" * 60)
200
- print(f"[RESULTS] {total_passed} passed, {total_issues} critical issues")
201
- print("=" * 60)
202
-
203
- if total_issues == 0:
204
- print("[OK] API validation passed")
205
- sys.exit(0)
206
- else:
207
- print("[X] Fix critical issues before deployment")
208
- sys.exit(1)
209
-
210
- if __name__ == "__main__":
211
- main()