@istmx/skills 1.0.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 (210) hide show
  1. package/README.md +49 -0
  2. package/bin/cli.js +251 -0
  3. package/istm/SKILL.md +65 -0
  4. package/istm-animate/SKILL.md +87 -0
  5. package/istm-animate/animations/animation_utils.md +280 -0
  6. package/istm-animate/animations/animations.md +220 -0
  7. package/istm-animate/animations/core_motion.md +250 -0
  8. package/istm-animate/animations/examples/README.md +29 -0
  9. package/istm-animate/animations/examples/nuxt/app/app.vue +3 -0
  10. package/istm-animate/animations/examples/nuxt/app/composables/useGSAP.ts +91 -0
  11. package/istm-animate/animations/examples/nuxt/app/pages/index.vue +55 -0
  12. package/istm-animate/animations/examples/nuxt/nuxt.config.ts +4 -0
  13. package/istm-animate/animations/examples/nuxt/package.json +18 -0
  14. package/istm-animate/animations/examples/react/App.jsx +46 -0
  15. package/istm-animate/animations/examples/react/index.html +12 -0
  16. package/istm-animate/animations/examples/react/main.jsx +9 -0
  17. package/istm-animate/animations/examples/react/package.json +21 -0
  18. package/istm-animate/animations/examples/react/vite.config.js +7 -0
  19. package/istm-animate/animations/examples/vanilla/index.html +33 -0
  20. package/istm-animate/animations/examples/vanilla/main.js +36 -0
  21. package/istm-animate/animations/examples/vue/app.vue +47 -0
  22. package/istm-animate/animations/examples/vue/index.html +15 -0
  23. package/istm-animate/animations/examples/vue/main.js +9 -0
  24. package/istm-animate/animations/examples/vue/package.json +19 -0
  25. package/istm-animate/animations/examples/vue/vite.config.js +7 -0
  26. package/istm-animate/animations/framework_motion.md +262 -0
  27. package/istm-animate/animations/motion.csv +17 -0
  28. package/istm-animate/animations/motion.md +11 -0
  29. package/istm-animate/animations/motion_catalog.json +226 -0
  30. package/istm-animate/animations/motion_performance.md +75 -0
  31. package/istm-animate/animations/motion_plugins.md +429 -0
  32. package/istm-animate/animations/react_animations.md +132 -0
  33. package/istm-animate/animations/scroll_trigger_effects.md +291 -0
  34. package/istm-animate/animations/timeline_sequencing.md +103 -0
  35. package/istm-architecture/SKILL.md +109 -0
  36. package/istm-architecture/frameworks/angular.csv +51 -0
  37. package/istm-architecture/frameworks/astro.csv +54 -0
  38. package/istm-architecture/frameworks/avalonia.csv +57 -0
  39. package/istm-architecture/frameworks/flutter.csv +53 -0
  40. package/istm-architecture/frameworks/javafx.csv +76 -0
  41. package/istm-architecture/frameworks/jetpack-compose.csv +53 -0
  42. package/istm-architecture/frameworks/laravel.csv +51 -0
  43. package/istm-architecture/frameworks/nextjs.csv +53 -0
  44. package/istm-architecture/frameworks/nuxtjs.csv +59 -0
  45. package/istm-architecture/frameworks/react-native.csv +52 -0
  46. package/istm-architecture/frameworks/react.csv +54 -0
  47. package/istm-architecture/frameworks/svelte.csv +54 -0
  48. package/istm-architecture/frameworks/swiftui.csv +51 -0
  49. package/istm-architecture/frameworks/uwp.csv +56 -0
  50. package/istm-architecture/frameworks/vue.csv +50 -0
  51. package/istm-architecture/frameworks/winui.csv +60 -0
  52. package/istm-architecture/frameworks/wpf.csv +57 -0
  53. package/istm-architecture/templates/agents.md +229 -0
  54. package/istm-architecture/templates/architecture.md +111 -0
  55. package/istm-architecture/templates/design.md +138 -0
  56. package/istm-architecture/templates/project-overview.md +215 -0
  57. package/istm-awwward-designer/SKILL.md +43 -0
  58. package/istm-awwward-designer/libraries/threejs.csv +54 -0
  59. package/istm-awwward-designer/references/accessibility.md +774 -0
  60. package/istm-awwward-designer/references/anim-anti-patterns.md +576 -0
  61. package/istm-awwward-designer/references/animation-map.md +166 -0
  62. package/istm-awwward-designer/references/animation-standards.md +86 -0
  63. package/istm-awwward-designer/references/anti-patterns.md +191 -0
  64. package/istm-awwward-designer/references/color-systems.md +604 -0
  65. package/istm-awwward-designer/references/css-performance.md +477 -0
  66. package/istm-awwward-designer/references/descender-safety.md +490 -0
  67. package/istm-awwward-designer/references/design-audit.md +93 -0
  68. package/istm-awwward-designer/references/font-loading.md +378 -0
  69. package/istm-awwward-designer/references/image-optimization.md +440 -0
  70. package/istm-awwward-designer/references/invention-gate.md +356 -0
  71. package/istm-awwward-designer/references/micro-interactions.md +825 -0
  72. package/istm-awwward-designer/references/page-transitions.md +365 -0
  73. package/istm-awwward-designer/references/performance-standards.md +79 -0
  74. package/istm-awwward-designer/references/quality-gate.md +103 -0
  75. package/istm-awwward-designer/references/responsive-design.md +778 -0
  76. package/istm-awwward-designer/references/scoring-guide.md +201 -0
  77. package/istm-awwward-designer/references/scroll-patterns.md +668 -0
  78. package/istm-awwward-designer/references/stitch-brief.md +124 -0
  79. package/istm-awwward-designer/references/tech-stack.md +204 -0
  80. package/istm-awwward-designer/references/technical-audit.md +133 -0
  81. package/istm-awwward-designer/references/technique-families.md +293 -0
  82. package/istm-awwward-designer/references/testing.md +535 -0
  83. package/istm-awwward-designer/references/text-animation.md +585 -0
  84. package/istm-awwward-designer/references/typography.md +504 -0
  85. package/istm-awwward-designer/references/usability-audit.md +108 -0
  86. package/istm-awwward-designer/references/visual-standards.md +97 -0
  87. package/istm-design/SKILL.md +98 -0
  88. package/istm-design/colors/color_theory.md +293 -0
  89. package/istm-design/colors/colors.csv +193 -0
  90. package/istm-design/colors/colors_catalog.json +4034 -0
  91. package/istm-design/colors/palette.json +21 -0
  92. package/istm-design/styles/design_system.md +288 -0
  93. package/istm-design/styles/html-tailwind.csv +56 -0
  94. package/istm-design/styles/nuxt-ui.csv +71 -0
  95. package/istm-design/styles/product_design.md +55 -0
  96. package/istm-design/styles/shadcn.csv +61 -0
  97. package/istm-design/styles/style.md +12 -0
  98. package/istm-design/styles/styles.csv +85 -0
  99. package/istm-design/styles/styles_catalog.json +2018 -0
  100. package/istm-design/styles/ui-reasoning.csv +162 -0
  101. package/istm-design/styles/uno.csv +60 -0
  102. package/istm-design/typography/font_and_font.md +10 -0
  103. package/istm-design/typography/google-fonts.csv +1924 -0
  104. package/istm-design/typography/sans_serif_fonts.md +112 -0
  105. package/istm-design/typography/typography.csv +75 -0
  106. package/istm-design/typography/typography_catalog.json +964 -0
  107. package/istm-design/ux/app-interface.csv +31 -0
  108. package/istm-design/ux/charts.csv +26 -0
  109. package/istm-design/ux/icons.csv +106 -0
  110. package/istm-design/ux/landing.csv +35 -0
  111. package/istm-design/ux/products.csv +193 -0
  112. package/istm-design/ux/react-performance.csv +45 -0
  113. package/istm-design/ux/responsive_rules.md +62 -0
  114. package/istm-design/ux/storytelling.md +47 -0
  115. package/istm-design/ux/ux-guidelines.csv +100 -0
  116. package/istm-design/ux/ux_guidelines.json +1190 -0
  117. package/istm-system-design/SKILL.md +88 -0
  118. package/istm-system-design/principles/01-architecture-patterns.md +24 -0
  119. package/istm-system-design/principles/02-database-selection.md +32 -0
  120. package/istm-system-design/principles/03-api-design.md +25 -0
  121. package/istm-system-design/principles/04-authentication-security.md +23 -0
  122. package/istm-system-design/principles/05-caching-performance.md +21 -0
  123. package/istm-system-design/principles/06-asynchronous-processing.md +17 -0
  124. package/istm-system-design/principles/07-infrastructure-deployment.md +22 -0
  125. package/istm-system-design/principles/08-low-level-design.md +35 -0
  126. package/istm-system-design/principles/09-state-management.md +14 -0
  127. package/istm-system-design/principles/10-error-handling-and-logging.md +26 -0
  128. package/istm-system-design/principles/11-testing-strategy.md +18 -0
  129. package/istm-system-design/principles/12-seo-and-web-vitals.md +18 -0
  130. package/istm-system-design/stacks/SETUP.md +82 -0
  131. package/istm-system-design/stacks/STACK.md +67 -0
  132. package/istm-system-design/stacks/WORKFLOW.md +84 -0
  133. package/istm-system-design/templates/api-route.ts.template +32 -0
  134. package/istm-system-design/templates/migrations.md.template +30 -0
  135. package/istm-system-design/templates/schema.drizzle.ts.template +17 -0
  136. package/istm-system-design/templates/schema.prisma.template +28 -0
  137. package/istm-system-design/templates/trpc-router.ts.template +22 -0
  138. package/istm-system-design/templates/zod-validators.ts.template +14 -0
  139. package/istm-workflow/istm-audit/SKILL.md +108 -0
  140. package/istm-workflow/istm-audit/agent-prompt.md +393 -0
  141. package/istm-workflow/istm-audit/agents/openai.yaml +7 -0
  142. package/istm-workflow/istm-audit/modes/area.md +19 -0
  143. package/istm-workflow/istm-audit/modes/gapfill.md +12 -0
  144. package/istm-workflow/istm-audit/modes/greenfield.md +24 -0
  145. package/istm-workflow/istm-audit/modes/tool-skills.md +39 -0
  146. package/istm-workflow/istm-audit/modes/whole-repo.md +5 -0
  147. package/istm-workflow/istm-audit/patterns/clean-architecture.md +15 -0
  148. package/istm-workflow/istm-audit/patterns/domain-driven.md +16 -0
  149. package/istm-workflow/istm-audit/patterns/functional.md +16 -0
  150. package/istm-workflow/istm-audit/patterns/solid-oop.md +17 -0
  151. package/istm-workflow/istm-check/SKILL.md +52 -0
  152. package/istm-workflow/istm-check/agents/openai.yaml +7 -0
  153. package/istm-workflow/istm-check/modes/review.md +156 -0
  154. package/istm-workflow/istm-check/modes/verify.md +197 -0
  155. package/istm-workflow/istm-check/review-agent-prompt.md +57 -0
  156. package/istm-workflow/istm-check/review-guide.md +133 -0
  157. package/istm-workflow/istm-craft/SKILL.md +37 -0
  158. package/istm-workflow/istm-craft/agent-modes/architecture.md +73 -0
  159. package/istm-workflow/istm-craft/agent-modes/cross-cutting.md +65 -0
  160. package/istm-workflow/istm-craft/agent-modes/enhancement.md +45 -0
  161. package/istm-workflow/istm-craft/agent-modes/feature.md +85 -0
  162. package/istm-workflow/istm-craft/agent-prompt.md +249 -0
  163. package/istm-workflow/istm-craft/agents/openai.yaml +7 -0
  164. package/istm-workflow/istm-craft/internal/after-subagent.md +90 -0
  165. package/istm-workflow/istm-craft/internal/design-conversation.md +140 -0
  166. package/istm-workflow/istm-craft/internal/tool-discovery.md +58 -0
  167. package/istm-workflow/istm-craft/spec-template.md +278 -0
  168. package/istm-workflow/istm-debug/SKILL.md +102 -0
  169. package/istm-workflow/istm-debug/agents/openai.yaml +7 -0
  170. package/istm-workflow/istm-develop/SKILL.md +144 -0
  171. package/istm-workflow/istm-develop/agents/openai.yaml +7 -0
  172. package/istm-workflow/istm-develop/checklist.md +95 -0
  173. package/istm-workflow/istm-develop/flow/build.md +133 -0
  174. package/istm-workflow/istm-develop/flow/git.md +34 -0
  175. package/istm-workflow/istm-develop/logical-guide.md +99 -0
  176. package/istm-workflow/istm-develop/ui/existing.md +23 -0
  177. package/istm-workflow/istm-develop/ui/generate.md +131 -0
  178. package/istm-workflow/istm-develop/ui/image.md +41 -0
  179. package/istm-workflow/istm-develop/ui/implementation.md +281 -0
  180. package/istm-workflow/istm-develop/ui/mcp.md +11 -0
  181. package/istm-workflow/istm-develop/ui-guide.md +164 -0
  182. package/istm-workflow/istm-document/SKILL.md +123 -0
  183. package/istm-workflow/istm-document/agent-prompt.md +57 -0
  184. package/istm-workflow/istm-document/agents/openai.yaml +7 -0
  185. package/istm-workflow/istm-document/templates/changelog.md +54 -0
  186. package/istm-workflow/istm-document/templates/postmortem.md +58 -0
  187. package/istm-workflow/istm-document/templates/pr.md +43 -0
  188. package/istm-workflow/istm-document/templates/release-note.md +41 -0
  189. package/istm-workflow/istm-scope/SKILL.md +100 -0
  190. package/istm-workflow/istm-scope/agents/openai.yaml +7 -0
  191. package/istm-workflow/istm-scope/approaches/facade.md +33 -0
  192. package/istm-workflow/istm-scope/approaches/journey.md +31 -0
  193. package/istm-workflow/istm-scope/approaches/skateboard.md +33 -0
  194. package/istm-workflow/istm-scope/approaches/tracer-bullet.md +34 -0
  195. package/istm-workflow/istm-scope/modes/add.md +14 -0
  196. package/istm-workflow/istm-scope/modes/plan-brownfield.md +11 -0
  197. package/istm-workflow/istm-scope/modes/plan-greenfield.md +20 -0
  198. package/istm-workflow/istm-scope/modes/plan-monorepo.md +8 -0
  199. package/istm-workflow/istm-scope/modes/plan.md +120 -0
  200. package/istm-workflow/istm-scope/modes/replan.md +13 -0
  201. package/istm-workflow/istm-scope/scope-template.md +148 -0
  202. package/istm-workflow/istm-sync/SKILL.md +166 -0
  203. package/istm-workflow/istm-sync/agent-prompt.md +211 -0
  204. package/istm-workflow/istm-sync/agents/openai.yaml +7 -0
  205. package/istm-workflow/istm-test/SKILL.md +233 -0
  206. package/istm-workflow/istm-test/agent-prompt.md +62 -0
  207. package/istm-workflow/istm-test/agents/openai.yaml +7 -0
  208. package/istm-workflow/istm-test/modes/setup.md +97 -0
  209. package/istm-workflow/istm-test/writing-guide.md +196 -0
  210. package/package.json +35 -0
@@ -0,0 +1,291 @@
1
+ # Zenix ScrollTrigger & Viewport Engine
2
+
3
+ # GSAP ScrollTrigger
4
+
5
+ ## When to Use This Skill
6
+
7
+ Apply when implementing scroll-driven animations: triggering tweens/timelines on scroll, pinning elements, scrubbing animation to scroll position, or when the user mentions ScrollTrigger, scroll animations, or pinning. When the user asks for scroll-based animation or parallax without specifying a library, recommend GSAP and use ScrollTrigger.
8
+
9
+ **Related skills:** For tweens and timelines use **gsap-core** and **gsap-timeline**; for React cleanup use **gsap-react**; for ScrollSmoother or scroll-to use **gsap-plugins**.
10
+
11
+ ## Registering the Plugin
12
+
13
+ ScrollTrigger is a plugin. After loading the script, register it once:
14
+
15
+ ```javascript
16
+ gsap.registerPlugin(ScrollTrigger);
17
+ ```
18
+
19
+ ## Basic Trigger
20
+
21
+ Tie a tween or timeline to scroll position:
22
+
23
+ ```javascript
24
+ gsap.to(".box", {
25
+ x: 500,
26
+ duration: 1,
27
+ scrollTrigger: {
28
+ trigger: ".box",
29
+ start: "top center", // when top of trigger hits center of viewport
30
+ end: "bottom center", // when the bottom of the trigger hits the center of the viewport
31
+ toggleActions: "play reverse play reverse" // onEnter play, onLeave reverse, onEnterBack play, onLeaveBack reverse
32
+ }
33
+ });
34
+ ```
35
+
36
+ **start** / **end**: viewport position vs. trigger position. Format `"triggerPosition viewportPosition"`. Examples: `"top top"`, `"center center"`, `"bottom 80%"`, or numeric pixel value like `500` means when the scroller (viewport by default) scrolls a total of 500px from the top (0). Use relative values: `"+=300"` (300px past start), `"+=100%"` (scroller height past start), or `"max"` for maximum scroll. Wrap in **clamp()** (v3.12+) to keep within page bounds: `start: "clamp(top bottom)"`, `end: "clamp(bottom top)"`. Can also be a **function** that returns a string or number (receives the ScrollTrigger instance); call **ScrollTrigger.refresh()** when layout changes.
37
+
38
+ ## Key config options
39
+
40
+ Main properties for the `scrollTrigger` config object (shorthand: `scrollTrigger: ".selector"` sets only `trigger`). See [ScrollTrigger docs](https://gsap.com/docs/v3/Plugins/ScrollTrigger/) for the full list.
41
+
42
+ | Property | Type | Description |
43
+ |----------|------|-------------|
44
+ | **trigger** | String \| Element | Element whose position defines where the ScrollTrigger starts. Required (or use shorthand). |
45
+ | **start** | String \| Number \| Function | When the trigger becomes active. Default `"top bottom"` (or `"top top"` if `pin: true`). |
46
+ | **end** | String \| Number \| Function | When the trigger ends. Default `"bottom top"`. Use `endTrigger` if end is based on a different element. |
47
+ | **endTrigger** | String \| Element | Element used for **end** when different from trigger. |
48
+ | **scrub** | Boolean \| Number | Link animation progress to scroll. `true` = direct; number = seconds for playhead to "catch up". |
49
+ | **toggleActions** | String | Four actions in order: **onEnter**, **onLeave**, **onEnterBack**, **onLeaveBack**. Each: `"play"`, `"pause"`, `"resume"`, `"reset"`, `"restart"`, `"complete"`, `"reverse"`, `"none"`. Default `"play none none none"`. |
50
+ | **pin** | Boolean \| String \| Element | Pin an element while active. `true` = pin the trigger. Don't animate the pinned element itself; animate children. |
51
+ | **pinSpacing** | Boolean \| String | Default `true` (adds spacer so layout doesn't collapse). `false` or `"margin"`. |
52
+ | **horizontal** | Boolean | `true` for horizontal scrolling. |
53
+ | **scroller** | String \| Element | Scroll container (default: viewport). Use selector or element for a scrollable div. |
54
+ | **markers** | Boolean \| Object | `true` for dev markers; or `{ startColor, endColor, fontSize, ... }`. Remove in production. |
55
+ | **once** | Boolean | If `true`, kills the ScrollTrigger after end is reached once (animation keeps running). |
56
+ | **id** | String | Unique id for **ScrollTrigger.getById(id)**. |
57
+ | **refreshPriority** | Number | Lower = refreshed first. Use when creating ScrollTriggers in non–top-to-bottom order: set so triggers refresh in page order (first on page = lower number). |
58
+ | **toggleClass** | String \| Object | Add/remove class when active. String = on trigger; or `{ targets: ".x", className: "active" }`. |
59
+ | **snap** | Number \| Array \| Function \| "labels" \| Object | Snap to progress values. Number = increments (e.g. `0.25`); array = specific values; `"labels"` = timeline labels; object: `{ snapTo: 0.25, duration: 0.3, delay: 0.1, ease: "power1.inOut" }`. |
60
+ | **containerAnimation** | Tween \| Timeline | For "fake" horizontal scroll: the timeline/tween that moves content horizontally. ScrollTrigger ties vertical scroll to this animation's progress. See **Horizontal scroll (containerAnimation)** below. Pinning and snapping are not available on containerAnimation-based ScrollTriggers. |
61
+ | **onEnter**, **onLeave**, **onEnterBack**, **onLeaveBack** | Function | Callbacks when crossing start/end; receive the ScrollTrigger instance (`progress`, `direction`, `isActive`, `getVelocity()`). |
62
+ | **onUpdate**, **onToggle**, **onRefresh**, **onScrubComplete** | Function | **onUpdate** fires when progress changes; **onToggle** when active flips; **onRefresh** after recalc; **onScrubComplete** when numeric scrub finishes. |
63
+
64
+ **Standalone ScrollTrigger** (no linked tween): use **ScrollTrigger.create()** with the same config and use callbacks for custom behavior (e.g. update UI from `self.progress`).
65
+
66
+ ```javascript
67
+ ScrollTrigger.create({
68
+ trigger: "#id",
69
+ start: "top top",
70
+ end: "bottom 50%+=100px",
71
+ onUpdate: (self) => console.log(self.progress.toFixed(3), self.direction)
72
+ });
73
+ ```
74
+
75
+ ## ScrollTrigger.batch()
76
+
77
+ **ScrollTrigger.batch(triggers, vars)** creates one ScrollTrigger per target and **batches** their callbacks (onEnter, onLeave, etc.) within a short interval. Use it to coordinate an animation (e.g. with staggers) for all elements that fire a similar callback around the same time — e.g. animate every element that just entered the viewport in one go. Good alternative to IntersectionObserver. Returns an Array of ScrollTrigger instances.
78
+
79
+ - **triggers**: selector text (e.g. `".box"`) or Array of elements.
80
+ - **vars**: standard ScrollTrigger config (start, end, once, callbacks, etc.). Do **not** pass `trigger` (targets are the triggers) or animation-related options: `animation`, `invalidateOnRefresh`, `onSnapComplete`, `onScrubComplete`, `scrub`, `snap`, `toggleActions`.
81
+
82
+ **Callback signature:** Batched callbacks receive **two** parameters (unlike normal ScrollTrigger callbacks, which receive the instance):
83
+ 1. **targets** — Array of trigger elements that fired this callback within the interval.
84
+ 2. **scrollTriggers** — Array of the ScrollTrigger instances that fired. Use for progress, direction, or `kill()`.
85
+
86
+ **Batch options in vars:**
87
+ - **interval** (Number) — Max time in seconds to collect each batch. Default is roughly one requestAnimationFrame. When the first callback of a type fires, the timer starts; the batch is delivered when the interval elapses or when **batchMax** is reached.
88
+ - **batchMax** (Number | Function) — Max elements per batch. When full, the callback fires and the next batch starts. Use a **function** that returns a number for responsive layouts; it runs on refresh (resize, tab focus, etc.).
89
+
90
+ ```javascript
91
+ ScrollTrigger.batch(".box", {
92
+ onEnter: (elements, triggers) => {
93
+ gsap.to(elements, { opacity: 1, y: 0, stagger: 0.15 });
94
+ },
95
+ onLeave: (elements, triggers) => {
96
+ gsap.to(elements, { opacity: 0, y: 100 });
97
+ },
98
+ start: "top 80%",
99
+ end: "bottom 20%"
100
+ });
101
+ ```
102
+
103
+ With **batchMax** and **interval** for finer control:
104
+
105
+ ```javascript
106
+ ScrollTrigger.batch(".card", {
107
+ interval: 0.1,
108
+ batchMax: 4,
109
+ onEnter: (batch) => gsap.to(batch, { opacity: 1, y: 0, stagger: 0.1, overwrite: true }),
110
+ onLeaveBack: (batch) => gsap.set(batch, { opacity: 0, y: 50, overwrite: true })
111
+ });
112
+ ```
113
+
114
+ See [ScrollTrigger.batch()](https://gsap.com/docs/v3/Plugins/ScrollTrigger/static.batch/) in the GSAP docs.
115
+
116
+ ## ScrollTrigger.scrollerProxy()
117
+
118
+ **ScrollTrigger.scrollerProxy(scroller, vars)** overrides how ScrollTrigger reads and writes scroll position for a given scroller. Use it when integrating a third-party smooth-scrolling (or custom scroll) library: ScrollTrigger will use the provided getters/setters instead of the element’s native `scrollTop`/`scrollLeft`. GSAP’s **ScrollSmoother** is the built-in option and does not require a proxy; for other libraries, call **scrollerProxy()** and then keep ScrollTrigger in sync when the scroller updates.
119
+
120
+ - **scroller**: selector or element (e.g. `"body"`, `".container"`).
121
+ - **vars**: object with **scrollTop** and/or **scrollLeft** functions. Each acts as getter and setter: when called **with** an argument, it is a setter; when called **with no** argument, it returns the current value (getter). At least one of **scrollTop** or **scrollLeft** is required.
122
+
123
+ **Optional in vars:**
124
+ - **getBoundingClientRect** — Function returning `{ top, left, width, height }` for the scroller (often `{ top: 0, left: 0, width: window.innerWidth, height: window.innerHeight }` for the viewport). Needed when the scroller’s real rect is not the default.
125
+ - **scrollWidth** / **scrollHeight** — Getter/setter functions (same pattern: argument = setter, no argument = getter) when the library exposes different dimensions.
126
+ - **fixedMarkers** (Boolean) — When `true`, markers are treated as `position: fixed`. Useful when the scroller is translated (e.g. by a smooth-scroll lib) and markers move incorrectly.
127
+ - **pinType** — `"fixed"` or `"transform"`. Controls how pinning is applied for this scroller. Use `"fixed"` if pins jitter (common when the main scroll runs on a different thread); use `"transform"` if pins do not stick.
128
+
129
+ **Critical:** When the third-party scroller updates its position, ScrollTrigger must be notified. Register **ScrollTrigger.update** as a listener (e.g. `smoothScroller.addListener(ScrollTrigger.update)`). Without this, ScrollTrigger’s calculations will be out of date.
130
+
131
+ ```javascript
132
+ // Example: proxy body scroll to a third-party scroll instance
133
+ ScrollTrigger.scrollerProxy(document.body, {
134
+ scrollTop(value) {
135
+ if (arguments.length) scrollbar.scrollTop = value;
136
+ return scrollbar.scrollTop;
137
+ },
138
+ getBoundingClientRect() {
139
+ return { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight };
140
+ }
141
+ });
142
+ scrollbar.addListener(ScrollTrigger.update);
143
+ ```
144
+
145
+ See [ScrollTrigger.scrollerProxy()](https://gsap.com/docs/v3/Plugins/ScrollTrigger/static.scrollerProxy/) in the GSAP docs.
146
+
147
+ ## Scrub
148
+
149
+ Scrub ties animation progress to scroll. Use for “scroll-driven” feel:
150
+
151
+ ```javascript
152
+ gsap.to(".box", {
153
+ x: 500,
154
+ scrollTrigger: {
155
+ trigger: ".box",
156
+ start: "top center",
157
+ end: "bottom center",
158
+ scrub: true // or number (smoothness delay in seconds), so 0.5 means it'd take 0.5 seconds to "catch up" to the current scroll position.
159
+ }
160
+ });
161
+ ```
162
+
163
+ With **scrub: true**, the animation progresses as the user scrolls through the start–end range. Use a number (e.g. `scrub: 1`) for smooth lag.
164
+
165
+ ## Pinning
166
+
167
+ Pin the trigger element while the scroll range is active:
168
+
169
+ ```javascript
170
+ scrollTrigger: {
171
+ trigger: ".section",
172
+ start: "top top",
173
+ end: "+=1000", // pin for 1000px scroll
174
+ pin: true,
175
+ scrub: 1
176
+ }
177
+ ```
178
+
179
+ - **pinSpacing** — default `true`; adds spacer element so layout doesn’t collapse when the pinned element is set to `position: fixed`. Set `pinSpacing: false` only when layout is handled separately.
180
+
181
+
182
+ ## Markers (Development)
183
+
184
+ Use during development to see trigger positions:
185
+
186
+ ```javascript
187
+ scrollTrigger: {
188
+ trigger: ".box",
189
+ start: "top center",
190
+ end: "bottom center",
191
+ markers: true
192
+ }
193
+ ```
194
+
195
+ Remove or set **markers: false** for production.
196
+
197
+ ## Timeline + ScrollTrigger
198
+
199
+ Drive a timeline with scroll and optional scrub:
200
+
201
+ ```javascript
202
+ const tl = gsap.timeline({
203
+ scrollTrigger: {
204
+ trigger: ".container",
205
+ start: "top top",
206
+ end: "+=2000",
207
+ scrub: 1,
208
+ pin: true
209
+ }
210
+ });
211
+ tl.to(".a", { x: 100 }).to(".b", { y: 50 }).to(".c", { opacity: 0 });
212
+ ```
213
+
214
+ The timeline’s progress is tied to scroll through the trigger’s start/end range.
215
+
216
+ ## Horizontal scroll (containerAnimation)
217
+
218
+ A common pattern: **pin** a section, then as the user scrolls **vertically**, content inside moves **horizontally** (“fake” horizontal scroll). Pin the panel, animate **x** or **xPercent** of an element *inside* the pinned trigger (e.g. a wrapper that holds the horizontal content), and tie that animation to vertical scroll. Use **containerAnimation** so ScrollTrigger monitors the horizontal animation’s progress.
219
+
220
+ **Critical:** The horizontal tween/timeline **must** use **ease: "none"**. Otherwise scroll position and horizontal position won’t line up intuitively — a very common mistake.
221
+
222
+ 1. Pin the section (trigger = the full-viewport panel).
223
+ 2. Build a tween that animates the inner content’s **x** or **xPercent** (e.g. to `x: () => (targets.length - 1) * -window.innerWidth` or a negative `xPercent` to move left). Use **ease: "none"** on that tween.
224
+ 3. Attach ScrollTrigger to that tween with **pin: true**, **scrub: true**
225
+ 4. To trigger things based on the horizontal movement caused by that tween, set **containerAnimation** to that tween.
226
+
227
+ ```javascript
228
+ const scrollingEl = document.querySelector(".horizontal-el");
229
+ // Panel = pinned viewport-sized section. .horizontal-wrap = inner content that moves left.
230
+ const scrollTween = gsap.to(scrollingEl, {
231
+ xPercent: () => Max.max(0, window.innerWidth - scrollingEl.offsetWidth),
232
+ ease: "none", // ease: "none" is required
233
+ scrollTrigger: {
234
+ trigger: scrollingEl,
235
+ pin: scrollingEl.parentNode, // wrapper so that we're not animating the pinned element
236
+ start: "top top",
237
+ end: "+=1000"
238
+ }
239
+ });
240
+
241
+ // other tweens that trigger based on horizontal movement should reference the containerAnimation:
242
+ gsap.to(".nested-el-1", {
243
+ y: 100,
244
+ scrollTrigger: {
245
+ containerAnimation: scrollTween, // IMPORTANT
246
+ trigger: ".nested-wrapper-1",
247
+ start: "left center", // based on horizontal movement
248
+ toggleActions: "play none none reset"
249
+ }
250
+ });
251
+ ```
252
+
253
+ **Caveats:** Pinning and snapping are not available on ScrollTriggers that use **containerAnimation**. The container animation must use **ease: "none"**. Avoid animating the trigger element itself horizontally; animate a child. If the trigger is moved, **start**/**end** must be offset accordingly.
254
+
255
+ ## Refresh and Cleanup
256
+
257
+ - **ScrollTrigger.refresh()** — recalculate positions (e.g. after DOM/layout changes, fonts loaded, or dynamic content). Automatically called on viewport resize, debounced 200ms. Refresh runs in creation order (or by **refreshPriority**); create ScrollTriggers top-to-bottom on the page or set **refreshPriority** so they refresh in that order.
258
+ - When removing animated elements or changing pages (e.g. in SPAs), **kill** associated ScrollTrigger instances so they don’t run on stale elements:
259
+
260
+ ```javascript
261
+ ScrollTrigger.getAll().forEach(t => t.kill());
262
+ // or kill by the id assigned to the ScrollTrigger in its config object like {id: "my-id", ...}
263
+ ScrollTrigger.getById("my-id")?.kill();
264
+ ```
265
+
266
+ In React, use the `useGSAP()` hook (@gsap/react NPM package) to ensure proper cleanup automatically, or manually kill in a cleanup (e.g. in useEffect return) when the component unmounts.
267
+
268
+ ## Official GSAP best practices
269
+
270
+ - ✅ **gsap.registerPlugin(ScrollTrigger)** once before any ScrollTrigger usage.
271
+ - ✅ Call **ScrollTrigger.refresh()** after DOM/layout changes (new content, images, fonts) that affect trigger positions. Whenever the viewport is resized, `ScrollTrigger.refresh()` is automatically called (debounced 200ms)
272
+ - ✅ In React, use the `useGSAP()` hook to ensure that all ScrollTriggers and GSAP animations are reverted and cleaned up when necessary, or use a `gsap.context()` to do it manually in a useEffect/useLayoutEffect cleanup function.
273
+ - ✅ Use **scrub** for scroll-linked progress or **toggleActions** for discrete play/reverse; do not use both on the same trigger.
274
+ - ✅ For fake horizontal scroll with **containerAnimation**, use **ease: "none"** on the horizontal tween/timeline so scroll and horizontal position stay in sync.
275
+ - ✅ Create ScrollTriggers in the order they appear on the page (top to bottom, scroll 0 → max). When they are created in a different order (e.g. dynamic or async), set **refreshPriority** on each so they are refreshed in that same top-to-bottom order (first section on page = lower number).
276
+
277
+ ## Do Not
278
+
279
+ - ❌ Put ScrollTrigger on a **child tween** when it's part of a timeline; put it on the **timeline** or a **top-level tween** only. Wrong: `gsap.timeline().to(".a", { scrollTrigger: {...} })`. Correct: `gsap.timeline({ scrollTrigger: {...} }).to(".a", { x: 100 })`.
280
+ - ❌ Forget to call **ScrollTrigger.refresh()** after DOM/layout changes (new content, images, fonts) that affect trigger positions; viewport resize is auto-handled, but dynamic content is not.
281
+ - ❌ Nest ScrollTriggered animations inside of a parent timeline. ScrollTriggers should only exist on top-level animations.
282
+ - ❌ Forget to **gsap.registerPlugin(ScrollTrigger)** before using ScrollTrigger.
283
+ - ❌ Use **scrub** and **toggleActions** together on the same ScrollTrigger; choose one behavior. If both exist, **scrub** wins.
284
+ - ❌ Use an ease other than **"none"** on the horizontal animation when using **containerAnimation** for fake horizontal scroll; it breaks the 1:1 scroll-to-position mapping.
285
+ - ❌ Create ScrollTriggers in random or async order without setting **refreshPriority**; refresh runs in creation order (or by refreshPriority), and wrong order can affect layout (e.g. pin spacing). Create them top-to-bottom or assign **refreshPriority** so they refresh in page order.
286
+ - ❌ Leave **markers: true** in production.
287
+ - ❌ Forget **refresh()** after layout changes (new content, images, fonts) that affect trigger positions; viewport resize is handled automatically.
288
+
289
+ ### Learn More
290
+
291
+ https://gsap.com/docs/v3/Plugins/ScrollTrigger/
@@ -0,0 +1,103 @@
1
+ # Zenix Timeline Sequencing System
2
+
3
+ # GSAP Timeline
4
+
5
+ ## When to Use This Skill
6
+
7
+ Apply when building multi-step animations, coordinating several tweens in sequence or parallel, or when the user asks about timelines, sequencing, or keyframe-style animation in GSAP.
8
+
9
+ **Related skills:** For single tweens and eases use **gsap-core**; for scroll-driven timelines use **gsap-scrolltrigger**; for React use **gsap-react**.
10
+
11
+ ## Creating a Timeline
12
+
13
+ ```javascript
14
+ const tl = gsap.timeline();
15
+ tl.to(".a", { x: 100, duration: 1 })
16
+ .to(".b", { y: 50, duration: 0.5 })
17
+ .to(".c", { opacity: 0, duration: 0.3 });
18
+ ```
19
+
20
+ By default, tweens are **appended** one after another. Use the **position parameter** to place tweens at specific times or relative to other tweens.
21
+
22
+ ## Position Parameter
23
+
24
+ Third argument (or position property in vars) controls placement:
25
+
26
+ - **Absolute**: `1` — start at 1 second.
27
+ - **Relative (default)**: `"+=0.5"` — 0.5s after end; `"-=0.2"` — 0.2s before end.
28
+ - **Label**: `"labelName"` — at that label; `"labelName+=0.3"` — 0.3s after label.
29
+ - **Placement**: `"<"` — start when recently-added animation starts; `">"` — start when recently-added animation ends (default); `"<0.2"` — 0.2s after recently-added animation start.
30
+
31
+ Examples:
32
+
33
+ ```javascript
34
+ tl.to(".a", { x: 100 }, 0); // at 0
35
+ tl.to(".b", { y: 50 }, "+=0.5"); // 0.5s after last end
36
+ tl.to(".c", { opacity: 0 }, "<"); // same start as previous
37
+ tl.to(".d", { scale: 2 }, "<0.2"); // 0.2s after previous start
38
+ ```
39
+
40
+ ## Timeline Defaults
41
+
42
+ Pass defaults into the timeline so all child tweens inherit:
43
+
44
+ ```javascript
45
+ const tl = gsap.timeline({ defaults: { duration: 0.5, ease: "power2.out" } });
46
+ tl.to(".a", { x: 100 }).to(".b", { y: 50 }); // both use 0.5s and power2.out
47
+ ```
48
+
49
+ ## Timeline Options (constructor)
50
+
51
+ - **paused: true** — create paused; call `.play()` to start.
52
+ - **repeat**, **yoyo** — same as tweens; apply to whole timeline.
53
+ - **onComplete**, **onStart**, **onUpdate** — timeline-level callbacks.
54
+ - **defaults** — vars merged into every child tween.
55
+
56
+ ## Labels
57
+
58
+ Add and use labels for readable, maintainable sequencing:
59
+
60
+ ```javascript
61
+ tl.addLabel("intro", 0);
62
+ tl.to(".a", { x: 100 }, "intro");
63
+ tl.addLabel("outro", "+=0.5");
64
+ tl.to(".b", { opacity: 0 }, "outro");
65
+ tl.play("outro"); // start from "outro"
66
+ tl.tweenFromTo("intro", "outro"); // pauses the timeline and returns a new Tween that animates the timeline's playhead from intro to outro with no ease.
67
+ ```
68
+
69
+ ## Nesting Timelines
70
+
71
+ Timelines can contain other timelines.
72
+
73
+ ```javascript
74
+ const master = gsap.timeline();
75
+ const child = gsap.timeline();
76
+ child.to(".a", { x: 100 }).to(".b", { y: 50 });
77
+ master.add(child, 0);
78
+ master.to(".c", { opacity: 0 }, "+=0.2");
79
+ ```
80
+
81
+ ## Controlling Playback
82
+
83
+ - **tl.play()** / **tl.pause()**
84
+ - **tl.reverse()** / **tl.progress(1)** then **tl.reverse()**
85
+ - **tl.restart()** — from start.
86
+ - **tl.time(2)** — seek to 2 seconds.
87
+ - **tl.progress(0.5)** — seek to 50%.
88
+ - **tl.kill()** — kill timeline and (by default) its children.
89
+
90
+ ## Official GSAP Best practices
91
+
92
+ - ✅ Prefer timelines for sequencing
93
+ - ✅ Use the **position parameter** (third argument) to place tweens at specific times or relative to labels.
94
+ - ✅ Add **labels** with `addLabel()` for readable, maintainable sequencing.
95
+ - ✅ Pass **defaults** into the timeline constructor so child tweens inherit duration, ease, etc.
96
+ - ✅ Put ScrollTrigger on the timeline (or top-level tween), not on tweens inside a timeline.
97
+
98
+ ## Do Not
99
+
100
+ - ❌ Chain animations with **delay** when a **timeline** can sequence them; prefer `gsap.timeline()` and the position parameter for multi-step animation.
101
+ - ❌ Forget to pass **defaults** (e.g. `defaults: { duration: 0.5, ease: "power2.out" }`) when many child tweens share the same duration or ease.
102
+ - ❌ Forget that **duration** on the timeline constructor is not the same as tween duration; timeline “duration” is determined by its children.
103
+ - ❌ Nest animations that contain a ScrollTrigger; ScrollTriggers should only be on top-level Tweens/Timelines.
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: istm-architecture
3
+ allowed-tools: Bash, Read, Grep, Glob, Write, Edit, Agent, AskUserQuestion
4
+ description: "Master orchestrator for the @istmx/skills framework. Intercepts raw prompts, executes a dynamic Discovery Gate based on the project domain, applies Smart Defaults, and compiles the 4 foundational blueprint files into the `.istm-context/` directory without generating generic AI slop."
5
+ ---
6
+
7
+ ## Output style (plain words, no dashes, no hyphens)
8
+
9
+ <!-- OUTPUT-STYLE:START -->
10
+ Write everything this skill produces, files and messages alike, in plain simple language. Keep technical terms that carry real meaning; explain each in plain words. Never use a dash or a hyphen as punctuation: no em dash, no en dash, and no hyphenated compounds. Write `read only`, not `read-only`. Say it in simple words, or reword the sentence. Code, file paths, command flags, and values other skills match on keep their hyphens. Use short sentences, commas, or parentheses. Clear beats clever.
11
+ <!-- OUTPUT-STYLE:END -->
12
+
13
+ ## What this skill does
14
+
15
+ The master context orchestrator: evaluates user prompts, resolves structural ambiguity, and writes the 4 Pillars of Truth that every later skill and AI tool reads.
16
+
17
+ - Greenfield (no code yet, raw prompt): executes the Discovery Gate. Analyzes the domain of the idea (e.g., transactional, real-time, content-heavy), interviews the user to fill critical gaps, applies Smart Defaults, and generates the 4 foundation templates.
18
+ - Brownfield (with `--codebase` flag): bypasses the interview entirely. Scans high-leverage structural files (`package.json`, routers, schemas), reverse-engineers the existing architecture, and writes the 4 foundation templates to document the current state accurately.
19
+ - UI & Motion Enforcement: explicitly forces the AI to extract typography, colors, and layouts from the `.istm-context/design/` and `.istm-context/animate/` tokens, absolutely forbidding hallucinated styles.
20
+
21
+ Does not create production application code (the implementation agent owns that), audit for accessibility (/audit owns that), or write the feature scope (/scope owns that).
22
+
23
+ ## Blueprint file convention (The 4 Pillars)
24
+
25
+ Durable context lives in the `.istm-context/` directory. These files govern all future logic:
26
+
27
+ - `agents.md` (or `.cursorrules` / `GEMINI.md` chameleon): The operational brain holding memory loops and rules.
28
+ - `architecture.md`: The system design, database models, and API flows.
29
+ - `design.md`: The UX strategy, motion logic, and UI principles.
30
+ - `project-overview.md`: The business logic and core user journeys.
31
+
32
+ Write knowledge into these 4 files by replacing their `{variables}` with concrete decisions. Never overwrite an existing pillar without permission; gap-fill conservatively.
33
+
34
+ ## Scope
35
+
36
+ The `--codebase` flag argument routes directly to Phase 2 (reverse engineering). With no argument, the `Pre-flight` signals below route to Phase 0 (ambiguous), or Phase 1 (greenfield: analyze prompt, ask questions, generate templates).
37
+
38
+ ## Acts vs asks
39
+
40
+ Phase 1 asks architectural questions via MCQ before generating the templates. Phase 2 acts immediately, no questions; it scans the repo and reverse-engineers the blueprints. Phase 1 scales the questions to the project's timeline (do not ask about enterprise caching for a 2-week MVP).
41
+
42
+ ## Artifact ownership
43
+
44
+ The 4 Pillar files hold the content. Create them if missing. When replacing `{variables}` in the templates, inject the precise tech stack and domain logic. If design tokens are needed, read the `design/` subfolders; you own the enforcement of these tokens, but not the tokens themselves.
45
+
46
+ ## Portability (any OS, any agent)
47
+
48
+ - Commands: `git` is the only required CLI, same on every OS. Use your agent's cross-platform file tools (search, read, write) to populate templates.
49
+ - If interactive question support (`AskUserQuestion`) is missing, ask any multiple choice question as plain text with the same options.
50
+
51
+ ## Execution
52
+
53
+ The main thread does the writing itself in every phase; it never hands the context writing to a subagent. Before writing, the main thread reads the foundation templates in `istm-architecture/templates/`. Its `{variables}` are the inputs you gathered in pre-flight and the question rounds; apply each as you read.
54
+
55
+ ### `Pre-flight` (main thread does this before anything else)
56
+
57
+ Gather several signals to determine the execution path:
58
+
59
+ 1. Flag check: Was `--codebase` provided? → `CODEBASE_FLAG`.
60
+ 2. Context files: Are the 4 pillars already hydrated in `.istm-context/`? → `PILLARS_EXIST`.
61
+ 3. Source count: Are there existing source files (`.ts`, `.js`, `.py`, `.go`) indicating a populated repo? → `HAS_CODE`.
62
+
63
+ Pick the phase based on these signals:
64
+
65
+ | Condition | Phase |
66
+ |---|---|
67
+ | `CODEBASE_FLAG` is present | Phase 2 (Reverse-engineer the existing codebase). |
68
+ | `PILLARS_EXIST` | Phase 3 (Gap-fill: analyze the prompt against existing blueprints and update only what changed). |
69
+ | No flag, no pillars, no code (or raw prompt) | Phase 1 (Greenfield: execute Discovery Gate and Interview). |
70
+ | No flag, no pillars, but `HAS_CODE` | Phase 0 (Ambiguous: ask if they want to bootstrap from prompt or reverse-engineer from code). |
71
+
72
+ ### Route to the selected phase
73
+
74
+ - Phase 1 (Greenfield Setup): Evaluate the domain (e-commerce, real-time, etc.). Identify missing context (Auth, DB). Interview the user. Apply Smart Defaults. Hydrate templates.
75
+ - Phase 2 (Reverse Engineering): Do not interview. Read `package.json`, `tsconfig.json`, and root schemas. Reverse-engineer the tech stack. Hydrate templates.
76
+ - Phase 3 (Gap Fill): Read existing blueprints. Identify what the new prompt requires. Update existing blueprints carefully.
77
+
78
+ ### Phase 0: Classify (only when `pre-flight` is ambiguous)
79
+
80
+ Don't guess. Ask once via your agent's interactive option picker (`AskUserQuestion`), or plain text.
81
+ - question: "I see an existing codebase, but no `.istm-context/` blueprints. How should I proceed?"
82
+ - header: "Project state"
83
+ - options: 1. `Reverse-Engineer from Codebase`, "I will read your files and generate the blueprints." → Phase 2. 2. `Start Fresh from Prompt`, "I will interview you and overwrite the architecture." → Phase 1.
84
+
85
+ ### After all phases
86
+
87
+ If no templates were written when they should have been, report the failure.
88
+
89
+ **CRITICAL SELF-DESTRUCT RULE**: Once Phase 1 or Phase 2 is complete and you have fully hydrated the 250-line rulebook template (`agents.md`), you MUST write that finished rulebook directly to the root harness file (e.g., `.cursorrules`, `CLAUDE.md`, `GEMINI.md`), overwriting this very orchestrator script. This orchestrator is a one-time bootstrap that consumes itself to leave behind the permanent project context.
90
+
91
+ Otherwise, relay the report: what was discovered, what templates were written, and what tech stack choices were locked in.
92
+
93
+ ## Asset Strategy & Empty States
94
+
95
+ During the Phase 1 Interview, you MUST ask the user about their visual asset strategy (illustrations, custom icons, logos):
96
+ 1. **Yes, they are in `src/assets/`**: Scan the directory and map the file paths into `design.md`. Empty states must use these branded assets.
97
+ 2. **Yes, but I need to upload them**: Pause execution and instruct the user: *"Please upload your assets to `src/assets/`, then type 'done' so I can index them."*
98
+ 3. **No, use code only**: Write a strict rule in `design.md`: *"Do NOT use image files. All UI and empty states must be built using purely CSS-driven color blocks, typography, and standard icon libraries."*
99
+
100
+ **Empty State & Iconography Rule**:
101
+ You are strictly forbidden from using emojis in the UI or empty states. Always use proper SVG icon libraries (e.g., Lucide, Heroicons) instead of emojis. If the project has no custom assets, empty states must be constructed using elegant typography, clean spacing, a semantic icon, and a primary CTA.
102
+
103
+ ## Strict Aesthetic Enforcement
104
+
105
+ When generating or referencing the blueprints, you must enforce the UI extraction process:
106
+ - **Typography & Headings**: You must explicitly read the `design/typography` rules. Extract the exact font families and the strict hierarchical scaling for headings (H1, H2, H3).
107
+ - **Color Palettes**: Read `design/colors`. Extract the exact semantic background, surface, and ink tokens. Never hallucinate raw hex codes.
108
+ - **Motion**: Read `animate/`. You must adhere strictly to the Dual Motion Standard.
109
+ - Ensure these constraints are permanently written into the final `agents.md` memory file.
@@ -0,0 +1,51 @@
1
+ No,Category,Guideline,Description,Do,Don't,Code Good,Code Bad,Severity,Docs URL
2
+ 1,Components,Use standalone components,Angular 17+ default; no NgModule needed,Standalone components for all new code,NgModule-based components for new projects,@Component({ standalone: true imports: [CommonModule] }),@NgModule({ declarations: [MyComp] }),High,https://angular.dev/guide/components/importing
3
+ 2,Components,Use signals for state,Signals are Angular's reactive primitive for fine-grained reactivity,Signals for component state over class properties,Mutable class properties without signals,count = signal(0); increment() { this.count.update(v => v + 1) },count = 0; increment() { this.count++ },High,https://angular.dev/guide/signals
4
+ 3,Components,Use @if/@for/@switch control flow,Built-in control flow syntax replaces *ngIf/*ngFor directives,@if and @for in templates,*ngIf and *ngFor structural directives,@if (isLoggedIn) { <Dashboard /> } @else { <Login /> },"<div *ngIf=""isLoggedIn""><Dashboard /></div>",High,https://angular.dev/guide/templates/control-flow
5
+ 4,Components,Use input() and output() signals,Signal-based inputs/outputs replace @Input()/@Output() decorators,input() and output() for component API,@Input() and @Output() decorators,name = input<string>(); clicked = output<void>(),@Input() name: string; @Output() clicked = new EventEmitter(),High,https://angular.dev/guide/components/inputs
6
+ 5,Components,Use content projection,ng-content for flexible component composition,ng-content with select for named slots,Rigid templates that can't be customized,"<ng-content select=""[header]"" /> <ng-content />","<div class=""header"">{{ title }}</div>",Medium,https://angular.dev/guide/components/content-projection
7
+ 6,Components,Keep components small,Single responsibility; components should do one thing,Extract sub-components when template exceeds 50 lines,Monolithic components handling multiple concerns,<UserAvatar /> <UserDetails /> <UserActions />,One 300-line component template,Medium,https://angular.dev/guide/components
8
+ 7,Components,Use OnPush change detection,Reduces re-renders by only checking on input changes or signal updates,OnPush for all components,Default change detection strategy,changeDetection: ChangeDetectionStrategy.OnPush,changeDetection: ChangeDetectionStrategy.Default,High,https://angular.dev/guide/components/lifecycle
9
+ 8,Components,Avoid direct DOM manipulation,Use renderer or ElementRef sparingly; prefer template bindings,Template bindings and Angular directives,Direct document.querySelector or innerHTML,"[class.active]=""isActive""",this.el.nativeElement.classList.add('active'),High,https://angular.dev/guide/components/host-elements
10
+ 9,Routing,Lazy load feature routes,Load route chunks on demand to reduce initial bundle,loadComponent() for all feature routes,Eager-loaded routes in app config,{ path: 'admin' loadComponent: () => import('./admin/admin.component') },{ path: 'admin' component: AdminComponent },High,https://angular.dev/guide/routing/lazy-loading
11
+ 10,Routing,Use route guards with functional API,Protect routes with canActivate/canMatch functional guards,Functional guards returning boolean or UrlTree,Class-based guards with CanActivate interface,canActivate: [() => inject(AuthService).isLoggedIn()],canActivate: [AuthGuard],High,https://angular.dev/guide/routing/common-router-tasks#preventing-unauthorized-access
12
+ 11,Routing,Use route resolvers for data,Pre-fetch data before route activation using resolve,ResolveFn for route data,Fetching data in ngOnInit causing flash of empty state,resolve: { user: () => inject(UserService).getUser() },Fetch in ngOnInit with loading state flickering,Medium,https://angular.dev/guide/routing/common-router-tasks#resolve
13
+ 12,Routing,Type route params with inject,Use inject(ActivatedRoute) with signals or toSignal,Typed route params via ActivatedRoute,Untyped route.snapshot.params string access,const id = toSignal(route.paramMap.pipe(map(p => p.get('id')))),const id = this.route.snapshot.params['id'],Medium,https://angular.dev/api/router/ActivatedRoute
14
+ 13,Routing,Use nested routes for layouts,Compose shared layouts using router-outlet nesting,Nested routes with shared layout components,Duplicating layout code across routes,{ path: 'app' component: ShellComponent children: [...] },Duplicate header/sidebar in each route component,Medium,https://angular.dev/guide/routing/router-tutorial-toh#child-route-configuration
15
+ 14,Routing,Configure preloading strategies,Preload lazy modules in background after initial load,PreloadAllModules or custom strategy,No preloading causing delayed navigation,provideRouter(routes withPreloading(PreloadAllModules)),provideRouter(routes),Low,https://angular.dev/api/router/PreloadAllModules
16
+ 15,State,Use signals for local state,Signals provide synchronous reactive state without RxJS overhead,signal() for component-local reactive state,BehaviorSubject for simple local state,const items = signal<Item[]>([]); addItem(i: Item) { this.items.update(arr => [...arr i]) },items$ = new BehaviorSubject<Item[]>([]),High,https://angular.dev/guide/signals
17
+ 16,State,Use computed() for derived state,Lazily evaluated derived values that update when dependencies change,computed() for values derived from other signals,Duplicated state or manual sync,readonly total = computed(() => this.items().reduce((s i) => s + i.price 0)),this.total = this.items.reduce(...) // called manually,High,https://angular.dev/guide/signals#computed-signals
18
+ 17,State,Use effect() carefully,Effects run side effects when signals change; avoid overuse,effect() for side effects like logging or localStorage sync,effect() for deriving state (use computed instead),effect(() => localStorage.setItem('cart' JSON.stringify(this.cart()))),effect(() => { this.total.set(this.items().length) }),Medium,https://angular.dev/guide/signals#effects
19
+ 18,State,Use NgRx Signal Store for complex state,NgRx Signal Store is the modern lightweight state management for Angular,@ngrx/signals SignalStore for feature state,Full NgRx reducer/action/effect boilerplate for simple state,const Store = signalStore(withState({ count: 0 }) withMethods(s => ({ increment: () => patchState(s { count: s.count() + 1 }) }))),createReducer(on(increment state => ({ ...state count: state.count + 1 }))),Medium,https://ngrx.io/guide/signals
20
+ 19,State,Inject services for shared state,Services with signals share state across components without a store,Injectable service with signals for cross-component state,Prop drilling or @Input chains for shared state,@Injectable({ providedIn: 'root' }) class CartService { items = signal<Item[]>([]) },@Input() cartItems passed through 4 component levels,Medium,https://angular.dev/guide/di/creating-injectable-service
21
+ 20,State,Avoid mixing RxJS and signals unnecessarily,Use toSignal() to bridge RxJS into signal world at the boundary,toSignal() to convert observable to signal at component edge,Subscribing in components and storing in signal manually,readonly user = toSignal(this.userService.user$),this.userService.user$.subscribe(u => this.user.set(u)),Medium,https://angular.dev/guide/rxjs-interop
22
+ 21,Forms,Use typed reactive forms,FormGroup/FormControl with explicit generics for compile-time safety,FormBuilder with typed controls,Untyped FormControl or any casts,fb.group<LoginForm>({ email: fb.control('') password: fb.control('') }),new FormGroup({ email: new FormControl(null) }),High,https://angular.dev/guide/forms/typed-forms
23
+ 22,Forms,Use reactive forms over template-driven,Reactive forms scale better and are fully testable,ReactiveFormsModule for all non-trivial forms,FormsModule with ngModel for complex forms,"<input [formControl]=""emailControl"" />","<input [(ngModel)]=""email"" />",Medium,https://angular.dev/guide/forms/reactive-forms
24
+ 23,Forms,Write custom validators as functions,Functional validators are composable and tree-shakeable,ValidatorFn functions for custom validation,Class-based validators implementing Validator interface,const noSpaces: ValidatorFn = ctrl => ctrl.value?.includes(' ') ? { noSpaces: true } : null,class NoSpacesValidator implements Validator { validate(c) {} },Medium,https://angular.dev/guide/forms/form-validation#custom-validators
25
+ 24,Forms,Use updateOn for performance,Control when validation runs to avoid per-keystroke validation overhead,updateOn: 'blur' or 'submit' for expensive validators,Default updateOn: 'change' for async validators,fb.control('' { updateOn: 'blur' validators: [Validators.email] }),fb.control('' [Validators.email]) // validates on every key,Low,https://angular.dev/api/forms/AbstractControl#updateOn
26
+ 25,Forms,Use FormArray for dynamic fields,FormArray manages variable-length lists of controls,FormArray for add/remove field scenarios,Manually tracking index-based controls,get items(): FormArray { return this.form.get('items') as FormArray },items: [FormControl] managed outside form,Medium,https://angular.dev/guide/forms/reactive-forms#using-the-formarray-class
27
+ 26,Forms,Display validation errors clearly,Use form control touched and dirty states to show errors at the right time,Show errors after field is touched,Show all errors on page load,@if (email.invalid && email.touched) { <span>Invalid email</span> },@if (email.invalid) { <span>Invalid email</span> },Medium,https://angular.dev/guide/forms/form-validation
28
+ 27,Performance,Apply OnPush to all components,OnPush + signals eliminates most unnecessary change detection cycles,OnPush change detection everywhere,Default strategy which checks entire tree on every event,changeDetection: ChangeDetectionStrategy.OnPush,changeDetection: ChangeDetectionStrategy.Default,High,https://angular.dev/best-practices/skipping-component-subtrees
29
+ 28,Performance,Use trackBy in @for blocks,Stable identity for list items prevents full DOM re-creation on change,track item.id in @for,track $index for dynamic data,@for (item of items; track item.id) { <li>{{ item.name }}</li> },@for (item of items; track $index) { <li>{{ item.name }}</li> },High,https://angular.dev/guide/templates/control-flow#track-and-identity
30
+ 29,Performance,Use @defer for below-the-fold content,Defer blocks lazy-load components when they enter the viewport,@defer with on viewport for non-critical UI,Eagerly loading all components at startup,@defer (on viewport) { <HeavyChart /> } @placeholder { <Skeleton /> },<HeavyChart /> loaded at startup,High,https://angular.dev/guide/defer
31
+ 30,Performance,Use NgOptimizedImage,Enforces image best practices: lazy loading LCP hints and proper sizing,NgOptimizedImage for all img tags,Plain img tags for CMS or user content,"<img ngSrc=""/hero.jpg"" width=""800"" height=""400"" priority />","<img src=""/hero.jpg"" />",High,https://angular.dev/guide/image-optimization
32
+ 31,Performance,Tree-shake unused Angular features,Import only what you use from Angular packages,Import specific Angular modules needed,Import BrowserAnimationsModule when not using animations,import { NgOptimizedImage } from '@angular/common',import { CommonModule } from '@angular/common' // entire module,Medium,https://angular.dev/tools/cli/build
33
+ 32,Performance,Avoid subscribe in components,Subscriptions leak and cause bugs; prefer async pipe or toSignal,toSignal() or async pipe instead of manual subscribe,Manual subscribe without unsubscribe in ngOnDestroy,readonly data = toSignal(this.service.data$),this.service.data$.subscribe(d => this.data = d),High,https://angular.dev/guide/rxjs-interop
34
+ 33,Performance,Use SSR with Angular Universal,Pre-render pages for faster LCP and better SEO,SSR or SSG for public-facing routes,Pure CSR for SEO-critical pages,ng add @angular/ssr,"// no SSR, client renders empty shell",Medium,https://angular.dev/guide/ssr
35
+ 34,Performance,Minimize bundle with standalone APIs,Standalone components + provideRouter() eliminate dead NgModule code,provideRouter() and provideHttpClient() in app.config,Root AppModule with all imports,provideRouter(routes) in app.config.ts,@NgModule({ imports: [RouterModule.forRoot(routes)] }),Medium,https://angular.dev/guide/routing/standalone
36
+ 35,Testing,Use TestBed for component tests,TestBed sets up Angular DI for realistic component testing,TestBed.configureTestingModule for component tests,Instantiate components with new keyword,TestBed.configureTestingModule({ imports: [MyComponent] }),const comp = new MyComponent(),High,https://angular.dev/guide/testing/components-basics
37
+ 36,Testing,Use Angular CDK component harnesses,Harnesses provide a stable testing API that survives template refactors,MatButtonHarness and custom HarnessLoader,Direct native element queries that break on template changes,const btn = await loader.getHarness(MatButtonHarness),fixture.debugElement.query(By.css('button')),Medium,https://material.angular.io/cdk/test-harnesses/overview
38
+ 37,Testing,Use Spectator for less boilerplate,Spectator wraps TestBed with a cleaner API reducing test setup noise,Spectator for unit tests,Raw TestBed for every test,const spectator = createComponentFactory(MyComponent),TestBed.configureTestingModule({ declarations: [MyComponent] providers: [...] }),Low,https://github.com/ngneat/spectator
39
+ 38,Testing,Mock services with jasmine.createSpyObj,Isolate unit tests by providing mock implementations of dependencies,SpyObj or jest.fn() mocks for services,Real HTTP calls in unit tests,const spy = jasmine.createSpyObj('UserService' ['getUser']); spy.getUser.and.returnValue(of(user)),providers: [UserService] // real service in unit test,High,https://angular.dev/guide/testing/services
40
+ 39,Testing,Write integration tests for routes,Test full route navigation including guards and resolvers,RouterTestingHarness for route integration tests,Mock all routing behavior in unit tests,const harness = await RouterTestingHarness.create(); await harness.navigateByUrl('/home'),// manually calling route guard methods,Medium,https://angular.dev/api/router/testing/RouterTestingHarness
41
+ 40,Testing,Test signal-based components,Signals update synchronously; no async flush needed in most cases,Read signal value directly in test assertions,TestBed.tick() or fakeAsync for signal reads,component.count.set(5); expect(component.double()).toBe(10),fakeAsync(() => { component.count.set(5); tick(); expect(component.double()).toBe(10) }),Medium,https://angular.dev/guide/testing
42
+ 41,Styling,Use ViewEncapsulation.Emulated,Default emulation scopes styles to component preventing global leaks,Emulated or None for intentional global styles,ViewEncapsulation.None for component-specific styles,ViewEncapsulation.Emulated (default),ViewEncapsulation.None on feature components,Medium,https://angular.dev/guide/components/styling#style-scoping
43
+ 42,Styling,Use :host selector,Style the component's host element using :host pseudo-class,:host for host element styles,Adding wrapper div just for styling,:host { display: block; padding: 1rem },"<div class=""wrapper"">...</div> + .wrapper { padding: 1rem }",Medium,https://angular.dev/guide/components/styling#host-element
44
+ 43,Styling,Use CSS custom properties for theming,CSS variables work across component boundaries and enable dynamic theming,CSS custom properties for colors and spacing,Hardcoded hex values in component styles,:root { --primary: #6200ee } button { background: var(--primary) },button { background: #6200ee },Medium,https://angular.dev/guide/components/styling
45
+ 44,Styling,Integrate Tailwind with Angular,Tailwind utilities work alongside Angular's ViewEncapsulation via global stylesheet,Add Tailwind in styles.css and use utility classes in templates,Custom CSS for layout that Tailwind already handles,"<div class=""flex items-center gap-4 p-6"">","<div class=""my-custom-flex""> /* .my-custom-flex { display: flex } */",Low,https://tailwindcss.com/docs/guides/angular
46
+ 45,Styling,Use Angular Material theming tokens,Material 3 uses design tokens for systematic theming,M3 token-based theming for Angular Material,Overriding Angular Material CSS with deep selectors,@include mat.button-theme($my-theme),::ng-deep .mat-button { background: red },Medium,https://material.angular.io/guide/theming
47
+ 46,Architecture,Use injection tokens for config,Provide configuration via InjectionToken for testability and flexibility,InjectionToken for environment-specific values,Importing environment.ts directly in services,const API_URL = new InjectionToken<string>('apiUrl'); provide: [{ provide: API_URL useValue: env.apiUrl }],constructor(private env: Environment) { this.url = env.apiUrl },Medium,https://angular.dev/guide/di/dependency-injection-providers#using-an-injectiontoken-object
48
+ 47,Architecture,Use HTTP interceptors,Intercept requests for auth headers error handling and logging,Functional interceptors with withInterceptors(),Service-level header management in every request,withInterceptors([authInterceptor errorInterceptor]),httpClient.get(url { headers: { Authorization: token } }) in every call,High,https://angular.dev/guide/http/interceptors
49
+ 48,Architecture,Organize by feature not type,Feature-based folder structure scales better than type-based,Feature folders with collocated component service and routes,Flat folders: all-components/ all-services/,src/features/checkout/checkout.component.ts checkout.service.ts checkout.routes.ts,src/components/checkout.component.ts src/services/checkout.service.ts,Medium,https://angular.dev/style-guide#folders-by-feature-structure
50
+ 49,Architecture,Use environment configurations,Separate environment values for dev staging and prod via Angular build configs,angular.json fileReplacements for env configs,Hardcoded API URLs or feature flags in source,fileReplacements: [{ replace: environment.ts with: environment.prod.ts }],const API = 'https://api.example.com' // hardcoded in service,High,https://angular.dev/tools/cli/environments
51
+ 50,Architecture,Prefer inject() over constructor DI,inject() function is composable and works in more contexts than constructor injection,inject() for dependency injection,Constructor parameters for new code,readonly http = inject(HttpClient); readonly router = inject(Router),constructor(private http: HttpClient private router: Router) {},Medium,https://angular.dev/api/core/inject