vc-extras 0.1.0 → 0.1.1

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 (249) hide show
  1. package/README.md +128 -71
  2. package/agent-install.mjs +159 -0
  3. package/agents/tester.md +23 -23
  4. package/install-extras.mjs +41 -109
  5. package/install-menu.mjs +22 -43
  6. package/install-skills.mjs +112 -112
  7. package/package.json +72 -28
  8. package/plugin-registry.mjs +73 -0
  9. package/plugins/config-ui/index.ts +159 -159
  10. package/plugins/config-ui/lib/arguments.mjs +24 -24
  11. package/plugins/config-ui/lib/documents.mjs +67 -67
  12. package/plugins/config-ui/lib/frontmatter.mjs +91 -91
  13. package/plugins/config-ui/lib/open.mjs +16 -16
  14. package/plugins/config-ui/lib/ownership.mjs +99 -99
  15. package/plugins/config-ui/lib/page.mjs +11 -11
  16. package/plugins/config-ui/lib/patch.mjs +35 -35
  17. package/plugins/config-ui/lib/paths.mjs +14 -14
  18. package/plugins/config-ui/lib/plugin-fields.mjs +86 -86
  19. package/plugins/config-ui/lib/plugin-validation.mjs +28 -28
  20. package/plugins/config-ui/lib/redaction.mjs +8 -8
  21. package/plugins/config-ui/lib/registry.mjs +282 -282
  22. package/plugins/config-ui/lib/secrets.mjs +44 -44
  23. package/plugins/config-ui/lib/server.mjs +250 -250
  24. package/plugins/config-ui/lib/sources.mjs +96 -96
  25. package/plugins/config-ui/lib/state.mjs +156 -156
  26. package/plugins/config-ui/lib/themes.mjs +113 -113
  27. package/plugins/config-ui/lib/writer.mjs +690 -690
  28. package/plugins/config-ui/project-local-owner.ts +106 -106
  29. package/plugins/config-ui/vc-extras.plugin.json +13 -0
  30. package/plugins/config-ui/web/app.mjs +997 -997
  31. package/plugins/config-ui/web/index.html +342 -342
  32. package/plugins/pi-blackhole/vc-extras.plugin.json +12 -0
  33. package/plugins/pi-btw/vc-extras.plugin.json +12 -0
  34. package/plugins/pi-claude-code/vc-extras.plugin.json +12 -0
  35. package/plugins/pi-fff/vc-extras.plugin.json +12 -0
  36. package/plugins/pi-jev-auto-mode/vc-extras.plugin.json +12 -0
  37. package/plugins/pi-mcp-adapter/vc-extras.plugin.json +12 -0
  38. package/plugins/pi-web-access/vc-extras.plugin.json +12 -0
  39. package/plugins/vc-ask/claude-hook.mjs +37 -0
  40. package/plugins/vc-ask/codex-native.mjs +28 -0
  41. package/plugins/vc-ask/host-channel.mjs +75 -0
  42. package/plugins/vc-ask/index.ts +57 -0
  43. package/plugins/vc-ask/native-questions.mjs +33 -0
  44. package/plugins/vc-ask/package.json +10 -0
  45. package/plugins/vc-ask/payload.ts +170 -0
  46. package/plugins/vc-ask/questionnaire/LICENSE.ask-user-question +21 -0
  47. package/plugins/vc-ask/questionnaire/UPSTREAM.md +104 -0
  48. package/plugins/vc-ask/questionnaire/answer-channel.ts +135 -0
  49. package/plugins/vc-ask/questionnaire/config.ts +180 -0
  50. package/plugins/vc-ask/questionnaire/events.ts +154 -0
  51. package/plugins/vc-ask/questionnaire/execute.ts +688 -0
  52. package/plugins/vc-ask/questionnaire/i18n.ts +73 -0
  53. package/plugins/vc-ask/questionnaire/inline-entry.ts +312 -0
  54. package/plugins/vc-ask/questionnaire/locales/de.json +43 -0
  55. package/plugins/vc-ask/questionnaire/locales/en.json +42 -0
  56. package/plugins/vc-ask/questionnaire/locales/es.json +43 -0
  57. package/plugins/vc-ask/questionnaire/locales/fr.json +43 -0
  58. package/plugins/vc-ask/questionnaire/locales/pt-BR.json +43 -0
  59. package/plugins/vc-ask/questionnaire/locales/pt.json +43 -0
  60. package/plugins/vc-ask/questionnaire/locales/ru.json +43 -0
  61. package/plugins/vc-ask/questionnaire/locales/uk.json +43 -0
  62. package/plugins/vc-ask/questionnaire/locales/zh.json +46 -0
  63. package/plugins/vc-ask/questionnaire/presentation.ts +11 -0
  64. package/plugins/vc-ask/questionnaire/question-preview.ts +6 -0
  65. package/plugins/vc-ask/questionnaire/rpc.ts +221 -0
  66. package/plugins/vc-ask/questionnaire/session-timeout.ts +67 -0
  67. package/plugins/vc-ask/questionnaire/state/build-questionnaire.ts +144 -0
  68. package/plugins/vc-ask/questionnaire/state/external-editor.ts +62 -0
  69. package/plugins/vc-ask/questionnaire/state/geometry.ts +131 -0
  70. package/plugins/vc-ask/questionnaire/state/key-router.ts +382 -0
  71. package/plugins/vc-ask/questionnaire/state/panel-router.ts +32 -0
  72. package/plugins/vc-ask/questionnaire/state/questionnaire-session.ts +642 -0
  73. package/plugins/vc-ask/questionnaire/state/row-intent.ts +143 -0
  74. package/plugins/vc-ask/questionnaire/state/selectors/contract.ts +24 -0
  75. package/plugins/vc-ask/questionnaire/state/selectors/derivations.ts +40 -0
  76. package/plugins/vc-ask/questionnaire/state/selectors/focus.ts +17 -0
  77. package/plugins/vc-ask/questionnaire/state/selectors/projections.ts +99 -0
  78. package/plugins/vc-ask/questionnaire/state/state-reducer.ts +455 -0
  79. package/plugins/vc-ask/questionnaire/state/state.ts +90 -0
  80. package/plugins/vc-ask/questionnaire/state/vertical.ts +158 -0
  81. package/plugins/vc-ask/questionnaire/timeout.ts +59 -0
  82. package/plugins/vc-ask/questionnaire/tool/external-answer.ts +103 -0
  83. package/plugins/vc-ask/questionnaire/tool/format-answer.ts +24 -0
  84. package/plugins/vc-ask/questionnaire/tool/normalize-params.ts +37 -0
  85. package/plugins/vc-ask/questionnaire/tool/response-envelope.ts +75 -0
  86. package/plugins/vc-ask/questionnaire/tool/types.ts +74 -0
  87. package/plugins/vc-ask/questionnaire/tool/validate-questionnaire.ts +75 -0
  88. package/plugins/vc-ask/questionnaire/view/card-theme.ts +245 -0
  89. package/plugins/vc-ask/questionnaire/view/components/inline-input.ts +66 -0
  90. package/plugins/vc-ask/questionnaire/view/components/multi-select-view.ts +177 -0
  91. package/plugins/vc-ask/questionnaire/view/components/option-list-view.ts +65 -0
  92. package/plugins/vc-ask/questionnaire/view/components/preview/markdown-content-cache.ts +101 -0
  93. package/plugins/vc-ask/questionnaire/view/components/preview/preview-block-renderer.ts +130 -0
  94. package/plugins/vc-ask/questionnaire/view/components/preview/preview-box-renderer.ts +86 -0
  95. package/plugins/vc-ask/questionnaire/view/components/preview/preview-layout-decider.ts +204 -0
  96. package/plugins/vc-ask/questionnaire/view/components/preview/preview-pane.ts +257 -0
  97. package/plugins/vc-ask/questionnaire/view/components/submit-picker.ts +65 -0
  98. package/plugins/vc-ask/questionnaire/view/components/tab-bar.ts +57 -0
  99. package/plugins/vc-ask/questionnaire/view/components/wrapping-select.ts +269 -0
  100. package/plugins/vc-ask/questionnaire/view/dialog-builder.ts +319 -0
  101. package/plugins/vc-ask/questionnaire/view/document-theme.ts +53 -0
  102. package/plugins/vc-ask/questionnaire/view/document-view.ts +306 -0
  103. package/plugins/vc-ask/questionnaire/view/panel-chrome.ts +133 -0
  104. package/plugins/vc-ask/questionnaire/view/props-adapter.ts +77 -0
  105. package/plugins/vc-ask/questionnaire/view/stateful-view.ts +24 -0
  106. package/plugins/vc-ask/questionnaire/view/tab-components.ts +16 -0
  107. package/plugins/vc-ask/questionnaire/view/tab-content-strategy.ts +280 -0
  108. package/plugins/vc-ask/questionnaire/view/vertical-view.ts +218 -0
  109. package/plugins/vc-ask/user-input-events.ts +34 -0
  110. package/plugins/vc-ask/vc-extras.plugin.json +18 -0
  111. package/plugins/vc-footer/agents/claude-code/adapter.mjs +29 -0
  112. package/plugins/vc-footer/agents/claude-code/cli.mjs +23 -0
  113. package/plugins/vc-footer/agents/claude-code/renderer.mjs +1 -0
  114. package/plugins/vc-footer/agents/claude-code/types.d.ts +38 -0
  115. package/plugins/vc-footer/agents/codex/adapter.mjs +13 -0
  116. package/plugins/vc-footer/agents/codex/mcp.mjs +45 -0
  117. package/plugins/vc-footer/agents/codex/native.mjs +19 -0
  118. package/plugins/vc-footer/agents/codex/renderer.mjs +2 -0
  119. package/plugins/vc-footer/agents/pi/adapter.mjs +23 -0
  120. package/plugins/vc-footer/agents/pi/index.js +84 -0
  121. package/plugins/vc-footer/agents/pi/project-local-owner.mjs +97 -0
  122. package/plugins/vc-footer/agents/pi/renderer.mjs +5 -0
  123. package/plugins/vc-footer/core/data.mjs +218 -0
  124. package/plugins/vc-footer/core/render.mjs +291 -0
  125. package/plugins/vc-footer/core/types.d.ts +29 -0
  126. package/plugins/vc-footer/package.json +22 -0
  127. package/plugins/vc-footer/vc-extras.plugin.json +32 -0
  128. package/skills/animate/LICENSE +21 -21
  129. package/skills/animate/RECIPES.md +324 -324
  130. package/skills/animate/SKILL.md +208 -208
  131. package/skills/animate/UPSTREAM.md +19 -19
  132. package/skills/animation-performance/LICENSE +21 -21
  133. package/skills/animation-performance/SKILL.md +223 -223
  134. package/skills/animation-performance/UPSTREAM.md +19 -19
  135. package/skills/answer-me-with-html/SKILL.md +174 -174
  136. package/skills/answer-me-with-html/scripts/am.mjs +12896 -12896
  137. package/skills/apple-design/LICENSE +21 -21
  138. package/skills/apple-design/SKILL.md +291 -291
  139. package/skills/apple-design/UPSTREAM.md +19 -19
  140. package/skills/bad-smell/SKILL.md +44 -44
  141. package/skills/commit/SKILL.md +90 -90
  142. package/skills/emil-design-eng/LICENSE +21 -21
  143. package/skills/emil-design-eng/SKILL.md +677 -677
  144. package/skills/emil-design-eng/UPSTREAM.md +19 -19
  145. package/skills/find-the-truth/SKILL.md +38 -38
  146. package/skills/find-the-truth/references/trace-method.md +48 -48
  147. package/skills/find-the-truth/references/truth-method.md +39 -39
  148. package/skills/gestures/LICENSE +21 -21
  149. package/skills/gestures/SKILL.md +107 -107
  150. package/skills/gestures/UPSTREAM.md +19 -19
  151. package/skills/humanizer-zh/LICENSE +21 -21
  152. package/skills/humanizer-zh/SKILL.md +409 -409
  153. package/skills/humanizer-zh/UPSTREAM.md +7 -7
  154. package/skills/impeccable/LICENSE +191 -191
  155. package/skills/impeccable/NOTICE.md +11 -11
  156. package/skills/impeccable/SKILL.md +89 -89
  157. package/skills/impeccable/licenses/modern-screenshot-MIT.txt +8 -8
  158. package/skills/impeccable/licenses/platform-design-skills-MIT.txt +21 -21
  159. package/skills/impeccable/reference/adapt.md +318 -318
  160. package/skills/impeccable/reference/adapt.native.md +58 -58
  161. package/skills/impeccable/reference/android.md +46 -46
  162. package/skills/impeccable/reference/animate.md +89 -89
  163. package/skills/impeccable/reference/audit.md +139 -139
  164. package/skills/impeccable/reference/audit.native.md +139 -139
  165. package/skills/impeccable/reference/bolder.md +33 -33
  166. package/skills/impeccable/reference/clarify.md +94 -94
  167. package/skills/impeccable/reference/colorize.md +86 -86
  168. package/skills/impeccable/reference/component-review.md +63 -63
  169. package/skills/impeccable/reference/craft-floor.md +44 -44
  170. package/skills/impeccable/reference/craft.md +5 -5
  171. package/skills/impeccable/reference/critique.md +819 -819
  172. package/skills/impeccable/reference/degraded/asset-producer.md +41 -41
  173. package/skills/impeccable/reference/degraded/documenter.md +23 -23
  174. package/skills/impeccable/reference/degraded/finish-reviewer.md +37 -37
  175. package/skills/impeccable/reference/degraded/manual-edit-applier.md +92 -92
  176. package/skills/impeccable/reference/delight.md +70 -70
  177. package/skills/impeccable/reference/distill.md +111 -111
  178. package/skills/impeccable/reference/doctor.md +54 -54
  179. package/skills/impeccable/reference/document.md +416 -416
  180. package/skills/impeccable/reference/extract.md +69 -69
  181. package/skills/impeccable/reference/generate.md +101 -101
  182. package/skills/impeccable/reference/harden.md +362 -362
  183. package/skills/impeccable/reference/hooks.md +114 -114
  184. package/skills/impeccable/reference/init.md +131 -131
  185. package/skills/impeccable/reference/ios.md +51 -51
  186. package/skills/impeccable/reference/layout.md +84 -84
  187. package/skills/impeccable/reference/live-setup.md +104 -104
  188. package/skills/impeccable/reference/live.md +327 -327
  189. package/skills/impeccable/reference/mode-operate.md +21 -21
  190. package/skills/impeccable/reference/mode-persuade.md +19 -19
  191. package/skills/impeccable/reference/mode-read.md +21 -21
  192. package/skills/impeccable/reference/new-work.md +152 -152
  193. package/skills/impeccable/reference/onboard.md +234 -234
  194. package/skills/impeccable/reference/operate.md +61 -61
  195. package/skills/impeccable/reference/optimize.md +257 -257
  196. package/skills/impeccable/reference/overdrive.md +127 -127
  197. package/skills/impeccable/reference/polish.md +105 -105
  198. package/skills/impeccable/reference/quieter.md +99 -99
  199. package/skills/impeccable/reference/region-map.md +26 -26
  200. package/skills/impeccable/reference/routing.md +24 -24
  201. package/skills/impeccable/reference/shape.md +59 -59
  202. package/skills/impeccable/reference/typeset.md +90 -90
  203. package/skills/impeccable/reference/visualize.md +47 -47
  204. package/skills/impeccable/scripts/VERSION +1 -1
  205. package/skills/impeccable/scripts/command-metadata.json +98 -98
  206. package/skills/impeccable/scripts/data/font-index-failures.json +120 -120
  207. package/skills/impeccable/scripts/engine-checksums.txt +9 -9
  208. package/skills/impeccable/scripts/impeccable +249 -249
  209. package/skills/impeccable/scripts/impeccable.cmd +278 -278
  210. package/skills/impeccable/scripts/live-browser-dom.js +320 -320
  211. package/skills/impeccable/scripts/live-browser-ignores.js +246 -246
  212. package/skills/impeccable/scripts/live-browser-session.js +183 -183
  213. package/skills/impeccable/scripts/live-browser.js +13862 -13862
  214. package/skills/impeccable/scripts/modern-screenshot.umd.js +14 -14
  215. package/skills/improve-animations/AUDIT.md +115 -115
  216. package/skills/improve-animations/LICENSE +21 -21
  217. package/skills/improve-animations/PLAN-TEMPLATE.md +73 -73
  218. package/skills/improve-animations/SKILL.md +110 -110
  219. package/skills/improve-animations/UPSTREAM.md +19 -19
  220. package/skills/pick-ui-library/LICENSE +21 -21
  221. package/skills/pick-ui-library/SKILL.md +85 -85
  222. package/skills/pick-ui-library/UPSTREAM.md +19 -19
  223. package/skills/review-animations/LICENSE +21 -21
  224. package/skills/review-animations/SKILL.md +120 -120
  225. package/skills/review-animations/STANDARDS.md +187 -187
  226. package/skills/review-animations/UPSTREAM.md +19 -19
  227. package/skills/test/SKILL.md +29 -29
  228. package/skills/test/references/test-method.md +60 -60
  229. package/skills/write-doc/SKILL.md +115 -115
  230. package/skills/write-doc/examples/result-report.md +53 -53
  231. package/skills/write-doc/examples/task-summary.md +45 -45
  232. package/skills/write-doc/references/terminology.md +147 -147
  233. package/specs/ask-host-protocol-v1.md +58 -0
  234. package/specs/design-demo.md +1102 -1102
  235. package/specs/frontend-immersive.md +28 -28
  236. package/specs/plugin-install-v2.md +123 -0
  237. package/specs/plugin-install.md +38 -0
  238. package/specs/web-modes/explore.md +31 -31
  239. package/specs/web-modes/risk.md +15 -15
  240. package/specs/web-modes/verify.md +16 -16
  241. package/vc-extras.mjs +46 -62
  242. package/plugins/essrj/context.ts +0 -47
  243. package/plugins/essrj/data.ts +0 -190
  244. package/plugins/essrj/index.ts +0 -139
  245. package/plugins/essrj/package.json +0 -12
  246. package/plugins/essrj/project-local-owner.ts +0 -106
  247. package/plugins/essrj/render.ts +0 -217
  248. package/plugins/essrj/types.ts +0 -40
  249. package/plugins.json +0 -38
@@ -1,19 +1,19 @@
1
- # Upstream
2
-
3
- - Repository: https://github.com/emilkowalski/skills
4
- - Commit: f7ce8c02d6e3c8f0d980a44c57bcc41a40254349 (2026-11-12)
5
- - Upstream path: `skills/emil-design-eng/`
6
- - License: MIT (see `LICENSE` in this directory)
7
-
8
- Files copied verbatim: `SKILL.md`.
9
-
10
- The only local adaptation is the frontmatter `disable-model-invocation: true` added by
11
- `npm run sync:skills`, so the model sees this skill only through the
12
- `emma/skills/skills-router/SKILL.md` row and loads it on demand.
13
-
14
- ## Resync
15
-
16
- 1. Check out the recorded commit of the upstream repository.
17
- 2. Replace the upstream files here with `skills/emil-design-eng/` from that commit; keep `LICENSE` and this file.
18
- 3. Run `npm run sync:skills` to restore the hidden frontmatter and the router row.
19
- 4. Keep the frontmatter `description` a single-line plain scalar; the router generator rejects block and folded scalars.
1
+ # Upstream
2
+
3
+ - Repository: https://github.com/emilkowalski/skills
4
+ - Commit: f7ce8c02d6e3c8f0d980a44c57bcc41a40254349 (2026-11-12)
5
+ - Upstream path: `skills/emil-design-eng/`
6
+ - License: MIT (see `LICENSE` in this directory)
7
+
8
+ Files copied verbatim: `SKILL.md`.
9
+
10
+ The only local adaptation is the frontmatter `disable-model-invocation: true` added by
11
+ `npm run sync:skills`, so the model sees this skill only through the
12
+ `emma/skills/skills-router/SKILL.md` row and loads it on demand.
13
+
14
+ ## Resync
15
+
16
+ 1. Check out the recorded commit of the upstream repository.
17
+ 2. Replace the upstream files here with `skills/emil-design-eng/` from that commit; keep `LICENSE` and this file.
18
+ 3. Run `npm run sync:skills` to restore the hidden frontmatter and the router row.
19
+ 4. Keep the frontmatter `description` a single-line plain scalar; the router generator rejects block and folded scalars.
@@ -1,38 +1,38 @@
1
- ---
2
- disable-model-invocation: true
3
- name: find-the-truth
4
- description: Use when the user wants to understand a piece of business logic or system behavior — for example how a path executes, which conditions and branches decide behavior, where rules come from, or how it evolved into its current shape.
5
- ---
6
-
7
- Assemble the user's comprehension goal and material hints, determine the scope, and always delegate to the `Explorer` sub-agent in the background — return immediately after dispatch and do something else; do not wait.
8
-
9
- ## Assemble the prompt
10
-
11
- - Assemble per the template below, replacing every `<...>` and `{...}`; when the user's description is vague, derive the information to search for from the question and the explanation's needs, and write it into Questions as concrete search targets — each concrete enough to tell "what counts as found".
12
- - Anchors and material must be real — point to actual files and commits, never summaries in place of content, no main-agent narrative; delete any hint line you cannot fill with something real, never fabricate.
13
- - Pre-building a full anchor set is unnecessary — locating the entry point is the Explorer's first step. One or two quick searches to confirm the feature exists are enough; fill Entry Hints when you have leads, drop the section entirely when you don't, put the user's original words into Task Background verbatim, and let the Explorer start from entry location.
14
- - Resolve `<trace-method-path>` to the absolute path of `references/trace-method.md` beside the loaded `SKILL.md`, so Explorer can read it without loading skills.
15
-
16
- ```markdown
17
- ## Questions
18
- <The information checklist the explanation needs, written as search targets the sub-agent can execute directly — cover as needed: code locations of the entry and the main path, each branch's condition (verbatim) and destination, where rule values come from (code/config/docs), main authors and commit dates, related docs and comments.>
19
-
20
- ## Entry Hints
21
- - Known entry points or routes: {ENTRY_POINTS} (controller/scheduled job/message consumer/CLI; fill when known, delete the line when not)
22
- - Known related files: {KNOWN_FILES} (paths only, no line ranges — tracing reads files in full)
23
-
24
- ## Task Background
25
- <The user's original words verbatim — keep terms (feature names, API names, error messages, table names) verbatim; they are the Explorer's first batch of search keys; this material will be assembled into a business-logic explanation for the user. If the question asks why it evolved this way, known commits or PRs also go here.>
26
-
27
- ## Scope and Constraints
28
- <State the boundary in one sentence: what to trace, which adjacent flows not to trace, how deep down the chain to stop; the boundary is drawn by the user's question — if you cannot write it, the translation isn't done.>
29
-
30
- ## Method
31
- Read `<trace-method-path>` in full first; strictly follow it.
32
- Return the structured logic inventory: trace scope / main path (each step with citation) / branch table (condition verbatim → destination → citation) / rule-source table (rule verbatim → type → citation) / contradictions & gaps; when the question asks: actors, history (authors/dates/motivation).
33
- ```
34
-
35
- ## Synthesize and present
36
-
37
- What the sub-agent returns is a complete logic inventory, not an evidence superset to filter — assemble it into the explanation for the user per `references/truth-method.md` beside this `SKILL.md` (overview → walkthrough → diagram → rules → uncertainties), wording and diagrams strictly per it; add nothing beyond the report.
38
- Diagrams go inline in the conversation (mermaid) by default; hand over to the answer-me-with-html skill when the content reaches one-pager explainer scale.
1
+ ---
2
+ disable-model-invocation: true
3
+ name: find-the-truth
4
+ description: Use when the user wants to understand a piece of business logic or system behavior — for example how a path executes, which conditions and branches decide behavior, where rules come from, or how it evolved into its current shape.
5
+ ---
6
+
7
+ Assemble the user's comprehension goal and material hints, determine the scope, and always delegate to the `Explorer` sub-agent in the background — return immediately after dispatch and do something else; do not wait.
8
+
9
+ ## Assemble the prompt
10
+
11
+ - Assemble per the template below, replacing every `<...>` and `{...}`; when the user's description is vague, derive the information to search for from the question and the explanation's needs, and write it into Questions as concrete search targets — each concrete enough to tell "what counts as found".
12
+ - Anchors and material must be real — point to actual files and commits, never summaries in place of content, no main-agent narrative; delete any hint line you cannot fill with something real, never fabricate.
13
+ - Pre-building a full anchor set is unnecessary — locating the entry point is the Explorer's first step. One or two quick searches to confirm the feature exists are enough; fill Entry Hints when you have leads, drop the section entirely when you don't, put the user's original words into Task Background verbatim, and let the Explorer start from entry location.
14
+ - Resolve `<trace-method-path>` to the absolute path of `references/trace-method.md` beside the loaded `SKILL.md`, so Explorer can read it without loading skills.
15
+
16
+ ```markdown
17
+ ## Questions
18
+ <The information checklist the explanation needs, written as search targets the sub-agent can execute directly — cover as needed: code locations of the entry and the main path, each branch's condition (verbatim) and destination, where rule values come from (code/config/docs), main authors and commit dates, related docs and comments.>
19
+
20
+ ## Entry Hints
21
+ - Known entry points or routes: {ENTRY_POINTS} (controller/scheduled job/message consumer/CLI; fill when known, delete the line when not)
22
+ - Known related files: {KNOWN_FILES} (paths only, no line ranges — tracing reads files in full)
23
+
24
+ ## Task Background
25
+ <The user's original words verbatim — keep terms (feature names, API names, error messages, table names) verbatim; they are the Explorer's first batch of search keys; this material will be assembled into a business-logic explanation for the user. If the question asks why it evolved this way, known commits or PRs also go here.>
26
+
27
+ ## Scope and Constraints
28
+ <State the boundary in one sentence: what to trace, which adjacent flows not to trace, how deep down the chain to stop; the boundary is drawn by the user's question — if you cannot write it, the translation isn't done.>
29
+
30
+ ## Method
31
+ Read `<trace-method-path>` in full first; strictly follow it.
32
+ Return the structured logic inventory: trace scope / main path (each step with citation) / branch table (condition verbatim → destination → citation) / rule-source table (rule verbatim → type → citation) / contradictions & gaps; when the question asks: actors, history (authors/dates/motivation).
33
+ ```
34
+
35
+ ## Synthesize and present
36
+
37
+ What the sub-agent returns is a complete logic inventory, not an evidence superset to filter — assemble it into the explanation for the user per `references/truth-method.md` beside this `SKILL.md` (overview → walkthrough → diagram → rules → uncertainties), wording and diagrams strictly per it; add nothing beyond the report.
38
+ Diagrams go inline in the conversation (mermaid) by default; hand over to the answer-me-with-html skill when the content reaches one-pager explainer scale.
@@ -1,48 +1,48 @@
1
- # Trace Method
2
-
3
- Goal: a **complete map** of the business logic within the question's scope — execution path, every branch, rule sources, actors. This is a tracing task, not archaeology: completeness replaces a findings cap as the delivery standard.
4
-
5
- Read code in full — every relevant function and file entirely, not just titles or summaries. Key logic often lives in adjacent code, config defaults, or the internals of callees.
6
-
7
- ## Execution discipline
8
-
9
- - Locate the entry point first, then follow the flow. Start from the entry (controller / scheduled job / message consumer / CLI command) and walk the call chain step by step; at each step record: what it does, which conditions decide the flow, and where the rule comes from (code constant / config / docs / database).
10
- - Main path first, then branches. Walk the most common path through to the exit, then enumerate every fork: condition verbatim → destination → citation. Every branch in scope must be accounted for — explained, or honestly marked as a gap.
11
- - Trace the present; dig into history on demand. The main task is "what the logic is now"; "why it was designed this way" gets a history investigation (commits, PRs, tickets) only when the question asks, with citations.
12
- - Build the inventory as you go. Accumulate per the report format; do not reassemble from memory at the end.
13
- - Quote key rules verbatim. Conditions, thresholds, and switches excerpted exactly, with `file:line`, so the reader can confirm in seconds.
14
- - Record what you searched. Branches you couldn't trace, rule sources you didn't find — write what you searched and with what; gaps are part of the delivery.
15
- - Never fabricate. What cannot be traced is marked a gap — never filled with "probably this".
16
- - Record both sides of contradictions. When two sources disagree about the same behavior, record both, each with a citation.
17
-
18
- ## Report format (structured logic inventory)
19
-
20
- No findings cap. If the main path is incomplete or branches are not fully enumerated within scope, mark it "incomplete" and state where it stops.
21
-
22
- **Trace scope**
23
-
24
- Entry, exit, and boundary (which downstream/upstream are out of scope).
25
-
26
- **Main path**
27
-
28
- Ordered steps: each step "what it does + citation (file:line)". Step granularity such that someone could re-walk it.
29
-
30
- **Branch table**
31
-
32
- Each row: condition (verbatim) → destination → citation. Branches whose destination could not be traced are listed here too, marked as gaps.
33
-
34
- **Rule-source table**
35
-
36
- Each row: rule content (verbatim) → type (code constant / config / docs) → citation. Where a "why" is recorded, cite it; where none exists, write "no motivation record found".
37
-
38
- **Actors**
39
-
40
- Who triggers, who consumes, which external systems are involved (when relevant to the question).
41
-
42
- **Contradictions and gaps**
43
-
44
- Contradictions: both sources, each with a citation. Gaps: the question, what was searched where and with what, and the result.
45
-
46
- **History** (when the question asks "why" or "who wrote it")
47
-
48
- Main authors and commit dates, design motivation — each with a citation; write "none found" when there is none.
1
+ # Trace Method
2
+
3
+ Goal: a **complete map** of the business logic within the question's scope — execution path, every branch, rule sources, actors. This is a tracing task, not archaeology: completeness replaces a findings cap as the delivery standard.
4
+
5
+ Read code in full — every relevant function and file entirely, not just titles or summaries. Key logic often lives in adjacent code, config defaults, or the internals of callees.
6
+
7
+ ## Execution discipline
8
+
9
+ - Locate the entry point first, then follow the flow. Start from the entry (controller / scheduled job / message consumer / CLI command) and walk the call chain step by step; at each step record: what it does, which conditions decide the flow, and where the rule comes from (code constant / config / docs / database).
10
+ - Main path first, then branches. Walk the most common path through to the exit, then enumerate every fork: condition verbatim → destination → citation. Every branch in scope must be accounted for — explained, or honestly marked as a gap.
11
+ - Trace the present; dig into history on demand. The main task is "what the logic is now"; "why it was designed this way" gets a history investigation (commits, PRs, tickets) only when the question asks, with citations.
12
+ - Build the inventory as you go. Accumulate per the report format; do not reassemble from memory at the end.
13
+ - Quote key rules verbatim. Conditions, thresholds, and switches excerpted exactly, with `file:line`, so the reader can confirm in seconds.
14
+ - Record what you searched. Branches you couldn't trace, rule sources you didn't find — write what you searched and with what; gaps are part of the delivery.
15
+ - Never fabricate. What cannot be traced is marked a gap — never filled with "probably this".
16
+ - Record both sides of contradictions. When two sources disagree about the same behavior, record both, each with a citation.
17
+
18
+ ## Report format (structured logic inventory)
19
+
20
+ No findings cap. If the main path is incomplete or branches are not fully enumerated within scope, mark it "incomplete" and state where it stops.
21
+
22
+ **Trace scope**
23
+
24
+ Entry, exit, and boundary (which downstream/upstream are out of scope).
25
+
26
+ **Main path**
27
+
28
+ Ordered steps: each step "what it does + citation (file:line)". Step granularity such that someone could re-walk it.
29
+
30
+ **Branch table**
31
+
32
+ Each row: condition (verbatim) → destination → citation. Branches whose destination could not be traced are listed here too, marked as gaps.
33
+
34
+ **Rule-source table**
35
+
36
+ Each row: rule content (verbatim) → type (code constant / config / docs) → citation. Where a "why" is recorded, cite it; where none exists, write "no motivation record found".
37
+
38
+ **Actors**
39
+
40
+ Who triggers, who consumes, which external systems are involved (when relevant to the question).
41
+
42
+ **Contradictions and gaps**
43
+
44
+ Contradictions: both sources, each with a citation. Gaps: the question, what was searched where and with what, and the result.
45
+
46
+ **History** (when the question asks "why" or "who wrote it")
47
+
48
+ Main authors and commit dates, design motivation — each with a citation; write "none found" when there is none.
@@ -1,39 +1,39 @@
1
- # Truth Method
2
-
3
- Input: the Explorer's logic-tracing report (a structured logic inventory). Output: a business-logic explanation for the user — a one-sentence overview, a step-by-step walkthrough, one complete diagram, the rules list, and the uncertainties.
4
-
5
- Discipline runs as an undercurrent: the user reads an explanation, not an audit report. Code shows what it does, not why it exists — the "why" evidence is in the report material and enters the explanation only when the question asks for it.
6
-
7
- ## Explanation structure
8
-
9
- 1. **One-sentence overview**: what this business logic does, from where to where.
10
- 2. **Step-by-step walkthrough**: walk the main path, one plain-language sentence per step; at each fork, state "under which condition the flow takes the other branch". Order and granularity follow the report's main path.
11
- 3. **Main diagram**: entry to exit + every branch. Solid edge = a fact with citation from the report; dashed = inference; `?` = gap.
12
- 4. **Rules and exceptions**: translate the rules scattered across code/config into plain sentences, each marked with its source (code/config/docs).
13
- 5. **Uncertainties**: one compact section — which branch could not be traced, which rule source is doubtful, who to ask (original author / owner / team). If the user's embedded hypothesis does not match the evidence, state here what the evidence actually supports.
14
-
15
- Do not use the "What We Found / Reasonable Inference / Competing Hypotheses / What We Don't Know" four-section audit layout — that layering is internal discipline, not the structure the user reads.
16
-
17
- ## Wording rules
18
-
19
- - Facts with citations from the report: state directly. When quoting a rule verbatim, give `file:line`.
20
- - Multi-source convergent claims: "appears to" / "very likely" allowed, with citations on first mention.
21
- - Inferences: must carry a hedge ("appears to", "very likely", "should be"); never mixed into the same tone as facts.
22
- - Speculation: stays out of the body; when genuinely valuable it goes in "Uncertainties", labeled as a guess.
23
- - Banned words: "obviously" (if it were obvious, the user wouldn't be asking), "clearly" (almost always precedes a claim that isn't), "of course" (same), "just" (dismissive and hides uncertainty), "I think / I believe" (you are synthesizing evidence — use "the evidence suggests").
24
- - Sycophancy trap: a hypothesis embedded in the user's question ("I assume it's for performance?") is one candidate among others; verify independently. If the evidence supports it, say so with citations; if not, state what the evidence does support.
25
- - No rationalization: do not retrofit a clean rationale onto messy history; do not assume a consistent pattern was intentional (it may be copy-paste); do not turn an absence of evidence into evidence of absence ("no one mentioned security, so it must be secure").
26
-
27
- ## Diagram content selection and confidence encoding
28
-
29
- - Draw the **complete** path and every branch within the question's scope; nothing outside scope. Test: if removing an element does not hurt the user's understanding, remove it.
30
- - Diagram type follows content: flow for execution paths, state diagram for state-dependent behavior, sequence for multi-party interactions, annotations for rule sources.
31
- - Encoding: solid = fact with citation from the report; dashed = inference; `?` = gap or untraced. Consistent with the body text.
32
- - The diagram contains no conclusion absent from the body text; key conclusions in the body must be visible in the diagram.
33
-
34
- ## Pre-delivery check
35
-
36
- - **Completeness**: the diagram covers entry to exit; every branch in the report is accounted for in the narration and the diagram — explained, or marked as a gap.
37
- - Every fact has a citation; inferences carry hedges; the diagram's encoding matches the narration.
38
- - An "Uncertainties" section exists; no gaps mentioned at all is a suspicious signal — either the trace was unusually complete or something was swept under the rug.
39
- - **Plain language**: every sentence reads like a person explaining to a person, not an audit report.
1
+ # Truth Method
2
+
3
+ Input: the Explorer's logic-tracing report (a structured logic inventory). Output: a business-logic explanation for the user — a one-sentence overview, a step-by-step walkthrough, one complete diagram, the rules list, and the uncertainties.
4
+
5
+ Discipline runs as an undercurrent: the user reads an explanation, not an audit report. Code shows what it does, not why it exists — the "why" evidence is in the report material and enters the explanation only when the question asks for it.
6
+
7
+ ## Explanation structure
8
+
9
+ 1. **One-sentence overview**: what this business logic does, from where to where.
10
+ 2. **Step-by-step walkthrough**: walk the main path, one plain-language sentence per step; at each fork, state "under which condition the flow takes the other branch". Order and granularity follow the report's main path.
11
+ 3. **Main diagram**: entry to exit + every branch. Solid edge = a fact with citation from the report; dashed = inference; `?` = gap.
12
+ 4. **Rules and exceptions**: translate the rules scattered across code/config into plain sentences, each marked with its source (code/config/docs).
13
+ 5. **Uncertainties**: one compact section — which branch could not be traced, which rule source is doubtful, who to ask (original author / owner / team). If the user's embedded hypothesis does not match the evidence, state here what the evidence actually supports.
14
+
15
+ Do not use the "What We Found / Reasonable Inference / Competing Hypotheses / What We Don't Know" four-section audit layout — that layering is internal discipline, not the structure the user reads.
16
+
17
+ ## Wording rules
18
+
19
+ - Facts with citations from the report: state directly. When quoting a rule verbatim, give `file:line`.
20
+ - Multi-source convergent claims: "appears to" / "very likely" allowed, with citations on first mention.
21
+ - Inferences: must carry a hedge ("appears to", "very likely", "should be"); never mixed into the same tone as facts.
22
+ - Speculation: stays out of the body; when genuinely valuable it goes in "Uncertainties", labeled as a guess.
23
+ - Banned words: "obviously" (if it were obvious, the user wouldn't be asking), "clearly" (almost always precedes a claim that isn't), "of course" (same), "just" (dismissive and hides uncertainty), "I think / I believe" (you are synthesizing evidence — use "the evidence suggests").
24
+ - Sycophancy trap: a hypothesis embedded in the user's question ("I assume it's for performance?") is one candidate among others; verify independently. If the evidence supports it, say so with citations; if not, state what the evidence does support.
25
+ - No rationalization: do not retrofit a clean rationale onto messy history; do not assume a consistent pattern was intentional (it may be copy-paste); do not turn an absence of evidence into evidence of absence ("no one mentioned security, so it must be secure").
26
+
27
+ ## Diagram content selection and confidence encoding
28
+
29
+ - Draw the **complete** path and every branch within the question's scope; nothing outside scope. Test: if removing an element does not hurt the user's understanding, remove it.
30
+ - Diagram type follows content: flow for execution paths, state diagram for state-dependent behavior, sequence for multi-party interactions, annotations for rule sources.
31
+ - Encoding: solid = fact with citation from the report; dashed = inference; `?` = gap or untraced. Consistent with the body text.
32
+ - The diagram contains no conclusion absent from the body text; key conclusions in the body must be visible in the diagram.
33
+
34
+ ## Pre-delivery check
35
+
36
+ - **Completeness**: the diagram covers entry to exit; every branch in the report is accounted for in the narration and the diagram — explained, or marked as a gap.
37
+ - Every fact has a citation; inferences carry hedges; the diagram's encoding matches the narration.
38
+ - An "Uncertainties" section exists; no gaps mentioned at all is a suspicious signal — either the trace was unusually complete or something was swept under the rug.
39
+ - **Plain language**: every sentence reads like a person explaining to a person, not an audit report.
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Emil Kowalski
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Emil Kowalski
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,107 +1,107 @@
1
- ---
2
- disable-model-invocation: true
3
- name: gestures
4
- description: Build drag, swipe, and sheet interactions that track the finger 1:1 and stay interruptible. Use when building or fixing anything the user drags, swipes, flings, holds, or dismisses with a gesture — drawers, sheets, swipe-to-dismiss toasts and cards, drag-to-reorder, pull-to-refresh, hold-to-confirm — or when a gesture feels laggy, disconnected from the finger, jumps on release, or can't be caught mid-animation. Triggers on — gesture, drag, draggable, swipe, swipe to dismiss, fling, momentum, velocity, drawer, sheet, bottom sheet, snap points, Vaul, dragConstraints, dragElastic, dragMomentum, onDragEnd, whileDrag, useMotionValue, rubber-band, overscroll, pull to refresh, hold to delete, press and hold, touch-action, dismiss threshold, "doesn't follow my finger", "jumps when I let go", "can't grab it mid-animation".
5
- ---
6
-
7
- # Gesture-Driven UI
8
-
9
- How to build gestures that feel physical. A gesture is direct manipulation: while the finger is down, the UI is the finger; the moment it lifts, physics takes over. Every rule below follows from that split.
10
-
11
- ## First decision: build it, or use a solution that exists?
12
-
13
- Doing a drawer gesture *right* means momentum-based dragging, overlay opacity matched to drag progress, velocity-aware dismissal, focus trapping, and Escape-to-close. That is weeks of edge cases, not an afternoon. **For a bottom sheet / drawer, default to [Vaul](https://vaul.emilkowal.ski/)** — it exists precisely because this is hard to hand-roll. Build the gesture yourself only when no library covers the interaction (custom swipe cards, bespoke drag interactions). Use the `pick-ui-library` skill when unsure.
14
-
15
- ## The two phases of every gesture
16
-
17
- Walk this split for any gesture you build. Mixing the phases up is the #1 cause of gestures that feel wrong.
18
-
19
- ```
20
- Is the pointer currently down?
21
- ├── Yes → TRACK phase: position maps 1:1 to the pointer.
22
- │ No easing. No duration. No spring. The element IS the finger.
23
- └── No → RELEASE phase: physics finishes the motion.
24
- A spring seeded with the release velocity. Never a keyframe.
25
- ```
26
-
27
- ### Track phase rules
28
-
29
- - **1:1 means 1:1.** Drive position from a `useMotionValue` (or direct `transform` writes), never a spring or a transition — a spring during tracking makes the element trail the finger and feel disconnected, like dragging something through syrup.
30
- - **Write `transform` directly on the dragged element.** Never update a CSS variable on a parent to move children: CSS variables are inheritable, so every change recalculates styles for all descendants. This exact bug made Vaul's drag laggy past ~20 list items; setting `transform` on the element fixed it.
31
- - **No React state per move event.** A re-render every pointermove drops frames. Motion values and direct style writes bypass the render cycle.
32
- - **Rubber-band at the edges.** Dragging past a boundary should move the element a fraction of the distance (Motion: `dragElastic` ≈ 0.2), not stop dead — hard stops feel like hitting a wall; resistance communicates "there's nothing further" physically.
33
-
34
- ### Release phase rules
35
-
36
- - **Finish with a spring, seeded with the gesture's velocity.** The element should leave the finger at the speed it was moving. A fixed-duration ease here makes every fling land identically, which reads as fake.
37
- - **Dismiss on distance OR velocity.** Passing a distance threshold (~40–50% of travel) dismisses, but so does a fast flick over a short distance. In Motion, read both from `onDragEnd`'s `info.offset` and `info.velocity`. Distance-only thresholds make flicks feel ignored.
38
- - **Bounce belongs only at the end of a drag.** A drag applies force — like throwing a ball at a wall — so a slight bounce on release feels physical. The same element closed by a button press gets **zero** bounce: no force was applied. Keep the value small, and remember bounce scales inversely with element size (smaller elements need more bounce to read the same).
39
- - **Snap-back is fast.** If the gesture doesn't pass the threshold, return quickly with the spring — a slow snap-back feels like the UI is disagreeing with the user in slow motion.
40
-
41
- ## Interruptibility is non-negotiable
42
-
43
- The user must be able to catch a sheet mid-close and drag it back. Springs allow this: when retargeted mid-flight they keep their current velocity, so the redirect is seamless. CSS `@keyframes` restart from zero and cannot be caught — this is why Sonner's early CSS enter animation made toasts jump when a second toast arrived. **Never use a keyframe animation on anything a gesture can touch.** CSS transitions and springs only.
44
-
45
- ## Linked values
46
-
47
- The dragged element is rarely alone — an overlay fades, the page behind scales. Derive these from drag progress, don't animate them separately:
48
-
49
- ```jsx
50
- const y = useMotionValue(0);
51
- const overlayOpacity = useTransform(y, [0, drawerHeight], [1, 0]);
52
- ```
53
-
54
- One source of truth means the overlay is always exactly as faded as the drawer is dismissed — including mid-gesture, including when the user reverses. Two separate animations drift apart the moment a gesture is interrupted.
55
-
56
- ## Motion drag props
57
-
58
- ```jsx
59
- <motion.div
60
- drag="y"
61
- dragConstraints={{ top: 0 }}
62
- dragElastic={0.2}
63
- onDragEnd={(e, info) => {
64
- if (info.offset.y > threshold || info.velocity.y > 500) dismiss();
65
- }}
66
- />
67
- ```
68
-
69
- `dragMomentum` is on by default — right for a flung card, wrong for a simple reposition; disable it when the element should stop where the finger stops. `dragConstraints` takes a ref or bounds object.
70
-
71
- ## Sheets without springs: the Vaul curve
72
-
73
- Vaul mimics the iOS sheet with pure CSS to stay small: `cubic-bezier(0.32, 0.72, 0, 1)` over **500ms**. The curve is extremely steep at the start — that's what lets a 500ms duration still feel snappy while landing with a spring-like gentle settle. Two rules from it:
74
-
75
- - A **small floating drawer** (not touching the screen edge) should override to ~200ms — the 500ms iOS timing only reads right on a full-width edge-attached sheet:
76
- ```css
77
- [vaul-drawer] { transition: transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1); }
78
- [vaul-overlay] { transition: opacity 0.2s cubic-bezier(0.165, 0.84, 0.44, 1); }
79
- ```
80
- - **The component must feel like a single entity.** If the drawer opens in 200ms, its height changes and content crossfades must live in the same timing family — one slow sub-animation makes the whole thing feel broken.
81
-
82
- Mark interactive children with `data-vaul-no-drag` so pressing a button inside the drawer doesn't start a drag.
83
-
84
- ## Spatial consistency
85
-
86
- **An element dismisses in the direction it entered.** Sonner's toast slides up from the bottom, so swipe-down dismisses it — enter and exit share one axis, which is what makes the gesture feel discoverable and intuitive without instruction. A gesture that dismisses along an axis the element never moved on has to be learned; one that reverses the entrance is *felt*.
87
-
88
- ## Hold gestures are asymmetric
89
-
90
- Hold-to-delete and similar press-and-hold interactions use **`linear`** during the hold — the animation visualizes time passing, and time passes linearly; any other curve lies about how long is left. On release before completion, snap back fast with `ease-out`. The deliberate phase is slow and honest; the cancel is instant. Symmetric timing here is a bug.
91
-
92
- ## Touch checklist
93
-
94
- Run through this for every gesture you ship:
95
-
96
- - **Test on a real phone** — hit the dev server by local IP. Trackpad simulation lies about touch, and a 60Hz desktop monitor hides opacity-transition roughness that a 120Hz phone shows.
97
- - **Hit targets ≥ 44×44px.** Enlarge small visual targets with an invisible `::before` hitbox instead of growing the layout.
98
- - **`touch-action`** on the drag axis (`touch-action: pan-x` for a vertical drag, etc.) so the browser doesn't fight the gesture with native scrolling.
99
- - **Gate hover effects** behind `@media (hover: hover) and (pointer: fine)` — touch fires phantom hovers on tap.
100
-
101
- ## Reduced motion
102
-
103
- Tracking is direct manipulation — the user is producing the motion — so it stays. What reduces: momentum flings, bounce, and any decorative motion around the gesture. On release under `prefers-reduced-motion`, settle with a short opacity/position change instead of a bouncy spring.
104
-
105
- ## When it still feels wrong
106
-
107
- A "weird" spring is usually fixed by increasing `damping`. A gesture that stutters is a performance problem — check the track-phase rules above first, then use the `animation-performance` skill. To diagnose a feeling you can't name, record the gesture and scrub it frame by frame.
1
+ ---
2
+ disable-model-invocation: true
3
+ name: gestures
4
+ description: Build drag, swipe, and sheet interactions that track the finger 1:1 and stay interruptible. Use when building or fixing anything the user drags, swipes, flings, holds, or dismisses with a gesture — drawers, sheets, swipe-to-dismiss toasts and cards, drag-to-reorder, pull-to-refresh, hold-to-confirm — or when a gesture feels laggy, disconnected from the finger, jumps on release, or can't be caught mid-animation. Triggers on — gesture, drag, draggable, swipe, swipe to dismiss, fling, momentum, velocity, drawer, sheet, bottom sheet, snap points, Vaul, dragConstraints, dragElastic, dragMomentum, onDragEnd, whileDrag, useMotionValue, rubber-band, overscroll, pull to refresh, hold to delete, press and hold, touch-action, dismiss threshold, "doesn't follow my finger", "jumps when I let go", "can't grab it mid-animation".
5
+ ---
6
+
7
+ # Gesture-Driven UI
8
+
9
+ How to build gestures that feel physical. A gesture is direct manipulation: while the finger is down, the UI is the finger; the moment it lifts, physics takes over. Every rule below follows from that split.
10
+
11
+ ## First decision: build it, or use a solution that exists?
12
+
13
+ Doing a drawer gesture *right* means momentum-based dragging, overlay opacity matched to drag progress, velocity-aware dismissal, focus trapping, and Escape-to-close. That is weeks of edge cases, not an afternoon. **For a bottom sheet / drawer, default to [Vaul](https://vaul.emilkowal.ski/)** — it exists precisely because this is hard to hand-roll. Build the gesture yourself only when no library covers the interaction (custom swipe cards, bespoke drag interactions). Use the `pick-ui-library` skill when unsure.
14
+
15
+ ## The two phases of every gesture
16
+
17
+ Walk this split for any gesture you build. Mixing the phases up is the #1 cause of gestures that feel wrong.
18
+
19
+ ```
20
+ Is the pointer currently down?
21
+ ├── Yes → TRACK phase: position maps 1:1 to the pointer.
22
+ │ No easing. No duration. No spring. The element IS the finger.
23
+ └── No → RELEASE phase: physics finishes the motion.
24
+ A spring seeded with the release velocity. Never a keyframe.
25
+ ```
26
+
27
+ ### Track phase rules
28
+
29
+ - **1:1 means 1:1.** Drive position from a `useMotionValue` (or direct `transform` writes), never a spring or a transition — a spring during tracking makes the element trail the finger and feel disconnected, like dragging something through syrup.
30
+ - **Write `transform` directly on the dragged element.** Never update a CSS variable on a parent to move children: CSS variables are inheritable, so every change recalculates styles for all descendants. This exact bug made Vaul's drag laggy past ~20 list items; setting `transform` on the element fixed it.
31
+ - **No React state per move event.** A re-render every pointermove drops frames. Motion values and direct style writes bypass the render cycle.
32
+ - **Rubber-band at the edges.** Dragging past a boundary should move the element a fraction of the distance (Motion: `dragElastic` ≈ 0.2), not stop dead — hard stops feel like hitting a wall; resistance communicates "there's nothing further" physically.
33
+
34
+ ### Release phase rules
35
+
36
+ - **Finish with a spring, seeded with the gesture's velocity.** The element should leave the finger at the speed it was moving. A fixed-duration ease here makes every fling land identically, which reads as fake.
37
+ - **Dismiss on distance OR velocity.** Passing a distance threshold (~40–50% of travel) dismisses, but so does a fast flick over a short distance. In Motion, read both from `onDragEnd`'s `info.offset` and `info.velocity`. Distance-only thresholds make flicks feel ignored.
38
+ - **Bounce belongs only at the end of a drag.** A drag applies force — like throwing a ball at a wall — so a slight bounce on release feels physical. The same element closed by a button press gets **zero** bounce: no force was applied. Keep the value small, and remember bounce scales inversely with element size (smaller elements need more bounce to read the same).
39
+ - **Snap-back is fast.** If the gesture doesn't pass the threshold, return quickly with the spring — a slow snap-back feels like the UI is disagreeing with the user in slow motion.
40
+
41
+ ## Interruptibility is non-negotiable
42
+
43
+ The user must be able to catch a sheet mid-close and drag it back. Springs allow this: when retargeted mid-flight they keep their current velocity, so the redirect is seamless. CSS `@keyframes` restart from zero and cannot be caught — this is why Sonner's early CSS enter animation made toasts jump when a second toast arrived. **Never use a keyframe animation on anything a gesture can touch.** CSS transitions and springs only.
44
+
45
+ ## Linked values
46
+
47
+ The dragged element is rarely alone — an overlay fades, the page behind scales. Derive these from drag progress, don't animate them separately:
48
+
49
+ ```jsx
50
+ const y = useMotionValue(0);
51
+ const overlayOpacity = useTransform(y, [0, drawerHeight], [1, 0]);
52
+ ```
53
+
54
+ One source of truth means the overlay is always exactly as faded as the drawer is dismissed — including mid-gesture, including when the user reverses. Two separate animations drift apart the moment a gesture is interrupted.
55
+
56
+ ## Motion drag props
57
+
58
+ ```jsx
59
+ <motion.div
60
+ drag="y"
61
+ dragConstraints={{ top: 0 }}
62
+ dragElastic={0.2}
63
+ onDragEnd={(e, info) => {
64
+ if (info.offset.y > threshold || info.velocity.y > 500) dismiss();
65
+ }}
66
+ />
67
+ ```
68
+
69
+ `dragMomentum` is on by default — right for a flung card, wrong for a simple reposition; disable it when the element should stop where the finger stops. `dragConstraints` takes a ref or bounds object.
70
+
71
+ ## Sheets without springs: the Vaul curve
72
+
73
+ Vaul mimics the iOS sheet with pure CSS to stay small: `cubic-bezier(0.32, 0.72, 0, 1)` over **500ms**. The curve is extremely steep at the start — that's what lets a 500ms duration still feel snappy while landing with a spring-like gentle settle. Two rules from it:
74
+
75
+ - A **small floating drawer** (not touching the screen edge) should override to ~200ms — the 500ms iOS timing only reads right on a full-width edge-attached sheet:
76
+ ```css
77
+ [vaul-drawer] { transition: transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1); }
78
+ [vaul-overlay] { transition: opacity 0.2s cubic-bezier(0.165, 0.84, 0.44, 1); }
79
+ ```
80
+ - **The component must feel like a single entity.** If the drawer opens in 200ms, its height changes and content crossfades must live in the same timing family — one slow sub-animation makes the whole thing feel broken.
81
+
82
+ Mark interactive children with `data-vaul-no-drag` so pressing a button inside the drawer doesn't start a drag.
83
+
84
+ ## Spatial consistency
85
+
86
+ **An element dismisses in the direction it entered.** Sonner's toast slides up from the bottom, so swipe-down dismisses it — enter and exit share one axis, which is what makes the gesture feel discoverable and intuitive without instruction. A gesture that dismisses along an axis the element never moved on has to be learned; one that reverses the entrance is *felt*.
87
+
88
+ ## Hold gestures are asymmetric
89
+
90
+ Hold-to-delete and similar press-and-hold interactions use **`linear`** during the hold — the animation visualizes time passing, and time passes linearly; any other curve lies about how long is left. On release before completion, snap back fast with `ease-out`. The deliberate phase is slow and honest; the cancel is instant. Symmetric timing here is a bug.
91
+
92
+ ## Touch checklist
93
+
94
+ Run through this for every gesture you ship:
95
+
96
+ - **Test on a real phone** — hit the dev server by local IP. Trackpad simulation lies about touch, and a 60Hz desktop monitor hides opacity-transition roughness that a 120Hz phone shows.
97
+ - **Hit targets ≥ 44×44px.** Enlarge small visual targets with an invisible `::before` hitbox instead of growing the layout.
98
+ - **`touch-action`** on the drag axis (`touch-action: pan-x` for a vertical drag, etc.) so the browser doesn't fight the gesture with native scrolling.
99
+ - **Gate hover effects** behind `@media (hover: hover) and (pointer: fine)` — touch fires phantom hovers on tap.
100
+
101
+ ## Reduced motion
102
+
103
+ Tracking is direct manipulation — the user is producing the motion — so it stays. What reduces: momentum flings, bounce, and any decorative motion around the gesture. On release under `prefers-reduced-motion`, settle with a short opacity/position change instead of a bouncy spring.
104
+
105
+ ## When it still feels wrong
106
+
107
+ A "weird" spring is usually fixed by increasing `damping`. A gesture that stutters is a performance problem — check the track-phase rules above first, then use the `animation-performance` skill. To diagnose a feeling you can't name, record the gesture and scrub it frame by frame.
@@ -1,19 +1,19 @@
1
- # Upstream
2
-
3
- - Repository: https://github.com/emilkowalski/skills
4
- - Commit: f7ce8c02d6e3c8f0d980a44c57bcc41a40254349 (2026-11-12)
5
- - Upstream path: `skills/gestures/`
6
- - License: MIT (see `LICENSE` in this directory)
7
-
8
- Files copied verbatim: `SKILL.md`.
9
-
10
- The only local adaptation is the frontmatter `disable-model-invocation: true` added by
11
- `npm run sync:skills`, so the model sees this skill only through the
12
- `emma/skills/skills-router/SKILL.md` row and loads it on demand.
13
-
14
- ## Resync
15
-
16
- 1. Check out the recorded commit of the upstream repository.
17
- 2. Replace the upstream files here with `skills/gestures/` from that commit; keep `LICENSE` and this file.
18
- 3. Run `npm run sync:skills` to restore the hidden frontmatter and the router row.
19
- 4. Keep the frontmatter `description` a single-line plain scalar; the router generator rejects block and folded scalars.
1
+ # Upstream
2
+
3
+ - Repository: https://github.com/emilkowalski/skills
4
+ - Commit: f7ce8c02d6e3c8f0d980a44c57bcc41a40254349 (2026-11-12)
5
+ - Upstream path: `skills/gestures/`
6
+ - License: MIT (see `LICENSE` in this directory)
7
+
8
+ Files copied verbatim: `SKILL.md`.
9
+
10
+ The only local adaptation is the frontmatter `disable-model-invocation: true` added by
11
+ `npm run sync:skills`, so the model sees this skill only through the
12
+ `emma/skills/skills-router/SKILL.md` row and loads it on demand.
13
+
14
+ ## Resync
15
+
16
+ 1. Check out the recorded commit of the upstream repository.
17
+ 2. Replace the upstream files here with `skills/gestures/` from that commit; keep `LICENSE` and this file.
18
+ 3. Run `npm run sync:skills` to restore the hidden frontmatter and the router row.
19
+ 4. Keep the frontmatter `description` a single-line plain scalar; the router generator rejects block and folded scalars.