contextos-agents 1.5.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 (310) hide show
  1. package/.agents/AGENTS.md +421 -0
  2. package/.agents/adapters/aider/export.js +137 -0
  3. package/.agents/adapters/claude/export.js +55 -0
  4. package/.agents/adapters/copilot/export.js +107 -0
  5. package/.agents/adapters/cursor/export.js +210 -0
  6. package/.agents/adapters/gemini/export.js +115 -0
  7. package/.agents/adapters/shared.js +119 -0
  8. package/.agents/adapters/zed/export.js +111 -0
  9. package/.agents/core/profiles/backend.yaml +47 -0
  10. package/.agents/core/profiles/enterprise.yaml +46 -0
  11. package/.agents/core/profiles/frontend.yaml +46 -0
  12. package/.agents/core/profiles/hackathon.yaml +45 -0
  13. package/.agents/core/profiles/mvp.yaml +43 -0
  14. package/.agents/core/profiles/startup.yaml +48 -0
  15. package/.agents/core/skills/adapters/EXAMPLES.md +19 -0
  16. package/.agents/core/skills/adapters/SKILL.md +105 -0
  17. package/.agents/core/skills/adapters/TROUBLESHOOTING.md +7 -0
  18. package/.agents/core/skills/adapters/VALIDATION.json +12 -0
  19. package/.agents/core/skills/adapters/skill.yaml +10 -0
  20. package/.agents/core/skills/architecture-diagrams/SKILL.md +108 -0
  21. package/.agents/core/skills/architecture-diagrams/VALIDATION.json +12 -0
  22. package/.agents/core/skills/architecture-diagrams/skill.yaml +8 -0
  23. package/.agents/core/skills/brutalist-design/SKILL.md +150 -0
  24. package/.agents/core/skills/brutalist-design/VALIDATION.json +12 -0
  25. package/.agents/core/skills/brutalist-design/skill.yaml +8 -0
  26. package/.agents/core/skills/context-manager/EXAMPLES.md +19 -0
  27. package/.agents/core/skills/context-manager/SKILL.md +126 -0
  28. package/.agents/core/skills/context-manager/TROUBLESHOOTING.md +7 -0
  29. package/.agents/core/skills/context-manager/VALIDATION.json +12 -0
  30. package/.agents/core/skills/context-manager/skill.yaml +10 -0
  31. package/.agents/core/skills/context-os/EXAMPLES.md +21 -0
  32. package/.agents/core/skills/context-os/SKILL.md +169 -0
  33. package/.agents/core/skills/context-os/TROUBLESHOOTING.md +7 -0
  34. package/.agents/core/skills/context-os/VALIDATION.json +12 -0
  35. package/.agents/core/skills/context-os/packs.yaml +59 -0
  36. package/.agents/core/skills/context-os/references/context-rules.md +68 -0
  37. package/.agents/core/skills/context-os/references/pipeline.md +119 -0
  38. package/.agents/core/skills/context-os/references/project-graph.md +103 -0
  39. package/.agents/core/skills/context-os/rules.yaml +135 -0
  40. package/.agents/core/skills/context-os/skill.yaml +10 -0
  41. package/.agents/core/skills/database/EXAMPLES.md +74 -0
  42. package/.agents/core/skills/database/SKILL.md +101 -0
  43. package/.agents/core/skills/database/TROUBLESHOOTING.md +18 -0
  44. package/.agents/core/skills/database/VALIDATION.json +11 -0
  45. package/.agents/core/skills/database/skill.yaml +25 -0
  46. package/.agents/core/skills/ddd/EXAMPLES.md +42 -0
  47. package/.agents/core/skills/ddd/SKILL.md +247 -0
  48. package/.agents/core/skills/ddd/TROUBLESHOOTING.md +19 -0
  49. package/.agents/core/skills/ddd/VALIDATION.json +12 -0
  50. package/.agents/core/skills/ddd/ddd.md +178 -0
  51. package/.agents/core/skills/ddd/skill.yaml +10 -0
  52. package/.agents/core/skills/decisions/EXAMPLES.md +35 -0
  53. package/.agents/core/skills/decisions/SKILL.md +90 -0
  54. package/.agents/core/skills/decisions/TROUBLESHOOTING.md +13 -0
  55. package/.agents/core/skills/decisions/VALIDATION.json +12 -0
  56. package/.agents/core/skills/decisions/skill.yaml +10 -0
  57. package/.agents/core/skills/docker/EXAMPLES.md +56 -0
  58. package/.agents/core/skills/docker/SKILL.md +63 -0
  59. package/.agents/core/skills/docker/TROUBLESHOOTING.md +18 -0
  60. package/.agents/core/skills/docker/VALIDATION.json +11 -0
  61. package/.agents/core/skills/docker/skill.yaml +23 -0
  62. package/.agents/core/skills/engineering-workflow/EXAMPLES.md +57 -0
  63. package/.agents/core/skills/engineering-workflow/SKILL.md +343 -0
  64. package/.agents/core/skills/engineering-workflow/TROUBLESHOOTING.md +19 -0
  65. package/.agents/core/skills/engineering-workflow/VALIDATION.json +12 -0
  66. package/.agents/core/skills/engineering-workflow/skill.yaml +13 -0
  67. package/.agents/core/skills/fastapi/EXAMPLES.md +36 -0
  68. package/.agents/core/skills/fastapi/SKILL.md +148 -0
  69. package/.agents/core/skills/fastapi/TROUBLESHOOTING.md +19 -0
  70. package/.agents/core/skills/fastapi/VALIDATION.json +12 -0
  71. package/.agents/core/skills/fastapi/fastapi.md +112 -0
  72. package/.agents/core/skills/fastapi/skill.yaml +10 -0
  73. package/.agents/core/skills/gemini-precision/SKILL.md +169 -0
  74. package/.agents/core/skills/gemini-precision/VALIDATION.json +12 -0
  75. package/.agents/core/skills/gemini-precision/skill.yaml +9 -0
  76. package/.agents/core/skills/generators/EXAMPLES.md +19 -0
  77. package/.agents/core/skills/generators/SKILL.md +112 -0
  78. package/.agents/core/skills/generators/TROUBLESHOOTING.md +7 -0
  79. package/.agents/core/skills/generators/VALIDATION.json +12 -0
  80. package/.agents/core/skills/generators/skill.yaml +10 -0
  81. package/.agents/core/skills/generators/templates/API.md +77 -0
  82. package/.agents/core/skills/generators/templates/ARCHITECTURE.md +70 -0
  83. package/.agents/core/skills/generators/templates/DATABASE.md +42 -0
  84. package/.agents/core/skills/generators/templates/DECISION.md +46 -0
  85. package/.agents/core/skills/generators/templates/PRD.md +67 -0
  86. package/.agents/core/skills/generators/templates/PROJECT_GRAPH.md +56 -0
  87. package/.agents/core/skills/generators/templates/ROADMAP.md +51 -0
  88. package/.agents/core/skills/generators/templates/TASKS.md +43 -0
  89. package/.agents/core/skills/generators/templates/UI.md +73 -0
  90. package/.agents/core/skills/graphify/EXAMPLES.md +73 -0
  91. package/.agents/core/skills/graphify/SKILL.md +130 -0
  92. package/.agents/core/skills/graphify/VALIDATION.json +12 -0
  93. package/.agents/core/skills/graphify/skill.yaml +13 -0
  94. package/.agents/core/skills/gstack-roles/EXAMPLES.md +23 -0
  95. package/.agents/core/skills/gstack-roles/SKILL.md +152 -0
  96. package/.agents/core/skills/gstack-roles/TROUBLESHOOTING.md +13 -0
  97. package/.agents/core/skills/gstack-roles/VALIDATION.json +12 -0
  98. package/.agents/core/skills/gstack-roles/skill.yaml +12 -0
  99. package/.agents/core/skills/impeccable-design/EXAMPLES.md +26 -0
  100. package/.agents/core/skills/impeccable-design/SKILL.md +201 -0
  101. package/.agents/core/skills/impeccable-design/TROUBLESHOOTING.md +19 -0
  102. package/.agents/core/skills/impeccable-design/VALIDATION.json +12 -0
  103. package/.agents/core/skills/impeccable-design/skill.yaml +14 -0
  104. package/.agents/core/skills/interview-me/SKILL.md +97 -0
  105. package/.agents/core/skills/interview-me/VALIDATION.json +12 -0
  106. package/.agents/core/skills/interview-me/skill.yaml +8 -0
  107. package/.agents/core/skills/microservices/EXAMPLES.md +38 -0
  108. package/.agents/core/skills/microservices/SKILL.md +164 -0
  109. package/.agents/core/skills/microservices/TROUBLESHOOTING.md +19 -0
  110. package/.agents/core/skills/microservices/VALIDATION.json +12 -0
  111. package/.agents/core/skills/microservices/microservices.md +119 -0
  112. package/.agents/core/skills/microservices/skill.yaml +10 -0
  113. package/.agents/core/skills/minimalist-design/SKILL.md +113 -0
  114. package/.agents/core/skills/minimalist-design/VALIDATION.json +12 -0
  115. package/.agents/core/skills/minimalist-design/skill.yaml +8 -0
  116. package/.agents/core/skills/nestjs/EXAMPLES.md +40 -0
  117. package/.agents/core/skills/nestjs/SKILL.md +139 -0
  118. package/.agents/core/skills/nestjs/TROUBLESHOOTING.md +19 -0
  119. package/.agents/core/skills/nestjs/VALIDATION.json +12 -0
  120. package/.agents/core/skills/nestjs/nestjs.md +103 -0
  121. package/.agents/core/skills/nestjs/skill.yaml +10 -0
  122. package/.agents/core/skills/nextjs/EXAMPLES.md +40 -0
  123. package/.agents/core/skills/nextjs/SKILL.md +163 -0
  124. package/.agents/core/skills/nextjs/TROUBLESHOOTING.md +19 -0
  125. package/.agents/core/skills/nextjs/VALIDATION.json +12 -0
  126. package/.agents/core/skills/nextjs/nextjs.md +67 -0
  127. package/.agents/core/skills/nextjs/skill.yaml +10 -0
  128. package/.agents/core/skills/node/EXAMPLES.md +80 -0
  129. package/.agents/core/skills/node/SKILL.md +128 -0
  130. package/.agents/core/skills/node/TROUBLESHOOTING.md +19 -0
  131. package/.agents/core/skills/node/VALIDATION.json +12 -0
  132. package/.agents/core/skills/node/node.md +87 -0
  133. package/.agents/core/skills/node/skill.yaml +10 -0
  134. package/.agents/core/skills/performance/EXAMPLES.md +30 -0
  135. package/.agents/core/skills/performance/SKILL.md +75 -0
  136. package/.agents/core/skills/performance/TROUBLESHOOTING.md +19 -0
  137. package/.agents/core/skills/performance/VALIDATION.json +12 -0
  138. package/.agents/core/skills/performance/performance.md +52 -0
  139. package/.agents/core/skills/performance/skill.yaml +10 -0
  140. package/.agents/core/skills/ponytail-mindset/EXAMPLES.md +45 -0
  141. package/.agents/core/skills/ponytail-mindset/SKILL.md +193 -0
  142. package/.agents/core/skills/ponytail-mindset/TROUBLESHOOTING.md +19 -0
  143. package/.agents/core/skills/ponytail-mindset/VALIDATION.json +12 -0
  144. package/.agents/core/skills/ponytail-mindset/skill.yaml +14 -0
  145. package/.agents/core/skills/react/EXAMPLES.md +79 -0
  146. package/.agents/core/skills/react/SKILL.md +132 -0
  147. package/.agents/core/skills/react/TROUBLESHOOTING.md +19 -0
  148. package/.agents/core/skills/react/VALIDATION.json +12 -0
  149. package/.agents/core/skills/react/react.md +93 -0
  150. package/.agents/core/skills/react/skill.yaml +10 -0
  151. package/.agents/core/skills/react-best-practices/SKILL.md +155 -0
  152. package/.agents/core/skills/react-best-practices/VALIDATION.json +12 -0
  153. package/.agents/core/skills/react-best-practices/skill.yaml +10 -0
  154. package/.agents/core/skills/redesign-audit/SKILL.md +117 -0
  155. package/.agents/core/skills/redesign-audit/VALIDATION.json +12 -0
  156. package/.agents/core/skills/redesign-audit/skill.yaml +8 -0
  157. package/.agents/core/skills/security/EXAMPLES.md +64 -0
  158. package/.agents/core/skills/security/SKILL.md +158 -0
  159. package/.agents/core/skills/security/TROUBLESHOOTING.md +19 -0
  160. package/.agents/core/skills/security/VALIDATION.json +12 -0
  161. package/.agents/core/skills/security/security.md +106 -0
  162. package/.agents/core/skills/security/skill.yaml +10 -0
  163. package/.agents/core/skills/soft-design/SKILL.md +108 -0
  164. package/.agents/core/skills/soft-design/VALIDATION.json +12 -0
  165. package/.agents/core/skills/soft-design/skill.yaml +8 -0
  166. package/.agents/core/skills/state-management/EXAMPLES.md +56 -0
  167. package/.agents/core/skills/state-management/SKILL.md +48 -0
  168. package/.agents/core/skills/state-management/TROUBLESHOOTING.md +18 -0
  169. package/.agents/core/skills/state-management/VALIDATION.json +11 -0
  170. package/.agents/core/skills/state-management/skill.yaml +22 -0
  171. package/.agents/core/skills/subagent-orchestrator/SKILL.md +100 -0
  172. package/.agents/core/skills/subagent-orchestrator/VALIDATION.json +12 -0
  173. package/.agents/core/skills/subagent-orchestrator/skill.yaml +8 -0
  174. package/.agents/core/skills/system-design/EXAMPLES.md +75 -0
  175. package/.agents/core/skills/system-design/SKILL.md +419 -0
  176. package/.agents/core/skills/system-design/TROUBLESHOOTING.md +19 -0
  177. package/.agents/core/skills/system-design/VALIDATION.json +12 -0
  178. package/.agents/core/skills/system-design/skill.yaml +13 -0
  179. package/.agents/core/skills/system-design/system-design.md +112 -0
  180. package/.agents/core/skills/testing/EXAMPLES.md +71 -0
  181. package/.agents/core/skills/testing/SKILL.md +70 -0
  182. package/.agents/core/skills/testing/TROUBLESHOOTING.md +18 -0
  183. package/.agents/core/skills/testing/VALIDATION.json +11 -0
  184. package/.agents/core/skills/testing/skill.yaml +26 -0
  185. package/.agents/core/skills/typescript/EXAMPLES.md +64 -0
  186. package/.agents/core/skills/typescript/SKILL.md +112 -0
  187. package/.agents/core/skills/typescript/TROUBLESHOOTING.md +19 -0
  188. package/.agents/core/skills/typescript/VALIDATION.json +12 -0
  189. package/.agents/core/skills/typescript/skill.yaml +10 -0
  190. package/.agents/core/skills/typescript/typescript.md +71 -0
  191. package/.agents/core/skills/ui-design/EXAMPLES.md +21 -0
  192. package/.agents/core/skills/ui-design/SKILL.md +124 -0
  193. package/.agents/core/skills/ui-design/TROUBLESHOOTING.md +19 -0
  194. package/.agents/core/skills/ui-design/VALIDATION.json +12 -0
  195. package/.agents/core/skills/ui-design/skill.yaml +10 -0
  196. package/.agents/core/skills/ui-design/ui.md +88 -0
  197. package/.agents/core/skills/ui-ux-pro/EXAMPLES.md +62 -0
  198. package/.agents/core/skills/ui-ux-pro/SKILL.md +375 -0
  199. package/.agents/core/skills/ui-ux-pro/TROUBLESHOOTING.md +19 -0
  200. package/.agents/core/skills/ui-ux-pro/VALIDATION.json +12 -0
  201. package/.agents/core/skills/ui-ux-pro/skill.yaml +13 -0
  202. package/.agents/core/skills/ux-design/EXAMPLES.md +36 -0
  203. package/.agents/core/skills/ux-design/SKILL.md +116 -0
  204. package/.agents/core/skills/ux-design/TROUBLESHOOTING.md +19 -0
  205. package/.agents/core/skills/ux-design/VALIDATION.json +12 -0
  206. package/.agents/core/skills/ux-design/skill.yaml +10 -0
  207. package/.agents/core/skills/ux-design/ux.md +80 -0
  208. package/.agents/core/skills/vercel-optimize/SKILL.md +83 -0
  209. package/.agents/core/skills/vercel-optimize/VALIDATION.json +12 -0
  210. package/.agents/core/skills/vercel-optimize/skill.yaml +10 -0
  211. package/.agents/core/skills/web-accessibility/EXAMPLES.md +39 -0
  212. package/.agents/core/skills/web-accessibility/SKILL.md +170 -0
  213. package/.agents/core/skills/web-accessibility/TROUBLESHOOTING.md +19 -0
  214. package/.agents/core/skills/web-accessibility/VALIDATION.json +12 -0
  215. package/.agents/core/skills/web-accessibility/accessibility.md +63 -0
  216. package/.agents/core/skills/web-accessibility/skill.yaml +10 -0
  217. package/.agents/ctx.js +370 -0
  218. package/.agents/generated/claude/skills/adapters/SKILL.md +126 -0
  219. package/.agents/generated/claude/skills/architecture-diagrams/SKILL.md +101 -0
  220. package/.agents/generated/claude/skills/brutalist-design/SKILL.md +145 -0
  221. package/.agents/generated/claude/skills/context-manager/SKILL.md +147 -0
  222. package/.agents/generated/claude/skills/context-os/SKILL.md +191 -0
  223. package/.agents/generated/claude/skills/database/SKILL.md +191 -0
  224. package/.agents/generated/claude/skills/ddd/SKILL.md +305 -0
  225. package/.agents/generated/claude/skills/decisions/SKILL.md +134 -0
  226. package/.agents/generated/claude/skills/docker/SKILL.md +135 -0
  227. package/.agents/generated/claude/skills/engineering-workflow/SKILL.md +414 -0
  228. package/.agents/generated/claude/skills/fastapi/SKILL.md +200 -0
  229. package/.agents/generated/claude/skills/gemini-precision/SKILL.md +161 -0
  230. package/.agents/generated/claude/skills/generators/SKILL.md +133 -0
  231. package/.agents/generated/claude/skills/graphify/SKILL.md +198 -0
  232. package/.agents/generated/claude/skills/gstack-roles/SKILL.md +184 -0
  233. package/.agents/generated/claude/skills/impeccable-design/SKILL.md +241 -0
  234. package/.agents/generated/claude/skills/interview-me/SKILL.md +90 -0
  235. package/.agents/generated/claude/skills/microservices/SKILL.md +218 -0
  236. package/.agents/generated/claude/skills/minimalist-design/SKILL.md +108 -0
  237. package/.agents/generated/claude/skills/nestjs/SKILL.md +195 -0
  238. package/.agents/generated/claude/skills/nextjs/SKILL.md +219 -0
  239. package/.agents/generated/claude/skills/node/SKILL.md +224 -0
  240. package/.agents/generated/claude/skills/performance/SKILL.md +121 -0
  241. package/.agents/generated/claude/skills/ponytail-mindset/SKILL.md +252 -0
  242. package/.agents/generated/claude/skills/react/SKILL.md +227 -0
  243. package/.agents/generated/claude/skills/react-best-practices/SKILL.md +146 -0
  244. package/.agents/generated/claude/skills/redesign-audit/SKILL.md +112 -0
  245. package/.agents/generated/claude/skills/security/SKILL.md +237 -0
  246. package/.agents/generated/claude/skills/soft-design/SKILL.md +103 -0
  247. package/.agents/generated/claude/skills/state-management/SKILL.md +120 -0
  248. package/.agents/generated/claude/skills/subagent-orchestrator/SKILL.md +93 -0
  249. package/.agents/generated/claude/skills/system-design/SKILL.md +507 -0
  250. package/.agents/generated/claude/skills/testing/SKILL.md +157 -0
  251. package/.agents/generated/claude/skills/typescript/SKILL.md +192 -0
  252. package/.agents/generated/claude/skills/ui-design/SKILL.md +161 -0
  253. package/.agents/generated/claude/skills/ui-ux-pro/SKILL.md +451 -0
  254. package/.agents/generated/claude/skills/ux-design/SKILL.md +168 -0
  255. package/.agents/generated/claude/skills/vercel-optimize/SKILL.md +76 -0
  256. package/.agents/generated/claude/skills/web-accessibility/SKILL.md +225 -0
  257. package/.agents/generated/gemini/skills/adapters/SKILL.md +135 -0
  258. package/.agents/generated/gemini/skills/architecture-diagrams/SKILL.md +107 -0
  259. package/.agents/generated/gemini/skills/brutalist-design/SKILL.md +151 -0
  260. package/.agents/generated/gemini/skills/context-manager/SKILL.md +156 -0
  261. package/.agents/generated/gemini/skills/context-os/SKILL.md +200 -0
  262. package/.agents/generated/gemini/skills/database/SKILL.md +200 -0
  263. package/.agents/generated/gemini/skills/ddd/SKILL.md +314 -0
  264. package/.agents/generated/gemini/skills/decisions/SKILL.md +143 -0
  265. package/.agents/generated/gemini/skills/docker/SKILL.md +144 -0
  266. package/.agents/generated/gemini/skills/engineering-workflow/SKILL.md +423 -0
  267. package/.agents/generated/gemini/skills/fastapi/SKILL.md +209 -0
  268. package/.agents/generated/gemini/skills/gemini-precision/SKILL.md +167 -0
  269. package/.agents/generated/gemini/skills/generators/SKILL.md +142 -0
  270. package/.agents/generated/gemini/skills/graphify/SKILL.md +205 -0
  271. package/.agents/generated/gemini/skills/gstack-roles/SKILL.md +193 -0
  272. package/.agents/generated/gemini/skills/impeccable-design/SKILL.md +250 -0
  273. package/.agents/generated/gemini/skills/interview-me/SKILL.md +96 -0
  274. package/.agents/generated/gemini/skills/microservices/SKILL.md +227 -0
  275. package/.agents/generated/gemini/skills/minimalist-design/SKILL.md +114 -0
  276. package/.agents/generated/gemini/skills/nestjs/SKILL.md +204 -0
  277. package/.agents/generated/gemini/skills/nextjs/SKILL.md +298 -0
  278. package/.agents/generated/gemini/skills/node/SKILL.md +323 -0
  279. package/.agents/generated/gemini/skills/performance/SKILL.md +185 -0
  280. package/.agents/generated/gemini/skills/ponytail-mindset/SKILL.md +261 -0
  281. package/.agents/generated/gemini/skills/react/SKILL.md +332 -0
  282. package/.agents/generated/gemini/skills/react-best-practices/SKILL.md +152 -0
  283. package/.agents/generated/gemini/skills/redesign-audit/SKILL.md +118 -0
  284. package/.agents/generated/gemini/skills/security/SKILL.md +355 -0
  285. package/.agents/generated/gemini/skills/soft-design/SKILL.md +109 -0
  286. package/.agents/generated/gemini/skills/state-management/SKILL.md +129 -0
  287. package/.agents/generated/gemini/skills/subagent-orchestrator/SKILL.md +99 -0
  288. package/.agents/generated/gemini/skills/system-design/SKILL.md +631 -0
  289. package/.agents/generated/gemini/skills/testing/SKILL.md +166 -0
  290. package/.agents/generated/gemini/skills/typescript/SKILL.md +275 -0
  291. package/.agents/generated/gemini/skills/ui-design/SKILL.md +170 -0
  292. package/.agents/generated/gemini/skills/ui-ux-pro/SKILL.md +460 -0
  293. package/.agents/generated/gemini/skills/ux-design/SKILL.md +177 -0
  294. package/.agents/generated/gemini/skills/vercel-optimize/SKILL.md +82 -0
  295. package/.agents/generated/gemini/skills/web-accessibility/SKILL.md +300 -0
  296. package/.agents/mcp/runtime.py +454 -0
  297. package/.agents/mcp/server.mjs +189373 -0
  298. package/.agents/plugins.js +574 -0
  299. package/.agents/profiles.js +267 -0
  300. package/.agents/resolver.js +336 -0
  301. package/.agents/skills-index.json +200 -0
  302. package/.agents/skills.json +6 -0
  303. package/.agents/validate.js +500 -0
  304. package/LICENSE +21 -0
  305. package/README.md +415 -0
  306. package/benchmarks/gemini-issues.js +533 -0
  307. package/bin/index.js +458 -0
  308. package/package.json +70 -0
  309. package/registry.json +53 -0
  310. package/registry.schema.json +32 -0
@@ -0,0 +1,146 @@
1
+ # Vercel React Best Practices
2
+
3
+ ## Overview
4
+
5
+ Comprehensive performance optimization guide for React and Next.js applications, maintained by Vercel. Contains 70 rules across 8 categories, prioritized by impact to guide automated refactoring, code generation, and production review.
6
+
7
+ ## When to Use
8
+
9
+ - When authoring new React functional components or Next.js App Router pages.
10
+ - When implementing data fetching (client or server-side Server Actions, RSC).
11
+ - When reviewing pull requests for rendering bottlenecks or memory leaks.
12
+ - When optimizing bundle size, eliminating network waterfalls, or improving Core Web Vitals (LCP, INP, CLS).
13
+
14
+ ## Rules & Patterns
15
+
16
+ ### Rule Categories by Priority
17
+
18
+ | Priority | Category | Impact | Prefix |
19
+ |----------|----------|--------|--------|
20
+ | 1 | Eliminating Waterfalls | CRITICAL | `async-` |
21
+ | 2 | Bundle Size Optimization | CRITICAL | `bundle-` |
22
+ | 3 | Server-Side Performance | HIGH | `server-` |
23
+ | 4 | Client-Side Data Fetching | MEDIUM-HIGH | `client-` |
24
+ | 5 | Re-render Optimization | MEDIUM | `rerender-` |
25
+ | 6 | Rendering Performance | MEDIUM | `rendering-` |
26
+ | 7 | JavaScript Performance | LOW-MEDIUM | `js-` |
27
+ | 8 | Advanced Patterns | LOW | `advanced-` |
28
+
29
+ ### 1. Eliminating Waterfalls (CRITICAL)
30
+
31
+ - `async-cheap-condition-before-await` - Check cheap sync conditions before awaiting flags or remote values.
32
+ - `async-defer-await` - Move await into branches where actually used.
33
+ - `async-parallel` - Use `Promise.all()` for independent asynchronous operations.
34
+ - `async-dependencies` - Use better-all for partial dependencies.
35
+ - `async-api-routes` - Start promises early, await late in API routes.
36
+ - `async-suspense-boundaries` - Use Suspense to stream content progressively.
37
+
38
+ ### 2. Bundle Size Optimization (CRITICAL)
39
+
40
+ - `bundle-barrel-imports` - Import directly from specific modules, avoid broad barrel files (`index.ts`).
41
+ - `bundle-analyzable-paths` - Prefer statically analyzable import paths to avoid bloated traces.
42
+ - `bundle-dynamic-imports` - Use `next/dynamic` or `React.lazy()` for heavy interactive components.
43
+ - `bundle-defer-third-party` - Load analytics and logging scripts after hydration.
44
+ - `bundle-conditional` - Load modules only when feature flags or user actions require them.
45
+ - `bundle-preload` - Preload assets on hover or focus for perceived instant navigation.
46
+
47
+ ### 3. Server-Side Performance (HIGH)
48
+
49
+ - `server-auth-actions` - Always authenticate server actions like API routes.
50
+ - `server-cache-react` - Use `React.cache()` for per-request deduplication.
51
+ - `server-cache-lru` - Use LRU cache for cross-request caching.
52
+ - `server-dedup-props` - Avoid duplicate serialization in RSC props.
53
+ - `server-hoist-static-io` - Hoist static I/O to module level.
54
+ - `server-no-shared-module-state` - Avoid module-level mutable request state in RSC/SSR.
55
+ - `server-serialization` - Minimize data passed across the server-client boundary.
56
+ - `server-parallel-fetching` - Restructure components to parallelize fetches.
57
+ - `server-after-nonblocking` - Use `after()` for non-blocking operations like analytics logging.
58
+
59
+ ### 4. Client-Side Data Fetching (MEDIUM-HIGH)
60
+
61
+ - `client-swr-dedup` - Use SWR or TanStack Query for automatic request deduplication.
62
+ - `client-event-listeners` - Deduplicate global event listeners.
63
+ - `client-passive-event-listeners` - Use passive listeners for scroll and touch.
64
+ - `client-localstorage-schema` - Version and minimize data stored in localStorage.
65
+
66
+ ### 5. Re-render Optimization (MEDIUM)
67
+
68
+ - `rerender-defer-reads` - Don't subscribe to state only used in callbacks.
69
+ - `rerender-memo` - Extract expensive work into memoized components.
70
+ - `rerender-memo-with-default-value` - Hoist default non-primitive props.
71
+ - `rerender-dependencies` - Use primitive dependencies in effects and callbacks.
72
+ - `rerender-derived-state` - Subscribe to derived booleans, not raw high-frequency values.
73
+ - `rerender-derived-state-no-effect` - Derive state during render, never in `useEffect`.
74
+ - `rerender-functional-setstate` - Use functional `setState` for stable callback references.
75
+ - `rerender-lazy-state-init` - Pass initializer functions to `useState` for expensive computations.
76
+ - `rerender-transitions` - Use `startTransition` for non-urgent state updates.
77
+ - `rerender-use-deferred-value` - Defer expensive renders to keep input responsive.
78
+ - `rerender-no-inline-components` - Never define subcomponents inside component render bodies.
79
+
80
+ ### 6. Rendering Performance (MEDIUM)
81
+
82
+ - `rendering-content-visibility` - Use `content-visibility: auto` for long offscreen lists.
83
+ - `rendering-hoist-jsx` - Extract static JSX elements outside components.
84
+ - `rendering-conditional-render` - Use ternary (`condition ? <Comp /> : null`), not `&&` to avoid 0 rendering.
85
+ - `rendering-usetransition-loading` - Prefer `useTransition` for loading state indicators.
86
+
87
+ ### 7. JavaScript Performance (LOW-MEDIUM)
88
+
89
+ - `js-index-maps` - Build `Map` for repeated lookups instead of repeated array searches.
90
+ - `js-cache-property-access` - Cache object properties in tight loops.
91
+ - `js-early-exit` - Return early from functions to avoid nested complexity.
92
+ - `js-hoist-regexp` - Hoist RegExp creation outside loops and functions.
93
+ - `js-set-map-lookups` - Use `Set` / `Map` for O(1) lookups.
94
+
95
+ ### 8. Advanced Patterns (LOW)
96
+
97
+ - `advanced-effect-event-deps` - Don't put `useEffectEvent` results in effect deps.
98
+ - `advanced-event-handler-refs` - Store event handlers in refs for stable listener attachments.
99
+ - `advanced-init-once` - Initialize app singletons once per lifecycle.
100
+
101
+ ## Code Examples
102
+
103
+ ```tsx
104
+ // [GOOD] Parallel server fetching without waterfall
105
+ import { cache } from 'react';
106
+
107
+ export const getUser = cache(async (id: string) => {
108
+ return db.user.findUnique({ where: { id } });
109
+ });
110
+
111
+ export default async function UserPage({ params }: { params: { id: string } }) {
112
+ // Parallel dispatch
113
+ const userPromise = getUser(params.id);
114
+ const postsPromise = getPosts(params.id);
115
+
116
+ const [user, posts] = await Promise.all([userPromise, postsPromise]);
117
+
118
+ return (
119
+ <main>
120
+ <h1>{user.name}</h1>
121
+ <PostList posts={posts} />
122
+ </main>
123
+ );
124
+ }
125
+ ```
126
+
127
+ ## Validation Checklist
128
+
129
+ - [ ] All independent async fetches use `Promise.all()` instead of sequential `await`.
130
+ - [ ] Direct imports used instead of barrel file imports for large libraries.
131
+ - [ ] No `useEffect` used for deriving computed state from props or state.
132
+ - [ ] Heavy interactive modals/drawers loaded dynamically via `next/dynamic`.
133
+ - [ ] Server actions perform authentication checks before data mutations.
134
+ - [ ] Zero subcomponents defined inside the body of parent components.
135
+
136
+ ## Common Mistakes
137
+
138
+ - Writing sequential `await fetchA(); await fetchB();` creating avoidable network waterfalls.
139
+ - Importing from package root barrel files triggering full bundle inclusion.
140
+ - Setting state inside `useEffect` in response to prop changes.
141
+ - Serializing full database models with sensitive or unused fields to Client Components.
142
+
143
+ ## Integration Notes
144
+
145
+ - Pairs with `react` and `nextjs` skills for idiomatic App Router patterns.
146
+ - Complements `performance` for Lighthouse and Core Web Vitals verification.
@@ -0,0 +1,112 @@
1
+ # Redesign Skill & UI Audit
2
+
3
+ ## Overview
4
+
5
+ A systematic redesign and auditing protocol designed to elevate existing websites, dashboards, and web applications to world-class agency quality. It diagnoses and eradicates generic AI design fingerprints, sloppy typography, inconsistent palettes, and absent interaction states without breaking business logic or underlying component contracts.
6
+
7
+ ## When to Use
8
+
9
+ - When auditing an existing UI codebase for design quality, responsiveness, or accessibility.
10
+ - When modernizing a legacy application or uplifting generic templates.
11
+ - When tasked to "redesign", "clean up the layout", "audit UI", or "make it look expensive and modern".
12
+
13
+ ## Rules & Patterns
14
+
15
+ ### 1. Workflow: Scan → Diagnose → Fix
16
+
17
+ 1. **Scan:** Read the codebase. Identify the framework, styling method (Tailwind v3/v4, vanilla CSS, CSS Modules), and established design tokens.
18
+ 2. **Diagnose:** Run through the design audit categories. Catalog generic patterns, missing states, and optical alignment flaws.
19
+ 3. **Fix:** Apply surgical, targeted upgrades working within the existing stack. Do not rewrite from scratch.
20
+
21
+ ### 2. Design Audit Categories
22
+
23
+ #### Typography
24
+
25
+ - **Replace Browser Defaults:** Swap generic `Inter`, `Roboto`, or system fonts with expressive typefaces (`Geist`, `Outfit`, `Cabinet Grotesk`, `Satoshi`).
26
+ - **Presence & Scale:** Increase display text size, tighten letter-spacing (`-0.02em` to `-0.04em`), reduce line-height on headlines.
27
+ - **Reading Comfort:** Limit body text to 65 characters per line (`max-w-prose`), increase line-height to 1.6.
28
+ - **Figures:** Enable tabular figures (`font-variant-numeric: tabular-nums`) for numbers in tables and data readouts.
29
+ - **Orphan Prevention:** Apply `text-wrap: balance` on headlines and `text-wrap: pretty` on paragraphs.
30
+
31
+ #### Color and Surfaces
32
+
33
+ - **No Pure Black Backgrounds:** Replace `#000000` with tinted dark charcoal (`#0A0A0A`, `#121212`).
34
+ - **Desaturate Accents:** Keep accent saturation below 80% so it blends harmoniously with neutrals.
35
+ - **Single Accent Color:** Commit to one dominant accent hue; remove conflicting secondary tints.
36
+ - **Tinted Shadows:** Tint shadows to match the background hue rather than harsh black opacity.
37
+ - **Background Depth:** Prevent sterile flat sections by layering subtle noise overlays, ambient gradients, or masked imagery.
38
+
39
+ #### Layout and Space
40
+
41
+ - **Asymmetry & Bento Grids:** Break repetitive 3-column Bootstrap grids with asymmetrical spans or offset cards.
42
+ - **Mobile Viewport Bug Fix:** Never use `height: 100vh`; always use `min-height: 100dvh`.
43
+ - **Vertical Alignment:** Pin action buttons to the bottom of card groups (`mt-auto` or grid alignment) to maintain horizontal baseline harmony across differing text heights.
44
+ - **Optical Centering:** Adjust icons, badges, and play buttons optically by 1-2px rather than relying solely on pure mathematical centering.
45
+
46
+ #### Interactivity and States
47
+
48
+ - **Interactive Feedback:** Add 200-300ms transitions, distinct hover shifts, and physical active presses (`scale(0.98)`).
49
+ - **Visible Focus Rings:** Mandatory `:focus-visible` styling for keyboard navigation.
50
+ - **States Completeness:** Always provide designed skeleton loaders, empty states, and inline error messages.
51
+
52
+ #### Content & Code Quality
53
+
54
+ - **Eradicate AI Clichés:** Remove buzzwords ("Elevate", "Seamless", "Unleash", "Next-Gen") and placeholder latin text.
55
+ - **Semantic HTML:** Replace nested div containers with `<nav>`, `<main>`, `<article>`, `<section>`, `<aside>`.
56
+ - **Relative Units:** Use `rem`, `%`, and CSS Grid rather than hardcoded pixel widths.
57
+
58
+ ### 3. Fix Priority
59
+
60
+ 1. **Font Swap:** Biggest instant aesthetic elevation with lowest regression risk.
61
+ 2. **Palette Cleanup:** Eliminate clashing or oversaturated colors.
62
+ 3. **States & Feedback:** Add hover, active, focus, loading, and empty states.
63
+ 4. **Layout & Alignment:** Fix container widths, baseline alignment, and mobile viewport heights.
64
+ 5. **Component Polish:** Replace generic cards and accordion boxes with modern minimal equivalents.
65
+
66
+ ## Code Examples
67
+
68
+ ```tsx
69
+ // [BEFORE] Generic, misaligned card with generic shadow
70
+ <div className="bg-white border rounded shadow p-4">
71
+ <h2>{title}</h2>
72
+ <p>{desc}</p>
73
+ <button className="bg-blue-500 text-white p-2">Click</button>
74
+ </div>
75
+
76
+ // [AFTER] Polished card with optical baseline alignment, tinted surface, and micro-interaction
77
+ <div className="flex flex-col bg-[#FFFFFF] dark:bg-[#121212] border border-black/5 dark:border-white/10 rounded-2xl p-6 hover:shadow-[0_4px_20px_rgba(0,0,0,0.04)] transition-all duration-200">
78
+ <h3 className="font-semibold text-lg tracking-tight text-neutral-900 dark:text-neutral-100 text-balance mb-2">
79
+ {title}
80
+ </h3>
81
+ <p className="text-sm text-neutral-600 dark:text-neutral-400 leading-relaxed text-pretty mb-6">
82
+ {desc}
83
+ </p>
84
+ <button
85
+ type="button"
86
+ className="mt-auto inline-flex items-center justify-center font-medium text-sm px-4 py-2.5 rounded-xl bg-neutral-900 dark:bg-neutral-100 text-white dark:text-black hover:bg-neutral-800 active:scale-[0.98] transition-transform duration-150 focus-visible:ring-2 focus-visible:ring-neutral-400"
87
+ >
88
+ Continue
89
+ </button>
90
+ </div>
91
+ ```
92
+
93
+ ## Validation Checklist
94
+
95
+ - [ ] All headings have `text-wrap: balance` and appropriate negative letter tracking.
96
+ - [ ] No pure black `#000000` backgrounds or oversaturated accent colors (>80% saturation).
97
+ - [ ] All interactive elements include `:hover`, `:active`, and `:focus-visible` styles.
98
+ - [ ] Cards in side-by-side grids align primary CTA buttons along the same bottom baseline.
99
+ - [ ] Viewport containers use `100dvh` instead of `100vh`.
100
+ - [ ] All lists, tables, and feeds have a designed empty state.
101
+
102
+ ## Common Mistakes
103
+
104
+ - Rewriting components from scratch and breaking existing prop contracts or unit tests.
105
+ - Forcing full-width sections without `max-w` constraints on ultra-wide screens.
106
+ - Leaving action buttons at random heights inside differing text content cards.
107
+ - Introducing external UI libraries without checking existing `package.json` dependencies.
108
+
109
+ ## Integration Notes
110
+
111
+ - Complements `impeccable-design` for hard 50-rule QA verification.
112
+ - Works alongside `ui-ux-pro` for token generation and color theory.
@@ -0,0 +1,237 @@
1
+ # security
2
+
3
+ ## Overview
4
+
5
+ Enforces zero-trust defense-in-depth, OWASP API Top 10 mitigation, cryptographic hardening, sensitive data leakage protection, and AI/LLM safety across all services, endpoints, and agent integrations.
6
+
7
+ ## When to Use
8
+
9
+ Activate whenever writing authentication, authorization, session management, database queries, cryptography, external API integrations, user input handling, or agent tool calling.
10
+
11
+ ## Rules & Patterns
12
+
13
+ ### Negative Constraints (What NOT to Do)
14
+
15
+ 1. **NEVER use standard string comparison (`===`) for secrets/hashes**: Always use `crypto.timingSafeEqual` to prevent timing attacks.
16
+ 2. **NEVER store sensitive JWT access/refresh tokens in `localStorage`**: Store tokens in `httpOnly`, `Secure`, `SameSite=Strict` cookies.
17
+ 3. **NEVER return raw database/internal error messages or stack traces to the client**: Return standardized generic error codes (`INTERNAL_SERVER_ERROR`) and log details internally.
18
+ 4. **NEVER trust client-provided IDs for authorization without tenant/ownership checks**: Always verify `where: { id, userId: session.userId }` to prevent Broken Object Level Authorization (BOLA/IDOR).
19
+ 5. **NEVER disable CSRF protection, CORS allow-all (`*`), or TLS verification (`NODE_TLS_REJECT_UNAUTHORIZED=0`) in production**: Always enforce strict origin whitelists and HTTPS.
20
+ 6. **NEVER pass un-sanitized third-party content directly into system prompts or shell execution**: Treat all external data as potentially adversarial.
21
+
22
+ ---
23
+
24
+ ### OWASP Top 10 for Modern APIs & Full-Stack
25
+
26
+ #### 1. Injection (SQL, NoSQL, Command)
27
+
28
+ - Always use parameterized queries — never concatenate user input into SQL or shell commands.
29
+ - Use ORMs (Prisma, Drizzle, SQLAlchemy) with strict schema validation.
30
+ - Validate and sanitize all user input before processing.
31
+
32
+ #### 2. Broken Object Level Authorization (BOLA / IDOR)
33
+
34
+ - Validate user ownership on EVERY database read, update, or delete:
35
+
36
+ ```typescript
37
+ // [GOOD] Scoped to authenticated user
38
+ const doc = await db.document.findFirst({
39
+ where: { id: documentId, tenantId: session.tenantId }
40
+ });
41
+ ```
42
+
43
+ #### 3. Broken Authentication & Session Management
44
+
45
+ - Use Argon2id or bcrypt (cost factor ≥ 12) for password hashing.
46
+ - Short-lived access tokens (15 min) + secure HTTP-only refresh tokens.
47
+ - Enforce rate limiting and brute-force lockouts on auth endpoints.
48
+
49
+ #### 4. SSRF (Server-Side Request Forgery)
50
+
51
+ - Restrict server-side URL fetching: validate URL scheme (`https:` only), resolve IP, and block private CIDR blocks (`10.0.0.0/8`, `127.0.0.0/8`, `169.254.0.0/16`, `192.168.0.0/16`).
52
+
53
+ #### 5. Security Misconfiguration & Headers
54
+
55
+ Enforce modern production security headers:
56
+
57
+ ```http
58
+ Content-Security-Policy: default-src 'self'
59
+ X-Content-Type-Options: nosniff
60
+ X-Frame-Options: DENY
61
+ Strict-Transport-Security: max-age=31536000; includeSubDomains
62
+ Referrer-Policy: strict-origin-when-cross-origin
63
+ Permissions-Policy: camera=(), microphone=(), geolocation=()
64
+ ```
65
+
66
+ ---
67
+
68
+ ### AI Agent & LLM Security Invariants
69
+
70
+ When building AI workflows, tools, or MCP servers:
71
+
72
+ 1. **Prompt Injection Defense**:
73
+ - Clearly delineate untrusted user/web content using boundary markers (e.g. `<untrusted_content>` tags).
74
+ - Never allow untrusted content to override system instructions or tool execution permissions.
75
+ 2. **Tool Execution Boundaries**:
76
+ - Destructive operations (database drops, file deletions, payment triggers) MUST require explicit user confirmation.
77
+ - Restrict file system tools to the workspace root — block directory traversal (`../`).
78
+ 3. **Secret Masking & Output Sanitization**:
79
+ - Scrub API keys (`sk-...`, `Bearer ...`), tokens, and credentials before writing to agent logs or step summaries.
80
+
81
+ ---
82
+
83
+ ## Code Examples
84
+
85
+ ### Timing-Safe Secret Verification
86
+
87
+ ```javascript
88
+ import crypto from 'node:crypto';
89
+
90
+ export function verifyWebhookSignature(payload, signature, secret) {
91
+ const hmac = crypto.createHmac('sha256', secret);
92
+ const digest = Buffer.from(hmac.update(payload).digest('hex'), 'utf8');
93
+ const sigBuffer = Buffer.from(signature, 'utf8');
94
+
95
+ if (digest.length !== sigBuffer.length) return false;
96
+ return crypto.timingSafeEqual(digest, sigBuffer);
97
+ }
98
+ ```
99
+
100
+ ### Safe SSRF Prevention Wrapper
101
+
102
+ ```typescript
103
+ import dns from 'node:dns/promises';
104
+
105
+ export async function validateSafeUrl(urlString: string): Promise<URL> {
106
+ const parsed = new URL(urlString);
107
+ if (parsed.protocol !== 'https:') {
108
+ throw new Error('Only HTTPS protocol is permitted');
109
+ }
110
+
111
+ const { address } = await dns.lookup(parsed.hostname);
112
+ if (
113
+ address.startsWith('127.') ||
114
+ address.startsWith('10.') ||
115
+ address.startsWith('192.168.') ||
116
+ address === '169.254.169.254'
117
+ ) {
118
+ throw new Error('Access to private/metadata IP addresses is blocked');
119
+ }
120
+
121
+ return parsed;
122
+ }
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Validation Checklist
128
+
129
+ - [ ] All database queries parameterized or managed by type-safe ORM.
130
+ - [ ] BOLA/IDOR prevented: all entity queries scoped by tenant/user id.
131
+ - [ ] Cookies set with `HttpOnly`, `Secure`, and `SameSite=Strict` or `Lax`.
132
+ - [ ] Passwords hashed with Argon2id / bcrypt.
133
+ - [ ] Security headers active in middleware/reverse proxy.
134
+ - [ ] No secrets or tokens checked into source control or exposed in logs.
135
+
136
+ ---
137
+
138
+ ## Common Mistakes
139
+
140
+ - **Trusting client-side claims**: Checking role or permissions only on the frontend without server-side validation.
141
+ - **Timing attacks on tokens**: Comparing tokens with `token === expectedToken` instead of `timingSafeEqual`.
142
+ - **Exposing internal stack traces**: Returning full error objects to client in production.
143
+ - **Unvalidated redirects / URLs**: Allowing arbitrary URLs in redirect or fetch parameters.
144
+
145
+ ---
146
+
147
+ ## Integration Notes
148
+
149
+ - Runs in the REVIEW phase for every backend route, auth flow, and database mutation.
150
+ - Integrates with `engineering-workflow` during Phase 5 (5-axis quality gate).
151
+ - Pairs with `system-design` to mandate secure network boundaries and authorization layers.
152
+
153
+
154
+ # Application Security Examples — Anti-patterns vs ContextOS Standard
155
+
156
+ ## Example 1: Timing-Safe Secret Verification
157
+
158
+ ### Anti-pattern: Anti-pattern (Vulnerable to side-channel timing attack)
159
+
160
+ ```typescript
161
+ // BAD: string comparison returns early on the first mismatched byte
162
+ export function verifyApiKey(providedKey: string, storedKey: string): boolean {
163
+ return providedKey === storedKey; // Vulnerable to timing analysis!
164
+ }
165
+ ```
166
+
167
+ ### Best practice: ContextOS Standard (Constant-time buffer comparison)
168
+
169
+ ```typescript
170
+ // GOOD: crypto.timingSafeEqual executes in constant time
171
+ import crypto from 'crypto';
172
+
173
+ export function verifyApiKey(providedKey: string, storedKey: string): boolean {
174
+ const providedBuffer = Buffer.from(providedKey, 'utf8');
175
+ const storedBuffer = Buffer.from(storedKey, 'utf8');
176
+
177
+ if (providedBuffer.length !== storedBuffer.length) {
178
+ return false;
179
+ }
180
+
181
+ return crypto.timingSafeEqual(providedBuffer, storedBuffer);
182
+ }
183
+ ```
184
+
185
+ ---
186
+
187
+ ## Example 2: Preventing IDOR (Insecure Direct Object Reference)
188
+
189
+ ### Anti-pattern: Anti-pattern (Trusting client ID without ownership check)
190
+
191
+ ```typescript
192
+ // BAD: any authenticated user can delete any other user's document!
193
+ app.delete('/api/documents/:id', requireAuth, async (req, res) => {
194
+ await prisma.document.delete({ where: { id: req.params.id } });
195
+ res.status(204).end();
196
+ });
197
+ ```
198
+
199
+ ### Best practice: ContextOS Standard (Multi-tenant scoped authorization check)
200
+
201
+ ```typescript
202
+ // GOOD: document deletion is strictly scoped to authenticated user or org
203
+ app.delete('/api/documents/:id', requireAuth, async (req, res) => {
204
+ const deleted = await prisma.document.deleteMany({
205
+ where: {
206
+ id: req.params.id,
207
+ organizationId: req.user.organizationId, // Tenant isolation
208
+ },
209
+ });
210
+
211
+ if (deleted.count === 0) {
212
+ return res.status(404).json({ error: 'Document not found or access denied' });
213
+ }
214
+
215
+ return res.status(204).end();
216
+ });
217
+ ```
218
+
219
+ # security Troubleshooting & Common Mistakes
220
+
221
+ ## 1. Insecure Direct Object References (IDOR)
222
+
223
+ - **Symptom**: User A can access User B's invoices by simply modifying the ID in the URL.
224
+ - **Root Cause**: Querying by record ID without scoping to the authenticated `user.id` or tenant ID.
225
+ - **Fix**: Always query with ownership predicate: `db.invoice.findFirst({ where: { id, userId: auth.user.id } })`.
226
+
227
+ ## 2. SQL Injection via Raw String Concatenation
228
+
229
+ - **Symptom**: Database compromised through input fields.
230
+ - **Root Cause**: String templating in raw queries (`db.query("SELECT * FROM users WHERE id = " + id)`).
231
+ - **Fix**: Always use parameterized queries (`$1, $2`) or ORM/query-builder methods.
232
+
233
+ ## 3. Storing Sensitive Secrets in Git or Client Bundles
234
+
235
+ - **Symptom**: API keys or JWT signing secrets exposed publicly.
236
+ - **Root Cause**: Hardcoding secrets in source files or prefixing server secrets with NEXT_PUBLIC_.
237
+ - **Fix**: Store all secrets in server-only environment variables; add git-secrets to pre-commit hooks.
@@ -0,0 +1,103 @@
1
+ # Agent Skill: Principal UI/UX Architect & Motion Choreographer (Awwwards-Tier)
2
+
3
+ ## Overview
4
+
5
+ Engineers high-end, agency-level digital experiences characterized by tactile haptic depth, cinematic spatial rhythm, obsessive micro-interactions, and fluid spring physics. Rejects generic commodity SaaS templates in favor of bespoke layout archetypes, nested double-bezel enclosures, and purposeful motion dynamics.
6
+
7
+ ## When to Use
8
+
9
+ - When tasked with creating luxury, premium, Awwwards-tier landing pages, portfolio showpieces, or editorial SaaS interfaces.
10
+ - When explicitly prompted for "soft UI", "expensive design", "Apple-level polish", or "calm aesthetics".
11
+ - When standard component libraries feel too clinical or generic.
12
+
13
+ ## Rules & Patterns
14
+
15
+ ### 1. Absolute Zero Directive (Strict Anti-Patterns)
16
+
17
+ - **Banned Fonts:** Inter, Roboto, Arial, Open Sans, Helvetica. (Use `Geist`, `Clash Display`, `PP Editorial New`, or `Plus Jakarta Sans`).
18
+ - **Banned Icons:** Thick-stroked Lucide, FontAwesome, or Material Icons. Use ultra-light, precise line icons (Phosphor Light, Remix Line).
19
+ - **Banned Borders & Shadows:** Generic 1px solid gray borders. Harsh dark drop shadows (`rgba(0,0,0,0.3)`).
20
+ - **Banned Layouts:** Edge-to-edge sticky navbars glued to the top. Symmetrical 3-column Bootstrap-style grids without massive whitespace.
21
+ - **Banned Motion:** Standard `linear` or `ease-in-out` transitions. Instant state changes without interpolation.
22
+
23
+ ### 2. The Creative Variance Engine
24
+
25
+ Before writing code, consciously pick ONE combination:
26
+
27
+ #### Vibe & Texture Archetypes
28
+
29
+ 1. **Ethereal Glass (SaaS / AI / Tech):** Deep OLED black (`#050505`), subtle radial mesh gradients, vantablack cards with `backdrop-blur-2xl` and white/10 hairlines.
30
+ 2. **Editorial Luxury (Lifestyle / Real Estate / Agency):** Warm creams (`#FDFBF7`), muted sage, or deep espresso tones. Variable serif headings with subtle CSS noise overlay (`opacity-[0.03]`).
31
+ 3. **Soft Structuralism (Consumer / Health / Portfolio):** Silver-grey or pure white backgrounds, bold grotesk typography, airy floating components with ultra-diffuse ambient shadows.
32
+
33
+ #### Layout Archetypes
34
+
35
+ 1. **The Asymmetrical Bento:** Masonry CSS Grid of varying card spans. (Collapses to single-column `grid-cols-1 gap-6` on mobile).
36
+ 2. **The Z-Axis Cascade:** Stacked cards with varying depth of field and subtle `-2deg` or `3deg` rotations. (Rotations removed on mobile).
37
+ 3. **The Editorial Split:** Massive typography on the left half (`w-1/2`), with horizontal interactive card ribbons on the right.
38
+
39
+ ### 3. Haptic Micro-Aesthetics
40
+
41
+ - **The Double-Bezel (Doppelrand):**
42
+ - **Outer Shell:** Wrapper `div` with subtle background (`bg-black/5` or `bg-white/5`), hairline border (`border border-white/10`), padding (`p-2`), and large outer radius (`rounded-[2rem]`).
43
+ - **Inner Core:** Nested card inside shell with distinct background, inner highlight (`shadow-[inset_0_1px_1px_rgba(255,255,255,0.15)]`), and mathematically concentric smaller radius (`rounded-[calc(2rem-0.5rem)]`).
44
+ - **Button-in-Button Trailing Icon:** Pill-shaped primary buttons (`rounded-full px-6 py-3`) with trailing arrows nested inside their own dedicated circular badge (`w-8 h-8 rounded-full bg-black/5 flex items-center justify-center`).
45
+ - **Macro-Whitespace:** Minimum `py-24` to `py-40` for section padding.
46
+
47
+ ### 4. Motion Choreography & Performance Guardrails
48
+
49
+ - **Custom Physics:** All transitions use custom cubic-beziers: `transition-all duration-700 ease-[cubic-bezier(0.32,0.72,0,1)]`.
50
+ - **GPU-Safe Animation:** Animate exclusively via `transform` and `opacity`. Never animate `top`, `left`, `width`, or `height`.
51
+ - **Blur Discipline:** Restrict `backdrop-blur` to fixed or sticky elements (navbars, modals). Never apply to scrolling containers.
52
+
53
+ ## Code Examples
54
+
55
+ ```tsx
56
+ export function DoubleBezelCard({ title, subtitle, tag }: { title: string; subtitle: string; tag: string }) {
57
+ return (
58
+ // Outer Shell
59
+ <div className="p-2 rounded-[2rem] bg-black/5 dark:bg-white/5 border border-black/10 dark:border-white/10 transition-all duration-700 ease-[cubic-bezier(0.32,0.72,0,1)] hover:shadow-2xl">
60
+ // Inner Core
61
+ <div className="p-8 rounded-[calc(2rem-0.5rem)] bg-[#FFFFFF] dark:bg-[#0E0E0E] shadow-[inset_0_1px_1px_rgba(255,255,255,0.15)] flex flex-col justify-between min-h-[320px]">
62
+ <div>
63
+ <span className="inline-block px-3 py-1 rounded-full text-[10px] uppercase tracking-[0.2em] font-medium bg-black/5 dark:bg-white/10 text-neutral-600 dark:text-neutral-400 mb-4">
64
+ {tag}
65
+ </span>
66
+ <h3 className="text-2xl font-bold tracking-tight text-neutral-900 dark:text-white mb-2">{title}</h3>
67
+ <p className="text-sm text-neutral-500 dark:text-neutral-400 leading-relaxed">{subtitle}</p>
68
+ </div>
69
+ <button
70
+ type="button"
71
+ className="group mt-6 inline-flex items-center justify-between pl-6 pr-2 py-2 rounded-full bg-neutral-900 dark:bg-white text-white dark:text-neutral-950 font-medium text-sm active:scale-[0.98] transition-all duration-300"
72
+ >
73
+ <span>Explore Experience</span>
74
+ <span className="w-8 h-8 rounded-full bg-white/10 dark:bg-black/10 flex items-center justify-center transition-transform duration-300 group-hover:translate-x-0.5 group-hover:-translate-y-0.5">
75
+
76
+ </span>
77
+ </button>
78
+ </div>
79
+ </div>
80
+ );
81
+ }
82
+ ```
83
+
84
+ ## Validation Checklist
85
+
86
+ - [ ] All major cards and interactive modules use the Double-Bezel concentric architecture.
87
+ - [ ] Primary buttons feature the nested button-in-button trailing icon pattern.
88
+ - [ ] Section vertical padding is at minimum `py-24`.
89
+ - [ ] Transitions use spring or custom cubic-bezier curves (no default linear transitions).
90
+ - [ ] Layout collapses gracefully to single-column on mobile viewports (<768px).
91
+ - [ ] Animations use only `transform` and `opacity`.
92
+
93
+ ## Common Mistakes
94
+
95
+ - Using standard `shadow-md` or harsh dark drop shadows instead of soft ambient shadows.
96
+ - Failing to recalculate concentric inner border-radii (`calc(outer - padding)`).
97
+ - Applying `backdrop-blur` on large scrolling sections, triggering GPU repaints.
98
+ - Sticking to generic 3-column Bootstrap grids.
99
+
100
+ ## Integration Notes
101
+
102
+ - Complements `impeccable-design` for QA and anti-pattern enforcement.
103
+ - Pairs with `ui-ux-pro` for color palette harmony and accessibility compliance.