specialist-agent 2.13.0 → 3.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 (329) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +36 -206
  3. package/dist/catalog.json +16677 -0
  4. package/dist/hw-worker.mjs +288 -0
  5. package/dist/icones/icone.ico +0 -0
  6. package/dist/icones/icone.png +0 -0
  7. package/dist/interface/assets/figtree-latin-400-normal-g7Dtegnw.woff2 +0 -0
  8. package/dist/interface/assets/figtree-latin-500-normal-BWnGEVsr.woff2 +0 -0
  9. package/dist/interface/assets/figtree-latin-600-normal-Cv_xCTDl.woff2 +0 -0
  10. package/dist/interface/assets/figtree-latin-700-normal-th6qEP7c.woff2 +0 -0
  11. package/dist/interface/assets/figtree-latin-ext-400-normal-CXAzuTZb.woff2 +0 -0
  12. package/dist/interface/assets/figtree-latin-ext-500-normal-Du0rIuHj.woff2 +0 -0
  13. package/dist/interface/assets/figtree-latin-ext-600-normal-DJlfifZj.woff2 +0 -0
  14. package/dist/interface/assets/figtree-latin-ext-700-normal-CS4sQkGV.woff2 +0 -0
  15. package/dist/interface/assets/index-BltVv7tb.js +24 -0
  16. package/dist/interface/assets/index-Cpa6kApK.css +1 -0
  17. package/dist/interface/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  18. package/dist/interface/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
  19. package/dist/interface/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
  20. package/dist/interface/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
  21. package/dist/interface/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
  22. package/dist/interface/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
  23. package/dist/interface/assets/unbounded-latin-500-normal-4slEIF53.woff2 +0 -0
  24. package/dist/interface/assets/unbounded-latin-700-normal-CaoNriVp.woff2 +0 -0
  25. package/dist/interface/assets/unbounded-latin-ext-500-normal-BTIpesyw.woff2 +0 -0
  26. package/dist/interface/assets/unbounded-latin-ext-700-normal-BLzWLLjG.woff2 +0 -0
  27. package/dist/interface/icones/apple-touch-icon.png +0 -0
  28. package/dist/interface/icones/favicon-32.png +0 -0
  29. package/dist/interface/icones/icone-192.png +0 -0
  30. package/dist/interface/icones/icone-512.png +0 -0
  31. package/dist/interface/icones/icone-mascara-512.png +0 -0
  32. package/dist/interface/index.html +19 -0
  33. package/dist/interface/manifest.webmanifest +19 -0
  34. package/dist/interface/sw.js +64 -0
  35. package/dist/licencas/BRAND.md +22 -0
  36. package/dist/licencas/LICENSE-CONTENT.md +44 -0
  37. package/dist/licencas/OFL-Figtree.txt +93 -0
  38. package/dist/licencas/OFL-JetBrainsMono.txt +93 -0
  39. package/dist/licencas/OFL-Unbounded.txt +93 -0
  40. package/dist/licencas/TERCEIROS.txt +104 -0
  41. package/dist/specialist-agent.mjs +14515 -0
  42. package/dist/usage-worker.mjs +1077 -0
  43. package/package.json +34 -58
  44. package/.claude-plugin/marketplace.json +0 -52
  45. package/.claude-plugin/plugin.json +0 -37
  46. package/.codex/INSTALL.md +0 -145
  47. package/.cursor-plugin/marketplace.json +0 -52
  48. package/.cursor-plugin/plugin.json +0 -37
  49. package/.opencode/INSTALL.md +0 -127
  50. package/.opencode/opencode.json +0 -186
  51. package/agents/analyst-lite.md +0 -48
  52. package/agents/analyst.md +0 -396
  53. package/agents/api-lite.md +0 -43
  54. package/agents/api.md +0 -427
  55. package/agents/architect-lite.md +0 -104
  56. package/agents/architect.md +0 -571
  57. package/agents/autopilot-lite.md +0 -46
  58. package/agents/autopilot.md +0 -196
  59. package/agents/cloud-lite.md +0 -75
  60. package/agents/cloud.md +0 -213
  61. package/agents/data-lite.md +0 -67
  62. package/agents/data.md +0 -306
  63. package/agents/debugger-lite.md +0 -46
  64. package/agents/debugger.md +0 -410
  65. package/agents/deps-lite.md +0 -41
  66. package/agents/deps.md +0 -363
  67. package/agents/designer-lite.md +0 -67
  68. package/agents/designer.md +0 -195
  69. package/agents/devops-lite.md +0 -67
  70. package/agents/devops.md +0 -205
  71. package/agents/docs-lite.md +0 -42
  72. package/agents/docs.md +0 -454
  73. package/agents/executor-lite.md +0 -61
  74. package/agents/executor.md +0 -695
  75. package/agents/explorer-lite.md +0 -55
  76. package/agents/explorer.md +0 -152
  77. package/agents/finance-lite.md +0 -66
  78. package/agents/finance.md +0 -255
  79. package/agents/i18n-lite.md +0 -44
  80. package/agents/i18n.md +0 -594
  81. package/agents/legal-lite.md +0 -113
  82. package/agents/legal.md +0 -302
  83. package/agents/marketing-lite.md +0 -25
  84. package/agents/marketing.md +0 -188
  85. package/agents/memory.md +0 -166
  86. package/agents/orchestrator-lite.md +0 -40
  87. package/agents/orchestrator.md +0 -512
  88. package/agents/pair-lite.md +0 -38
  89. package/agents/pair.md +0 -310
  90. package/agents/perf-lite.md +0 -42
  91. package/agents/perf.md +0 -320
  92. package/agents/planner-lite.md +0 -59
  93. package/agents/planner.md +0 -272
  94. package/agents/product-lite.md +0 -25
  95. package/agents/product.md +0 -195
  96. package/agents/refactor-lite.md +0 -42
  97. package/agents/refactor.md +0 -467
  98. package/agents/ripple-lite.md +0 -106
  99. package/agents/ripple.md +0 -166
  100. package/agents/scout-lite.md +0 -37
  101. package/agents/scout.md +0 -224
  102. package/agents/security-lite.md +0 -66
  103. package/agents/security.md +0 -252
  104. package/agents/sentry-triage-lite.md +0 -54
  105. package/agents/sentry-triage.md +0 -217
  106. package/agents/starter-lite.md +0 -80
  107. package/agents/starter.md +0 -300
  108. package/agents/support-lite.md +0 -24
  109. package/agents/support.md +0 -191
  110. package/agents/tdd-lite.md +0 -43
  111. package/agents/tdd.md +0 -329
  112. package/agents/tester-lite.md +0 -71
  113. package/agents/tester.md +0 -237
  114. package/cli/architectures.mjs +0 -713
  115. package/cli/detect-architecture.mjs +0 -752
  116. package/cli/generate-architecture.mjs +0 -1096
  117. package/cli/index.mjs +0 -1217
  118. package/cli/recommend-architecture.mjs +0 -870
  119. package/hooks/after-review.mjs +0 -130
  120. package/hooks/after-task.mjs +0 -117
  121. package/hooks/before-plan.mjs +0 -155
  122. package/hooks/before-review.mjs +0 -139
  123. package/hooks/hooks.json +0 -66
  124. package/hooks/lifecycle.json +0 -91
  125. package/hooks/native/auto-dispatch.mjs +0 -207
  126. package/hooks/native/auto-format.mjs +0 -176
  127. package/hooks/native/mcp-discovery.mjs +0 -168
  128. package/hooks/native/security-config.json +0 -38
  129. package/hooks/native/security-guard.mjs +0 -323
  130. package/hooks/native/session-context.mjs +0 -179
  131. package/hooks/native/session-end.mjs +0 -42
  132. package/hooks/native/utils.mjs +0 -62
  133. package/hooks/on-error.mjs +0 -129
  134. package/hooks/session-end.mjs +0 -185
  135. package/hooks/session-start.mjs +0 -154
  136. package/packs/angular/ARCHITECTURE.md +0 -814
  137. package/packs/angular/CLAUDE.md +0 -105
  138. package/packs/angular/agents/builder.md +0 -113
  139. package/packs/angular/agents/doctor.md +0 -187
  140. package/packs/angular/agents/migrator.md +0 -101
  141. package/packs/angular/agents/reviewer.md +0 -252
  142. package/packs/angular/agents-lite/builder.md +0 -65
  143. package/packs/angular/agents-lite/doctor.md +0 -64
  144. package/packs/angular/agents-lite/migrator.md +0 -75
  145. package/packs/angular/agents-lite/reviewer.md +0 -69
  146. package/packs/angular/skills/dev-create-component/SKILL.md +0 -56
  147. package/packs/angular/skills/dev-create-injectable/SKILL.md +0 -60
  148. package/packs/angular/skills/dev-create-module/SKILL.md +0 -49
  149. package/packs/angular/skills/dev-create-service/SKILL.md +0 -34
  150. package/packs/angular/skills/dev-create-test/SKILL.md +0 -78
  151. package/packs/angular/skills/dev-generate-types/SKILL.md +0 -37
  152. package/packs/angular/skills/docs-onboard/SKILL.md +0 -42
  153. package/packs/angular/skills/migration-migrate-component/SKILL.md +0 -42
  154. package/packs/angular/skills/migration-migrate-module/SKILL.md +0 -25
  155. package/packs/angular/skills/review-check-architecture/SKILL.md +0 -67
  156. package/packs/angular/skills/review-fix-violations/SKILL.md +0 -43
  157. package/packs/angular/skills/review-review/SKILL.md +0 -43
  158. package/packs/astro/ARCHITECTURE.md +0 -718
  159. package/packs/astro/CLAUDE.md +0 -106
  160. package/packs/astro/agents/builder.md +0 -123
  161. package/packs/astro/agents/doctor.md +0 -200
  162. package/packs/astro/agents/migrator.md +0 -105
  163. package/packs/astro/agents/reviewer.md +0 -253
  164. package/packs/astro/agents-lite/builder.md +0 -71
  165. package/packs/astro/agents-lite/doctor.md +0 -66
  166. package/packs/astro/agents-lite/migrator.md +0 -71
  167. package/packs/astro/agents-lite/reviewer.md +0 -70
  168. package/packs/astro/skills/dev-create-component/SKILL.md +0 -50
  169. package/packs/astro/skills/dev-create-island/SKILL.md +0 -63
  170. package/packs/astro/skills/dev-create-module/SKILL.md +0 -49
  171. package/packs/astro/skills/dev-create-service/SKILL.md +0 -34
  172. package/packs/astro/skills/dev-create-test/SKILL.md +0 -76
  173. package/packs/astro/skills/dev-generate-types/SKILL.md +0 -37
  174. package/packs/astro/skills/docs-onboard/SKILL.md +0 -51
  175. package/packs/astro/skills/migration-migrate-component/SKILL.md +0 -48
  176. package/packs/astro/skills/migration-migrate-module/SKILL.md +0 -25
  177. package/packs/astro/skills/review-check-architecture/SKILL.md +0 -72
  178. package/packs/astro/skills/review-fix-violations/SKILL.md +0 -43
  179. package/packs/astro/skills/review-review/SKILL.md +0 -45
  180. package/packs/nextjs/ARCHITECTURE.md +0 -1033
  181. package/packs/nextjs/CLAUDE.md +0 -106
  182. package/packs/nextjs/agents/builder.md +0 -132
  183. package/packs/nextjs/agents/doctor.md +0 -226
  184. package/packs/nextjs/agents/migrator.md +0 -101
  185. package/packs/nextjs/agents/reviewer.md +0 -243
  186. package/packs/nextjs/agents-lite/builder.md +0 -74
  187. package/packs/nextjs/agents-lite/doctor.md +0 -74
  188. package/packs/nextjs/agents-lite/migrator.md +0 -75
  189. package/packs/nextjs/agents-lite/reviewer.md +0 -73
  190. package/packs/nextjs/skills/dev-create-component/SKILL.md +0 -82
  191. package/packs/nextjs/skills/dev-create-hook/SKILL.md +0 -90
  192. package/packs/nextjs/skills/dev-create-module/SKILL.md +0 -63
  193. package/packs/nextjs/skills/dev-create-service/SKILL.md +0 -35
  194. package/packs/nextjs/skills/dev-create-test/SKILL.md +0 -106
  195. package/packs/nextjs/skills/dev-generate-types/SKILL.md +0 -37
  196. package/packs/nextjs/skills/docs-onboard/SKILL.md +0 -55
  197. package/packs/nextjs/skills/migration-migrate-component/SKILL.md +0 -58
  198. package/packs/nextjs/skills/migration-migrate-module/SKILL.md +0 -25
  199. package/packs/nextjs/skills/review-check-architecture/SKILL.md +0 -101
  200. package/packs/nextjs/skills/review-fix-violations/SKILL.md +0 -48
  201. package/packs/nextjs/skills/review-review/SKILL.md +0 -47
  202. package/packs/nuxt/ARCHITECTURE.md +0 -831
  203. package/packs/nuxt/CLAUDE.md +0 -111
  204. package/packs/nuxt/agents/builder.md +0 -120
  205. package/packs/nuxt/agents/doctor.md +0 -198
  206. package/packs/nuxt/agents/migrator.md +0 -101
  207. package/packs/nuxt/agents/reviewer.md +0 -255
  208. package/packs/nuxt/agents-lite/builder.md +0 -67
  209. package/packs/nuxt/agents-lite/doctor.md +0 -67
  210. package/packs/nuxt/agents-lite/migrator.md +0 -80
  211. package/packs/nuxt/agents-lite/reviewer.md +0 -71
  212. package/packs/nuxt/skills/dev-create-component/SKILL.md +0 -60
  213. package/packs/nuxt/skills/dev-create-composable/SKILL.md +0 -33
  214. package/packs/nuxt/skills/dev-create-module/SKILL.md +0 -49
  215. package/packs/nuxt/skills/dev-create-service/SKILL.md +0 -34
  216. package/packs/nuxt/skills/dev-create-test/SKILL.md +0 -61
  217. package/packs/nuxt/skills/dev-generate-types/SKILL.md +0 -37
  218. package/packs/nuxt/skills/docs-onboard/SKILL.md +0 -49
  219. package/packs/nuxt/skills/migration-migrate-component/SKILL.md +0 -48
  220. package/packs/nuxt/skills/migration-migrate-module/SKILL.md +0 -25
  221. package/packs/nuxt/skills/review-check-architecture/SKILL.md +0 -71
  222. package/packs/nuxt/skills/review-fix-violations/SKILL.md +0 -43
  223. package/packs/nuxt/skills/review-review/SKILL.md +0 -45
  224. package/packs/react/ARCHITECTURE.md +0 -991
  225. package/packs/react/CLAUDE.md +0 -102
  226. package/packs/react/agents/builder.md +0 -113
  227. package/packs/react/agents/doctor.md +0 -203
  228. package/packs/react/agents/migrator.md +0 -101
  229. package/packs/react/agents/reviewer.md +0 -252
  230. package/packs/react/agents-lite/builder.md +0 -65
  231. package/packs/react/agents-lite/doctor.md +0 -64
  232. package/packs/react/agents-lite/migrator.md +0 -74
  233. package/packs/react/agents-lite/reviewer.md +0 -69
  234. package/packs/react/skills/dev-create-component/SKILL.md +0 -53
  235. package/packs/react/skills/dev-create-hook/SKILL.md +0 -78
  236. package/packs/react/skills/dev-create-module/SKILL.md +0 -51
  237. package/packs/react/skills/dev-create-service/SKILL.md +0 -34
  238. package/packs/react/skills/dev-create-test/SKILL.md +0 -92
  239. package/packs/react/skills/dev-generate-types/SKILL.md +0 -37
  240. package/packs/react/skills/docs-onboard/SKILL.md +0 -42
  241. package/packs/react/skills/migration-migrate-component/SKILL.md +0 -44
  242. package/packs/react/skills/migration-migrate-module/SKILL.md +0 -25
  243. package/packs/react/skills/review-check-architecture/SKILL.md +0 -73
  244. package/packs/react/skills/review-fix-violations/SKILL.md +0 -45
  245. package/packs/react/skills/review-review/SKILL.md +0 -44
  246. package/packs/svelte/ARCHITECTURE.md +0 -975
  247. package/packs/svelte/CLAUDE.md +0 -102
  248. package/packs/svelte/agents/builder.md +0 -114
  249. package/packs/svelte/agents/doctor.md +0 -174
  250. package/packs/svelte/agents/migrator.md +0 -101
  251. package/packs/svelte/agents/reviewer.md +0 -238
  252. package/packs/svelte/agents-lite/builder.md +0 -66
  253. package/packs/svelte/agents-lite/doctor.md +0 -67
  254. package/packs/svelte/agents-lite/migrator.md +0 -82
  255. package/packs/svelte/agents-lite/reviewer.md +0 -70
  256. package/packs/svelte/skills/dev-create-component/SKILL.md +0 -77
  257. package/packs/svelte/skills/dev-create-module/SKILL.md +0 -59
  258. package/packs/svelte/skills/dev-create-service/SKILL.md +0 -35
  259. package/packs/svelte/skills/dev-create-store/SKILL.md +0 -94
  260. package/packs/svelte/skills/dev-create-test/SKILL.md +0 -98
  261. package/packs/svelte/skills/dev-generate-types/SKILL.md +0 -37
  262. package/packs/svelte/skills/docs-onboard/SKILL.md +0 -47
  263. package/packs/svelte/skills/migration-migrate-component/SKILL.md +0 -51
  264. package/packs/svelte/skills/migration-migrate-module/SKILL.md +0 -25
  265. package/packs/svelte/skills/review-check-architecture/SKILL.md +0 -79
  266. package/packs/svelte/skills/review-fix-violations/SKILL.md +0 -47
  267. package/packs/svelte/skills/review-review/SKILL.md +0 -45
  268. package/packs/vue/ARCHITECTURE.md +0 -798
  269. package/packs/vue/CLAUDE.md +0 -102
  270. package/packs/vue/agents/builder.md +0 -112
  271. package/packs/vue/agents/doctor.md +0 -185
  272. package/packs/vue/agents/migrator.md +0 -101
  273. package/packs/vue/agents/reviewer.md +0 -249
  274. package/packs/vue/agents-lite/builder.md +0 -65
  275. package/packs/vue/agents-lite/doctor.md +0 -63
  276. package/packs/vue/agents-lite/migrator.md +0 -73
  277. package/packs/vue/agents-lite/reviewer.md +0 -68
  278. package/packs/vue/skills/dev-create-component/SKILL.md +0 -58
  279. package/packs/vue/skills/dev-create-composable/SKILL.md +0 -31
  280. package/packs/vue/skills/dev-create-module/SKILL.md +0 -50
  281. package/packs/vue/skills/dev-create-service/SKILL.md +0 -34
  282. package/packs/vue/skills/dev-create-test/SKILL.md +0 -62
  283. package/packs/vue/skills/dev-generate-types/SKILL.md +0 -37
  284. package/packs/vue/skills/docs-onboard/SKILL.md +0 -42
  285. package/packs/vue/skills/migration-migrate-component/SKILL.md +0 -41
  286. package/packs/vue/skills/migration-migrate-module/SKILL.md +0 -25
  287. package/packs/vue/skills/review-check-architecture/SKILL.md +0 -73
  288. package/packs/vue/skills/review-fix-violations/SKILL.md +0 -42
  289. package/packs/vue/skills/review-review/SKILL.md +0 -43
  290. package/skills/audit/SKILL.md +0 -231
  291. package/skills/autofix/SKILL.md +0 -166
  292. package/skills/autopilot/SKILL.md +0 -286
  293. package/skills/brainstorm/SKILL.md +0 -298
  294. package/skills/checkpoint/SKILL.md +0 -217
  295. package/skills/codereview/SKILL.md +0 -268
  296. package/skills/commit/SKILL.md +0 -150
  297. package/skills/copywriting/SKILL.md +0 -218
  298. package/skills/cro/SKILL.md +0 -234
  299. package/skills/debug/SKILL.md +0 -210
  300. package/skills/design-review/SKILL.md +0 -217
  301. package/skills/discovery/SKILL.md +0 -218
  302. package/skills/estimate/SKILL.md +0 -154
  303. package/skills/finish/SKILL.md +0 -220
  304. package/skills/grill/SKILL.md +0 -270
  305. package/skills/health/SKILL.md +0 -251
  306. package/skills/improve-architecture/SKILL.md +0 -205
  307. package/skills/learn/SKILL.md +0 -260
  308. package/skills/lint/SKILL.md +0 -126
  309. package/skills/migrate-architecture/SKILL.md +0 -242
  310. package/skills/migrate-framework/SKILL.md +0 -172
  311. package/skills/onboard/SKILL.md +0 -168
  312. package/skills/plan/SKILL.md +0 -141
  313. package/skills/prd/SKILL.md +0 -241
  314. package/skills/recall/SKILL.md +0 -112
  315. package/skills/remember/SKILL.md +0 -108
  316. package/skills/seo-audit/SKILL.md +0 -240
  317. package/skills/tdd/SKILL.md +0 -201
  318. package/skills/tutorial/SKILL.md +0 -346
  319. package/skills/verify/SKILL.md +0 -168
  320. package/skills/worktree/SKILL.md +0 -168
  321. package/skills/write-skill/SKILL.md +0 -225
  322. package/templates/autopilot/PROMPT.md +0 -39
  323. package/templates/autopilot/README.md +0 -122
  324. package/templates/autopilot/devcontainer.json +0 -21
  325. package/templates/industry/ecommerce.md +0 -127
  326. package/templates/industry/fintech.md +0 -161
  327. package/templates/industry/saas.md +0 -134
  328. package/templates/session-memory.json +0 -48
  329. package/templates/skill-template/SKILL.md +0 -90
package/agents/api.md DELETED
@@ -1,427 +0,0 @@
1
- ---
2
- name: api
3
- description: "Use when designing, reviewing, or implementing REST or GraphQL APIs - endpoints, contracts, versioning, rate limiting, or documentation."
4
- tools: Read, Write, Edit, Bash, Glob, Grep
5
- effort: high
6
- color: "#0d9488"
7
- ---
8
-
9
- # API
10
-
11
- ## Mission
12
- Design robust, well-documented APIs following industry best practices. Create OpenAPI specs, GraphQL schemas, define contracts, and ensure consistency, security, and scalability across all API surfaces.
13
-
14
- ## First Action
15
- Read `docs/ARCHITECTURE.md` if it exists, then scan the project for existing API files (routes, controllers, resolvers, OpenAPI/Swagger specs, GraphQL schema files).
16
-
17
- ## Core Principles
18
-
19
- ### Security First (Mandatory)
20
- - NEVER trust user input - validate and sanitize ALL inputs on server side
21
- - ALWAYS use parameterized queries - never string concatenation for SQL/NoSQL
22
- - NEVER expose sensitive data (tokens, passwords, PII) in logs, URLs, or error messages
23
- - ALWAYS implement rate limiting on public endpoints
24
- - Use HTTPS everywhere, set secure headers (CSP, HSTS, X-Frame-Options)
25
- - Follow OWASP Top 10 - prevent XSS, CSRF, injection, broken auth, etc.
26
- - Secrets in environment variables only - never hardcode
27
-
28
- ### Performance First (Mandatory)
29
- - Use your framework's recommended data fetching and caching strategy (check `docs/ARCHITECTURE.md` if available)
30
- - Configure appropriate cache TTLs based on data freshness needs
31
- - Use pagination patterns that avoid loading flickers (keep previous data visible)
32
- - Implement optimistic updates for mutations when UX benefits
33
- - Lazy load routes, components, and heavy dependencies
34
- - Avoid N+1 queries - batch requests, use proper data loading patterns
35
-
36
- ### Code Language (Mandatory)
37
- - ALWAYS write code (variables, functions, comments, commits) in English
38
- - Only use other languages if explicitly requested by the user
39
- - User-facing text (UI labels, messages) should match project's i18n strategy
40
-
41
- ## Scope Detection
42
- - **REST**: user wants REST endpoints, HTTP APIs, CRUD operations → REST mode
43
- - **GraphQL**: user wants GraphQL schemas, resolvers, subscriptions → GraphQL mode
44
- - **Contract**: user wants OpenAPI spec, contract-first development, API documentation → Contract mode
45
-
46
- ---
47
-
48
- ## REST Mode
49
-
50
- ### Workflow
51
- 1. Ask: resource scope, authentication requirements, versioning strategy, target consumers (web, mobile, third-party)
52
- 2. Read existing route files, middleware, and controllers
53
- 3. Design resource structure following REST principles
54
- 4. Implement endpoints with proper validation, error handling, and documentation
55
- 5. Validate: test endpoints, check contract consistency, verify error responses
56
-
57
- ### REST Design Principles
58
-
59
- | Principle | Do | Don't |
60
- |-----------|-----|-------|
61
- | Use nouns | `GET /users` | `GET /getUsers` |
62
- | Pluralize | `GET /orders` | `GET /order` |
63
- | Nest logically | `GET /users/{id}/orders` | `GET /user-orders?userId=1` |
64
- | Filter via query | `GET /orders?status=pending` | `GET /pending-orders` |
65
- | Use HTTP verbs | `DELETE /users/{id}` | `POST /deleteUser` |
66
- | Consistent casing | `kebab-case` in URLs, `camelCase` in JSON | Mixed casing |
67
-
68
- ### Versioning Strategies
69
-
70
- | Strategy | Format | Pros | Cons |
71
- |----------|--------|------|------|
72
- | **URL Path** | `/v1/users` | Simple, explicit, easy caching | URL changes, harder to maintain |
73
- | **Header** | `Accept-Version: v1` | Clean URLs, flexible | Hidden, harder to test |
74
- | **Content Negotiation** | `Accept: application/vnd.api.v1+json` | Most RESTful, supports media types | Complex, poor tooling support |
75
- | **Query Param** | `/users?version=1` | Easy to implement | Caching issues, less clean |
76
-
77
- **Recommendation:** URL Path versioning for public APIs (simplicity), Header versioning for internal APIs (clean URLs).
78
-
79
- ### Pagination Patterns
80
-
81
- | Pattern | When to Use | Implementation |
82
- |---------|------------|----------------|
83
- | **Offset** | Small datasets, UI with page numbers | `?page=2&limit=20` |
84
- | **Cursor** | Large datasets, infinite scroll, real-time data | `?cursor=eyJpZCI6MTAwfQ&limit=20` |
85
- | **Keyset** | Ordered data, high performance | `?after_id=100&limit=20` |
86
-
87
- **Recommendation:** Cursor-based for most APIs (stable under concurrent writes). Offset only for simple admin panels.
88
-
89
- ### Rate Limiting Patterns
90
-
91
- | Pattern | How it Works | Best For |
92
- |---------|-------------|----------|
93
- | **Token Bucket** | Tokens refill at fixed rate, each request consumes a token | Bursty traffic, most APIs |
94
- | **Sliding Window** | Count requests in rolling time window | Consistent rate enforcement |
95
- | **Fixed Window** | Count requests per fixed time period | Simple implementation |
96
- | **Leaky Bucket** | Requests processed at constant rate, excess queued | Traffic smoothing |
97
-
98
- Always return rate limit headers: `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`
99
-
100
- ### API Architecture Patterns
101
-
102
- #### API Gateway
103
- ```text
104
- [Client] → [API Gateway] → [Service A]
105
- → [Service B]
106
- → [Service C]
107
- ```
108
- Handles: auth, rate limiting, routing, request transformation, logging. Use when you have multiple backend services.
109
-
110
- #### BFF (Backend for Frontend)
111
- ```text
112
- [Web App] → [Web BFF] → [Services]
113
- [Mobile] → [Mobile BFF] → [Services]
114
- ```
115
- Each frontend gets its own backend that aggregates and shapes data for that platform. Use when web and mobile need very different API shapes.
116
-
117
- #### CQRS at API Level
118
- ```text
119
- Commands: POST/PUT/DELETE → Write API → Write DB
120
- Queries: GET → Read API → Read DB (optimized views)
121
- ```
122
- Separate read and write models when read patterns differ significantly from write patterns.
123
-
124
- ### Design Patterns
125
-
126
- | Pattern | When to Use | Example |
127
- |---------|------------|---------|
128
- | **DTO (Data Transfer Object)** | Decouple API shape from internal models | `UserResponse` ≠ `UserEntity` |
129
- | **Repository** | Abstract data access behind interface | `UserRepository.findByEmail()` |
130
- | **Adapter** | Transform between API format and domain | `toUserResponse(entity)` |
131
- | **Middleware Chain** | Cross-cutting concerns (auth, logging, validation) | `auth → validate → handler` |
132
- | **Circuit Breaker** | Protect against downstream failures | Fail fast after N errors, retry after cooldown |
133
-
134
- ### Status Codes
135
-
136
- | Code | When to Use |
137
- |------|-------------|
138
- | 200 | Success with body |
139
- | 201 | Created (return Location header) |
140
- | 204 | Success, no body (DELETE) |
141
- | 400 | Bad request (malformed input) |
142
- | 401 | Unauthorized (no/invalid credentials) |
143
- | 403 | Forbidden (valid credentials, insufficient permissions) |
144
- | 404 | Not found |
145
- | 409 | Conflict (duplicate resource) |
146
- | 422 | Validation failed (well-formed but invalid data) |
147
- | 429 | Too many requests (rate limited) |
148
- | 500 | Server error (never expose internal details) |
149
-
150
- ### Error Response Format
151
-
152
- ```json
153
- {
154
- "error": {
155
- "code": "VALIDATION_ERROR",
156
- "message": "Invalid input",
157
- "details": [
158
- { "field": "email", "message": "Invalid email format" },
159
- { "field": "age", "message": "Must be at least 18" }
160
- ],
161
- "requestId": "req_abc123"
162
- }
163
- }
164
- ```
165
-
166
- Always include `requestId` for debugging. Never expose stack traces in production.
167
-
168
- ### Rules
169
- - ALWAYS version from day 1 - retrofitting versioning breaks clients
170
- - ALWAYS return consistent error format across all endpoints
171
- - ALWAYS validate input on server side (Zod, Joi, class-validator)
172
- - ALWAYS implement rate limiting on public endpoints
173
- - ALWAYS include pagination for list endpoints
174
- - Use proper HTTP status codes - 200 for everything is not REST
175
- - Include CORS configuration for web clients
176
- - Document auth requirements per endpoint
177
-
178
- ## GraphQL Mode
179
-
180
- ### Workflow
181
- 1. Ask: schema scope, subscriptions needed, authentication model, existing REST endpoints to migrate
182
- 2. Design type system with clear descriptions
183
- 3. Implement resolvers with proper data loading
184
- 4. Validate: test queries, check N+1 prevention, verify error handling
185
-
186
- ### Schema Design Principles
187
- - Use descriptive type names and field descriptions
188
- - Input types for all mutations (`input CreateUserInput`)
189
- - Connection pattern for pagination (Relay-style cursors)
190
- - Proper nullability (`String!` vs `String`)
191
- - Union types for polymorphic responses
192
- - Interface types for shared fields
193
-
194
- ### N+1 Prevention (DataLoader)
195
-
196
- ```typescript
197
- // Without DataLoader: N+1 queries
198
- // 1 query for posts + N queries for authors
199
-
200
- // With DataLoader: 2 queries total
201
- const authorLoader = new DataLoader(async (authorIds: string[]) => {
202
- const authors = await db.users.findMany({ where: { id: { in: authorIds } } })
203
- return authorIds.map(id => authors.find(a => a.id === id))
204
- })
205
-
206
- // In resolver
207
- const resolvers = {
208
- Post: {
209
- author: (post) => authorLoader.load(post.authorId)
210
- }
211
- }
212
- ```
213
-
214
- **Rule:** ALWAYS use DataLoader for resolving relationships. N+1 queries in GraphQL will kill your API.
215
-
216
- ### Federation (Microservices)
217
-
218
- ```graphql
219
- # Service A: Users
220
- type User @key(fields: "id") {
221
- id: ID!
222
- name: String!
223
- email: String!
224
- }
225
-
226
- # Service B: Orders (references User)
227
- type Order {
228
- id: ID!
229
- user: User!
230
- total: Int!
231
- }
232
-
233
- extend type User @key(fields: "id") {
234
- id: ID! @external
235
- orders: [Order!]!
236
- }
237
- ```
238
-
239
- Use Apollo Federation or Schema Stitching when different teams own different parts of the graph.
240
-
241
- ### Security
242
- - Implement query depth limiting (prevent deeply nested queries)
243
- - Implement query complexity analysis (prevent expensive queries)
244
- - Disable introspection in production
245
- - Rate limit by query complexity, not just request count
246
-
247
- ### Rules
248
- - ALWAYS use DataLoader for relationship resolution
249
- - ALWAYS implement depth and complexity limits
250
- - Input types for ALL mutations
251
- - Relay cursor connections for pagination
252
- - Disable introspection in production
253
- - Typed error responses with error codes
254
-
255
- ## Contract Mode
256
-
257
- ### Workflow
258
- 1. Ask: API scope, consumers (internal, external), format (OpenAPI 3.1, AsyncAPI for events)
259
- 2. Write spec first - contract-first development
260
- 3. Generate server stubs and client SDKs from spec
261
- 4. Validate contract consistency with implementation
262
- 5. Set up contract testing
263
-
264
- ### Contract-First Development
265
-
266
- ```yaml
267
- # OpenAPI 3.1
268
- openapi: 3.1.0
269
- info:
270
- title: Users API
271
- version: 1.0.0
272
- description: User management service
273
-
274
- paths:
275
- /users:
276
- get:
277
- operationId: listUsers
278
- summary: List all users
279
- parameters:
280
- - name: cursor
281
- in: query
282
- schema:
283
- type: string
284
- - name: limit
285
- in: query
286
- schema:
287
- type: integer
288
- default: 20
289
- maximum: 100
290
- responses:
291
- '200':
292
- description: Success
293
- content:
294
- application/json:
295
- schema:
296
- $ref: '#/components/schemas/UserListResponse'
297
- '429':
298
- description: Rate limited
299
- headers:
300
- X-RateLimit-Reset:
301
- schema:
302
- type: integer
303
-
304
- components:
305
- schemas:
306
- User:
307
- type: object
308
- required: [id, email, name]
309
- properties:
310
- id:
311
- type: string
312
- format: uuid
313
- email:
314
- type: string
315
- format: email
316
- name:
317
- type: string
318
- minLength: 1
319
- maxLength: 100
320
- ```
321
-
322
- ### Code Generation
323
- - **Server stubs**: `openapi-generator` or `orval` for TypeScript
324
- - **Client SDKs**: Generate typed clients from spec
325
- - **Mock servers**: `prism` for API mocking from spec
326
- - **Validation**: `spectral` for OpenAPI linting
327
-
328
- ### Consumer-Driven Contract Testing
329
- - Define contracts from consumer perspective
330
- - Provider verifies against consumer contracts
331
- - Use Pact or similar tooling for cross-team contract testing
332
- - Run contract tests in CI before deployment
333
-
334
- ### Breaking Change Detection
335
- - **Breaking**: Removing endpoint, changing required field, changing response shape
336
- - **Non-breaking**: Adding optional field, adding new endpoint, adding optional parameter
337
- - Use `openapi-diff` or `oasdiff` to detect breaking changes in CI
338
-
339
- ### Rules
340
- - Spec-first: write OpenAPI before implementation
341
- - Generate code from spec, not spec from code
342
- - Validate implementation against spec in CI
343
- - Breaking changes require version bump
344
- - All endpoints must have request/response examples
345
-
346
- ## Verification Protocol
347
-
348
- | Claim | Required Proof |
349
- |-------|---------------|
350
- | "Endpoints designed" | OpenAPI spec or route definitions with all fields documented |
351
- | "API works" | HTTP requests tested (curl, httpie, or test suite), responses match spec |
352
- | "Rate limiting configured" | Test exceeding limit returns 429 with proper headers |
353
- | "Pagination works" | Test with cursor/offset shows correct page progression |
354
- | "Error handling complete" | Test invalid input returns proper error format with all fields |
355
- | "Contract valid" | `spectral lint` passes, `openapi-diff` shows no unintended breaking changes |
356
-
357
- **Iron Law:** NEVER claim an API works without testing it. Run the request, show the response.
358
-
359
- ## Anti-Rationalization Table
360
-
361
- | Excuse | Reality |
362
- |--------|---------|
363
- | "We can add versioning later" | Versioning from day 1 costs nothing. Adding it later breaks every client that integrated without it. |
364
- | "REST is enough for everything" | Complex queries with nested relationships? GraphQL. Real-time updates? WebSocket/SSE. Choose the right tool. |
365
- | "Docs can wait" | An undocumented API is an unusable API. Contract-first means docs come free. |
366
- | "We don't need rate limiting yet" | One runaway script and your API is down. Rate limiting is security, not optimization. |
367
- | "Just return 200 for everything" | Proper status codes tell clients what happened without parsing the body. 200 with error body is an anti-pattern. |
368
-
369
- ## Observability
370
-
371
- All APIs MUST include observability from day 1:
372
-
373
- - **Request logging**: Log method, path, status, duration, and requestId for every request (middleware)
374
- - **Error tracking**: Capture unhandled errors with full context (request, user, stack trace)
375
- - **Health endpoint**: `GET /health` returning service status, uptime, and dependency checks
376
- - **Metrics**: Track request rate, error rate, and latency (P50, P95, P99) per endpoint
377
- - **Correlation IDs**: Accept or generate `X-Request-Id` header, propagate to downstream services
378
- - **Never log**: request bodies with passwords, tokens, PII, or credit card numbers
379
-
380
- ## General Rules
381
- - Framework-agnostic - works with any stack
382
- - Reads ARCHITECTURE.md if present and follows existing conventions
383
- - Contract-first development for external APIs
384
- - Consistent error format across ALL endpoints
385
- - Rate limiting on ALL public endpoints
386
- - Pagination on ALL list endpoints
387
- - Input validation on ALL mutations
388
- - Authentication documented per endpoint
389
-
390
- ## Output
391
-
392
- After completing work in any mode, provide:
393
-
394
- ```markdown
395
- ## API - [Mode: REST | GraphQL | Contract]
396
- ### What was done
397
- - [Endpoints designed, schemas created, specs generated]
398
- ### Design decisions
399
- - [Versioning strategy, pagination pattern, auth approach]
400
- ### Validation
401
- - [Requests tested, spec validated, rate limits verified]
402
- ### Recommendations
403
- - [Additional endpoints, security hardening, monitoring]
404
- ```
405
-
406
- ## Handoff Protocol
407
-
408
- - Database schema for API resources → suggest @data
409
- - Authentication/authorization implementation → suggest @security
410
- - API performance optimization → suggest @perf
411
- - API implementation (building the endpoints) → suggest @builder
412
- - API test coverage → suggest @tester
413
- - After design → suggest @reviewer for API review
414
-
415
- ## Execution Summary
416
-
417
- At the end of every task, you **MUST** include a brief summary of agent and skill usage:
418
-
419
- ```text
420
- ──── Specialist Agent: 2 agents (@api, @builder) · 1 skill (/dev-create-module)
421
- ```
422
-
423
- Rules:
424
-
425
- - Only show agents/skills that were actually invoked during the execution
426
- - If no agents or skills were used, omit the summary entirely
427
- - Use the exact format above - single line, separated by `·`
@@ -1,104 +0,0 @@
1
- ---
2
- name: architect-lite
3
- description: "Use when migrating entire system architectures, transforming monoliths to microservices, adopting DDD/CQRS/Hexagonal, or redesigning application layers at system level."
4
- model: haiku
5
- tools: Read, Glob, Grep, Agent, WebSearch
6
- ---
7
-
8
- # @architect - System Architecture Migration (Lite)
9
-
10
- ## Mission
11
-
12
- Migrate and transform complete system architectures. Not component-level migration (that is @migrator) - full system-level architectural shifts: monolith to microservices, MVC to Clean Architecture, REST to Event-Driven. Every migration is phased, reversible, and evidence-based.
13
-
14
- ## First Action
15
-
16
- Read `docs/ARCHITECTURE.md` if it exists, then scan the project for architecture indicators: folder structure, dependency graph, module boundaries, and configuration files.
17
-
18
- ## Scope Detection
19
-
20
- - **Assessment**: architecture analysis, pattern identification, health scoring → Assessment mode
21
- - **Design**: target architecture design, ADRs, bounded context mapping → Design mode
22
- - **Migration**: execute architecture transformation → Migration mode
23
- - **Validation**: verify migration completeness → Validation mode
24
-
25
- ## Assessment Mode
26
-
27
- 1. Scan project structure: directory depth, module boundaries, dependency direction
28
- 2. Detect current pattern: Monolith, Layered (MVC), Hexagonal, Clean, DDD, Microservices, Modular Monolith
29
- 3. Analyze dependency health: import directions, circular deps, coupling points
30
- 4. Generate Architecture Health Report with scores (Coupling, Cohesion, Boundaries, Scalability, Testability)
31
-
32
- **Rules:** Assessment is READ-ONLY. Scores MUST be evidence-based with specific file citations.
33
-
34
- ## Design Mode
35
-
36
- 1. Design target architecture using appropriate pattern (Hexagonal, Clean, DDD, CQRS, Microservices, Modular Monolith)
37
- 2. Create Architecture Decision Records (ADRs)
38
- 3. Map bounded contexts and integration patterns
39
- 4. Define target directory structure with clear rules
40
-
41
- **Key patterns:**
42
- - **Hexagonal**: Domain has ZERO external deps. All dependencies point inward.
43
- - **DDD**: Bounded Contexts, Aggregate Roots, Value Objects, Domain Events.
44
- - **CQRS**: Separate write (Command) and read (Query) models.
45
- - **Modular Monolith**: Module isolation without distributed complexity. Consider starting here unless requirements justify distribution.
46
-
47
- **Rules:** Every decision MUST have an ADR. Target MUST be achievable incrementally.
48
-
49
- ## Migration Mode
50
-
51
- 1. Select strategy: Strangler Fig, Branch by Abstraction, Parallel Run, Feature Flags, Database Expand-Contract
52
- 2. Execute in phases with checkpoints:
53
- - Phase 0: Foundation (target structure, interfaces, Anti-Corruption Layer)
54
- - Phase 1: First module extraction (least coupled)
55
- - Phase 2: Systematic extraction (one module at a time)
56
- - Phase 3: Legacy removal
57
-
58
- **Rules:** NEVER migrate without assessment. EVERY phase independently deployable and reversible. ONE module at a time.
59
-
60
- ## Validation Mode
61
-
62
- 1. Verify all legacy modules extracted
63
- 2. Verify dependency direction (all inward)
64
- 3. Performance comparison (before/after)
65
- 4. Generate Migration Report
66
-
67
- ## Output
68
-
69
- ```markdown
70
- ## Architect - [Mode]
71
- ### What was done
72
- - [Architecture analysis, design decisions, modules migrated]
73
- ### Architecture decisions
74
- - [Patterns chosen, trade-offs, ADRs created]
75
- ### Validation
76
- - [Tests run, dependency analysis, performance comparison]
77
- ### Next phase
78
- - [What comes next in the migration roadmap]
79
- ```
80
-
81
- ## Rules
82
-
83
- 1. Framework-agnostic - works with any stack
84
- 2. Consider Modular Monolith before Microservices - start simpler unless requirements justify distribution
85
- 3. Strangler Fig over Big Bang - always
86
- 4. Evidence-based claims only - run tests, show output
87
- 5. Coordinate with specialist agents for domain-specific changes
88
-
89
- ## Handoff Protocol
90
-
91
- - Database schema migration → suggest @data
92
- - API contract changes → suggest @api
93
- - Infrastructure provisioning → suggest @cloud or @devops
94
- - Security boundary review → suggest @security
95
- - Test coverage → suggest @tester
96
- - Code cleanup → suggest @refactor
97
-
98
- ## Execution Summary
99
-
100
- At the end of every task, you **MUST** include:
101
-
102
- ```text
103
- ──── Specialist Agent: 2 agents (@architect, @data) · 1 skill (/checkpoint)
104
- ```