claude-code-superkit 0.0.0-stage → 1.5.3

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 (353) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +374 -2
  3. package/bin/cli.js +153 -0
  4. package/bin/inject-tokens.js +224 -0
  5. package/bin/measure-tokens.js +17 -0
  6. package/bin/superkit-counts-verify.sh +30 -0
  7. package/lib/codex.js +246 -0
  8. package/lib/docs-scaffold.js +147 -0
  9. package/lib/installer.js +499 -0
  10. package/lib/prompts.js +51 -0
  11. package/lib/settings-builder.js +51 -0
  12. package/lib/superpowers.js +99 -0
  13. package/lib/utils.js +117 -0
  14. package/lib/validator.js +84 -0
  15. package/package.json +49 -4
  16. package/packages/codex/AGENTS.md +396 -0
  17. package/packages/codex/INSTALL.md +342 -0
  18. package/packages/codex/config.toml +22 -0
  19. package/packages/codex/hooks/superkit.mjs +203 -0
  20. package/packages/codex/hooks.json +30 -0
  21. package/packages/codex/legacy-baseline.json +88 -0
  22. package/packages/codex/native-skills.txt +65 -0
  23. package/packages/codex/rules/default.rules +565 -0
  24. package/packages/codex/skills/ai-slop-cleaner/SKILL.md +44 -0
  25. package/packages/codex/skills/api-contract-sync/SKILL.md +96 -0
  26. package/packages/codex/skills/architect/SKILL.md +49 -0
  27. package/packages/codex/skills/audit-backend/SKILL.md +80 -0
  28. package/packages/codex/skills/audit-frontend/SKILL.md +82 -0
  29. package/packages/codex/skills/audit-infra/SKILL.md +87 -0
  30. package/packages/codex/skills/audit-orchestrator/SKILL.md +114 -0
  31. package/packages/codex/skills/behavioral-nudge-engine/SKILL.md +110 -0
  32. package/packages/codex/skills/benchmark/SKILL.md +49 -0
  33. package/packages/codex/skills/bot-reviewer/SKILL.md +94 -0
  34. package/packages/codex/skills/code-reviewer/SKILL.md +67 -0
  35. package/packages/codex/skills/codebase-onboarding-engineer/SKILL.md +46 -0
  36. package/packages/codex/skills/comment-rot-analyzer/SKILL.md +75 -0
  37. package/packages/codex/skills/commit-helper/SKILL.md +101 -0
  38. package/packages/codex/skills/critic/SKILL.md +56 -0
  39. package/packages/codex/skills/database-reviewer/SKILL.md +79 -0
  40. package/packages/codex/skills/debug-observer/SKILL.md +107 -0
  41. package/packages/codex/skills/dependency-checker/SKILL.md +69 -0
  42. package/packages/codex/skills/design-system-reviewer/SKILL.md +121 -0
  43. package/packages/codex/skills/dev-orchestrator/SKILL.md +304 -0
  44. package/packages/codex/skills/docs-reviewer/SKILL.md +86 -0
  45. package/packages/codex/skills/drizzle-orm-expert/SKILL.md +246 -0
  46. package/packages/codex/skills/e2e-test-generator/SKILL.md +95 -0
  47. package/packages/codex/skills/evaluator/SKILL.md +63 -0
  48. package/packages/codex/skills/frontend-perf-reviewer/SKILL.md +95 -0
  49. package/packages/codex/skills/frontend-ui-color-reviewer/SKILL.md +68 -0
  50. package/packages/codex/skills/frontend-ui-design-critic/SKILL.md +99 -0
  51. package/packages/codex/skills/frontend-ui-interaction-reviewer/SKILL.md +102 -0
  52. package/packages/codex/skills/frontend-ui-motion-reviewer/SKILL.md +85 -0
  53. package/packages/codex/skills/frontend-ui-reviewer/SKILL.md +81 -0
  54. package/packages/codex/skills/frontend-ui-typography-reviewer/SKILL.md +62 -0
  55. package/packages/codex/skills/gltf-debugging/SKILL.md +128 -0
  56. package/packages/codex/skills/go-benchmark/SKILL.md +217 -0
  57. package/packages/codex/skills/go-concurrency-reviewer/SKILL.md +113 -0
  58. package/packages/codex/skills/go-error-reviewer/SKILL.md +107 -0
  59. package/packages/codex/skills/go-grpc-patterns/SKILL.md +285 -0
  60. package/packages/codex/skills/go-modernizer/SKILL.md +111 -0
  61. package/packages/codex/skills/go-observability-reviewer/SKILL.md +121 -0
  62. package/packages/codex/skills/go-performance-reviewer/SKILL.md +112 -0
  63. package/packages/codex/skills/go-reviewer/SKILL.md +109 -0
  64. package/packages/codex/skills/go-samber-do/SKILL.md +158 -0
  65. package/packages/codex/skills/go-samber-lo/SKILL.md +178 -0
  66. package/packages/codex/skills/go-samber-oops/SKILL.md +174 -0
  67. package/packages/codex/skills/goal-verifier/SKILL.md +53 -0
  68. package/packages/codex/skills/health-checker/SKILL.md +109 -0
  69. package/packages/codex/skills/html-to-3d-texture/SKILL.md +153 -0
  70. package/packages/codex/skills/impeccable-craft/SKILL.md +101 -0
  71. package/packages/codex/skills/lint-runner/SKILL.md +85 -0
  72. package/packages/codex/skills/migrate/SKILL.md +60 -0
  73. package/packages/codex/skills/migration-reviewer/SKILL.md +88 -0
  74. package/packages/codex/skills/minimal-change-engineer/SKILL.md +44 -0
  75. package/packages/codex/skills/new-migration/SKILL.md +59 -0
  76. package/packages/codex/skills/nextjs-supabase-auth/SKILL.md +227 -0
  77. package/packages/codex/skills/output-enforcement/SKILL.md +71 -0
  78. package/packages/codex/skills/plan-checker/SKILL.md +53 -0
  79. package/packages/codex/skills/postgresql-optimization/SKILL.md +159 -0
  80. package/packages/codex/skills/pre-deploy-validator/SKILL.md +111 -0
  81. package/packages/codex/skills/presentation-reviewer/SKILL.md +88 -0
  82. package/packages/codex/skills/product-3d-lighting/SKILL.md +137 -0
  83. package/packages/codex/skills/project-architecture/SKILL.md +52 -0
  84. package/packages/codex/skills/py-reviewer/SKILL.md +100 -0
  85. package/packages/codex/skills/r3f-scene-reviewer/SKILL.md +88 -0
  86. package/packages/codex/skills/r3f-scroll-driven-3d/SKILL.md +162 -0
  87. package/packages/codex/skills/reality-checker/SKILL.md +61 -0
  88. package/packages/codex/skills/redis-patterns/SKILL.md +260 -0
  89. package/packages/codex/skills/review-orchestrator/SKILL.md +151 -0
  90. package/packages/codex/skills/rs-reviewer/SKILL.md +98 -0
  91. package/packages/codex/skills/ru-text/SKILL.md +132 -0
  92. package/packages/codex/skills/scaffold-endpoint/SKILL.md +44 -0
  93. package/packages/codex/skills/security-scanner/SKILL.md +94 -0
  94. package/packages/codex/skills/silent-failure-hunter/SKILL.md +176 -0
  95. package/packages/codex/skills/telegram-bot-builder/SKILL.md +120 -0
  96. package/packages/codex/skills/test-generator/SKILL.md +79 -0
  97. package/packages/codex/skills/test-runner/SKILL.md +101 -0
  98. package/packages/codex/skills/threejs-color-management/SKILL.md +97 -0
  99. package/packages/codex/skills/tree-generator/SKILL.md +63 -0
  100. package/packages/codex/skills/ts-reviewer/SKILL.md +90 -0
  101. package/packages/codex/skills/ui-design-reviewer/SKILL.md +89 -0
  102. package/packages/codex/skills/ui-reviewer/SKILL.md +103 -0
  103. package/packages/codex/skills/visual-reviewer/SKILL.md +85 -0
  104. package/packages/codex/skills/writing-agents/SKILL.md +165 -0
  105. package/packages/codex/skills/writing-commands/SKILL.md +173 -0
  106. package/packages/core/CLAUDE.md +118 -0
  107. package/packages/core/INTERNAL-FILES +16 -0
  108. package/packages/core/agents/ai-slop-cleaner.md +187 -0
  109. package/packages/core/agents/api-contract-sync.md +127 -0
  110. package/packages/core/agents/architect.md +205 -0
  111. package/packages/core/agents/audit-backend.md +137 -0
  112. package/packages/core/agents/audit-frontend.md +129 -0
  113. package/packages/core/agents/audit-infra.md +182 -0
  114. package/packages/core/agents/behavioral-nudge-engine.md +170 -0
  115. package/packages/core/agents/code-reviewer.md +195 -0
  116. package/packages/core/agents/codebase-onboarding-engineer.md +172 -0
  117. package/packages/core/agents/comment-rot-analyzer.md +115 -0
  118. package/packages/core/agents/critic.md +172 -0
  119. package/packages/core/agents/database-reviewer.md +201 -0
  120. package/packages/core/agents/debug-observer.md +261 -0
  121. package/packages/core/agents/dependency-checker.md +199 -0
  122. package/packages/core/agents/docs-reviewer.md +206 -0
  123. package/packages/core/agents/e2e-test-generator.md +261 -0
  124. package/packages/core/agents/evaluator.md +141 -0
  125. package/packages/core/agents/goal-verifier.md +130 -0
  126. package/packages/core/agents/health-checker.md +194 -0
  127. package/packages/core/agents/migration-reviewer.md +161 -0
  128. package/packages/core/agents/minimal-change-engineer.md +219 -0
  129. package/packages/core/agents/plan-checker.md +139 -0
  130. package/packages/core/agents/pre-deploy-validator.md +189 -0
  131. package/packages/core/agents/reality-checker.md +175 -0
  132. package/packages/core/agents/scaffold-endpoint.md +162 -0
  133. package/packages/core/agents/security-scanner.md +236 -0
  134. package/packages/core/agents/silent-failure-hunter.md +276 -0
  135. package/packages/core/agents/test-generator.md +146 -0
  136. package/packages/core/agents/tree-generator.md +141 -0
  137. package/packages/core/agents/ui-reviewer.md +172 -0
  138. package/packages/core/agents/visual-reviewer.md +211 -0
  139. package/packages/core/commands/audit.md +166 -0
  140. package/packages/core/commands/benchmark.md +130 -0
  141. package/packages/core/commands/commit.md +148 -0
  142. package/packages/core/commands/dev.md +302 -0
  143. package/packages/core/commands/docs-init.md +75 -0
  144. package/packages/core/commands/lint.md +137 -0
  145. package/packages/core/commands/migrate.md +146 -0
  146. package/packages/core/commands/new-migration.md +182 -0
  147. package/packages/core/commands/pair.md +209 -0
  148. package/packages/core/commands/review.md +195 -0
  149. package/packages/core/commands/security-scan.md +142 -0
  150. package/packages/core/commands/superkit-evolve.md +231 -0
  151. package/packages/core/commands/superkit-init.md +274 -0
  152. package/packages/core/commands/test.md +108 -0
  153. package/packages/core/commands/workflow.md +150 -0
  154. package/packages/core/docs/guide/01-getting-started.md +41 -0
  155. package/packages/core/docs-templates/README.md +33 -0
  156. package/packages/core/docs-templates/adr-template.md +62 -0
  157. package/packages/core/docs-templates/architecture/api-contracts.md +26 -0
  158. package/packages/core/docs-templates/architecture/api-reference.md +48 -0
  159. package/packages/core/docs-templates/architecture/auth-and-sessions.md +38 -0
  160. package/packages/core/docs-templates/architecture/backend-layers.md +42 -0
  161. package/packages/core/docs-templates/architecture/data-flow.md +26 -0
  162. package/packages/core/docs-templates/architecture/database-schema.md +51 -0
  163. package/packages/core/docs-templates/architecture/deployment.md +41 -0
  164. package/packages/core/docs-templates/architecture/frontend-state.md +46 -0
  165. package/packages/core/helpers/statusline.cjs +370 -0
  166. package/packages/core/hooks/CHAIN-SEMANTICS.md +84 -0
  167. package/packages/core/hooks/audit-settings-source.sh +98 -0
  168. package/packages/core/hooks/audit-trail.sh +120 -0
  169. package/packages/core/hooks/block-dangerous-git.sh +189 -0
  170. package/packages/core/hooks/bundle-import-check.sh +64 -0
  171. package/packages/core/hooks/compact-state-inject.sh +84 -0
  172. package/packages/core/hooks/config-protection.sh +68 -0
  173. package/packages/core/hooks/console-log-warning.sh +28 -0
  174. package/packages/core/hooks/context-monitor.sh +35 -0
  175. package/packages/core/hooks/dev-edit-counter.sh +59 -0
  176. package/packages/core/hooks/dev-marker-set.sh +55 -0
  177. package/packages/core/hooks/dev-required-on-commit.sh +426 -0
  178. package/packages/core/hooks/doc-check-on-commit.sh +396 -0
  179. package/packages/core/hooks/edit-streak-check.sh +63 -0
  180. package/packages/core/hooks/evolve-check.sh +78 -0
  181. package/packages/core/hooks/gateguard-pre-edit.sh +154 -0
  182. package/packages/core/hooks/gateguard-record-facts.sh +37 -0
  183. package/packages/core/hooks/intake-classifier.py +449 -0
  184. package/packages/core/hooks/lib/profile.sh +141 -0
  185. package/packages/core/hooks/loop-guard.sh +75 -0
  186. package/packages/core/hooks/migration-safety.sh +56 -0
  187. package/packages/core/hooks/plan-completion-gate.sh +61 -0
  188. package/packages/core/hooks/pre-compact-save.sh +89 -0
  189. package/packages/core/hooks/security-patterns.sh +119 -0
  190. package/packages/core/hooks/session-context-restore.sh +76 -0
  191. package/packages/core/hooks/subagent-stop-validate.sh +73 -0
  192. package/packages/core/hooks/superkit-counts-verify.sh +346 -0
  193. package/packages/core/hooks/superkit-update.sh +367 -0
  194. package/packages/core/hooks/tests/README.md +42 -0
  195. package/packages/core/hooks/tests/audit-trail-chain_test.sh +62 -0
  196. package/packages/core/hooks/tests/block-dangerous-git_test.sh +144 -0
  197. package/packages/core/hooks/tests/chain-semantics/h1.sh +11 -0
  198. package/packages/core/hooks/tests/chain-semantics/h2.sh +9 -0
  199. package/packages/core/hooks/tests/chain-semantics/h3.sh +11 -0
  200. package/packages/core/hooks/tests/chain-semantics/run-experiment.sh +65 -0
  201. package/packages/core/hooks/tests/chain-semantics/settings-experiment.json +15 -0
  202. package/packages/core/hooks/tests/counts-verify_test.sh +118 -0
  203. package/packages/core/hooks/tests/dev-required-on-commit_test.sh +207 -0
  204. package/packages/core/hooks/tests/dev-required-wip-on-main_test.sh +20 -0
  205. package/packages/core/hooks/tests/doc-check-on-commit_test.sh +122 -0
  206. package/packages/core/hooks/tests/edit-streak-check_test.sh +106 -0
  207. package/packages/core/hooks/tests/internal-manifest_test.sh +130 -0
  208. package/packages/core/hooks/tests/json-path_test.sh +108 -0
  209. package/packages/core/hooks/tests/mirror-invariants_test.sh +139 -0
  210. package/packages/core/hooks/tests/nudge-throttle_test.sh +95 -0
  211. package/packages/core/hooks/tests/profile-helper_test.sh +21 -0
  212. package/packages/core/hooks/tests/run-all.sh +47 -0
  213. package/packages/core/hooks/tests/session-key-helper_test.sh +17 -0
  214. package/packages/core/hooks/tests/superkit-update_test.sh +311 -0
  215. package/packages/core/hooks/tests/warn-visibility_test.sh +59 -0
  216. package/packages/core/hooks/user-intent-detect.sh +44 -0
  217. package/packages/core/hooks/verify-hooks.sh +69 -0
  218. package/packages/core/rules/auto-commands.md +124 -0
  219. package/packages/core/rules/coding-style.md +68 -0
  220. package/packages/core/rules/dev-workflow.md +77 -0
  221. package/packages/core/rules/documentation.md +106 -0
  222. package/packages/core/rules/frontend-aesthetics.md +53 -0
  223. package/packages/core/rules/git-workflow.md +14 -0
  224. package/packages/core/rules/security.md +29 -0
  225. package/packages/core/rules/superkit-integrity.md +114 -0
  226. package/packages/core/settings.json +229 -0
  227. package/packages/core/skills/drizzle-orm-expert/SKILL.md +260 -0
  228. package/packages/core/skills/nextjs-supabase-auth/SKILL.md +259 -0
  229. package/packages/core/skills/postgresql-optimization/SKILL.md +150 -0
  230. package/packages/core/skills/project-architecture/SKILL.md +31 -0
  231. package/packages/core/skills/project-scanner/SKILL.md +132 -0
  232. package/packages/core/skills/redis-patterns/SKILL.md +261 -0
  233. package/packages/core/skills/ru-text/SKILL.md +156 -0
  234. package/packages/core/skills/telegram-bot-builder/SKILL.md +145 -0
  235. package/packages/core/skills/writing-agents/SKILL.md +220 -0
  236. package/packages/core/skills/writing-commands/SKILL.md +176 -0
  237. package/packages/core/skills/writing-hooks/SKILL.md +335 -0
  238. package/packages/extras/bot-reviewer.md +279 -0
  239. package/packages/extras/design-system-reviewer.md +234 -0
  240. package/packages/extras/red-blue-auditor/README.md +117 -0
  241. package/packages/extras/red-blue-auditor/agent.md +128 -0
  242. package/packages/extras/red-blue-auditor/patterns/agent-config.txt +4 -0
  243. package/packages/extras/red-blue-auditor/patterns/hook-injection.txt +8 -0
  244. package/packages/extras/red-blue-auditor/patterns/mcp-risk.txt +5 -0
  245. package/packages/extras/red-blue-auditor/patterns/permission-abuse.txt +6 -0
  246. package/packages/extras/red-blue-auditor/patterns/secrets.txt +17 -0
  247. package/packages/extras/red-blue-auditor/scan.sh +88 -0
  248. package/packages/extras/skillsmp-search/SKILL.md +134 -0
  249. package/packages/frontend-3d/README.md +62 -0
  250. package/packages/frontend-3d/agents/frontend-perf-reviewer.md +164 -0
  251. package/packages/frontend-3d/agents/presentation-reviewer.md +146 -0
  252. package/packages/frontend-3d/agents/r3f-scene-reviewer.md +128 -0
  253. package/packages/frontend-3d/agents/ui-design-reviewer.md +169 -0
  254. package/packages/frontend-3d/commands/capture-screen.md +166 -0
  255. package/packages/frontend-3d/hooks/bundle-size-warn.sh +93 -0
  256. package/packages/frontend-3d/hooks/gsap-pattern-check.sh +74 -0
  257. package/packages/frontend-3d/hooks/r3f-color-check.sh +76 -0
  258. package/packages/frontend-3d/hooks/tailwind-version-guard.sh +98 -0
  259. package/packages/frontend-3d/rules/frontend-aesthetics-3d.md +81 -0
  260. package/packages/frontend-3d/rules/gsap-conventions.md +129 -0
  261. package/packages/frontend-3d/rules/threejs-conventions.md +116 -0
  262. package/packages/frontend-3d/skills/gltf-debugging/SKILL.md +145 -0
  263. package/packages/frontend-3d/skills/html-to-3d-texture/SKILL.md +183 -0
  264. package/packages/frontend-3d/skills/output-enforcement/SKILL.md +79 -0
  265. package/packages/frontend-3d/skills/product-3d-lighting/SKILL.md +166 -0
  266. package/packages/frontend-3d/skills/r3f-scroll-driven-3d/SKILL.md +209 -0
  267. package/packages/frontend-3d/skills/threejs-color-management/SKILL.md +111 -0
  268. package/packages/frontend-ui/NOTICE.md +99 -0
  269. package/packages/frontend-ui/README.md +59 -0
  270. package/packages/frontend-ui/agents/ui-color-reviewer.md +174 -0
  271. package/packages/frontend-ui/agents/ui-design-critic.md +198 -0
  272. package/packages/frontend-ui/agents/ui-interaction-reviewer.md +259 -0
  273. package/packages/frontend-ui/agents/ui-motion-reviewer.md +266 -0
  274. package/packages/frontend-ui/agents/ui-reviewer.md +251 -0
  275. package/packages/frontend-ui/agents/ui-typography-reviewer.md +222 -0
  276. package/packages/frontend-ui/hooks/tests/ui-animation-easing-check_test.sh +78 -0
  277. package/packages/frontend-ui/hooks/tests/ui-banned-fonts-check_test.sh +77 -0
  278. package/packages/frontend-ui/hooks/tests/ui-color-check_test.sh +75 -0
  279. package/packages/frontend-ui/hooks/ui-animation-easing-check.sh +86 -0
  280. package/packages/frontend-ui/hooks/ui-banned-fonts-check.sh +90 -0
  281. package/packages/frontend-ui/hooks/ui-color-check.sh +102 -0
  282. package/packages/frontend-ui/rules/color-and-contrast.md +230 -0
  283. package/packages/frontend-ui/rules/frontend-design-aesthetics.md +124 -0
  284. package/packages/frontend-ui/rules/interaction-polish.md +335 -0
  285. package/packages/frontend-ui/rules/motion-and-animation.md +283 -0
  286. package/packages/frontend-ui/rules/spatial-and-layout.md +212 -0
  287. package/packages/frontend-ui/rules/typography-guidelines.md +185 -0
  288. package/packages/frontend-ui/rules/ui-anti-patterns.md +309 -0
  289. package/packages/frontend-ui/settings.json +24 -0
  290. package/packages/frontend-ui/skills/impeccable-craft/SKILL.md +187 -0
  291. package/packages/gan/README.md +232 -0
  292. package/packages/gan/agents/gan-evaluator.md +214 -0
  293. package/packages/gan/agents/gan-generator.md +171 -0
  294. package/packages/gan/agents/gan-planner.md +206 -0
  295. package/packages/gan/rubrics/functionality.md +66 -0
  296. package/packages/gan/rubrics/ui-quality.md +77 -0
  297. package/packages/gan/skills/gan-evaluator/SKILL.md +91 -0
  298. package/packages/gan/skills/gan-generator/SKILL.md +72 -0
  299. package/packages/gan/skills/gan-planner/SKILL.md +93 -0
  300. package/packages/stack-agents/go/go-concurrency-reviewer.md +210 -0
  301. package/packages/stack-agents/go/go-error-reviewer.md +187 -0
  302. package/packages/stack-agents/go/go-modernizer.md +160 -0
  303. package/packages/stack-agents/go/go-observability-reviewer.md +185 -0
  304. package/packages/stack-agents/go/go-performance-reviewer.md +160 -0
  305. package/packages/stack-agents/go/go-reviewer.md +277 -0
  306. package/packages/stack-agents/go/references/benchmark-methodology.md +280 -0
  307. package/packages/stack-agents/go/references/channel-patterns.md +384 -0
  308. package/packages/stack-agents/go/references/cli-cobra-viper.md +190 -0
  309. package/packages/stack-agents/go/references/code-style.md +262 -0
  310. package/packages/stack-agents/go/references/context-propagation.md +317 -0
  311. package/packages/stack-agents/go/references/data-structures.md +315 -0
  312. package/packages/stack-agents/go/references/database-patterns.md +334 -0
  313. package/packages/stack-agents/go/references/design-patterns.md +411 -0
  314. package/packages/stack-agents/go/references/di-frameworks.md +146 -0
  315. package/packages/stack-agents/go/references/error-creation.md +251 -0
  316. package/packages/stack-agents/go/references/error-inspection.md +348 -0
  317. package/packages/stack-agents/go/references/error-wrapping.md +230 -0
  318. package/packages/stack-agents/go/references/gopls-driving.md +62 -0
  319. package/packages/stack-agents/go/references/goroutine-lifecycle.md +351 -0
  320. package/packages/stack-agents/go/references/graphql-patterns.md +221 -0
  321. package/packages/stack-agents/go/references/grpc-patterns.md +373 -0
  322. package/packages/stack-agents/go/references/modernize-guide.md +522 -0
  323. package/packages/stack-agents/go/references/module-management.md +191 -0
  324. package/packages/stack-agents/go/references/naming-conventions.md +176 -0
  325. package/packages/stack-agents/go/references/observability-pipeline.md +352 -0
  326. package/packages/stack-agents/go/references/performance-profiling.md +250 -0
  327. package/packages/stack-agents/go/references/refactoring-mechanics.md +127 -0
  328. package/packages/stack-agents/go/references/rest-openapi-patterns.md +160 -0
  329. package/packages/stack-agents/go/references/samber-do.md +201 -0
  330. package/packages/stack-agents/go/references/samber-libraries.md +363 -0
  331. package/packages/stack-agents/go/references/samber-lo.md +260 -0
  332. package/packages/stack-agents/go/references/samber-oops.md +200 -0
  333. package/packages/stack-agents/go/references/security-checklist.md +441 -0
  334. package/packages/stack-agents/go/references/standard-stdlib-now.md +181 -0
  335. package/packages/stack-agents/go/references/stay-updated.md +147 -0
  336. package/packages/stack-agents/go/references/structs-interfaces.md +312 -0
  337. package/packages/stack-agents/go/references/sync-primitives.md +395 -0
  338. package/packages/stack-agents/go/references/testing-patterns.md +483 -0
  339. package/packages/stack-agents/go/references/troubleshooting.md +98 -0
  340. package/packages/stack-agents/python/py-reviewer.md +194 -0
  341. package/packages/stack-agents/rust/rs-reviewer.md +188 -0
  342. package/packages/stack-agents/typescript/ts-reviewer.md +135 -0
  343. package/packages/stack-hooks/go/go-context-check-on-edit.sh +56 -0
  344. package/packages/stack-hooks/go/go-error-check-on-edit.sh +54 -0
  345. package/packages/stack-hooks/go/go-format-on-edit.sh +32 -0
  346. package/packages/stack-hooks/go/go-safety-check-on-edit.sh +54 -0
  347. package/packages/stack-hooks/go/go-vet-on-edit.sh +61 -0
  348. package/packages/stack-hooks/go/golangci-lint-on-edit.sh +54 -0
  349. package/packages/stack-hooks/python/ruff-on-edit.sh +67 -0
  350. package/packages/stack-hooks/rust/cargo-check-on-edit.sh +64 -0
  351. package/packages/stack-hooks/typescript/typecheck-on-edit.sh +76 -0
  352. package/packages/stack-rules/go/go-conventions.md +44 -0
  353. package/packages/stack-rules/go/go-safety.md +35 -0
@@ -0,0 +1,169 @@
1
+ ---
2
+ name: ui-design-reviewer
3
+ description: Anti-slop UI review — typography, color calibration, layout diversity, motion quality, interactive states. Activate when reviewing frontend components for design quality.
4
+ tokens: 2246
5
+ model: opus
6
+ allowed-tools: Read, Grep, Glob
7
+ ---
8
+
9
+ # UI Design Reviewer
10
+
11
+ You review frontend code for design quality, catching AI-generated slop patterns and enforcing premium aesthetics. Read-only reviewer: you report, you never edit.
12
+
13
+ ## Hard Rules
14
+
15
+ 1. Every FAIL MUST cite exact `file:line` from a file you Read in this session — never from memory.
16
+ 2. Severity is ONLY `CRITICAL` / `WARNING` / `SUGGESTION`. Confidence is ONLY `HIGH` / `MEDIUM` / `LOW`. Never `INFO`, never percentages.
17
+ 3. All 16 checks get a status row (`PASS` / `FAIL` / `N/A`) — never omit a check.
18
+ 4. A clean review (0 FAILs) is a valid result — do not manufacture findings.
19
+ 5. If a referenced file/symbol cannot be found: output `NOT FOUND: <path>` — never invent its contents.
20
+ 6. Never flag a documented, intentional design choice (Phase 0 context) as slop.
21
+
22
+ ## Phase 0 — Load Project Context
23
+
24
+ Read if present, skip silently if absent: `CLAUDE.md` or `AGENTS.md` (design tokens, brand guidelines, UI conventions); `docs/architecture/*.md` (frontend layers, typography/color decisions); `.claude/rules/frontend-aesthetics-3d.md` (if present, treat as authoritative aesthetic standards).
25
+ Use it to: avoid flagging the project's intentional choices (chosen accent palette, typography pairings) as AI slop. Violations of DOCUMENTED conventions → report with HIGH confidence instead of MEDIUM.
26
+
27
+ ## Process
28
+
29
+ 1. **Scope** — Determine files to review: if the caller names files, review those; otherwise Glob for the components mentioned in the task (e.g. `**/components/**/*.tsx`, `**/*.css`). Read every in-scope file in full. Done when: every in-scope file is Read or reported `NOT FOUND: <path>`.
30
+ 2. **Run the 16 checks** — Apply the checklist below to every in-scope file. Useful ripgrep patterns: `h-screen`, `from-purple|from-violet|from-indigo`, `tracking-`, `max-w-`, `transition|animate`, `linear`, `backdrop-blur`. A grep hit is a lead, not evidence — Read the surrounding code before marking FAIL. Done when: all 16 checks have a status for the reviewed scope.
31
+ 3. **Report** — Emit exactly the Output Contract. Done when: every FAIL row has `file:line`, every LOW-confidence suspicion is in Open Questions, and the score follows the Score Rule.
32
+
33
+ ## Review Checklist (16 checks)
34
+
35
+ ### Typography (3 checks)
36
+
37
+ | # | Check | Severity | What to look for |
38
+ |---|-------|----------|------------------|
39
+ | 1 | Font choice | WARNING | No Inter/Roboto/Arial as display/headline font in premium designs — use distinctive fonts. System fonts OK for body text in utility apps. Tier rule below |
40
+ | 2 | Headline tracking | WARNING | Headlines should use `tracking-tighter` or `tracking-tight`. Default tracking looks AI-generated |
41
+ | 3 | Body width | SUGGESTION | Body text constrained to `max-w-[65ch]` or similar. Full-width paragraphs are hard to read |
42
+
43
+ **Check 1 tier rule** — decide premium vs utility in this order: (a) project docs declare a design tier → use it; (b) no declaration → marketing/landing/hero pages are premium, dashboards/admin/internal tools are utility; (c) still ambiguous → treat as premium but report the finding at MEDIUM confidence.
44
+
45
+ ### Color (3 checks)
46
+
47
+ | # | Check | Severity | What to look for |
48
+ |---|-------|----------|------------------|
49
+ | 4 | Accent count | WARNING | Max 1 accent color. Multiple accents = visual noise. Use shades/tints for variation |
50
+ | 5 | Saturation | WARNING | Accent saturation < 80%. Hyper-saturated colors look cheap on most screens |
51
+ | 6 | AI gradient default | CRITICAL | No purple-to-blue gradient as default accent. This is the #1 AI-generated pattern red flag |
52
+
53
+ ### Layout (3 checks)
54
+
55
+ | # | Check | Severity | What to look for |
56
+ |---|-------|----------|------------------|
57
+ | 7 | Center bias | WARNING | Not everything centered. Use split screen, asymmetric layouts when content permits |
58
+ | 8 | Grid over flex | SUGGESTION | CSS Grid for page layout over flex percentage math. Grid is more intentional |
59
+ | 9 | Viewport height | CRITICAL | `min-h-[100dvh]` not `h-screen`. iOS Safari address bar causes viewport jumping with `h-screen` |
60
+
61
+ ### Motion (3 checks)
62
+
63
+ | # | Check | Severity | What to look for |
64
+ |---|-------|----------|------------------|
65
+ | 10 | Spring physics | WARNING | Use spring/ease-out for interactions, not `linear`. Linear motion feels robotic |
66
+ | 11 | Staggered reveals | SUGGESTION | List/grid items use staggered entrance (0.05-0.1s delay between items). Batch pop-in looks cheap |
67
+ | 12 | No instant changes | WARNING | State transitions should animate. Instant opacity/display toggle breaks flow |
68
+
69
+ ### Interactive States (2 checks)
70
+
71
+ | # | Check | Severity | What to look for |
72
+ |---|-------|----------|------------------|
73
+ | 13 | Loading/empty/error | CRITICAL | All async states have explicit UI: loading skeleton, empty state message, error fallback |
74
+ | 14 | Active feedback | WARNING | `:active` state on buttons/cards — `scale-[0.98]` or similar for tactile feel |
75
+
76
+ ### Glassmorphism (2 checks — `N/A` if no glassmorphic elements in scope)
77
+
78
+ | # | Check | Severity | What to look for |
79
+ |---|-------|----------|------------------|
80
+ | 15 | Glass border | SUGGESTION | Glassmorphic elements have inner `border border-white/10` + `shadow-inner` for refraction effect |
81
+ | 16 | Tinted shadow | SUGGESTION | Shadows should be tinted (not pure black) — `shadow-accent/10` matches the element's context |
82
+
83
+ ## Evidence Gate
84
+
85
+ Report a finding ONLY if all four hold:
86
+ 1. **Citation** — exact `file:line` you Read in this session, never from memory.
87
+ 2. **Failure mode** — a concrete input/path that triggers the problem (no "could be problematic").
88
+ 3. **Context** — you read the surrounding component/styles, not just the flagged line.
89
+ 4. **Severity** you can defend to a skeptic.
90
+ If a referenced file/symbol cannot be found: output `NOT FOUND: <path>` — never invent its contents.
91
+ A clean review (0 findings) is a valid result — do not manufacture findings.
92
+
93
+ ## Severity / Confidence
94
+
95
+ Severity — CRITICAL: data loss, security, crash (here: broken viewport, missing async states, hallmark AI-slop gradient) · WARNING: incorrect behavior under specific conditions, degraded perceived quality · SUGGESTION: style/readability, safe to ignore.
96
+ Confidence — HIGH (≥80): problem visible in the code · MEDIUM (60–79): pattern-based, mark "needs verification" · LOW (<60): route to Open Questions, never silently drop.
97
+
98
+ ## Score Rule
99
+
100
+ `score = round(100 × PASS / (PASS + FAIL))`, counting only checks with status PASS or FAIL (N/A excluded). Any FAIL on a CRITICAL check (#6, #9, #13) caps the score at 50. If PASS + FAIL = 0, report `score: N/A`.
101
+
102
+ ## Output Contract
103
+
104
+ ~~~
105
+ ## UI Design Review: <files or scope>
106
+
107
+ ### Check Table
108
+ | # | Check | Severity | Status | Confidence | Evidence |
109
+ |---|-------|----------|--------|------------|----------|
110
+ <16 rows, one per check; Status PASS / FAIL / N/A; FAIL rows include file:line; N/A rows say why>
111
+
112
+ ### Findings
113
+ [SEVERITY/CONFIDENCE] file:line — one-line description
114
+ Evidence: <what the code shows>
115
+ Fix: <concrete change>
116
+ <one block per FAIL row; if none: "No findings — clean review.">
117
+
118
+ ### Open Questions
119
+ LOW-confidence or ambiguous items — listed, not dropped:
120
+ - file:line — what you suspect + what context would confirm it
121
+ <or "None.">
122
+
123
+ ### Summary
124
+ - Checks: X PASS, Y FAIL, Z N/A
125
+ - Critical failures: <list or "none">
126
+ - Design quality score: <N>/100 (Score Rule)
127
+ - Recommendations: <top 3 or fewer, most impactful first>
128
+ ~~~
129
+
130
+ **Mini example** (abbreviated to 2 rows):
131
+
132
+ ~~~
133
+ ## UI Design Review: src/components/Hero.tsx
134
+
135
+ ### Check Table
136
+ | # | Check | Severity | Status | Confidence | Evidence |
137
+ |---|-------|----------|--------|------------|----------|
138
+ | 1 | Font choice | WARNING | PASS | HIGH | Space Grotesk display font, Hero.tsx:12 |
139
+ | 6 | AI gradient default | CRITICAL | FAIL | HIGH | Hero.tsx:34 `from-purple-500 to-blue-600` |
140
+
141
+ ### Findings
142
+ [CRITICAL/HIGH] src/components/Hero.tsx:34 — purple-to-blue gradient as hero accent
143
+ Evidence: `bg-gradient-to-r from-purple-500 to-blue-600` on the primary CTA background
144
+ Fix: replace with the project's single brand accent (or a shade/tint of it)
145
+
146
+ ### Open Questions
147
+ None.
148
+
149
+ ### Summary
150
+ - Checks: 13 PASS, 1 FAIL, 2 N/A
151
+ - Critical failures: #6 AI gradient default
152
+ - Design quality score: 50/100 (Score Rule — CRITICAL fail caps at 50)
153
+ - Recommendations: replace hero gradient with brand accent
154
+ ~~~
155
+
156
+ ## Done ONLY when
157
+
158
+ - [ ] All 16 checks have a status row (PASS / FAIL / N/A).
159
+ - [ ] Every FAIL row and Finding cites `file:line` from a file Read this session.
160
+ - [ ] Score computed by the Score Rule — not estimated.
161
+ - [ ] LOW-confidence items are in Open Questions, not dropped and not promoted.
162
+
163
+ ## Recap — non-negotiables
164
+
165
+ - FAIL requires exact `file:line` you Read this session; unfound files → `NOT FOUND: <path>`.
166
+ - Only CRITICAL / WARNING / SUGGESTION + HIGH / MEDIUM / LOW — no INFO, no percentages.
167
+ - All 16 checks reported; 0 FAILs is a legitimate outcome — never manufacture findings.
168
+ - Documented project design choices are never slop.
169
+ - Score comes from the Score Rule, never from feel.
@@ -0,0 +1,166 @@
1
+ ---
2
+ description: Capture a React component as PNG texture for 3D model screens
3
+ argument-hint: "[port] (default: 3000)"
4
+ allowed-tools: Bash, Read
5
+ ---
6
+
7
+ # Capture Screen PNG
8
+
9
+ ## Role
10
+
11
+ Capture a running app screen as a high-resolution PNG in `public/textures/` for use as a texture on a 3D model: a full-viewport screenshot of a URL/route, or a single element marked `data-screen-id` (element capture runs through the Step 5 script).
12
+
13
+ ## Hard Rules
14
+
15
+ 1. Playwright CLI: use ONLY these verified flags — `--viewport-size`, `--device`, `--full-page`, `--wait-for-timeout`. A `--device-scale-factor` flag DOES NOT exist; for DPR control beyond a device preset use the Step 5 script.
16
+ 2. Dev server not responding → STOP and tell the user to start it. Never screenshot a dead server.
17
+ 3. No capture route found → ASK the user for the route. Never assume `/capture` exists.
18
+ 4. Defaults: iPhone 16 Pro Max — viewport 440x956, scale 2x (expected output 880x1912), corner radius R=124 (62pt × 2). Another device → use its Resolution Guide row; non-iPhone corner radius → ask the user or skip rounding, never guess.
19
+ 5. Before reporting done, verify the PNG's real dimensions (Step 7); if they differ from expected, report Status: MISMATCH — do not claim OK.
20
+
21
+ ## Prerequisites
22
+
23
+ - Dev server running (Vite, Next.js, etc.)
24
+ - `playwright` installed (`npx playwright install chromium`)
25
+ - `sharp` installed (only for rounded corners, Step 6)
26
+
27
+ ## Resolution Guide
28
+
29
+ | Device | Viewport | @2x Output |
30
+ |--------|----------|------------|
31
+ | iPhone 15 Pro | 393x852 | 786x1704 |
32
+ | iPhone 16 Pro Max | 440x956 | 880x1912 |
33
+ | iPad Pro 11" | 834x1194 | 1668x2388 |
34
+ | MacBook Pro 14" | 1512x982 | 3024x1964 |
35
+
36
+ ## Steps
37
+
38
+ ### 1. Resolve inputs
39
+
40
+ - `<PORT>` = $ARGUMENTS if a port number was given, else `3000`. Substitute this value everywhere `<PORT>` appears below.
41
+ - Target device: the default from Hard Rule 4, unless the user named another Resolution Guide device.
42
+ - Done when: `<PORT>`, viewport, and expected output size are fixed.
43
+
44
+ ### 2. Check dev server
45
+
46
+ ```bash
47
+ curl -s -o /dev/null -w "%{http_code}" "http://localhost:<PORT>"
48
+ ```
49
+
50
+ - Status 200–399 → continue. Anything else, or no output → STOP (Hard Rule 2): "Dev server not responding on port <PORT> — start it and re-run /capture-screen."
51
+ - Done when: a 2xx/3xx status was actually observed.
52
+
53
+ ### 3. Find the capture route
54
+
55
+ ```bash
56
+ find . -name "capture*.html" -o -name "test-3d*.html" 2>/dev/null | head -5
57
+ grep -rln "data-screen-id" src/ app/ pages/ 2>/dev/null | head -5
58
+ ```
59
+
60
+ - Capture/test page found → `<ROUTE>` = its route (e.g. `/capture`).
61
+ - `data-screen-id` found in a component → note it: capture that element in Step 5.
62
+ - Neither found → ASK the user which route renders the screen (Hard Rule 3), then set `<ROUTE>` from the answer.
63
+ - Done when: `<ROUTE>` is set and you know whether element capture applies.
64
+
65
+ ### 4. Capture — CLI path
66
+
67
+ Pick exactly ONE:
68
+
69
+ - **1x at exact viewport** (quick preview, any device row):
70
+
71
+ ```bash
72
+ npx playwright screenshot \
73
+ --viewport-size "440,956" \
74
+ --wait-for-timeout 3000 \
75
+ "http://localhost:<PORT><ROUTE>" \
76
+ public/textures/screen-capture.png
77
+ ```
78
+
79
+ - **@2x via device preset — iPad Pro 11" only** (its Playwright descriptor is 2x DPR: 834x1194 → 1668x2388). iPhone presets are 3x DPR with smaller viewports and do NOT produce the table's @2x sizes:
80
+
81
+ ```bash
82
+ npx playwright screenshot --device "iPad Pro 11" --wait-for-timeout 3000 \
83
+ "http://localhost:<PORT><ROUTE>" public/textures/screen-capture.png
84
+ ```
85
+
86
+ - **Neither fits** (exact @2x at iPhone/MacBook sizes, or element capture) → go to Step 5.
87
+
88
+ - Done when: PNG written, or Step 5 chosen.
89
+
90
+ ### 5. Capture — script fallback (exact @2x / element by data-screen-id)
91
+
92
+ ```bash
93
+ node -e "
94
+ const { chromium } = require('playwright');
95
+ (async () => {
96
+ const browser = await chromium.launch();
97
+ const page = await browser.newPage({ viewport: { width: 440, height: 956 }, deviceScaleFactor: 2 });
98
+ await page.goto('http://localhost:<PORT><ROUTE>', { waitUntil: 'networkidle' });
99
+ const el = page.locator('[data-screen-id]');
100
+ if (await el.count() > 0) { await el.first().screenshot({ path: 'public/textures/screen-capture.png' }); }
101
+ else { await page.screenshot({ path: 'public/textures/screen-capture.png' }); }
102
+ await browser.close();
103
+ })();
104
+ "
105
+ ```
106
+
107
+ - Replace width/height with the chosen Resolution Guide viewport; narrow the selector to `[data-screen-id="<id>"]` if a specific id is known.
108
+ - Done when: PNG written.
109
+
110
+ ### 6. Apply rounded corners (optional, for phone screens)
111
+
112
+ R=124 is the Hard Rule 4 default; for other devices follow Hard Rule 4.
113
+
114
+ ```bash
115
+ node -e "
116
+ const sharp = require('sharp');
117
+ const fs = require('fs');
118
+ const FILE = 'public/textures/screen-capture.png';
119
+ const R = 124; // 62pt * 2x
120
+ async function main() {
121
+ const meta = await sharp(FILE).metadata();
122
+ const w = meta.width, h = meta.height;
123
+ const mask = Buffer.from('<svg width=\"'+w+'\" height=\"'+h+'\"><rect x=\"0\" y=\"0\" width=\"'+w+'\" height=\"'+h+'\" rx=\"'+R+'\" ry=\"'+R+'\" fill=\"white\"/></svg>');
124
+ await sharp(FILE).ensureAlpha().composite([{input:mask,blend:'dest-in'}]).png().toFile(FILE+'.tmp');
125
+ fs.renameSync(FILE+'.tmp', FILE);
126
+ const m2 = await sharp(FILE).metadata();
127
+ console.log('Done:', m2.width, 'x', m2.height, 'alpha:', m2.hasAlpha);
128
+ }
129
+ main();
130
+ "
131
+ ```
132
+
133
+ - Done when: script printed `Done: <w> x <h> alpha: true` (skipped entirely if corners not wanted).
134
+
135
+ ### 7. Verify output
136
+
137
+ ```bash
138
+ # macOS (built-in)
139
+ sips -g pixelWidth -g pixelHeight public/textures/screen-capture.png
140
+ # Linux (requires ImageMagick: apt install imagemagick)
141
+ identify public/textures/screen-capture.png
142
+ # Universal (Node.js)
143
+ node -e "const s=require('sharp');s('public/textures/screen-capture.png').metadata().then(m=>console.log(m.width+'x'+m.height,'alpha:',m.hasAlpha))"
144
+ ```
145
+
146
+ - Expected dimensions: @2x table value for the Step 5 full-viewport path or the iPad preset; the viewport size for the 1x CLI path. Element capture (`data-screen-id`): expected = the element's rendered box × 2 — the device table does not apply.
147
+ - Done when: real dimensions compared against expected, and `alpha: true` confirmed if Step 6 ran.
148
+
149
+ ## Output
150
+
151
+ ```
152
+ ## Capture Result
153
+ - URL: http://localhost:<PORT><ROUTE>
154
+ - Method: [CLI 1x | CLI --device "iPad Pro 11" @2x | script @2x full-viewport | script element <data-screen-id>]
155
+ - File: public/textures/screen-capture.png
156
+ - Dimensions: <W>x<H> (expected: <EW>x<EH>)
157
+ - Corners: [applied R=<R>, alpha: yes | skipped]
158
+ - Status: [OK | MISMATCH: <what differs>]
159
+ ```
160
+
161
+ ## Recap
162
+
163
+ - Only verified CLI flags — `--device-scale-factor` does not exist; DPR beyond a preset means the Step 5 script.
164
+ - Server down → STOP; no route found → ASK. Never assume `/capture`.
165
+ - Default target: iPhone 16 Pro Max 440x956 @2x → 880x1912, R=124; other devices come from the Resolution Guide.
166
+ - Verify real PNG dimensions before reporting; a size mismatch is reported, never hidden.
@@ -0,0 +1,93 @@
1
+ #!/bin/bash
2
+ # bundle-size-warn.sh — PostToolUse hook for Edit/Write
3
+ # Warns on heavy package imports that bloat bundle size.
4
+ # Warnings only (exit 0 always) — never blocks.
5
+ # Profile: standard, strict (skip on fast)
6
+
7
+ # Unified profile + disable check
8
+ SUPERKIT_PROFILE_LIB="$(dirname "$0")/lib/profile.sh"
9
+ [ -f "$SUPERKIT_PROFILE_LIB" ] || SUPERKIT_PROFILE_LIB="$(dirname "$0")/../lib/profile.sh"
10
+ # shellcheck source=/dev/null
11
+ [ -f "$SUPERKIT_PROFILE_LIB" ] && source "$SUPERKIT_PROFILE_LIB" && should_skip_hook "$(basename "$0" .sh)" && exit 0
12
+
13
+ PROFILE="${CLAUDE_HOOK_PROFILE:-standard}"
14
+ if [ "$PROFILE" = "fast" ]; then
15
+ exit 0
16
+ fi
17
+
18
+ INPUT=$(cat)
19
+ FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')
20
+
21
+ if [ -z "$FILE_PATH" ]; then
22
+ exit 0
23
+ fi
24
+
25
+ # Only process .tsx/.jsx/.ts files
26
+ if [[ ! "$FILE_PATH" =~ \.(tsx|jsx|ts)$ ]]; then
27
+ exit 0
28
+ fi
29
+
30
+ if [ ! -f "$FILE_PATH" ]; then
31
+ exit 0
32
+ fi
33
+
34
+ # Get the content that was written/edited
35
+ CONTENT=$(echo "$INPUT" | jq -r '.tool_input.new_string // .tool_input.content // empty')
36
+
37
+ if [ -z "$CONTENT" ]; then
38
+ exit 0
39
+ fi
40
+
41
+ BASENAME=$(basename "$FILE_PATH")
42
+ WARNINGS=""
43
+
44
+ # 1. moment.js (67kb gzipped)
45
+ if echo "$CONTENT" | grep -qE "from\s+['\"]moment['\"]|require\s*\(\s*['\"]moment['\"]\s*\)" 2>/dev/null; then
46
+ WARNINGS="${WARNINGS}\n ⚠ Bundle: moment (67kb gzipped) — consider date-fns or dayjs as lighter alternatives in ${BASENAME}"
47
+ fi
48
+
49
+ # 2. lodash full import (71kb gzipped)
50
+ if echo "$CONTENT" | grep -qE "from\s+['\"]lodash['\"]|require\s*\(\s*['\"]lodash['\"]\s*\)" 2>/dev/null; then
51
+ WARNINGS="${WARNINGS}\n ⚠ Bundle: lodash full import (71kb gzipped) — use lodash-es with named imports (import { debounce } from 'lodash-es') in ${BASENAME}"
52
+ fi
53
+
54
+ # 3. import * as THREE (600kb+)
55
+ if echo "$CONTENT" | grep -qE "import\s+\*\s+as\s+THREE" 2>/dev/null; then
56
+ WARNINGS="${WARNINGS}\n ⚠ Bundle: import * as THREE (600kb+) — use named imports (import { Scene, Mesh } from 'three') or dynamic import() for code splitting in ${BASENAME}"
57
+ fi
58
+
59
+ # 4. chart.js (200kb+ gzipped)
60
+ if echo "$CONTENT" | grep -qE "from\s+['\"]chart\.js['\"]|require\s*\(\s*['\"]chart\.js['\"]\s*\)" 2>/dev/null; then
61
+ WARNINGS="${WARNINGS}\n ⚠ Bundle: chart.js (200kb+) — use tree-shaking imports: import { Chart, LineController } from 'chart.js' in ${BASENAME}"
62
+ fi
63
+
64
+ # 5. @mui/material (300kb+)
65
+ if echo "$CONTENT" | grep -qE "from\s+['\"]@mui/material['\"]" 2>/dev/null; then
66
+ WARNINGS="${WARNINGS}\n ⚠ Bundle: @mui/material barrel import (300kb+) — use deep imports: import Button from '@mui/material/Button' in ${BASENAME}"
67
+ fi
68
+
69
+ # 6. antd (350kb+)
70
+ if echo "$CONTENT" | grep -qE "from\s+['\"]antd['\"]" 2>/dev/null; then
71
+ WARNINGS="${WARNINGS}\n ⚠ Bundle: antd barrel import (350kb+) — use babel-plugin-import or import { Button } from 'antd' with tree-shaking in ${BASENAME}"
72
+ fi
73
+
74
+ # 7. framer-motion (140kb)
75
+ if echo "$CONTENT" | grep -qE "from\s+['\"]framer-motion['\"]" 2>/dev/null; then
76
+ WARNINGS="${WARNINGS}\n ⚠ Bundle: framer-motion (140kb) — consider motion/react (lighter) or CSS animations for simple transitions in ${BASENAME}"
77
+ fi
78
+
79
+ # 8. Generic namespace import warning (import * as)
80
+ if echo "$CONTENT" | grep -qE "import\s+\*\s+as\s+" 2>/dev/null; then
81
+ # Don't double-warn on THREE which is already covered
82
+ if ! echo "$CONTENT" | grep -qE "import\s+\*\s+as\s+THREE" 2>/dev/null; then
83
+ WARNINGS="${WARNINGS}\n ⚠ Bundle: namespace import (import * as) defeats tree-shaking — prefer named imports in ${BASENAME}"
84
+ fi
85
+ fi
86
+
87
+ # Output warnings
88
+ if [ -n "$WARNINGS" ]; then
89
+ echo -e "\nBundle size check:${WARNINGS}"
90
+ echo ""
91
+ fi
92
+
93
+ exit 0
@@ -0,0 +1,74 @@
1
+ #!/bin/bash
2
+ # gsap-pattern-check.sh — PostToolUse hook for Edit/Write
3
+ # Checks for common GSAP anti-patterns in .tsx/.jsx files.
4
+ # Warnings only (exit 0 always) — never blocks.
5
+ # Profile: standard, strict (skip on fast)
6
+
7
+ # Unified profile + disable check
8
+ SUPERKIT_PROFILE_LIB="$(dirname "$0")/lib/profile.sh"
9
+ [ -f "$SUPERKIT_PROFILE_LIB" ] || SUPERKIT_PROFILE_LIB="$(dirname "$0")/../lib/profile.sh"
10
+ # shellcheck source=/dev/null
11
+ [ -f "$SUPERKIT_PROFILE_LIB" ] && source "$SUPERKIT_PROFILE_LIB" && should_skip_hook "$(basename "$0" .sh)" && exit 0
12
+
13
+ PROFILE="${CLAUDE_HOOK_PROFILE:-standard}"
14
+ if [ "$PROFILE" = "fast" ]; then
15
+ exit 0
16
+ fi
17
+
18
+ INPUT=$(cat)
19
+ FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')
20
+
21
+ if [ -z "$FILE_PATH" ]; then
22
+ exit 0
23
+ fi
24
+
25
+ # Only process .tsx/.jsx files
26
+ if [[ ! "$FILE_PATH" =~ \.(tsx|jsx)$ ]]; then
27
+ exit 0
28
+ fi
29
+
30
+ if [ ! -f "$FILE_PATH" ]; then
31
+ exit 0
32
+ fi
33
+
34
+ BASENAME=$(basename "$FILE_PATH")
35
+ WARNINGS=""
36
+
37
+ # 1. scrub: true without a number — should be scrub: 1 or scrub: 0.5
38
+ if grep -qnE 'scrub:\s*true' "$FILE_PATH" 2>/dev/null; then
39
+ WARNINGS="${WARNINGS}\n ⚠ GSAP: scrub: true should be a number (scrub: 1 or scrub: 0.5) for smooth animation in ${BASENAME}"
40
+ fi
41
+
42
+ # 2. scrollTrigger present but missing invalidateOnRefresh: true
43
+ if grep -qiE 'scrollTrigger\s*[:={]' "$FILE_PATH" 2>/dev/null; then
44
+ if ! grep -q 'invalidateOnRefresh\s*:\s*true' "$FILE_PATH" 2>/dev/null; then
45
+ WARNINGS="${WARNINGS}\n ⚠ GSAP: ScrollTrigger without invalidateOnRefresh: true — layout breaks on resize in ${BASENAME}"
46
+ fi
47
+ fi
48
+
49
+ # 3. Timeline created without tl.set({}, {}, 1.0) extension
50
+ if grep -qE 'gsap\.timeline\(' "$FILE_PATH" 2>/dev/null; then
51
+ if ! grep -qE '\.set\(\s*\{\s*\}\s*,\s*\{\s*\}\s*,\s*[0-9]' "$FILE_PATH" 2>/dev/null; then
52
+ WARNINGS="${WARNINGS}\n ⚠ GSAP: timeline without tl.set({}, {}, 1.0) — animations may compress into first 10% of scroll in ${BASENAME}"
53
+ fi
54
+ fi
55
+
56
+ # 4. GSAP imported directly from "gsap" instead of a centralized setup
57
+ if grep -qE "from\s+['\"]gsap['\"]" "$FILE_PATH" 2>/dev/null; then
58
+ WARNINGS="${WARNINGS}\n ⚠ GSAP: direct import from \"gsap\" — use a centralized GSAP setup file for unified plugin registration in ${BASENAME}"
59
+ fi
60
+
61
+ # 5. Animations outside gsap.context()
62
+ if grep -qE 'gsap\.(to|from|fromTo|timeline)\(' "$FILE_PATH" 2>/dev/null; then
63
+ if ! grep -q 'gsap\.context(' "$FILE_PATH" 2>/dev/null; then
64
+ WARNINGS="${WARNINGS}\n ⚠ GSAP: animations without gsap.context() — may cause cleanup issues on unmount in ${BASENAME}"
65
+ fi
66
+ fi
67
+
68
+ # Output warnings
69
+ if [ -n "$WARNINGS" ]; then
70
+ echo -e "\nGSAP pattern check:${WARNINGS}"
71
+ echo ""
72
+ fi
73
+
74
+ exit 0
@@ -0,0 +1,76 @@
1
+ #!/bin/bash
2
+ # r3f-color-check.sh — PostToolUse hook for Edit/Write
3
+ # Checks Three.js / React Three Fiber color management anti-patterns.
4
+ # Warnings only (exit 0 always) — never blocks.
5
+ # Profile: standard, strict (skip on fast)
6
+
7
+ # Unified profile + disable check
8
+ SUPERKIT_PROFILE_LIB="$(dirname "$0")/lib/profile.sh"
9
+ [ -f "$SUPERKIT_PROFILE_LIB" ] || SUPERKIT_PROFILE_LIB="$(dirname "$0")/../lib/profile.sh"
10
+ # shellcheck source=/dev/null
11
+ [ -f "$SUPERKIT_PROFILE_LIB" ] && source "$SUPERKIT_PROFILE_LIB" && should_skip_hook "$(basename "$0" .sh)" && exit 0
12
+
13
+ PROFILE="${CLAUDE_HOOK_PROFILE:-standard}"
14
+ if [ "$PROFILE" = "fast" ]; then
15
+ exit 0
16
+ fi
17
+
18
+ INPUT=$(cat)
19
+ FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')
20
+
21
+ if [ -z "$FILE_PATH" ]; then
22
+ exit 0
23
+ fi
24
+
25
+ # Only process .tsx/.jsx/.ts files
26
+ if [[ ! "$FILE_PATH" =~ \.(tsx|jsx|ts)$ ]]; then
27
+ exit 0
28
+ fi
29
+
30
+ if [ ! -f "$FILE_PATH" ]; then
31
+ exit 0
32
+ fi
33
+
34
+ # Only check files that import three or @react-three
35
+ if ! grep -qE "from\s+['\"](@react-three/|three)" "$FILE_PATH" 2>/dev/null; then
36
+ exit 0
37
+ fi
38
+
39
+ BASENAME=$(basename "$FILE_PATH")
40
+ WARNINGS=""
41
+
42
+ # 1. sRGBEncoding / LinearEncoding deprecated since Three.js r152
43
+ if grep -qE '(sRGBEncoding|LinearEncoding)' "$FILE_PATH" 2>/dev/null; then
44
+ WARNINGS="${WARNINGS}\n ⚠ R3F: sRGBEncoding/LinearEncoding is deprecated since r152 — use texture.colorSpace = THREE.SRGBColorSpace or THREE.LinearSRGBColorSpace in ${BASENAME}"
45
+ fi
46
+
47
+ # 2. Texture loaded without explicit colorSpace assignment
48
+ if grep -qE '(useTexture|useLoader\s*\(\s*TextureLoader|new\s+TextureLoader)' "$FILE_PATH" 2>/dev/null; then
49
+ if ! grep -qE '\.colorSpace\s*=' "$FILE_PATH" 2>/dev/null; then
50
+ WARNINGS="${WARNINGS}\n ⚠ R3F: texture loaded without explicit colorSpace — set texture.colorSpace to avoid incorrect gamma in ${BASENAME}"
51
+ fi
52
+ fi
53
+
54
+ # 3. MeshStandardMaterial on screen/display elements (should use meshBasicMaterial)
55
+ if grep -qiE '(meshStandardMaterial|MeshStandardMaterial)' "$FILE_PATH" 2>/dev/null; then
56
+ if grep -qiE '(screen|display|monitor|ui|hud|overlay)' "$FILE_PATH" 2>/dev/null; then
57
+ WARNINGS="${WARNINGS}\n ⚠ R3F: MeshStandardMaterial on screen/display mesh — consider meshBasicMaterial (no lighting needed for flat screens) in ${BASENAME}"
58
+ fi
59
+ fi
60
+
61
+ # 4. Material with texture but no toneMapped prop
62
+ if grep -qE '(\bmap\s*=|\bmap:\s)' "$FILE_PATH" 2>/dev/null; then
63
+ if grep -qE '(meshStandardMaterial|meshBasicMaterial|meshPhongMaterial|MeshStandardMaterial|MeshBasicMaterial|MeshPhongMaterial)' "$FILE_PATH" 2>/dev/null; then
64
+ if ! grep -qE 'toneMapped' "$FILE_PATH" 2>/dev/null; then
65
+ WARNINGS="${WARNINGS}\n ⚠ R3F: material with texture but no toneMapped prop — add toneMapped={false} for UI/screen textures to preserve colors in ${BASENAME}"
66
+ fi
67
+ fi
68
+ fi
69
+
70
+ # Output warnings
71
+ if [ -n "$WARNINGS" ]; then
72
+ echo -e "\nR3F color management check:${WARNINGS}"
73
+ echo ""
74
+ fi
75
+
76
+ exit 0
@@ -0,0 +1,98 @@
1
+ #!/bin/bash
2
+ # tailwind-version-guard.sh — PostToolUse hook for Edit/Write
3
+ # Detects Tailwind CSS v3 vs v4 syntax mismatches.
4
+ # Warnings only (exit 0 always) — never blocks.
5
+ # Profile: standard, strict (skip on fast)
6
+
7
+ # Unified profile + disable check
8
+ SUPERKIT_PROFILE_LIB="$(dirname "$0")/lib/profile.sh"
9
+ [ -f "$SUPERKIT_PROFILE_LIB" ] || SUPERKIT_PROFILE_LIB="$(dirname "$0")/../lib/profile.sh"
10
+ # shellcheck source=/dev/null
11
+ [ -f "$SUPERKIT_PROFILE_LIB" ] && source "$SUPERKIT_PROFILE_LIB" && should_skip_hook "$(basename "$0" .sh)" && exit 0
12
+
13
+ PROFILE="${CLAUDE_HOOK_PROFILE:-standard}"
14
+ if [ "$PROFILE" = "fast" ]; then
15
+ exit 0
16
+ fi
17
+
18
+ INPUT=$(cat)
19
+ FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')
20
+
21
+ if [ -z "$FILE_PATH" ]; then
22
+ exit 0
23
+ fi
24
+
25
+ # Only process .tsx/.jsx/.css/.scss files
26
+ if [[ ! "$FILE_PATH" =~ \.(tsx|jsx|css|scss)$ ]]; then
27
+ exit 0
28
+ fi
29
+
30
+ if [ ! -f "$FILE_PATH" ]; then
31
+ exit 0
32
+ fi
33
+
34
+ BASENAME=$(basename "$FILE_PATH")
35
+
36
+ # Detect Tailwind version from nearest package.json
37
+ TW_VERSION=""
38
+ SEARCH_DIR=$(dirname "$FILE_PATH")
39
+ while [ "$SEARCH_DIR" != "/" ]; do
40
+ if [ -f "${SEARCH_DIR}/package.json" ]; then
41
+ TW_VERSION=$(jq -r '.dependencies.tailwindcss // .devDependencies.tailwindcss // empty' "${SEARCH_DIR}/package.json" 2>/dev/null)
42
+ break
43
+ fi
44
+ SEARCH_DIR=$(dirname "$SEARCH_DIR")
45
+ done
46
+
47
+ if [ -z "$TW_VERSION" ]; then
48
+ exit 0
49
+ fi
50
+
51
+ # Extract major version number
52
+ TW_MAJOR=$(echo "$TW_VERSION" | grep -oE '[0-9]+' | head -1)
53
+
54
+ if [ -z "$TW_MAJOR" ]; then
55
+ exit 0
56
+ fi
57
+
58
+ WARNINGS=""
59
+
60
+ if [ "$TW_MAJOR" = "4" ]; then
61
+ # Tailwind v4 project — warn on v3 patterns
62
+
63
+ # Old postcss plugin name (tailwindcss used as postcss plugin in v3)
64
+ if grep -qE "require\s*\(\s*['\"]tailwindcss['\"]\s*\)" "$FILE_PATH" 2>/dev/null; then
65
+ WARNINGS="${WARNINGS}\n ⚠ TW v4: postcss plugin 'tailwindcss' is v3 syntax — v4 uses @tailwindcss/postcss in ${BASENAME}"
66
+ fi
67
+
68
+ # @tailwind directives (v3 syntax)
69
+ if grep -qE '@tailwind\s+(base|components|utilities)' "$FILE_PATH" 2>/dev/null; then
70
+ WARNINGS="${WARNINGS}\n ⚠ TW v4: @tailwind directives are v3 syntax — v4 uses @import \"tailwindcss\" in ${BASENAME}"
71
+ fi
72
+
73
+ # tailwind.config reference (v4 uses CSS-based config)
74
+ if grep -qE 'tailwind\.config' "$FILE_PATH" 2>/dev/null; then
75
+ WARNINGS="${WARNINGS}\n ⚠ TW v4: tailwind.config is v3 syntax — v4 uses @theme in CSS for configuration in ${BASENAME}"
76
+ fi
77
+
78
+ elif [ "$TW_MAJOR" = "3" ]; then
79
+ # Tailwind v3 project — warn on v4 patterns
80
+
81
+ # @import "tailwindcss" (v4 syntax)
82
+ if grep -qE $'@import\\s+["\']tailwindcss["\']' "$FILE_PATH" 2>/dev/null; then
83
+ WARNINGS="${WARNINGS}\n ⚠ TW v3: @import \"tailwindcss\" is v4 syntax — v3 uses @tailwind base/components/utilities in ${BASENAME}"
84
+ fi
85
+
86
+ # @theme directive (v4 syntax)
87
+ if grep -qE '@theme\s*\{' "$FILE_PATH" 2>/dev/null; then
88
+ WARNINGS="${WARNINGS}\n ⚠ TW v3: @theme directive is v4 syntax — v3 uses tailwind.config.js for theme configuration in ${BASENAME}"
89
+ fi
90
+ fi
91
+
92
+ # Output warnings
93
+ if [ -n "$WARNINGS" ]; then
94
+ echo -e "\nTailwind version guard (v${TW_MAJOR} detected):${WARNINGS}"
95
+ echo ""
96
+ fi
97
+
98
+ exit 0