@oriro/orirocli 0.1.7 → 0.1.9

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 (351) hide show
  1. package/ATTRIBUTION.md +8 -0
  2. package/LICENSE +21 -0
  3. package/dist/cli.js +35 -5
  4. package/package.json +1 -1
  5. package/skills/21stdev/SKILL.md +64 -0
  6. package/skills/graphify/SKILL.md +619 -0
  7. package/skills/graphify/__init__.py +28 -0
  8. package/skills/graphify/__main__.py +4582 -0
  9. package/skills/graphify/affected.py +154 -0
  10. package/skills/graphify/always_on/agents-md.md +12 -0
  11. package/skills/graphify/always_on/antigravity-rules.md +14 -0
  12. package/skills/graphify/always_on/claude-md.md +9 -0
  13. package/skills/graphify/always_on/gemini-md.md +9 -0
  14. package/skills/graphify/always_on/kiro-steering.md +5 -0
  15. package/skills/graphify/always_on/vscode-instructions.md +17 -0
  16. package/skills/graphify/analyze.py +724 -0
  17. package/skills/graphify/benchmark.py +155 -0
  18. package/skills/graphify/build.py +487 -0
  19. package/skills/graphify/cache.py +417 -0
  20. package/skills/graphify/callflow_html.py +2020 -0
  21. package/skills/graphify/cluster.py +272 -0
  22. package/skills/graphify/command-kilo.md +15 -0
  23. package/skills/graphify/dedup.py +429 -0
  24. package/skills/graphify/detect.py +1379 -0
  25. package/skills/graphify/diagnostics.py +390 -0
  26. package/skills/graphify/export.py +1408 -0
  27. package/skills/graphify/extract.py +11570 -0
  28. package/skills/graphify/global_graph.py +159 -0
  29. package/skills/graphify/google_workspace.py +223 -0
  30. package/skills/graphify/hooks.py +457 -0
  31. package/skills/graphify/ingest.py +331 -0
  32. package/skills/graphify/llm.py +1896 -0
  33. package/skills/graphify/manifest.py +4 -0
  34. package/skills/graphify/mcp_ingest.py +392 -0
  35. package/skills/graphify/multigraph_compat.py +212 -0
  36. package/skills/graphify/pg_introspect.py +142 -0
  37. package/skills/graphify/prs.py +748 -0
  38. package/skills/graphify/querylog.py +70 -0
  39. package/skills/graphify/report.py +218 -0
  40. package/skills/graphify/scip_ingest.py +363 -0
  41. package/skills/graphify/security.py +336 -0
  42. package/skills/graphify/semantic_cleanup.py +319 -0
  43. package/skills/graphify/serve.py +1309 -0
  44. package/skills/graphify/skill-aider.md +1246 -0
  45. package/skills/graphify/skill-amp.md +613 -0
  46. package/skills/graphify/skill-claw.md +616 -0
  47. package/skills/graphify/skill-codex.md +613 -0
  48. package/skills/graphify/skill-copilot.md +616 -0
  49. package/skills/graphify/skill-devin.md +1372 -0
  50. package/skills/graphify/skill-droid.md +613 -0
  51. package/skills/graphify/skill-kilo.md +625 -0
  52. package/skills/graphify/skill-kiro.md +615 -0
  53. package/skills/graphify/skill-opencode.md +608 -0
  54. package/skills/graphify/skill-pi.md +615 -0
  55. package/skills/graphify/skill-trae.md +614 -0
  56. package/skills/graphify/skill-vscode.md +612 -0
  57. package/skills/graphify/skill-windows.md +651 -0
  58. package/skills/graphify/skills/amp/references/add-watch.md +56 -0
  59. package/skills/graphify/skills/amp/references/exports.md +71 -0
  60. package/skills/graphify/skills/amp/references/extraction-spec.md +68 -0
  61. package/skills/graphify/skills/amp/references/github-and-merge.md +46 -0
  62. package/skills/graphify/skills/amp/references/hooks.md +33 -0
  63. package/skills/graphify/skills/amp/references/query.md +249 -0
  64. package/skills/graphify/skills/amp/references/transcribe.md +48 -0
  65. package/skills/graphify/skills/amp/references/update.md +179 -0
  66. package/skills/graphify/skills/claude/references/add-watch.md +56 -0
  67. package/skills/graphify/skills/claude/references/exports.md +71 -0
  68. package/skills/graphify/skills/claude/references/extraction-spec.md +68 -0
  69. package/skills/graphify/skills/claude/references/github-and-merge.md +46 -0
  70. package/skills/graphify/skills/claude/references/hooks.md +33 -0
  71. package/skills/graphify/skills/claude/references/query.md +103 -0
  72. package/skills/graphify/skills/claude/references/transcribe.md +48 -0
  73. package/skills/graphify/skills/claude/references/update.md +179 -0
  74. package/skills/graphify/skills/claw/references/add-watch.md +56 -0
  75. package/skills/graphify/skills/claw/references/exports.md +71 -0
  76. package/skills/graphify/skills/claw/references/extraction-spec.md +29 -0
  77. package/skills/graphify/skills/claw/references/github-and-merge.md +46 -0
  78. package/skills/graphify/skills/claw/references/hooks.md +33 -0
  79. package/skills/graphify/skills/claw/references/query.md +249 -0
  80. package/skills/graphify/skills/claw/references/transcribe.md +48 -0
  81. package/skills/graphify/skills/claw/references/update.md +179 -0
  82. package/skills/graphify/skills/codex/references/add-watch.md +56 -0
  83. package/skills/graphify/skills/codex/references/exports.md +71 -0
  84. package/skills/graphify/skills/codex/references/extraction-spec.md +29 -0
  85. package/skills/graphify/skills/codex/references/github-and-merge.md +46 -0
  86. package/skills/graphify/skills/codex/references/hooks.md +33 -0
  87. package/skills/graphify/skills/codex/references/query.md +249 -0
  88. package/skills/graphify/skills/codex/references/transcribe.md +48 -0
  89. package/skills/graphify/skills/codex/references/update.md +179 -0
  90. package/skills/graphify/skills/copilot/references/add-watch.md +56 -0
  91. package/skills/graphify/skills/copilot/references/exports.md +71 -0
  92. package/skills/graphify/skills/copilot/references/extraction-spec.md +68 -0
  93. package/skills/graphify/skills/copilot/references/github-and-merge.md +46 -0
  94. package/skills/graphify/skills/copilot/references/hooks.md +33 -0
  95. package/skills/graphify/skills/copilot/references/query.md +249 -0
  96. package/skills/graphify/skills/copilot/references/transcribe.md +48 -0
  97. package/skills/graphify/skills/copilot/references/update.md +179 -0
  98. package/skills/graphify/skills/droid/references/add-watch.md +56 -0
  99. package/skills/graphify/skills/droid/references/exports.md +71 -0
  100. package/skills/graphify/skills/droid/references/extraction-spec.md +68 -0
  101. package/skills/graphify/skills/droid/references/github-and-merge.md +46 -0
  102. package/skills/graphify/skills/droid/references/hooks.md +33 -0
  103. package/skills/graphify/skills/droid/references/query.md +249 -0
  104. package/skills/graphify/skills/droid/references/transcribe.md +48 -0
  105. package/skills/graphify/skills/droid/references/update.md +179 -0
  106. package/skills/graphify/skills/kilo/references/add-watch.md +56 -0
  107. package/skills/graphify/skills/kilo/references/exports.md +71 -0
  108. package/skills/graphify/skills/kilo/references/extraction-spec.md +68 -0
  109. package/skills/graphify/skills/kilo/references/github-and-merge.md +46 -0
  110. package/skills/graphify/skills/kilo/references/hooks.md +33 -0
  111. package/skills/graphify/skills/kilo/references/query.md +249 -0
  112. package/skills/graphify/skills/kilo/references/transcribe.md +48 -0
  113. package/skills/graphify/skills/kilo/references/update.md +179 -0
  114. package/skills/graphify/skills/kiro/references/add-watch.md +56 -0
  115. package/skills/graphify/skills/kiro/references/exports.md +71 -0
  116. package/skills/graphify/skills/kiro/references/extraction-spec.md +29 -0
  117. package/skills/graphify/skills/kiro/references/github-and-merge.md +46 -0
  118. package/skills/graphify/skills/kiro/references/hooks.md +33 -0
  119. package/skills/graphify/skills/kiro/references/query.md +249 -0
  120. package/skills/graphify/skills/kiro/references/transcribe.md +48 -0
  121. package/skills/graphify/skills/kiro/references/update.md +179 -0
  122. package/skills/graphify/skills/opencode/references/add-watch.md +56 -0
  123. package/skills/graphify/skills/opencode/references/exports.md +71 -0
  124. package/skills/graphify/skills/opencode/references/extraction-spec.md +68 -0
  125. package/skills/graphify/skills/opencode/references/github-and-merge.md +46 -0
  126. package/skills/graphify/skills/opencode/references/hooks.md +33 -0
  127. package/skills/graphify/skills/opencode/references/query.md +249 -0
  128. package/skills/graphify/skills/opencode/references/transcribe.md +48 -0
  129. package/skills/graphify/skills/opencode/references/update.md +179 -0
  130. package/skills/graphify/skills/pi/references/add-watch.md +56 -0
  131. package/skills/graphify/skills/pi/references/exports.md +71 -0
  132. package/skills/graphify/skills/pi/references/extraction-spec.md +29 -0
  133. package/skills/graphify/skills/pi/references/github-and-merge.md +46 -0
  134. package/skills/graphify/skills/pi/references/hooks.md +33 -0
  135. package/skills/graphify/skills/pi/references/query.md +249 -0
  136. package/skills/graphify/skills/pi/references/transcribe.md +48 -0
  137. package/skills/graphify/skills/pi/references/update.md +179 -0
  138. package/skills/graphify/skills/trae/references/add-watch.md +56 -0
  139. package/skills/graphify/skills/trae/references/exports.md +71 -0
  140. package/skills/graphify/skills/trae/references/extraction-spec.md +68 -0
  141. package/skills/graphify/skills/trae/references/github-and-merge.md +46 -0
  142. package/skills/graphify/skills/trae/references/hooks.md +35 -0
  143. package/skills/graphify/skills/trae/references/query.md +249 -0
  144. package/skills/graphify/skills/trae/references/transcribe.md +48 -0
  145. package/skills/graphify/skills/trae/references/update.md +179 -0
  146. package/skills/graphify/skills/vscode/references/add-watch.md +56 -0
  147. package/skills/graphify/skills/vscode/references/exports.md +71 -0
  148. package/skills/graphify/skills/vscode/references/extraction-spec.md +68 -0
  149. package/skills/graphify/skills/vscode/references/github-and-merge.md +46 -0
  150. package/skills/graphify/skills/vscode/references/hooks.md +33 -0
  151. package/skills/graphify/skills/vscode/references/query.md +249 -0
  152. package/skills/graphify/skills/vscode/references/transcribe.md +48 -0
  153. package/skills/graphify/skills/vscode/references/update.md +179 -0
  154. package/skills/graphify/skills/windows/references/add-watch.md +56 -0
  155. package/skills/graphify/skills/windows/references/exports.md +71 -0
  156. package/skills/graphify/skills/windows/references/extraction-spec.md +68 -0
  157. package/skills/graphify/skills/windows/references/github-and-merge.md +46 -0
  158. package/skills/graphify/skills/windows/references/hooks.md +33 -0
  159. package/skills/graphify/skills/windows/references/query.md +249 -0
  160. package/skills/graphify/skills/windows/references/transcribe.md +48 -0
  161. package/skills/graphify/skills/windows/references/update.md +179 -0
  162. package/skills/graphify/symbol_resolution.py +538 -0
  163. package/skills/graphify/transcribe.py +184 -0
  164. package/skills/graphify/tree_html.py +582 -0
  165. package/skills/graphify/validate.py +72 -0
  166. package/skills/graphify/watch.py +898 -0
  167. package/skills/graphify/wiki.py +282 -0
  168. package/skills/impeccable/SKILL.md +186 -0
  169. package/skills/impeccable/agents/impeccable_asset_producer.toml +92 -0
  170. package/skills/impeccable/agents/impeccable_manual_edit_applier.toml +95 -0
  171. package/skills/impeccable/agents/openai.yaml +4 -0
  172. package/skills/impeccable/reference/adapt.md +311 -0
  173. package/skills/impeccable/reference/animate.md +201 -0
  174. package/skills/impeccable/reference/audit.md +133 -0
  175. package/skills/impeccable/reference/bolder.md +113 -0
  176. package/skills/impeccable/reference/brand.md +108 -0
  177. package/skills/impeccable/reference/clarify.md +288 -0
  178. package/skills/impeccable/reference/codex.md +105 -0
  179. package/skills/impeccable/reference/colorize.md +257 -0
  180. package/skills/impeccable/reference/craft.md +123 -0
  181. package/skills/impeccable/reference/critique.md +790 -0
  182. package/skills/impeccable/reference/delight.md +302 -0
  183. package/skills/impeccable/reference/distill.md +111 -0
  184. package/skills/impeccable/reference/document.md +429 -0
  185. package/skills/impeccable/reference/extract.md +69 -0
  186. package/skills/impeccable/reference/harden.md +347 -0
  187. package/skills/impeccable/reference/init.md +172 -0
  188. package/skills/impeccable/reference/interaction-design.md +189 -0
  189. package/skills/impeccable/reference/layout.md +161 -0
  190. package/skills/impeccable/reference/live.md +720 -0
  191. package/skills/impeccable/reference/onboard.md +234 -0
  192. package/skills/impeccable/reference/optimize.md +258 -0
  193. package/skills/impeccable/reference/overdrive.md +130 -0
  194. package/skills/impeccable/reference/polish.md +241 -0
  195. package/skills/impeccable/reference/product.md +60 -0
  196. package/skills/impeccable/reference/quieter.md +99 -0
  197. package/skills/impeccable/reference/shape.md +165 -0
  198. package/skills/impeccable/reference/typeset.md +279 -0
  199. package/skills/impeccable/scripts/cleanup-deprecated.mjs +284 -0
  200. package/skills/impeccable/scripts/command-metadata.json +94 -0
  201. package/skills/impeccable/scripts/context-signals.mjs +225 -0
  202. package/skills/impeccable/scripts/context.mjs +266 -0
  203. package/skills/impeccable/scripts/critique-storage.mjs +242 -0
  204. package/skills/impeccable/scripts/design-parser.mjs +835 -0
  205. package/skills/impeccable/scripts/detect-csp.mjs +198 -0
  206. package/skills/impeccable/scripts/detect.mjs +21 -0
  207. package/skills/impeccable/scripts/detector/browser/injected/index.mjs +1733 -0
  208. package/skills/impeccable/scripts/detector/cli/main.mjs +244 -0
  209. package/skills/impeccable/scripts/detector/detect-antipatterns-browser.js +4618 -0
  210. package/skills/impeccable/scripts/detector/detect-antipatterns.mjs +43 -0
  211. package/skills/impeccable/scripts/detector/engines/browser/detect-url.mjs +252 -0
  212. package/skills/impeccable/scripts/detector/engines/regex/detect-text.mjs +535 -0
  213. package/skills/impeccable/scripts/detector/engines/static-html/css-cascade.mjs +986 -0
  214. package/skills/impeccable/scripts/detector/engines/static-html/detect-html.mjs +208 -0
  215. package/skills/impeccable/scripts/detector/engines/visual/screenshot-contrast.mjs +189 -0
  216. package/skills/impeccable/scripts/detector/findings.mjs +12 -0
  217. package/skills/impeccable/scripts/detector/node/file-system.mjs +198 -0
  218. package/skills/impeccable/scripts/detector/profile/profiler.mjs +166 -0
  219. package/skills/impeccable/scripts/detector/registry/antipatterns.mjs +419 -0
  220. package/skills/impeccable/scripts/detector/rules/checks.mjs +2384 -0
  221. package/skills/impeccable/scripts/detector/shared/color.mjs +124 -0
  222. package/skills/impeccable/scripts/detector/shared/constants.mjs +101 -0
  223. package/skills/impeccable/scripts/detector/shared/page.mjs +7 -0
  224. package/skills/impeccable/scripts/impeccable-paths.mjs +126 -0
  225. package/skills/impeccable/scripts/is-generated.mjs +69 -0
  226. package/skills/impeccable/scripts/live-accept.mjs +812 -0
  227. package/skills/impeccable/scripts/live-browser-session.js +123 -0
  228. package/skills/impeccable/scripts/live-browser.js +10295 -0
  229. package/skills/impeccable/scripts/live-commit-manual-edits.mjs +1241 -0
  230. package/skills/impeccable/scripts/live-complete.mjs +75 -0
  231. package/skills/impeccable/scripts/live-completion.mjs +19 -0
  232. package/skills/impeccable/scripts/live-copy-edit-agent.mjs +683 -0
  233. package/skills/impeccable/scripts/live-discard-manual-edits.mjs +51 -0
  234. package/skills/impeccable/scripts/live-event-validation.mjs +137 -0
  235. package/skills/impeccable/scripts/live-inject.mjs +557 -0
  236. package/skills/impeccable/scripts/live-insert-ui.mjs +458 -0
  237. package/skills/impeccable/scripts/live-insert.mjs +272 -0
  238. package/skills/impeccable/scripts/live-manual-edit-evidence.mjs +363 -0
  239. package/skills/impeccable/scripts/live-manual-edits-buffer.mjs +152 -0
  240. package/skills/impeccable/scripts/live-poll.mjs +379 -0
  241. package/skills/impeccable/scripts/live-resume.mjs +94 -0
  242. package/skills/impeccable/scripts/live-server.mjs +2326 -0
  243. package/skills/impeccable/scripts/live-session-store.mjs +289 -0
  244. package/skills/impeccable/scripts/live-status.mjs +61 -0
  245. package/skills/impeccable/scripts/live-svelte-component.mjs +826 -0
  246. package/skills/impeccable/scripts/live-sveltekit-adapter.mjs +274 -0
  247. package/skills/impeccable/scripts/live-ui-core.mjs +179 -0
  248. package/skills/impeccable/scripts/live-vocabulary.mjs +36 -0
  249. package/skills/impeccable/scripts/live-wrap.mjs +894 -0
  250. package/skills/impeccable/scripts/live.mjs +246 -0
  251. package/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
  252. package/skills/impeccable/scripts/palette.mjs +633 -0
  253. package/skills/impeccable/scripts/pin.mjs +214 -0
  254. package/skills/uipm-ui-styling/LICENSE.txt +202 -0
  255. package/skills/uipm-ui-styling/SKILL.md +328 -0
  256. package/skills/uipm-ui-styling/canvas-fonts/ArsenalSC-OFL.txt +93 -0
  257. package/skills/uipm-ui-styling/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
  258. package/skills/uipm-ui-styling/canvas-fonts/BigShoulders-Bold.ttf +0 -0
  259. package/skills/uipm-ui-styling/canvas-fonts/BigShoulders-OFL.txt +93 -0
  260. package/skills/uipm-ui-styling/canvas-fonts/BigShoulders-Regular.ttf +0 -0
  261. package/skills/uipm-ui-styling/canvas-fonts/Boldonse-OFL.txt +93 -0
  262. package/skills/uipm-ui-styling/canvas-fonts/Boldonse-Regular.ttf +0 -0
  263. package/skills/uipm-ui-styling/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
  264. package/skills/uipm-ui-styling/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
  265. package/skills/uipm-ui-styling/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
  266. package/skills/uipm-ui-styling/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
  267. package/skills/uipm-ui-styling/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
  268. package/skills/uipm-ui-styling/canvas-fonts/CrimsonPro-OFL.txt +93 -0
  269. package/skills/uipm-ui-styling/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
  270. package/skills/uipm-ui-styling/canvas-fonts/DMMono-OFL.txt +93 -0
  271. package/skills/uipm-ui-styling/canvas-fonts/DMMono-Regular.ttf +0 -0
  272. package/skills/uipm-ui-styling/canvas-fonts/EricaOne-OFL.txt +94 -0
  273. package/skills/uipm-ui-styling/canvas-fonts/EricaOne-Regular.ttf +0 -0
  274. package/skills/uipm-ui-styling/canvas-fonts/GeistMono-Bold.ttf +0 -0
  275. package/skills/uipm-ui-styling/canvas-fonts/GeistMono-OFL.txt +93 -0
  276. package/skills/uipm-ui-styling/canvas-fonts/GeistMono-Regular.ttf +0 -0
  277. package/skills/uipm-ui-styling/canvas-fonts/Gloock-OFL.txt +93 -0
  278. package/skills/uipm-ui-styling/canvas-fonts/Gloock-Regular.ttf +0 -0
  279. package/skills/uipm-ui-styling/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
  280. package/skills/uipm-ui-styling/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
  281. package/skills/uipm-ui-styling/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
  282. package/skills/uipm-ui-styling/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
  283. package/skills/uipm-ui-styling/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
  284. package/skills/uipm-ui-styling/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
  285. package/skills/uipm-ui-styling/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
  286. package/skills/uipm-ui-styling/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
  287. package/skills/uipm-ui-styling/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
  288. package/skills/uipm-ui-styling/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
  289. package/skills/uipm-ui-styling/canvas-fonts/InstrumentSans-OFL.txt +93 -0
  290. package/skills/uipm-ui-styling/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
  291. package/skills/uipm-ui-styling/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
  292. package/skills/uipm-ui-styling/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
  293. package/skills/uipm-ui-styling/canvas-fonts/Italiana-OFL.txt +93 -0
  294. package/skills/uipm-ui-styling/canvas-fonts/Italiana-Regular.ttf +0 -0
  295. package/skills/uipm-ui-styling/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
  296. package/skills/uipm-ui-styling/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
  297. package/skills/uipm-ui-styling/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
  298. package/skills/uipm-ui-styling/canvas-fonts/Jura-Light.ttf +0 -0
  299. package/skills/uipm-ui-styling/canvas-fonts/Jura-Medium.ttf +0 -0
  300. package/skills/uipm-ui-styling/canvas-fonts/Jura-OFL.txt +93 -0
  301. package/skills/uipm-ui-styling/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
  302. package/skills/uipm-ui-styling/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
  303. package/skills/uipm-ui-styling/canvas-fonts/Lora-Bold.ttf +0 -0
  304. package/skills/uipm-ui-styling/canvas-fonts/Lora-BoldItalic.ttf +0 -0
  305. package/skills/uipm-ui-styling/canvas-fonts/Lora-Italic.ttf +0 -0
  306. package/skills/uipm-ui-styling/canvas-fonts/Lora-OFL.txt +93 -0
  307. package/skills/uipm-ui-styling/canvas-fonts/Lora-Regular.ttf +0 -0
  308. package/skills/uipm-ui-styling/canvas-fonts/NationalPark-Bold.ttf +0 -0
  309. package/skills/uipm-ui-styling/canvas-fonts/NationalPark-OFL.txt +93 -0
  310. package/skills/uipm-ui-styling/canvas-fonts/NationalPark-Regular.ttf +0 -0
  311. package/skills/uipm-ui-styling/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
  312. package/skills/uipm-ui-styling/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
  313. package/skills/uipm-ui-styling/canvas-fonts/Outfit-Bold.ttf +0 -0
  314. package/skills/uipm-ui-styling/canvas-fonts/Outfit-OFL.txt +93 -0
  315. package/skills/uipm-ui-styling/canvas-fonts/Outfit-Regular.ttf +0 -0
  316. package/skills/uipm-ui-styling/canvas-fonts/PixelifySans-Medium.ttf +0 -0
  317. package/skills/uipm-ui-styling/canvas-fonts/PixelifySans-OFL.txt +93 -0
  318. package/skills/uipm-ui-styling/canvas-fonts/PoiretOne-OFL.txt +93 -0
  319. package/skills/uipm-ui-styling/canvas-fonts/PoiretOne-Regular.ttf +0 -0
  320. package/skills/uipm-ui-styling/canvas-fonts/RedHatMono-Bold.ttf +0 -0
  321. package/skills/uipm-ui-styling/canvas-fonts/RedHatMono-OFL.txt +93 -0
  322. package/skills/uipm-ui-styling/canvas-fonts/RedHatMono-Regular.ttf +0 -0
  323. package/skills/uipm-ui-styling/canvas-fonts/Silkscreen-OFL.txt +93 -0
  324. package/skills/uipm-ui-styling/canvas-fonts/Silkscreen-Regular.ttf +0 -0
  325. package/skills/uipm-ui-styling/canvas-fonts/SmoochSans-Medium.ttf +0 -0
  326. package/skills/uipm-ui-styling/canvas-fonts/SmoochSans-OFL.txt +93 -0
  327. package/skills/uipm-ui-styling/canvas-fonts/Tektur-Medium.ttf +0 -0
  328. package/skills/uipm-ui-styling/canvas-fonts/Tektur-OFL.txt +93 -0
  329. package/skills/uipm-ui-styling/canvas-fonts/Tektur-Regular.ttf +0 -0
  330. package/skills/uipm-ui-styling/canvas-fonts/WorkSans-Bold.ttf +0 -0
  331. package/skills/uipm-ui-styling/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
  332. package/skills/uipm-ui-styling/canvas-fonts/WorkSans-Italic.ttf +0 -0
  333. package/skills/uipm-ui-styling/canvas-fonts/WorkSans-OFL.txt +93 -0
  334. package/skills/uipm-ui-styling/canvas-fonts/WorkSans-Regular.ttf +0 -0
  335. package/skills/uipm-ui-styling/canvas-fonts/YoungSerif-OFL.txt +93 -0
  336. package/skills/uipm-ui-styling/canvas-fonts/YoungSerif-Regular.ttf +0 -0
  337. package/skills/uipm-ui-styling/references/canvas-design-system.md +320 -0
  338. package/skills/uipm-ui-styling/references/shadcn-accessibility.md +471 -0
  339. package/skills/uipm-ui-styling/references/shadcn-components.md +424 -0
  340. package/skills/uipm-ui-styling/references/shadcn-theming.md +373 -0
  341. package/skills/uipm-ui-styling/references/tailwind-customization.md +483 -0
  342. package/skills/uipm-ui-styling/references/tailwind-responsive.md +382 -0
  343. package/skills/uipm-ui-styling/references/tailwind-utilities.md +455 -0
  344. package/skills/uipm-ui-styling/scripts/.coverage +0 -0
  345. package/skills/uipm-ui-styling/scripts/requirements.txt +17 -0
  346. package/skills/uipm-ui-styling/scripts/shadcn_add.py +292 -0
  347. package/skills/uipm-ui-styling/scripts/tailwind_config_gen.py +456 -0
  348. package/skills/uipm-ui-styling/scripts/tests/coverage-ui.json +1 -0
  349. package/skills/uipm-ui-styling/scripts/tests/requirements.txt +3 -0
  350. package/skills/uipm-ui-styling/scripts/tests/test_shadcn_add.py +266 -0
  351. package/skills/uipm-ui-styling/scripts/tests/test_tailwind_config_gen.py +336 -0
@@ -0,0 +1,535 @@
1
+ import { GENERIC_FONTS } from '../../shared/constants.mjs';
2
+ import { isFullPage } from '../../shared/page.mjs';
3
+ import { finding } from '../../findings.mjs';
4
+ import { filterByProviders } from '../../registry/antipatterns.mjs';
5
+ import { profileFindings, profileStep } from '../../profile/profiler.mjs';
6
+
7
+ // ---------------------------------------------------------------------------
8
+ // Regex fallback (non-HTML files: CSS, JSX, TSX, etc.)
9
+ // ---------------------------------------------------------------------------
10
+
11
+ const hasRounded = (line) => /\brounded(?:-\w+)?\b/.test(line);
12
+ const hasBorderRadius = (line) => /border-radius/i.test(line);
13
+ const isSafeElement = (line) => /<(?:blockquote|nav[\s>]|pre[\s>]|code[\s>]|a\s|input[\s>]|span[\s>])/i.test(line);
14
+
15
+ /** Strip HTML to plain text — drops script/style/comments/tags so
16
+ * content-text analyzers don't false-positive on code or CSS. */
17
+ function stripHtmlToText(html) {
18
+ return html
19
+ .replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi, ' ')
20
+ .replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi, ' ')
21
+ .replace(/<!--[\s\S]*?-->/g, ' ')
22
+ .replace(/<[^>]+>/g, ' ')
23
+ .replace(/\s+/g, ' ');
24
+ }
25
+
26
+ function isNeutralBorderColor(str) {
27
+ const m = str.match(/solid\s+(#[0-9a-f]{3,8}|rgba?\([^)]+\)|\w+)/i);
28
+ if (!m) return false;
29
+ const c = m[1].toLowerCase();
30
+ if (['gray', 'grey', 'silver', 'white', 'black', 'transparent', 'currentcolor'].includes(c)) return true;
31
+ const hex = c.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/);
32
+ if (hex) {
33
+ const [r, g, b] = [parseInt(hex[1], 16), parseInt(hex[2], 16), parseInt(hex[3], 16)];
34
+ return (Math.max(r, g, b) - Math.min(r, g, b)) < 30;
35
+ }
36
+ const shex = c.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/);
37
+ if (shex) {
38
+ const [r, g, b] = [parseInt(shex[1] + shex[1], 16), parseInt(shex[2] + shex[2], 16), parseInt(shex[3] + shex[3], 16)];
39
+ return (Math.max(r, g, b) - Math.min(r, g, b)) < 30;
40
+ }
41
+ return false;
42
+ }
43
+
44
+ const REGEX_MATCHERS = [
45
+ // --- Side-tab ---
46
+ { id: 'side-tab', regex: /\bborder-[lrse]-(\d+)\b/g,
47
+ test: (m, line) => { const n = +m[1]; return hasRounded(line) ? n >= 1 : n >= 4; },
48
+ fmt: (m) => m[0] },
49
+ { id: 'side-tab', regex: /border-(?:left|right)\s*:\s*(\d+)px\s+solid[^;]*/gi,
50
+ test: (m, line) => { if (isSafeElement(line)) return false; if (isNeutralBorderColor(m[0])) return false; const n = +m[1]; return hasBorderRadius(line) ? n >= 1 : n >= 3; },
51
+ fmt: (m) => m[0].replace(/\s*;?\s*$/, '') },
52
+ { id: 'side-tab', regex: /border-(?:left|right)-width\s*:\s*(\d+)px/gi,
53
+ test: (m, line) => !isSafeElement(line) && +m[1] >= 3,
54
+ fmt: (m) => m[0] },
55
+ { id: 'side-tab', regex: /border-inline-(?:start|end)\s*:\s*(\d+)px\s+solid/gi,
56
+ test: (m, line) => !isSafeElement(line) && +m[1] >= 3,
57
+ fmt: (m) => m[0] },
58
+ { id: 'side-tab', regex: /border-inline-(?:start|end)-width\s*:\s*(\d+)px/gi,
59
+ test: (m, line) => !isSafeElement(line) && +m[1] >= 3,
60
+ fmt: (m) => m[0] },
61
+ { id: 'side-tab', regex: /border(?:Left|Right)\s*[:=]\s*["'`](\d+)px\s+solid/g,
62
+ test: (m) => +m[1] >= 3,
63
+ fmt: (m) => m[0] },
64
+ // --- Border accent on rounded ---
65
+ { id: 'border-accent-on-rounded', regex: /\bborder-[tb]-(\d+)\b/g,
66
+ test: (m, line) => hasRounded(line) && +m[1] >= 1,
67
+ fmt: (m) => m[0] },
68
+ { id: 'border-accent-on-rounded', regex: /border-(?:top|bottom)\s*:\s*(\d+)px\s+solid/gi,
69
+ test: (m, line) => +m[1] >= 3 && hasBorderRadius(line),
70
+ fmt: (m) => m[0] },
71
+ // --- Overused font ---
72
+ { id: 'overused-font', regex: /font-family\s*:\s*['"]?(Inter|Roboto|Open Sans|Lato|Montserrat|Arial|Helvetica|Fraunces|Geist Sans|Geist Mono|Geist|Mona Sans|Plus Jakarta Sans|Space Grotesk|Recoleta|Instrument Sans|Instrument Serif)\b/gi,
73
+ test: () => true,
74
+ fmt: (m) => m[0] },
75
+ { id: 'overused-font', regex: /fonts\.googleapis\.com\/css2?\?family=(Inter|Roboto|Open\+Sans|Lato|Montserrat|Fraunces|Plus\+Jakarta\+Sans|Space\+Grotesk|Instrument\+Sans|Instrument\+Serif|Mona\+Sans|Geist)\b/gi,
76
+ test: () => true,
77
+ fmt: (m) => `Google Fonts: ${m[1].replace(/\+/g, ' ')}` },
78
+ // --- Gradient text ---
79
+ { id: 'gradient-text', regex: /background-clip\s*:\s*text|-webkit-background-clip\s*:\s*text/gi,
80
+ test: (m, line) => /gradient/i.test(line),
81
+ fmt: () => 'background-clip: text + gradient' },
82
+ // --- Gradient text (Tailwind) ---
83
+ { id: 'gradient-text', regex: /\bbg-clip-text\b/g,
84
+ test: (m, line) => /\bbg-gradient-to-/i.test(line),
85
+ fmt: () => 'bg-clip-text + bg-gradient' },
86
+ // --- Tailwind gray on colored bg ---
87
+ { id: 'gray-on-color', regex: /\btext-(?:gray|slate|zinc|neutral|stone)-(\d+)\b/g,
88
+ test: (m, line) => /\bbg-(?:red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-\d+\b/.test(line),
89
+ fmt: (m, line) => { const bg = line.match(/\bbg-(?:red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-\d+\b/); return `${m[0]} on ${bg?.[0] || '?'}`; } },
90
+ // --- Tailwind AI palette ---
91
+ { id: 'ai-color-palette', regex: /\btext-(?:purple|violet|indigo)-(\d+)\b/g,
92
+ test: (m, line) => /\btext-(?:[2-9]xl|[3-9]xl)\b|<h[1-3]/i.test(line),
93
+ fmt: (m) => `${m[0]} on heading` },
94
+ { id: 'ai-color-palette', regex: /\bfrom-(?:purple|violet|indigo)-(\d+)\b/g,
95
+ test: (m, line) => /\bto-(?:purple|violet|indigo|blue|cyan|pink|fuchsia)-\d+\b/.test(line),
96
+ fmt: (m) => `${m[0]} gradient` },
97
+ // --- Bounce/elastic easing ---
98
+ { id: 'bounce-easing', regex: /\banimate-bounce\b/g,
99
+ test: () => true,
100
+ fmt: () => 'animate-bounce (Tailwind)' },
101
+ { id: 'bounce-easing', regex: /animation(?:-name)?\s*:\s*[^;]*\b(bounce|elastic|wobble|jiggle|spring)\b/gi,
102
+ test: () => true,
103
+ fmt: (m) => m[0] },
104
+ { id: 'bounce-easing', regex: /cubic-bezier\(\s*([\d.-]+)\s*,\s*([\d.-]+)\s*,\s*([\d.-]+)\s*,\s*([\d.-]+)\s*\)/g,
105
+ test: (m) => {
106
+ const y1 = parseFloat(m[2]), y2 = parseFloat(m[4]);
107
+ return y1 < -0.1 || y1 > 1.1 || y2 < -0.1 || y2 > 1.1;
108
+ },
109
+ fmt: (m) => `cubic-bezier(${m[1]}, ${m[2]}, ${m[3]}, ${m[4]})` },
110
+ // --- Layout property transition ---
111
+ { id: 'layout-transition', regex: /transition\s*:\s*([^;{}]+)/gi,
112
+ test: (m) => {
113
+ const val = m[1].toLowerCase();
114
+ if (/\ball\b/.test(val)) return false;
115
+ return /\b(?:(?:max|min)-)?(?:width|height)\b|\bpadding\b|\bmargin\b/.test(val);
116
+ },
117
+ fmt: (m) => {
118
+ const found = m[1].match(/\b(?:(?:max|min)-)?(?:width|height)\b|\bpadding(?:-(?:top|right|bottom|left))?\b|\bmargin(?:-(?:top|right|bottom|left))?\b/gi);
119
+ return `transition: ${found ? found.join(', ') : m[1].trim()}`;
120
+ } },
121
+ { id: 'layout-transition', regex: /transition-property\s*:\s*([^;{}]+)/gi,
122
+ test: (m) => {
123
+ const val = m[1].toLowerCase();
124
+ if (/\ball\b/.test(val)) return false;
125
+ return /\b(?:(?:max|min)-)?(?:width|height)\b|\bpadding\b|\bmargin\b/.test(val);
126
+ },
127
+ fmt: (m) => {
128
+ const found = m[1].match(/\b(?:(?:max|min)-)?(?:width|height)\b|\bpadding(?:-(?:top|right|bottom|left))?\b|\bmargin(?:-(?:top|right|bottom|left))?\b/gi);
129
+ return `transition-property: ${found ? found.join(', ') : m[1].trim()}`;
130
+ } },
131
+ // --- Broken image: src="" or src="#" or src=" " ---
132
+ { id: 'broken-image', regex: /<img\b[^>]*?\bsrc\s*=\s*(?:""|''|"\s+"|'\s+'|"#"|'#')/gi,
133
+ test: () => true,
134
+ fmt: (m) => m[0].slice(0, 100) },
135
+ // --- Broken image: <img> with no src attribute at all ---
136
+ { id: 'broken-image', regex: /<img\b(?:(?!\bsrc\s*=)[^>])*>/gi,
137
+ test: (m) => !/\bsrc\s*=/i.test(m[0]),
138
+ fmt: (m) => m[0].slice(0, 100) },
139
+ ];
140
+
141
+ const REGEX_ANALYZERS = [
142
+ // Single font
143
+ (content, filePath) => {
144
+ const fontFamilyRe = /font-family\s*:\s*([^;}]+)/gi;
145
+ const fonts = new Set();
146
+ let m;
147
+ while ((m = fontFamilyRe.exec(content)) !== null) {
148
+ for (const f of m[1].split(',').map(f => f.trim().replace(/^['"]|['"]$/g, '').toLowerCase())) {
149
+ if (f && !GENERIC_FONTS.has(f)) fonts.add(f);
150
+ }
151
+ }
152
+ const gfRe = /fonts\.googleapis\.com\/css2?\?family=([^&"'\s]+)/gi;
153
+ while ((m = gfRe.exec(content)) !== null) {
154
+ for (const f of m[1].split('|').map(f => f.split(':')[0].replace(/\+/g, ' ').toLowerCase())) fonts.add(f);
155
+ }
156
+ if (fonts.size !== 1 || content.split('\n').length < 20) return [];
157
+ const name = [...fonts][0];
158
+ const lines = content.split('\n');
159
+ let line = 1;
160
+ for (let i = 0; i < lines.length; i++) { if (lines[i].toLowerCase().includes(name)) { line = i + 1; break; } }
161
+ return [finding('single-font', filePath, `only font used is ${name}`, line)];
162
+ },
163
+ // Flat type hierarchy
164
+ (content, filePath) => {
165
+ const sizes = new Set();
166
+ const REM = 16;
167
+ let m;
168
+ const sizeRe = /font-size\s*:\s*([\d.]+)(px|rem|em)\b/gi;
169
+ while ((m = sizeRe.exec(content)) !== null) {
170
+ const px = m[2] === 'px' ? +m[1] : +m[1] * REM;
171
+ if (px > 0 && px < 200) sizes.add(Math.round(px * 10) / 10);
172
+ }
173
+ const clampRe = /font-size\s*:\s*clamp\(\s*([\d.]+)(px|rem|em)\s*,\s*[^,]+,\s*([\d.]+)(px|rem|em)\s*\)/gi;
174
+ while ((m = clampRe.exec(content)) !== null) {
175
+ sizes.add(Math.round((m[2] === 'px' ? +m[1] : +m[1] * REM) * 10) / 10);
176
+ sizes.add(Math.round((m[4] === 'px' ? +m[3] : +m[3] * REM) * 10) / 10);
177
+ }
178
+ const TW = { 'text-xs': 12, 'text-sm': 14, 'text-base': 16, 'text-lg': 18, 'text-xl': 20, 'text-2xl': 24, 'text-3xl': 30, 'text-4xl': 36, 'text-5xl': 48, 'text-6xl': 60, 'text-7xl': 72, 'text-8xl': 96, 'text-9xl': 128 };
179
+ for (const [cls, px] of Object.entries(TW)) { if (new RegExp(`\\b${cls}\\b`).test(content)) sizes.add(px); }
180
+ if (sizes.size < 3) return [];
181
+ const sorted = [...sizes].sort((a, b) => a - b);
182
+ const ratio = sorted[sorted.length - 1] / sorted[0];
183
+ if (ratio >= 2.0) return [];
184
+ const lines = content.split('\n');
185
+ let line = 1;
186
+ for (let i = 0; i < lines.length; i++) { if (/font-size/i.test(lines[i]) || /\btext-(?:xs|sm|base|lg|xl|\d)/i.test(lines[i])) { line = i + 1; break; } }
187
+ return [finding('flat-type-hierarchy', filePath, `Sizes: ${sorted.map(s => s + 'px').join(', ')} (ratio ${ratio.toFixed(1)}:1)`, line)];
188
+ },
189
+ // Monotonous spacing (regex)
190
+ (content, filePath) => {
191
+ const vals = [];
192
+ let m;
193
+ const pxRe = /(?:padding|margin)(?:-(?:top|right|bottom|left))?\s*:\s*(\d+)px/gi;
194
+ while ((m = pxRe.exec(content)) !== null) { const v = +m[1]; if (v > 0 && v < 200) vals.push(v); }
195
+ const remRe = /(?:padding|margin)(?:-(?:top|right|bottom|left))?\s*:\s*([\d.]+)rem/gi;
196
+ while ((m = remRe.exec(content)) !== null) { const v = Math.round(parseFloat(m[1]) * 16); if (v > 0 && v < 200) vals.push(v); }
197
+ const gapRe = /gap\s*:\s*(\d+)px/gi;
198
+ while ((m = gapRe.exec(content)) !== null) vals.push(+m[1]);
199
+ const twRe = /\b(?:p|px|py|pt|pb|pl|pr|m|mx|my|mt|mb|ml|mr|gap)-(\d+)\b/g;
200
+ while ((m = twRe.exec(content)) !== null) vals.push(+m[1] * 4);
201
+ const rounded = vals.map(v => Math.round(v / 4) * 4);
202
+ if (rounded.length < 10) return [];
203
+ const counts = {};
204
+ for (const v of rounded) counts[v] = (counts[v] || 0) + 1;
205
+ const maxCount = Math.max(...Object.values(counts));
206
+ const pct = maxCount / rounded.length;
207
+ const unique = [...new Set(rounded)].filter(v => v > 0);
208
+ if (pct <= 0.6 || unique.length > 3) return [];
209
+ const dominant = Object.entries(counts).sort((a, b) => b[1] - a[1])[0][0];
210
+ return [finding('monotonous-spacing', filePath, `~${dominant}px used ${maxCount}/${rounded.length} times (${Math.round(pct * 100)}%)`)];
211
+ },
212
+ // Em-dash overuse: 5+ em-dashes or "--" in body text content
213
+ // (occasional em-dash use in prose is fine; the pattern fires only
214
+ // when count crosses into AI-cadence territory).
215
+ (content, filePath) => {
216
+ const text = stripHtmlToText(content);
217
+ let count = 0;
218
+ const re = /[—]|--(?=\S)/g;
219
+ while (re.exec(text) !== null) count++;
220
+ if (count < 5) return [];
221
+ return [finding('em-dash-overuse', filePath, `${count} em-dashes in body text`)];
222
+ },
223
+ // Marketing buzzwords: SaaS phrase list
224
+ (content, filePath) => {
225
+ const text = stripHtmlToText(content);
226
+ const lower = text.toLowerCase();
227
+ const BUZZWORDS = [
228
+ 'streamline your', 'empower your', 'supercharge your',
229
+ 'unleash your', 'unleash the power', 'leverage the power',
230
+ 'built for the modern', 'trusted by leading', 'trusted by the world',
231
+ 'best-in-class', 'industry-leading', 'world-class', 'enterprise-grade',
232
+ 'next-generation', 'cutting-edge', 'transform your business',
233
+ 'revolutionize', 'game-changer', 'game changing',
234
+ 'mission-critical', 'best of breed', 'future-proof', 'future proof',
235
+ 'seamless experience', 'seamlessly integrate',
236
+ 'drive engagement', 'drive growth', 'drive results',
237
+ 'harness the power',
238
+ ];
239
+ let count = 0;
240
+ let firstSample = '';
241
+ for (const phrase of BUZZWORDS) {
242
+ let from = 0;
243
+ while (true) {
244
+ const idx = lower.indexOf(phrase, from);
245
+ if (idx === -1) break;
246
+ count++;
247
+ if (!firstSample) {
248
+ firstSample = text.slice(Math.max(0, idx - 12), Math.min(text.length, idx + phrase.length + 12)).trim();
249
+ }
250
+ from = idx + phrase.length;
251
+ }
252
+ }
253
+ if (count === 0) return [];
254
+ return [finding('marketing-buzzword', filePath, `${count} buzzword phrase${count === 1 ? '' : 's'}: "${firstSample}"`)];
255
+ },
256
+ // Numbered section markers (01 / 02 / 03 ...)
257
+ (content, filePath) => {
258
+ const text = stripHtmlToText(content);
259
+ const re = /\b(0[1-9]|1[0-2])\b/g;
260
+ const seen = new Set();
261
+ let m;
262
+ while ((m = re.exec(text)) !== null) seen.add(m[1]);
263
+ if (seen.size < 3) return [];
264
+ const sorted = [...seen].sort();
265
+ let sequential = 0;
266
+ for (let i = 1; i < sorted.length; i++) {
267
+ if (parseInt(sorted[i], 10) === parseInt(sorted[i - 1], 10) + 1) sequential++;
268
+ }
269
+ if (sequential < 2) return [];
270
+ return [finding('numbered-section-markers', filePath, `Sequence: ${sorted.slice(0, 6).join(', ')}`)];
271
+ },
272
+ // Aphoristic cadence: manufactured-contrast + short-rebuttal
273
+ (content, filePath) => {
274
+ const text = stripHtmlToText(content);
275
+ const NOT_A_RE = /\bNot an? [a-z][^.!?]{1,40}[.!]\s+[A-Z][^.!?]{1,60}[.!]/g;
276
+ const SHORT_REBUTTAL_RE = /\b[A-Z][^.!?]{4,80}[.!]\s+(No|Just)\s+[a-z][^.!?]{2,60}[.!]/g;
277
+ let count = 0;
278
+ let firstSample = '';
279
+ let m;
280
+ NOT_A_RE.lastIndex = 0;
281
+ while ((m = NOT_A_RE.exec(text)) !== null) {
282
+ count++;
283
+ if (!firstSample) firstSample = m[0].trim().slice(0, 80);
284
+ }
285
+ SHORT_REBUTTAL_RE.lastIndex = 0;
286
+ while ((m = SHORT_REBUTTAL_RE.exec(text)) !== null) {
287
+ count++;
288
+ if (!firstSample) firstSample = m[0].trim().slice(0, 80);
289
+ }
290
+ if (count < 3) return [];
291
+ return [finding('aphoristic-cadence', filePath, `${count} aphoristic constructions: "${firstSample}"`)];
292
+ },
293
+ // Dark glow (page-level: dark bg + colored box-shadow with blur)
294
+ (content, filePath) => {
295
+ // Check if page has a dark background
296
+ const darkBgRe = /background(?:-color)?\s*:\s*(?:#(?:0[0-9a-f]|1[0-9a-f]|2[0-3])[0-9a-f]{4}\b|#(?:0|1)[0-9a-f]{2}\b|rgb\(\s*(\d{1,2})\s*,\s*(\d{1,2})\s*,\s*(\d{1,2})\s*\))/gi;
297
+ const twDarkBg = /\bbg-(?:gray|slate|zinc|neutral|stone)-(?:9\d{2}|800)\b/;
298
+ const hasDarkBg = darkBgRe.test(content) || twDarkBg.test(content);
299
+ if (!hasDarkBg) return [];
300
+
301
+ // Check for colored box-shadow with blur > 4px
302
+ const shadowRe = /box-shadow\s*:\s*([^;{}]+)/gi;
303
+ let m;
304
+ while ((m = shadowRe.exec(content)) !== null) {
305
+ const val = m[1];
306
+ const colorMatch = val.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);
307
+ if (!colorMatch) continue;
308
+ const [r, g, b] = [+colorMatch[1], +colorMatch[2], +colorMatch[3]];
309
+ if ((Math.max(r, g, b) - Math.min(r, g, b)) < 30) continue; // skip gray
310
+ // Check blur: look for pattern like "0 0 20px" (third number > 4)
311
+ const pxVals = [...val.matchAll(/(\d+)px|(?<![.\d])\b(0)\b(?![.\d])/g)].map(p => +(p[1] || p[2]));
312
+ if (pxVals.length >= 3 && pxVals[2] > 4) {
313
+ const lines = content.substring(0, m.index).split('\n');
314
+ return [finding('dark-glow', filePath, `Colored glow (rgb(${r},${g},${b})) on dark page`, lines.length)];
315
+ }
316
+ }
317
+ return [];
318
+ },
319
+ ];
320
+
321
+ // ---------------------------------------------------------------------------
322
+ // Style block extraction (Vue/Svelte <style> blocks)
323
+ // ---------------------------------------------------------------------------
324
+
325
+ function extractStyleBlocks(content, ext) {
326
+ ext = ext.toLowerCase();
327
+ if (ext !== '.vue' && ext !== '.svelte') return [];
328
+ const blocks = [];
329
+ const re = /<style[^>]*>([\s\S]*?)<\/style>/gi;
330
+ let m;
331
+ while ((m = re.exec(content)) !== null) {
332
+ const before = content.substring(0, m.index);
333
+ const startLine = before.split('\n').length + 1;
334
+ blocks.push({ content: m[1], startLine });
335
+ }
336
+ return blocks;
337
+ }
338
+
339
+ // ---------------------------------------------------------------------------
340
+ // CSS-in-JS extraction (styled-components, emotion)
341
+ // ---------------------------------------------------------------------------
342
+
343
+ const CSS_IN_JS_EXTENSIONS = new Set(['.js', '.ts', '.jsx', '.tsx']);
344
+
345
+ function extractCSSinJS(content, ext) {
346
+ ext = ext.toLowerCase();
347
+ if (!CSS_IN_JS_EXTENSIONS.has(ext)) return [];
348
+ const blocks = [];
349
+ const re = /(?:styled(?:\.\w+|\([^)]+\))|css)\s*`([\s\S]*?)`/g;
350
+ let m;
351
+ while ((m = re.exec(content)) !== null) {
352
+ const before = content.substring(0, m.index);
353
+ const startLine = before.split('\n').length;
354
+ blocks.push({ content: m[1], startLine });
355
+ }
356
+ return blocks;
357
+ }
358
+
359
+ function runRegexMatchers(lines, filePath, lineOffset = 0, blockContext = null, options = {}) {
360
+ const { profile, phase = 'regex-matchers' } = options || {};
361
+ const findings = [];
362
+ if (!profile) {
363
+ for (const matcher of REGEX_MATCHERS) {
364
+ for (let i = 0; i < lines.length; i++) {
365
+ const line = lines[i];
366
+ matcher.regex.lastIndex = 0;
367
+ let m;
368
+ while ((m = matcher.regex.exec(line)) !== null) {
369
+ // For extracted blocks, use nearby lines as context for multi-line CSS patterns
370
+ const context = blockContext
371
+ ? lines.slice(Math.max(0, i - 3), Math.min(lines.length, i + 4)).join(' ')
372
+ : line;
373
+ if (matcher.test(m, context)) {
374
+ findings.push(finding(matcher.id, filePath, matcher.fmt(m, context), i + 1 + lineOffset));
375
+ }
376
+ }
377
+ }
378
+ }
379
+ return findings;
380
+ }
381
+
382
+ for (const matcher of REGEX_MATCHERS) {
383
+ const matcherFindings = profileFindings(profile, {
384
+ engine: 'regex',
385
+ phase,
386
+ ruleId: matcher.id,
387
+ target: filePath,
388
+ }, () => {
389
+ const matches = [];
390
+ for (let i = 0; i < lines.length; i++) {
391
+ const line = lines[i];
392
+ matcher.regex.lastIndex = 0;
393
+ let m;
394
+ while ((m = matcher.regex.exec(line)) !== null) {
395
+ // For extracted blocks, use nearby lines as context for multi-line CSS patterns
396
+ const context = blockContext
397
+ ? lines.slice(Math.max(0, i - 3), Math.min(lines.length, i + 4)).join(' ')
398
+ : line;
399
+ if (matcher.test(m, context)) {
400
+ matches.push(finding(matcher.id, filePath, matcher.fmt(m, context), i + 1 + lineOffset));
401
+ }
402
+ }
403
+ }
404
+ return matches;
405
+ });
406
+ findings.push(...matcherFindings);
407
+ }
408
+ return findings;
409
+ }
410
+
411
+ /** Page-level analyzers that scan rendered text content (em-dash use,
412
+ * buzzword phrases, numbered section markers, aphoristic cadence).
413
+ * These are detector-agnostic — they work on any HTML/text source
414
+ * and don't need a parsed DOM. Exported so detectHtml can call them
415
+ * for `.html` files (which otherwise skip the regex engine). */
416
+ const TEXT_CONTENT_ANALYZER_IDS = [
417
+ 'em-dash-overuse',
418
+ 'marketing-buzzword',
419
+ 'numbered-section-markers',
420
+ 'aphoristic-cadence',
421
+ ];
422
+
423
+ function runTextContentAnalyzers(content, filePath, options = {}) {
424
+ const profile = options?.profile;
425
+ if (!isFullPage(content)) return [];
426
+ // The 4 text-content analyzers are at indices 3-6 in REGEX_ANALYZERS.
427
+ const findings = [];
428
+ for (let i = 0; i < TEXT_CONTENT_ANALYZER_IDS.length; i++) {
429
+ const analyzer = REGEX_ANALYZERS[3 + i];
430
+ const ruleId = TEXT_CONTENT_ANALYZER_IDS[i];
431
+ findings.push(...profileFindings(profile, {
432
+ engine: 'regex',
433
+ phase: 'text-content',
434
+ ruleId,
435
+ target: filePath,
436
+ }, () => analyzer(content, filePath)));
437
+ }
438
+ return findings;
439
+ }
440
+
441
+ function detectText(content, filePath, options = {}) {
442
+ const profile = options?.profile;
443
+ const findings = [];
444
+ const lines = content.split('\n');
445
+ const ext = filePath ? (filePath.match(/\.\w+$/)?.[0] || '').toLowerCase() : '';
446
+
447
+ // Run regex matchers on the full file content (catches Tailwind classes, inline styles)
448
+ // Enable block context for CSS files where related properties span multiple lines
449
+ const cssLike = new Set(['.css', '.scss', '.less']);
450
+ findings.push(...runRegexMatchers(lines, filePath, 0, cssLike.has(ext) || null, {
451
+ profile,
452
+ phase: 'source',
453
+ }));
454
+
455
+ // Extract and scan <style> blocks from Vue/Svelte SFCs
456
+ const styleBlocks = profile
457
+ ? profileStep(profile, {
458
+ engine: 'regex',
459
+ phase: 'extract',
460
+ ruleId: 'style-blocks',
461
+ target: filePath,
462
+ }, () => extractStyleBlocks(content, ext))
463
+ : extractStyleBlocks(content, ext);
464
+ for (const block of styleBlocks) {
465
+ const blockLines = block.content.split('\n');
466
+ findings.push(...runRegexMatchers(blockLines, filePath, block.startLine - 1, true, {
467
+ profile,
468
+ phase: 'style-block',
469
+ }));
470
+ }
471
+
472
+ // Extract and scan CSS-in-JS template literals
473
+ const cssJsBlocks = profile
474
+ ? profileStep(profile, {
475
+ engine: 'regex',
476
+ phase: 'extract',
477
+ ruleId: 'css-in-js',
478
+ target: filePath,
479
+ }, () => extractCSSinJS(content, ext))
480
+ : extractCSSinJS(content, ext);
481
+ for (const block of cssJsBlocks) {
482
+ const blockLines = block.content.split('\n');
483
+ findings.push(...runRegexMatchers(blockLines, filePath, block.startLine - 1, true, {
484
+ profile,
485
+ phase: 'css-in-js',
486
+ }));
487
+ }
488
+
489
+ // Deduplicate findings (same antipattern + similar snippet, within 2 lines)
490
+ const deduped = [];
491
+ for (const f of findings) {
492
+ const isDupe = deduped.some(d =>
493
+ d.antipattern === f.antipattern &&
494
+ d.snippet === f.snippet &&
495
+ Math.abs(d.line - f.line) <= 2
496
+ );
497
+ if (!isDupe) deduped.push(f);
498
+ }
499
+
500
+ // Page-level analyzers only run on full pages
501
+ if (isFullPage(content)) {
502
+ const analyzerIds = [
503
+ 'single-font',
504
+ 'flat-type-hierarchy',
505
+ 'monotonous-spacing',
506
+ 'em-dash-overuse',
507
+ 'marketing-buzzword',
508
+ 'numbered-section-markers',
509
+ 'aphoristic-cadence',
510
+ 'dark-glow',
511
+ ];
512
+ for (let i = 0; i < REGEX_ANALYZERS.length; i++) {
513
+ const analyzer = REGEX_ANALYZERS[i];
514
+ deduped.push(...profileFindings(profile, {
515
+ engine: 'regex',
516
+ phase: 'page-analyzer',
517
+ ruleId: analyzerIds[i] || `analyzer-${i + 1}`,
518
+ target: filePath,
519
+ }, () => analyzer(content, filePath)));
520
+ }
521
+ }
522
+
523
+ return filterByProviders(deduped, options?.providers);
524
+ }
525
+
526
+ export {
527
+ REGEX_MATCHERS,
528
+ REGEX_ANALYZERS,
529
+ TEXT_CONTENT_ANALYZER_IDS,
530
+ extractStyleBlocks,
531
+ extractCSSinJS,
532
+ runRegexMatchers,
533
+ runTextContentAnalyzers,
534
+ detectText,
535
+ };