@istmx/skills 1.2.0 → 2.1.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 (332) hide show
  1. package/README.md +134 -40
  2. package/RELEASE_v2.1.0.md +69 -0
  3. package/bin/cli.js +95 -91
  4. package/context/conversation_transcript.md +768 -0
  5. package/context/progress.md +121 -0
  6. package/istm/SKILL.md +20 -11
  7. package/istm-animate/SKILL.md +46 -33
  8. package/istm-animate/core/motion-principles/SKILL.md +284 -0
  9. package/istm-animate/core/motion-principles/references/designers.md +127 -0
  10. package/istm-animate/core/motion-principles/references/easing-guide.md +231 -0
  11. package/istm-animate/core/motion-principles/references/enter-exit-recipes.md +466 -0
  12. package/istm-animate/frameworks/canvas-generative/SKILL.md +325 -0
  13. package/istm-animate/frameworks/canvas-generative/references/algorithms.md +925 -0
  14. package/istm-animate/frameworks/css-native/SKILL.md +319 -0
  15. package/istm-animate/frameworks/css-native/references/modern-css.md +465 -0
  16. package/istm-animate/frameworks/framer-motion/SKILL.md +187 -0
  17. package/istm-animate/frameworks/framer-motion/references/api.md +312 -0
  18. package/istm-animate/frameworks/gsap/SKILL.md +188 -0
  19. package/istm-animate/frameworks/gsap/references/core.md +218 -0
  20. package/istm-animate/frameworks/gsap/references/plugins.md +371 -0
  21. package/istm-animate/frameworks/gsap/references/scrolltrigger.md +325 -0
  22. package/istm-animate/frameworks/gsap/references/timeline.md +218 -0
  23. package/istm-animate/frameworks/threejs-r3f/SKILL.md +243 -0
  24. package/istm-animate/frameworks/threejs-r3f/references/scene-setup.md +392 -0
  25. package/istm-animate/frameworks/threejs-r3f/references/shaders.md +446 -0
  26. package/istm-animate/mobile/android/compose-graphics/SKILL.md +503 -0
  27. package/istm-animate/mobile/android/compose-graphics/references/agsl-recipes.md +356 -0
  28. package/istm-animate/mobile/android/compose-graphics/references/canvas-generative.md +282 -0
  29. package/istm-animate/mobile/android/compose-graphics/references/m3-expressive-deep.md +303 -0
  30. package/istm-animate/mobile/android/compose-motion/SKILL.md +359 -0
  31. package/istm-animate/mobile/android/compose-motion/references/gestures-compose.md +273 -0
  32. package/istm-animate/mobile/android/compose-motion/references/recomposition-and-anim.md +196 -0
  33. package/istm-animate/mobile/android/compose-motion/references/shared-transitions.md +281 -0
  34. package/istm-animate/mobile/android/compose-multiplatform/SKILL.md +311 -0
  35. package/istm-animate/mobile/android/compose-multiplatform/references/cmp-interop.md +288 -0
  36. package/istm-animate/mobile/android/compose-multiplatform/references/cmp-platform-quirks.md +156 -0
  37. package/istm-animate/mobile/apple/swiftui-graphics/SKILL.md +408 -0
  38. package/istm-animate/mobile/apple/swiftui-graphics/references/canvas-swiftui.md +239 -0
  39. package/istm-animate/mobile/apple/swiftui-graphics/references/liquid-glass-deep.md +252 -0
  40. package/istm-animate/mobile/apple/swiftui-graphics/references/metal-recipes.md +382 -0
  41. package/istm-animate/mobile/apple/swiftui-motion/SKILL.md +379 -0
  42. package/istm-animate/mobile/apple/swiftui-motion/references/gestures-swiftui.md +336 -0
  43. package/istm-animate/mobile/apple/swiftui-motion/references/phase-keyframe-deep.md +231 -0
  44. package/istm-animate/mobile/apple/swiftui-motion/references/springs-cheatsheet.md +129 -0
  45. package/istm-animate/references/animate.md +199 -0
  46. package/istm-animate/references/audit.md +115 -0
  47. package/istm-animate/references/design-engineering.md +674 -0
  48. package/istm-animate/references/improve.md +101 -0
  49. package/istm-animate/references/opportunities.md +132 -0
  50. package/istm-animate/references/plan-template.md +73 -0
  51. package/istm-animate/references/recipes.md +324 -0
  52. package/istm-animate/references/review.md +112 -0
  53. package/istm-animate/references/standards.md +187 -0
  54. package/istm-animate/references/vocabulary.md +173 -0
  55. package/istm-architecture/SKILL.md +70 -14
  56. package/istm-architecture/templates/agents.md +21 -2
  57. package/istm-awwward-designer/SKILL.md +53 -17
  58. package/istm-design/SKILL.md +49 -63
  59. package/istm-design/anti-laziness/architectural-patterns.md +55 -0
  60. package/istm-design/anti-laziness/parameter-tuning.md +44 -0
  61. package/istm-design/anti-laziness/prompt-engineering.md +52 -0
  62. package/istm-design/anti-laziness/reference-prompts.md +79 -0
  63. package/istm-design/archetypes/brandkit/SKILL.md +798 -0
  64. package/istm-design/archetypes/brutalist/SKILL.md +92 -0
  65. package/istm-design/archetypes/minimalist/SKILL.md +85 -0
  66. package/istm-design/archetypes/soft/SKILL.md +98 -0
  67. package/istm-design/core/design-audit/SKILL.md +248 -0
  68. package/istm-design/core/desktop-principles/SKILL.md +363 -0
  69. package/istm-design/core/desktop-principles/references/keyboard-patterns.md +137 -0
  70. package/istm-design/core/desktop-principles/references/multi-window.md +105 -0
  71. package/istm-design/core/mobile-principles/SKILL.md +289 -0
  72. package/istm-design/core/mobile-principles/references/accessibility-mobile.md +175 -0
  73. package/istm-design/core/mobile-principles/references/gestures-deep.md +220 -0
  74. package/istm-design/core/ui-ux-pro-max/SKILL.md +392 -0
  75. package/istm-design/core/ui-ux-pro-max/UPSTREAM.md +23 -0
  76. package/istm-design/core/ui-ux-pro-max/data/app-interface.csv +31 -0
  77. package/istm-design/core/ui-ux-pro-max/data/charts.csv +26 -0
  78. package/istm-design/core/ui-ux-pro-max/data/colors.csv +193 -0
  79. package/istm-design/core/ui-ux-pro-max/data/google-fonts.csv +1924 -0
  80. package/istm-design/core/ui-ux-pro-max/data/icons.csv +106 -0
  81. package/istm-design/core/ui-ux-pro-max/data/landing.csv +35 -0
  82. package/istm-design/core/ui-ux-pro-max/data/motion.csv +17 -0
  83. package/istm-design/core/ui-ux-pro-max/data/products.csv +193 -0
  84. package/istm-design/core/ui-ux-pro-max/data/react-performance.csv +45 -0
  85. package/istm-design/core/ui-ux-pro-max/data/stacks/angular.csv +51 -0
  86. package/istm-design/core/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  87. package/istm-design/core/ui-ux-pro-max/data/stacks/avalonia.csv +57 -0
  88. package/istm-design/core/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  89. package/istm-design/core/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  90. package/istm-design/core/ui-ux-pro-max/data/stacks/javafx.csv +76 -0
  91. package/istm-design/core/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  92. package/istm-design/core/ui-ux-pro-max/data/stacks/laravel.csv +51 -0
  93. package/istm-design/core/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  94. package/istm-design/core/ui-ux-pro-max/data/stacks/nuxt-ui.csv +71 -0
  95. package/istm-design/core/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  96. package/istm-design/core/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  97. package/istm-design/core/ui-ux-pro-max/data/stacks/react.csv +54 -0
  98. package/istm-design/core/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  99. package/istm-design/core/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  100. package/istm-design/core/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  101. package/istm-design/core/ui-ux-pro-max/data/stacks/threejs.csv +54 -0
  102. package/istm-design/core/ui-ux-pro-max/data/stacks/uno.csv +60 -0
  103. package/istm-design/core/ui-ux-pro-max/data/stacks/uwp.csv +56 -0
  104. package/istm-design/core/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  105. package/istm-design/core/ui-ux-pro-max/data/stacks/winui.csv +60 -0
  106. package/istm-design/core/ui-ux-pro-max/data/stacks/wpf.csv +57 -0
  107. package/istm-design/core/ui-ux-pro-max/data/styles.csv +85 -0
  108. package/istm-design/core/ui-ux-pro-max/data/typography.csv +75 -0
  109. package/istm-design/core/ui-ux-pro-max/data/ui-reasoning.csv +162 -0
  110. package/istm-design/core/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  111. package/istm-design/core/ui-ux-pro-max/references/pro-rules.md +109 -0
  112. package/istm-design/core/ui-ux-pro-max/references/quick-reference.md +240 -0
  113. package/istm-design/core/ui-ux-pro-max/scripts/core.py +464 -0
  114. package/istm-design/core/ui-ux-pro-max/scripts/design_system.py +1371 -0
  115. package/istm-design/core/ui-ux-pro-max/scripts/search.py +162 -0
  116. package/istm-design/core/ui-ux-pro-max/scripts/tests/test_core.py +134 -0
  117. package/istm-design/core/ui-ux-pro-max/scripts/validate_data.py +114 -0
  118. package/istm-design/image-to-code/SKILL.md +1228 -0
  119. package/istm-design/imagegen/SKILL.md +987 -0
  120. package/istm-design/presets/airbnb/DESIGN.md +545 -0
  121. package/istm-design/presets/airbnb/README.md +5 -0
  122. package/istm-design/presets/airtable/DESIGN.md +554 -0
  123. package/istm-design/presets/airtable/README.md +5 -0
  124. package/istm-design/presets/apple/DESIGN.md +562 -0
  125. package/istm-design/presets/apple/README.md +5 -0
  126. package/istm-design/presets/binance/DESIGN.md +634 -0
  127. package/istm-design/presets/binance/README.md +5 -0
  128. package/istm-design/presets/bmw/DESIGN.md +544 -0
  129. package/istm-design/presets/bmw/README.md +5 -0
  130. package/istm-design/presets/bmw-m/DESIGN.md +503 -0
  131. package/istm-design/presets/bmw-m/README.md +5 -0
  132. package/istm-design/presets/bugatti/DESIGN.md +454 -0
  133. package/istm-design/presets/bugatti/README.md +5 -0
  134. package/istm-design/presets/cal/DESIGN.md +542 -0
  135. package/istm-design/presets/cal/README.md +5 -0
  136. package/istm-design/presets/catalog.md +127 -0
  137. package/istm-design/presets/claude/DESIGN.md +589 -0
  138. package/istm-design/presets/claude/README.md +5 -0
  139. package/istm-design/presets/clay/DESIGN.md +541 -0
  140. package/istm-design/presets/clay/README.md +5 -0
  141. package/istm-design/presets/clickhouse/DESIGN.md +544 -0
  142. package/istm-design/presets/clickhouse/README.md +5 -0
  143. package/istm-design/presets/cohere/DESIGN.md +451 -0
  144. package/istm-design/presets/cohere/README.md +5 -0
  145. package/istm-design/presets/coinbase/DESIGN.md +570 -0
  146. package/istm-design/presets/coinbase/README.md +5 -0
  147. package/istm-design/presets/composio/DESIGN.md +506 -0
  148. package/istm-design/presets/composio/README.md +5 -0
  149. package/istm-design/presets/cursor/DESIGN.md +537 -0
  150. package/istm-design/presets/cursor/README.md +5 -0
  151. package/istm-design/presets/dell-1996/DESIGN.md +632 -0
  152. package/istm-design/presets/dell-1996/README.md +5 -0
  153. package/istm-design/presets/elevenlabs/DESIGN.md +504 -0
  154. package/istm-design/presets/elevenlabs/README.md +5 -0
  155. package/istm-design/presets/expo/DESIGN.md +526 -0
  156. package/istm-design/presets/expo/README.md +5 -0
  157. package/istm-design/presets/ferrari/DESIGN.md +531 -0
  158. package/istm-design/presets/ferrari/README.md +5 -0
  159. package/istm-design/presets/figma/DESIGN.md +578 -0
  160. package/istm-design/presets/figma/README.md +5 -0
  161. package/istm-design/presets/framer/DESIGN.md +544 -0
  162. package/istm-design/presets/framer/README.md +5 -0
  163. package/istm-design/presets/hashicorp/DESIGN.md +575 -0
  164. package/istm-design/presets/hashicorp/README.md +5 -0
  165. package/istm-design/presets/hp/DESIGN.md +670 -0
  166. package/istm-design/presets/hp/README.md +5 -0
  167. package/istm-design/presets/ibm/DESIGN.md +550 -0
  168. package/istm-design/presets/ibm/README.md +5 -0
  169. package/istm-design/presets/intercom/DESIGN.md +546 -0
  170. package/istm-design/presets/intercom/README.md +5 -0
  171. package/istm-design/presets/kraken/DESIGN.md +125 -0
  172. package/istm-design/presets/kraken/README.md +5 -0
  173. package/istm-design/presets/lamborghini/DESIGN.md +288 -0
  174. package/istm-design/presets/lamborghini/README.md +5 -0
  175. package/istm-design/presets/linear/DESIGN.md +548 -0
  176. package/istm-design/presets/linear/README.md +5 -0
  177. package/istm-design/presets/lovable/DESIGN.md +298 -0
  178. package/istm-design/presets/lovable/README.md +5 -0
  179. package/istm-design/presets/mastercard/DESIGN.md +365 -0
  180. package/istm-design/presets/mastercard/README.md +5 -0
  181. package/istm-design/presets/meta/DESIGN.md +683 -0
  182. package/istm-design/presets/meta/README.md +5 -0
  183. package/istm-design/presets/minimax/DESIGN.md +746 -0
  184. package/istm-design/presets/minimax/README.md +5 -0
  185. package/istm-design/presets/mintlify/DESIGN.md +852 -0
  186. package/istm-design/presets/mintlify/README.md +5 -0
  187. package/istm-design/presets/miro/DESIGN.md +825 -0
  188. package/istm-design/presets/miro/README.md +5 -0
  189. package/istm-design/presets/mistral/DESIGN.md +773 -0
  190. package/istm-design/presets/mistral/README.md +5 -0
  191. package/istm-design/presets/mongodb/DESIGN.md +767 -0
  192. package/istm-design/presets/mongodb/README.md +5 -0
  193. package/istm-design/presets/nike/DESIGN.md +575 -0
  194. package/istm-design/presets/nike/README.md +5 -0
  195. package/istm-design/presets/nintendo-2001/DESIGN.md +649 -0
  196. package/istm-design/presets/nintendo-2001/README.md +5 -0
  197. package/istm-design/presets/notion/DESIGN.md +821 -0
  198. package/istm-design/presets/notion/README.md +5 -0
  199. package/istm-design/presets/nvidia/DESIGN.md +640 -0
  200. package/istm-design/presets/nvidia/README.md +5 -0
  201. package/istm-design/presets/ollama/DESIGN.md +539 -0
  202. package/istm-design/presets/ollama/README.md +5 -0
  203. package/istm-design/presets/opencode/DESIGN.md +521 -0
  204. package/istm-design/presets/opencode/README.md +5 -0
  205. package/istm-design/presets/pinterest/DESIGN.md +597 -0
  206. package/istm-design/presets/pinterest/README.md +5 -0
  207. package/istm-design/presets/playstation/DESIGN.md +661 -0
  208. package/istm-design/presets/playstation/README.md +5 -0
  209. package/istm-design/presets/posthog/DESIGN.md +690 -0
  210. package/istm-design/presets/posthog/README.md +5 -0
  211. package/istm-design/presets/raycast/DESIGN.md +669 -0
  212. package/istm-design/presets/raycast/README.md +5 -0
  213. package/istm-design/presets/renault/DESIGN.md +589 -0
  214. package/istm-design/presets/renault/README.md +5 -0
  215. package/istm-design/presets/replicate/DESIGN.md +616 -0
  216. package/istm-design/presets/replicate/README.md +5 -0
  217. package/istm-design/presets/resend/DESIGN.md +585 -0
  218. package/istm-design/presets/resend/README.md +5 -0
  219. package/istm-design/presets/revolut/DESIGN.md +636 -0
  220. package/istm-design/presets/revolut/README.md +5 -0
  221. package/istm-design/presets/runwayml/DESIGN.md +244 -0
  222. package/istm-design/presets/runwayml/README.md +5 -0
  223. package/istm-design/presets/sanity/DESIGN.md +357 -0
  224. package/istm-design/presets/sanity/README.md +5 -0
  225. package/istm-design/presets/sentry/DESIGN.md +551 -0
  226. package/istm-design/presets/sentry/README.md +5 -0
  227. package/istm-design/presets/shopify/DESIGN.md +516 -0
  228. package/istm-design/presets/shopify/README.md +5 -0
  229. package/istm-design/presets/slack/DESIGN.md +482 -0
  230. package/istm-design/presets/spacex/DESIGN.md +363 -0
  231. package/istm-design/presets/spacex/README.md +5 -0
  232. package/istm-design/presets/spotify/DESIGN.md +246 -0
  233. package/istm-design/presets/spotify/README.md +5 -0
  234. package/istm-design/presets/starbucks/DESIGN.md +580 -0
  235. package/istm-design/presets/starbucks/README.md +5 -0
  236. package/istm-design/presets/stripe/DESIGN.md +487 -0
  237. package/istm-design/presets/stripe/README.md +5 -0
  238. package/istm-design/presets/supabase/DESIGN.md +462 -0
  239. package/istm-design/presets/supabase/README.md +5 -0
  240. package/istm-design/presets/superhuman/DESIGN.md +448 -0
  241. package/istm-design/presets/superhuman/README.md +5 -0
  242. package/istm-design/presets/tesla/DESIGN.md +286 -0
  243. package/istm-design/presets/tesla/README.md +5 -0
  244. package/istm-design/presets/theverge/DESIGN.md +339 -0
  245. package/istm-design/presets/theverge/README.md +5 -0
  246. package/istm-design/presets/together/DESIGN.md +633 -0
  247. package/istm-design/presets/together/README.md +5 -0
  248. package/istm-design/presets/uber/DESIGN.md +636 -0
  249. package/istm-design/presets/uber/README.md +5 -0
  250. package/istm-design/presets/vercel/DESIGN.md +736 -0
  251. package/istm-design/presets/vercel/README.md +5 -0
  252. package/istm-design/presets/vodafone/DESIGN.md +538 -0
  253. package/istm-design/presets/vodafone/README.md +5 -0
  254. package/istm-design/presets/voltagent/DESIGN.md +521 -0
  255. package/istm-design/presets/voltagent/README.md +5 -0
  256. package/istm-design/presets/warp/DESIGN.md +526 -0
  257. package/istm-design/presets/warp/README.md +5 -0
  258. package/istm-design/presets/webflow/DESIGN.md +588 -0
  259. package/istm-design/presets/webflow/README.md +5 -0
  260. package/istm-design/presets/wired/DESIGN.md +497 -0
  261. package/istm-design/presets/wired/README.md +5 -0
  262. package/istm-design/presets/wise/DESIGN.md +544 -0
  263. package/istm-design/presets/wise/README.md +5 -0
  264. package/istm-design/presets/xai/DESIGN.md +465 -0
  265. package/istm-design/presets/xai/README.md +5 -0
  266. package/istm-design/presets/zapier/DESIGN.md +537 -0
  267. package/istm-design/presets/zapier/README.md +5 -0
  268. package/istm-design/references/apple-design.md +282 -0
  269. package/istm-design/references/generation-guide.md +209 -0
  270. package/istm-design/references/pick-ui-library.md +77 -0
  271. package/istm-design/references/picker.md +197 -0
  272. package/istm-design/references/prototype.md +90 -0
  273. package/istm-design/references/schema.md +366 -0
  274. package/istm-design/semantic-design/DESIGN.md +121 -0
  275. package/istm-design/semantic-design/SKILL.md +184 -0
  276. package/istm-system-design/SKILL.md +12 -5
  277. package/istm-workflow/istm-autoplan/SKILL.md +1905 -0
  278. package/istm-workflow/istm-autoplan/SKILL.md.tmpl +923 -0
  279. package/istm-workflow/istm-craft/SKILL.md +12 -6
  280. package/istm-workflow/istm-cso/ACKNOWLEDGEMENTS.md +14 -0
  281. package/istm-workflow/istm-cso/SKILL.md +1313 -0
  282. package/istm-workflow/istm-cso/SKILL.md.tmpl +407 -0
  283. package/istm-workflow/istm-cso/sections/audit-phases.md +253 -0
  284. package/istm-workflow/istm-cso/sections/audit-phases.md.tmpl +251 -0
  285. package/istm-workflow/istm-cso/sections/manifest.json +14 -0
  286. package/istm-workflow/istm-debt/SKILL.md +44 -0
  287. package/istm-workflow/istm-debug/SKILL.md +12 -3
  288. package/istm-workflow/istm-design-review/SKILL.md +2053 -0
  289. package/istm-workflow/istm-design-review/SKILL.md.tmpl +312 -0
  290. package/istm-workflow/istm-develop/SKILL.md +10 -4
  291. package/istm-workflow/istm-eng-review/SKILL.md +1112 -0
  292. package/istm-workflow/istm-eng-review/SKILL.md.tmpl +163 -0
  293. package/istm-workflow/istm-eng-review/sections/manifest.json +14 -0
  294. package/istm-workflow/istm-eng-review/sections/review-sections.md +942 -0
  295. package/istm-workflow/istm-eng-review/sections/review-sections.md.tmpl +225 -0
  296. package/istm-workflow/istm-gain/SKILL.md +50 -0
  297. package/istm-workflow/istm-health/SKILL.md +1104 -0
  298. package/istm-workflow/istm-health/SKILL.md.tmpl +320 -0
  299. package/istm-workflow/istm-qa/BROWSER.md +1468 -0
  300. package/istm-workflow/istm-qa/SKILL.md +1743 -0
  301. package/istm-workflow/istm-qa/SKILL.md.tmpl +354 -0
  302. package/istm-workflow/istm-qa/references/issue-taxonomy.md +85 -0
  303. package/istm-workflow/istm-qa/templates/qa-report-template.md +126 -0
  304. package/istm-workflow/istm-release/SKILL.md +989 -0
  305. package/istm-workflow/istm-release/SKILL.md.tmpl +160 -0
  306. package/istm-workflow/istm-release/sections/manifest.json +14 -0
  307. package/istm-workflow/istm-release/sections/release-body.md +547 -0
  308. package/istm-workflow/istm-release/sections/release-body.md.tmpl +420 -0
  309. package/istm-workflow/istm-review/SKILL.md +57 -0
  310. package/istm-workflow/istm-ship/SKILL.md +1504 -0
  311. package/istm-workflow/istm-ship/SKILL.md.tmpl +582 -0
  312. package/istm-workflow/istm-ship/sections/adversarial.md +218 -0
  313. package/istm-workflow/istm-ship/sections/adversarial.md.tmpl +19 -0
  314. package/istm-workflow/istm-ship/sections/apple-release.md +58 -0
  315. package/istm-workflow/istm-ship/sections/apple-release.md.tmpl +56 -0
  316. package/istm-workflow/istm-ship/sections/changelog.md +45 -0
  317. package/istm-workflow/istm-ship/sections/changelog.md.tmpl +3 -0
  318. package/istm-workflow/istm-ship/sections/greptile.md +51 -0
  319. package/istm-workflow/istm-ship/sections/greptile.md.tmpl +49 -0
  320. package/istm-workflow/istm-ship/sections/manifest.json +62 -0
  321. package/istm-workflow/istm-ship/sections/plan-completion.md +329 -0
  322. package/istm-workflow/istm-ship/sections/plan-completion.md.tmpl +31 -0
  323. package/istm-workflow/istm-ship/sections/pr-body.md +209 -0
  324. package/istm-workflow/istm-ship/sections/pr-body.md.tmpl +207 -0
  325. package/istm-workflow/istm-ship/sections/review-army.md +406 -0
  326. package/istm-workflow/istm-ship/sections/review-army.md.tmpl +56 -0
  327. package/istm-workflow/istm-ship/sections/test-coverage.md +264 -0
  328. package/istm-workflow/istm-ship/sections/test-coverage.md.tmpl +23 -0
  329. package/istm-workflow/istm-ship/sections/tests.md +403 -0
  330. package/istm-workflow/istm-ship/sections/tests.md.tmpl +116 -0
  331. package/package.json +6 -3
  332. package/RELEASE_v1.2.0.md +0 -40
@@ -0,0 +1,252 @@
1
+ # Liquid Glass Deep Dive (iOS 26)
2
+
3
+ > System-level glassmorphism with adaptive depth and morphing transitions. iOS 26+.
4
+ > Concise rules. Fallback patterns for older iOS at the bottom.
5
+
6
+ ---
7
+
8
+ ## What Liquid Glass Is
9
+
10
+ iOS 26 ships a system glassmorphism layer with adaptive depth, refraction, and morphing transitions across views. It is built on the same Metal stack as `.layerEffect` but optimized at the system level: the OS knows about device pixel density, surrounding content, and motion, and tunes blur radius, opacity, and refraction in real time. Pre-iOS 26 used `Material` (`.ultraThinMaterial` etc.), which is purely a backdrop blur. Liquid Glass adds light bending, edge highlights, and a coordinated namespace for morphing between glass surfaces.
11
+
12
+ ---
13
+
14
+ ## Basic API
15
+
16
+ | API | Purpose |
17
+ |---|---|
18
+ | `.glassEffect()` | Default glass (`.regular`) |
19
+ | `.glassEffect(.regular)` / `.clear` | Depth variants (frosted vs high-transparency) |
20
+ | `.glassEffect(.identity)` | No-op variant, to conditionally disable the effect |
21
+ | `.glassEffectID(_, in:)` | Pair a glass surface with a namespace for morphing |
22
+ | `GlassEffectContainer` | Group glass surfaces that should morph as one |
23
+ | `.glassBackgroundEffect(displayMode:)` | Older watchOS alias; iOS prefers `.glassEffect()` |
24
+
25
+ Variant guidance (iOS 26 `Glass` exposes only these):
26
+ - `.clear`: high transparency, content stays visible. Use for lightweight chrome over rich/media backgrounds.
27
+ - `.regular`: balanced, frosted, default. Use for cards, tab bars, modals, focused surfaces.
28
+ - `.identity`: no visual effect - use to disable glass conditionally.
29
+
30
+ Refine either variant with `.tint(_:)` and `.interactive()`, e.g. `.glassEffect(.regular.tint(.blue).interactive())`.
31
+
32
+ ---
33
+
34
+ ## Recipe: Glass Card Morphing
35
+
36
+ Hero card that expands to a sheet. Both states share `glassEffectID`, the OS animates the morph.
37
+
38
+ ```swift
39
+ struct ExpandingCard: View {
40
+ @Namespace var glassNS
41
+ @State var expanded = false
42
+
43
+ var body: some View {
44
+ ZStack {
45
+ if !expanded {
46
+ Image("hero")
47
+ .resizable()
48
+ .scaledToFit()
49
+ .frame(width: 200, height: 280)
50
+ .glassEffect(.regular)
51
+ .glassEffectID("hero", in: glassNS)
52
+ .onTapGesture {
53
+ withAnimation(.spring(response: 0.4, dampingFraction: 0.85)) {
54
+ expanded = true
55
+ }
56
+ }
57
+ } else {
58
+ VStack {
59
+ Image("hero").resizable().scaledToFit()
60
+ Text("Details").font(.title)
61
+ }
62
+ .padding()
63
+ .frame(maxWidth: .infinity, maxHeight: .infinity)
64
+ .glassEffect(.regular)
65
+ .glassEffectID("hero", in: glassNS)
66
+ .onTapGesture {
67
+ withAnimation(.spring(response: 0.4, dampingFraction: 0.85)) {
68
+ expanded = false
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
75
+ ```
76
+
77
+ The OS interpolates blur, refraction, and edge highlights between the two states.
78
+
79
+ ---
80
+
81
+ ## Recipe: Glass Tab Bar
82
+
83
+ Floating tab bar with `.glassEffect(.regular)` over scrolling content. The bar adapts its tint as content scrolls beneath.
84
+
85
+ ```swift
86
+ struct GlassTabBar: View {
87
+ @State var selected = 0
88
+ let tabs = ["house", "magnifyingglass", "person"]
89
+
90
+ var body: some View {
91
+ ZStack(alignment: .bottom) {
92
+ ScrollView {
93
+ LazyVStack(spacing: 16) {
94
+ ForEach(0..<50) { i in
95
+ Card(index: i)
96
+ }
97
+ }
98
+ .padding()
99
+ }
100
+
101
+ HStack(spacing: 32) {
102
+ ForEach(tabs.indices, id: \.self) { i in
103
+ Image(systemName: tabs[i])
104
+ .font(.title2)
105
+ .foregroundStyle(selected == i ? .primary : .secondary)
106
+ .frame(width: 44, height: 44)
107
+ .onTapGesture { selected = i }
108
+ }
109
+ }
110
+ .padding(.horizontal, 24)
111
+ .padding(.vertical, 12)
112
+ .glassEffect(.regular)
113
+ .clipShape(Capsule())
114
+ .padding(.bottom, 16)
115
+ }
116
+ }
117
+ }
118
+ ```
119
+
120
+ ---
121
+
122
+ ## Recipe: Glass Modal Stack
123
+
124
+ Stacked sheets with progressively heavier glass, signaling depth.
125
+
126
+ ```swift
127
+ struct GlassModalStack: View {
128
+ @State var first = false
129
+ @State var second = false
130
+
131
+ var body: some View {
132
+ Button("Open") { first = true }
133
+ .sheet(isPresented: $first) {
134
+ VStack {
135
+ Text("Layer 1").font(.title)
136
+ Button("Deeper") { second = true }
137
+ }
138
+ .frame(maxWidth: .infinity, maxHeight: .infinity)
139
+ .glassEffect(.clear)
140
+ .sheet(isPresented: $second) {
141
+ Text("Layer 2")
142
+ .frame(maxWidth: .infinity, maxHeight: .infinity)
143
+ .glassEffect(.regular) // heavier frost as we go deeper
144
+ }
145
+ }
146
+ }
147
+ }
148
+ ```
149
+
150
+ > Rule of thumb: use `.clear` for light chrome and `.regular` for focused/heavier surfaces. iOS 26 `Glass` has only these two depth variants (plus `.identity` to disable) - there is no `.thin`/`.thick` (those are `Material`, not `Glass`).
151
+
152
+ ---
153
+
154
+ ## iOS <26 Fallback Patterns
155
+
156
+ | iOS 26 API | Pre-iOS 26 fallback |
157
+ |---|---|
158
+ | `.glassEffect(.clear)` | `.background(.ultraThinMaterial)` |
159
+ | `.glassEffect(.regular)` | `.background(.regularMaterial)` |
160
+ | `.glassEffectID(_, in:)` | `matchedGeometryEffect(id:in:)` on a material-backed view |
161
+ | `GlassEffectContainer` | Manual `ZStack` + shared namespace |
162
+
163
+ ```swift
164
+ @ViewBuilder
165
+ func adaptiveGlass<Content: View>(@ViewBuilder content: () -> Content) -> some View {
166
+ if #available(iOS 26.0, *) {
167
+ content().glassEffect(.regular)
168
+ } else {
169
+ content().background(.ultraThinMaterial)
170
+ }
171
+ }
172
+ ```
173
+
174
+ ---
175
+
176
+ ## What Doesn't Work Pre-iOS 26
177
+
178
+ - **True refraction** (light bending through glass). Material is flat backdrop blur.
179
+ - **Adaptive transparency** based on what's behind. Material is a fixed mix.
180
+ - **`glassEffectID` morphing**. Use `matchedGeometryEffect` on a material-backed view; the material itself doesn't animate between states, only the view's frame does.
181
+ - **Edge highlights** that respond to motion. Static border at best.
182
+
183
+ If those are non-negotiable for your design, gate the feature on iOS 26 and ship a simpler fallback.
184
+
185
+ ---
186
+
187
+ ## Gotchas
188
+
189
+ ### Glass on glass nests poorly
190
+
191
+ Stacking glass on glass compounds blur and washes out content. Use `GlassEffectContainer` to group siblings into one rendered surface.
192
+
193
+ ```swift
194
+ // BAD -- two passes, content disappears
195
+ Card().glassEffect(.regular)
196
+ .padding()
197
+ .background(.ultraThinMaterial)
198
+
199
+ // GOOD -- one container, one pass
200
+ GlassEffectContainer {
201
+ HStack { Pill1(); Pill2() }
202
+ }
203
+ ```
204
+
205
+ ### Glass over solid backgrounds is invisible
206
+
207
+ Liquid Glass is designed to refract content beneath. Over a flat white or black solid, the effect is imperceptible. Use it over photographic, gradient, or animated backgrounds.
208
+
209
+ ```swift
210
+ // BAD -- nothing to refract
211
+ ZStack {
212
+ Color.white
213
+ Card().glassEffect(.regular) // looks like a slightly grey card
214
+ }
215
+
216
+ // GOOD -- refractive content underneath
217
+ ZStack {
218
+ Image("blurred-photo").resizable().scaledToFill()
219
+ Card().glassEffect(.regular)
220
+ }
221
+ ```
222
+
223
+ ### Glass inside `LazyVStack` rows compounds cost
224
+
225
+ Each cell rendering its own glass means N GPU passes during scroll. Either lift the glass out of the cell or accept the cost only for visible cells (Lazy stacks help, but glass is still expensive per cell).
226
+
227
+ ```swift
228
+ // BAD
229
+ LazyVStack {
230
+ ForEach(items) { item in
231
+ Card(item: item).glassEffect(.regular)
232
+ }
233
+ }
234
+
235
+ // GOOD -- glass on the chrome only, cells use solid backgrounds
236
+ ZStack {
237
+ LazyVStack {
238
+ ForEach(items) { item in
239
+ Card(item: item).background(.ultraThinMaterial.opacity(0.5))
240
+ }
241
+ }
242
+ Header().glassEffect(.regular)
243
+ }
244
+ ```
245
+
246
+ ---
247
+
248
+ ## Sources
249
+
250
+ - Apple HIG iOS 26 Materials (see Apple iOS 26 release notes)
251
+ - [Apple SwiftUI Materials documentation](https://developer.apple.com/documentation/swiftui/material)
252
+ - [dpearson2699/swift-ios-skills](https://github.com/dpearson2699/swift-ios-skills) (swiftui-liquid-glass module)
@@ -0,0 +1,382 @@
1
+ # Metal Shader Recipes
2
+
3
+ > Working Metal Shading Language (MSL) shaders for SwiftUI's `.colorEffect`, `.distortionEffect`, `.layerEffect`. iOS 17+.
4
+ > Each recipe: description, .metal code, Swift binding, parameters, performance note.
5
+
6
+ All `.metal` files start with:
7
+ ```metal
8
+ #include <SwiftUI/SwiftUI_Metal.h>
9
+ using namespace metal;
10
+ ```
11
+ (Omitted from each recipe below for brevity. Add it once per file.)
12
+
13
+ ---
14
+
15
+ ## 1. Ripple Touch
16
+
17
+ Touch ripple displacing pixels along a sine wave with time decay. The ripple fades as `time` grows.
18
+
19
+ ```metal
20
+ [[ stitchable ]]
21
+ half4 ripple(float2 position, SwiftUI::Layer layer,
22
+ float2 origin, float time, float amp) {
23
+ float distance = length(position - origin);
24
+ // wavefront expands with time, decays with distance
25
+ float wavefront = distance - time * 200.0;
26
+ float wave = sin(wavefront * 0.05) * amp;
27
+ // decay: ripple weakens past the wavefront and over time
28
+ float decay = exp(-time * 1.5) * exp(-abs(wavefront) * 0.005);
29
+ wave *= decay;
30
+ float2 dir = normalize(position - origin);
31
+ float2 displaced = position + dir * wave * clamp(50.0 / max(distance, 1.0), 0.0, 50.0);
32
+ return layer.sample(displaced);
33
+ }
34
+ ```
35
+
36
+ ```swift
37
+ struct RippleView: View {
38
+ @State var origin: CGPoint = .zero
39
+ @State var time: Float = 0
40
+
41
+ var body: some View {
42
+ Image("photo")
43
+ .resizable()
44
+ .scaledToFit()
45
+ .layerEffect(
46
+ ShaderLibrary.ripple(
47
+ .float2(Float(origin.x), Float(origin.y)),
48
+ .float(time),
49
+ .float(0.05)
50
+ ),
51
+ maxSampleOffset: CGSize(width: 50, height: 50)
52
+ )
53
+ .onTapGesture { location in
54
+ origin = location
55
+ time = 0
56
+ withAnimation(.linear(duration: 1.5)) { time = 1.5 }
57
+ }
58
+ }
59
+ }
60
+ ```
61
+
62
+ **Params:**
63
+ - `origin` (float2): touch point in view space.
64
+ - `time` (float): seconds since tap, drives wavefront expansion.
65
+ - `amp` (float): ripple amplitude. 0.05 is subtle; 0.2 cartoonish.
66
+
67
+ **Perf:** `.layerEffect` is the most expensive of the three. `clamp` on the displacement protects against runaway sampling. Keep `maxSampleOffset` tight.
68
+
69
+ ---
70
+
71
+ ## 2. Holographic Gradient
72
+
73
+ Rainbow shimmer over luminance, scrollable via a parameter. Useful for foil cards and trading-card effects.
74
+
75
+ ```metal
76
+ [[ stitchable ]]
77
+ half4 holographic(float2 position, half4 color, float scroll) {
78
+ float n = position.x * 0.01 + position.y * 0.005 + scroll * 0.3;
79
+ half3 rainbow = half3(
80
+ sin(n * 2.0) * 0.5 + 0.5,
81
+ sin(n * 2.0 + 2.094) * 0.5 + 0.5,
82
+ sin(n * 2.0 + 4.188) * 0.5 + 0.5
83
+ );
84
+ half luminance = dot(color.rgb, half3(0.299, 0.587, 0.114));
85
+ return half4(mix(color.rgb, rainbow * luminance * 2.0, 0.5), color.a);
86
+ }
87
+ ```
88
+
89
+ ```swift
90
+ struct HolographicCard: View {
91
+ @State var scroll: Float = 0
92
+
93
+ var body: some View {
94
+ Image("card")
95
+ .resizable()
96
+ .scaledToFit()
97
+ .colorEffect(ShaderLibrary.holographic(.float(scroll)))
98
+ .gesture(
99
+ DragGesture()
100
+ .onChanged { scroll = Float($0.translation.width / 200) }
101
+ )
102
+ }
103
+ }
104
+ ```
105
+
106
+ **Params:**
107
+ - `scroll` (float): drives the rainbow phase. Bind to scroll offset, time, or drag delta.
108
+
109
+ **Perf:** cheap. `.colorEffect` runs purely per-pixel with no neighbor access. Safe to apply on full-screen views.
110
+
111
+ ---
112
+
113
+ ## 3. CRT Scanlines + Chromatic Aberration
114
+
115
+ True chromatic aberration via offset RGB samples. Promote to `.layerEffect`.
116
+
117
+ ```metal
118
+ [[ stitchable ]]
119
+ half4 crt(float2 position, SwiftUI::Layer layer, float time) {
120
+ float scanline = sin(position.y * 1.5) * 0.04;
121
+ float flicker = sin(time * 60.0) * 0.02;
122
+
123
+ // sample R and B with horizontal offset for chromatic aberration
124
+ float aberration = 1.5;
125
+ half r = layer.sample(position + float2(aberration, 0)).r;
126
+ half g = layer.sample(position).g;
127
+ half b = layer.sample(position - float2(aberration, 0)).b;
128
+ half a = layer.sample(position).a;
129
+
130
+ half3 rgb = half3(r, g, b) * (1.0 - scanline - flicker);
131
+ return half4(rgb, a);
132
+ }
133
+ ```
134
+
135
+ ```swift
136
+ struct CRTView<Content: View>: View {
137
+ let content: Content
138
+ let startTime = Date()
139
+ init(@ViewBuilder content: () -> Content) { self.content = content() }
140
+
141
+ var body: some View {
142
+ TimelineView(.animation) { timeline in
143
+ let t = Float(timeline.date.timeIntervalSince(startTime))
144
+ content.layerEffect(
145
+ ShaderLibrary.crt(.float(t)),
146
+ maxSampleOffset: CGSize(width: 2, height: 0)
147
+ )
148
+ }
149
+ }
150
+ }
151
+ ```
152
+
153
+ **Params:**
154
+ - `time` (float): seconds elapsed, drives flicker.
155
+
156
+ **Perf:** four `layer.sample` calls per pixel. Keep aberration small (`maxSampleOffset` of 2px is enough). At full screen on iPhone 12 and below, expect dropped frames if combined with other effects.
157
+
158
+ ---
159
+
160
+ ## 4. Glow Halo
161
+
162
+ Brightens pixels above a luminance threshold. Cheaper than bloom, ships in one pass.
163
+
164
+ ```metal
165
+ [[ stitchable ]]
166
+ half4 glow(float2 position, half4 color, float threshold, float strength) {
167
+ half luminance = dot(color.rgb, half3(0.299, 0.587, 0.114));
168
+ half mask = smoothstep(threshold, threshold + 0.1, luminance);
169
+ half3 boosted = color.rgb + color.rgb * mask * strength;
170
+ return half4(boosted, color.a);
171
+ }
172
+ ```
173
+
174
+ ```swift
175
+ Text("HELLO")
176
+ .font(.system(size: 80, weight: .black))
177
+ .foregroundStyle(.white)
178
+ .colorEffect(
179
+ ShaderLibrary.glow(.float(0.7), .float(2.0))
180
+ )
181
+ ```
182
+
183
+ **Params:**
184
+ - `threshold` (float): luminance above which pixels glow. 0.7 = highlights only.
185
+ - `strength` (float): multiplier. 2.0 doubles bright pixels.
186
+
187
+ **Perf:** very cheap. Pair with a Gaussian blur underneath for a true bloom look (use SwiftUI's `.blur(radius:)` on a duplicate layer).
188
+
189
+ ---
190
+
191
+ ## 5. Distortion / Heat Haze
192
+
193
+ Wavering distortion driven by pseudo-noise. Use case: heat above a fire, water reflections.
194
+
195
+ ```metal
196
+ // hash-based pseudo-noise, fast and shader-friendly
197
+ float hash(float2 p) {
198
+ return fract(sin(dot(p, float2(127.1, 311.7))) * 43758.5453);
199
+ }
200
+
201
+ float noise(float2 p) {
202
+ float2 i = floor(p);
203
+ float2 f = fract(p);
204
+ float a = hash(i);
205
+ float b = hash(i + float2(1.0, 0.0));
206
+ float c = hash(i + float2(0.0, 1.0));
207
+ float d = hash(i + float2(1.0, 1.0));
208
+ float2 u = f * f * (3.0 - 2.0 * f);
209
+ return mix(a, b, u.x) + (c - a) * u.y * (1.0 - u.x) + (d - b) * u.x * u.y;
210
+ }
211
+
212
+ [[ stitchable ]]
213
+ float2 heatHaze(float2 position, float time, float strength) {
214
+ float n = noise(position * 0.02 + float2(0, time * 2.0));
215
+ float2 offset = float2(
216
+ (n - 0.5) * strength,
217
+ (noise(position * 0.02 + float2(time, 0)) - 0.5) * strength
218
+ );
219
+ return position + offset;
220
+ }
221
+ ```
222
+
223
+ ```swift
224
+ TimelineView(.animation) { timeline in
225
+ let t = Float(timeline.date.timeIntervalSinceReferenceDate)
226
+ Image("flame")
227
+ .resizable()
228
+ .scaledToFit()
229
+ .distortionEffect(
230
+ ShaderLibrary.heatHaze(.float(t), .float(8.0)),
231
+ maxSampleOffset: CGSize(width: 8, height: 8)
232
+ )
233
+ }
234
+ ```
235
+
236
+ **Params:**
237
+ - `time` (float): seconds elapsed, scrolls the noise field.
238
+ - `strength` (float): max pixel displacement. 8 px = visible but plausible.
239
+
240
+ **Perf:** `.distortionEffect` is per-pixel sampling -- medium cost. The noise function is the hot path; if too slow on older devices, sample a noise texture instead.
241
+
242
+ ---
243
+
244
+ ## 6. Particle Emitter (Canvas + TimelineView)
245
+
246
+ 50 additive particles drifting upward. Pure SwiftUI, no Metal.
247
+
248
+ ```swift
249
+ struct Particle: Identifiable {
250
+ let id = UUID()
251
+ var position: CGPoint
252
+ var velocity: CGVector
253
+ var life: Double
254
+ var size: Double
255
+ }
256
+
257
+ struct ParticleEmitter: View {
258
+ @State var particles: [Particle] = (0..<50).map { _ in
259
+ Particle(
260
+ position: CGPoint(x: .random(in: 0...300), y: 600),
261
+ velocity: CGVector(dx: .random(in: -20...20), dy: .random(in: -100 ... -50)),
262
+ life: .random(in: 0...3),
263
+ size: .random(in: 2...6)
264
+ )
265
+ }
266
+
267
+ var body: some View {
268
+ TimelineView(.animation) { timeline in
269
+ Canvas { context, size in
270
+ context.blendMode = .plusLighter
271
+ let t = timeline.date.timeIntervalSinceReferenceDate
272
+ for p in particles {
273
+ let life = (p.life + t).truncatingRemainder(dividingBy: 3)
274
+ let progress = life / 3
275
+ let y = p.position.y + p.velocity.dy * life
276
+ let x = p.position.x + p.velocity.dx * life
277
+ let alpha = (1.0 - progress) * 0.8
278
+ context.fill(
279
+ Path(ellipseIn: CGRect(x: x, y: y, width: p.size, height: p.size)),
280
+ with: .color(.orange.opacity(alpha))
281
+ )
282
+ }
283
+ }
284
+ }
285
+ .frame(width: 300, height: 600)
286
+ }
287
+ }
288
+ ```
289
+
290
+ **Params:** all configured in particle struct (position, velocity, life, size).
291
+
292
+ **Perf:** Canvas with 50 fills at 60fps is fine on iPhone 11+. For 500+ particles or per-pixel glow, switch to a Metal `.colorEffect` on a CALayer-backed view or use SpriteKit/Metal directly.
293
+
294
+ ---
295
+
296
+ ## 7. Noise Overlay (Film Grain)
297
+
298
+ 3D pseudo-noise approximation for animated film grain.
299
+
300
+ ```metal
301
+ float hash3(float3 p) {
302
+ return fract(sin(dot(p, float3(127.1, 311.7, 74.7))) * 43758.5453);
303
+ }
304
+
305
+ [[ stitchable ]]
306
+ half4 grain(float2 position, half4 color, float time, float strength) {
307
+ float n = hash3(float3(position * 0.5, time * 10.0));
308
+ half g = half(n - 0.5) * half(strength);
309
+ return half4(color.rgb + g, color.a);
310
+ }
311
+ ```
312
+
313
+ ```swift
314
+ TimelineView(.animation) { timeline in
315
+ let t = Float(timeline.date.timeIntervalSinceReferenceDate)
316
+ Image("photo")
317
+ .resizable()
318
+ .scaledToFit()
319
+ .colorEffect(ShaderLibrary.grain(.float(t), .float(0.15)))
320
+ }
321
+ ```
322
+
323
+ **Params:**
324
+ - `time` (float): drives grain animation. Pass elapsed seconds.
325
+ - `strength` (float): grain amplitude. 0.05 subtle, 0.2 strong, 0.4 destructive.
326
+
327
+ **Perf:** very cheap. The hash is one `sin` and a `fract`. Safe on full-screen views at 60fps.
328
+
329
+ ---
330
+
331
+ ## Combining Recipes
332
+
333
+ Two strategies, in order of preference:
334
+
335
+ ### A. Single shader with multiple ops (best perf)
336
+
337
+ Combine into one `[[ stitchable ]]` function. One render pass.
338
+
339
+ ```metal
340
+ [[ stitchable ]]
341
+ half4 holoGrain(float2 position, half4 color, float time, float scroll) {
342
+ // holographic
343
+ float n = position.x * 0.01 + position.y * 0.005 + scroll * 0.3;
344
+ half3 rainbow = half3(
345
+ sin(n * 2.0) * 0.5 + 0.5,
346
+ sin(n * 2.0 + 2.094) * 0.5 + 0.5,
347
+ sin(n * 2.0 + 4.188) * 0.5 + 0.5
348
+ );
349
+ half lum = dot(color.rgb, half3(0.299, 0.587, 0.114));
350
+ half3 holo = mix(color.rgb, rainbow * lum * 2.0, 0.5);
351
+
352
+ // grain
353
+ float g = fract(sin(dot(float3(position * 0.5, time * 10.0), float3(127.1, 311.7, 74.7))) * 43758.5453);
354
+ half3 final = holo + half(g - 0.5) * 0.1;
355
+
356
+ return half4(final, color.a);
357
+ }
358
+ ```
359
+
360
+ ### B. Stacked modifiers (use only when ops are conditional)
361
+
362
+ Each modifier is one render pass. Acceptable for 2 ops. Don't go past 3.
363
+
364
+ ```swift
365
+ Image("card")
366
+ .colorEffect(ShaderLibrary.holographic(.float(scroll)))
367
+ .colorEffect(ShaderLibrary.grain(.float(time), .float(0.1)))
368
+ ```
369
+
370
+ > When in doubt: prototype with stacked modifiers, then collapse into one shader for ship.
371
+
372
+ ---
373
+
374
+ ## Sources
375
+
376
+ - [twostraws/Inferno](https://github.com/twostraws/Inferno) - reference Metal shaders for SwiftUI
377
+ - [Treata11/iShader](https://github.com/Treata11/iShader)
378
+ - [jamesrochabrun/ShaderKit](https://github.com/jamesrochabrun/ShaderKit)
379
+ - [raphaelsalaja/metallurgy](https://github.com/raphaelsalaja/metallurgy)
380
+ - [eleev/swiftui-new-metal-shaders](https://github.com/eleev/swiftui-new-metal-shaders)
381
+ - [Apple Metal Shading Language Spec](https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf)
382
+ - [Apple Shader documentation](https://developer.apple.com/documentation/swiftui/shader)